Meet Toki Operator

Docs/Manage API

Program management

Store credits, exchange rules, membership rewards and activity administration.

Operations10 queries · 9 mutations

storeCreditCurrencies#

Lists available store credit currencies with pagination; exchange partner currencies require includeExchangePartners.

Arguments

  • reverseBoolean

    Reverse the sort order.

  • ids[String!]

    Only these currency IDs; an empty list returns none.

  • searchString

    Case-insensitive currency name search.

  • includeExchangePartnersBoolean

    Include currencies of merchants allowed by active exchange-with rules, for segment conditions.

Returns

TokiStoreCreditCurrencyConnection!

A page of TokiStoreCreditCurrency in nodes, with pageInfo for the next page. Each item:

An available store credit currency. Exchange partners are included only when requested for segment conditions.

  • idID!
  • nameString!

    Currency name.

  • merchantIdID!

    Merchant owning the currency.

query StoreCreditCurrencies($first: Int) {
  storeCreditCurrencies(first: $first) {
    nodes {
      id
      name
      merchantId
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "storeCreditCurrencies": {
      "nodes": [
        {
          "id": "7035ce0c-7135-4f9f-a235-d1327335d2c5",
          "name": "Gold",
          "merchantId": "ddfe2080-defe-4213-affe-23a6e0fe2539"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
query

storeCredits#

Lists store credit currencies belonging to the current merchant, with conversion and display settings.

Returns

TokiStoreCreditsOutput!

Stored currency settings returned by the merchant API.

  • list[TokiStoreCreditsOutputList!]!

    The complete list of store credit currencies. Omitted currencies are archived when saving.

query StoreCredits {
  storeCredits {
    list {
      name
      id
      rewardDisplayPreference
    }
  }
}
Response
{
  "data": {
    "storeCredits": {
      "list": [
        {
          "name": "Gold",
          "id": "be22f9ad-bd22-481a-ac22-f687bb22f4f4",
          "rewardDisplayPreference": "store_credit"
        }
      ]
    }
  }
}
mutation

storeCreditsUpdate#

Replaces the current merchant store credit currency list. Missing currencies are archived; new ones are created.

Input

TokiStoreCreditsUpdateInput!

Complete replacement of merchant store credit currency settings.

  • list[TokiStoreCreditsUpdateListInput!]!Required

    The complete list of store credit currencies. Omitted currencies are archived when saving.

Returns

TokiStoreCreditsOutput!

Stored currency settings returned by the merchant API.

  • list[TokiStoreCreditsOutputList!]!

    The complete list of store credit currencies. Omitted currencies are archived when saving.

mutation StoreCreditsUpdate($input: TokiStoreCreditsUpdateInput!) {
  storeCreditsUpdate(input: $input) {
    list {
      name
      id
      rewardDisplayPreference
    }
  }
}
Variables
{
  "input": {
    "list": [
      {
        "name": "Gold"
      }
    ]
  }
}
Response
{
  "data": {
    "storeCreditsUpdate": {
      "list": [
        {
          "name": "Gold",
          "id": "8a915f46-8b91-40d9-a891-5c2089915db3",
          "rewardDisplayPreference": "store_credit"
        }
      ]
    }
  }
}

exchangeRules#

Lists exchange rules owned by the current merchant and their participating merchants.

Arguments

Returns

TokiExchangeRuleSummaryConnection!

A page of TokiExchangeRuleSummary in nodes, with pageInfo for the next page. Each item:

An exchange rule and its participating merchants.

  • nameString!

    Exchange rule display name.

  • isActiveBoolean!

    Whether the exchange rule is active.

  • ruleTypeString!

    Stored exchange rule type.

  • exchangeRuleIdString!

    ID of the exchange rule.

  • createdAtString!

    Creation timestamp in ISO 8601 format.

  • merchantIdString!

    ID of the merchant that owns the rule.

  • merchantsExchangeRules[TokiExchangeRuleSummaryMerchantsExchangeRules!]!

    Merchants participating in this exchange rule.

query ExchangeRules($first: Int) {
  exchangeRules(first: $first) {
    nodes {
      name
      isActive
      ruleType
      createdAt
      merchantsExchangeRules {
        merchantExchangeRuleId
        merchantName
        merchantId
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "exchangeRules": {
      "nodes": [
        {
          "name": "Gold",
          "isActive": true,
          "ruleType": "Rule type",
          "createdAt": "2026-10-14T09:30:00.000Z",
          "merchantsExchangeRules": [
            {
              "merchantExchangeRuleId": "fbe28e7b-fae2-4ce8-ade2-91a1fce2900e",
              "merchantName": "Merchant name",
              "merchantId": "dd1c2cec-de1c-4e7f-af1c-3012e01c31a5"
            }
          ]
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
mutation

exchangeRuleUpsert#

Creates or updates an exchange rule and replaces its participating merchants.

Input

TokiExchangeRuleUpsertInput!

Exchange rule settings and the replacement list of participating merchants.

  • nameString!Required

    Exchange rule display name.

  • isActiveBoolean!Required

    Whether the exchange rule is active.

  • ruleTypeString!Required

    Stored exchange rule type.

  • exchangeRuleIdString

    Existing merchant-owned rule ID. Omit to create a rule.

  • merchantsExchangeRules[TokiExchangeRuleUpsertMerchantsExchangeRulesInput!]!Required

    Complete replacement list of participating merchants.

Returns

TokiExchangeRuleUpsertPayload!

Confirmation of the exchange rule change.

  • resultString!

    The string success after the change completes.

mutation ExchangeRuleUpsert($input: TokiExchangeRuleUpsertInput!) {
  exchangeRuleUpsert(input: $input) {
    result
  }
}
Variables
{
  "input": {
    "name": "Gold",
    "isActive": true,
    "ruleType": "Rule type",
    "exchangeRuleId": "8739e45f-8639-42cc-a939-e7858839e5f2",
    "merchantsExchangeRules": [
      {
        "merchantId": "6241a889-6141-46f6-a041-a5635f41a3d0"
      }
    ]
  }
}
Response
{
  "data": {
    "exchangeRuleUpsert": {
      "result": "Result"
    }
  }
}
mutation

exchangeRuleDelete#

Deletes an exchange rule owned by the current merchant and its participating merchant links.

Input

TokiExchangeRuleDeleteInput!

Merchant-owned exchange rule to delete.

  • exchangeRuleIdString!Required

    ID of an exchange rule owned by the current merchant.

Returns

TokiExchangeRuleDeletePayload!

Confirmation of the exchange rule change.

  • resultString!

    The string success after the change completes.

mutation ExchangeRuleDelete($input: TokiExchangeRuleDeleteInput!) {
  exchangeRuleDelete(input: $input) {
    result
  }
}
Variables
{
  "input": {
    "exchangeRuleId": "2d969e2f-2c96-4c9c-af96-a1552e969fc2"
  }
}
Response
{
  "data": {
    "exchangeRuleDelete": {
      "result": "Result"
    }
  }
}
mutation

exchangeRuleStatusUpdate#

Sets whether an exchange rule owned by the current merchant is active.

Input

TokiExchangeRuleStatusUpdateInput!

New active status for a merchant-owned exchange rule.

  • exchangeRuleIdString!Required

    ID of an exchange rule owned by the current merchant.

  • isActiveBoolean!Required

    Whether the exchange rule should be active.

Returns

TokiExchangeRuleStatusUpdatePayload!

Confirmation of the exchange rule change.

  • resultString!

    The string success after the change completes.

mutation ExchangeRuleStatusUpdate($input: TokiExchangeRuleStatusUpdateInput!) {
  exchangeRuleStatusUpdate(input: $input) {
    result
  }
}
Variables
{
  "input": {
    "exchangeRuleId": "e4811217-e381-4084-a681-153de58113aa",
    "isActive": true
  }
}
Response
{
  "data": {
    "exchangeRuleStatusUpdate": {
      "result": "Result"
    }
  }
}
mutation

membershipMaintainStatusUpdate#

Updates whether membership status is maintained for the current merchant.

Input

TokiMembershipMaintainStatusUpdateInput!

Merchant setting controlling membership status maintenance.

  • valueBoolean!Required

    Whether membership status maintenance should be enabled.

Returns

TokiMembershipMaintainStatusUpdatePayload!

Saved membership status maintenance setting.

  • successBoolean!

    True after the setting is saved.

  • valueBoolean!

    The saved status maintenance setting.

mutation MembershipMaintainStatusUpdate($input: TokiMembershipMaintainStatusUpdateInput!) {
  membershipMaintainStatusUpdate(input: $input) {
    success
    value
  }
}
Variables
{
  "input": {
    "value": false
  }
}
Response
{
  "data": {
    "membershipMaintainStatusUpdate": {
      "success": false,
      "value": false
    }
  }
}
mutation

membershipRewardsBulkUpdate#

Adds rewards to selected memberships, removes selected rewards or updates selected rewards within the current merchant.

Input

TokiMembershipRewardsBulkUpdateInput!

Bulk addition, removal or replacement of merchant membership rewards.

  • membershipIds[String!]!Required

    Memberships receiving added rewards. Used with the add action.

  • rewardIds[String!]!Required

    Existing reward rules to remove or update. Every rule must belong to this merchant.

  • rewards[TokiRewardRuleInput!]

    Reward configurations to add, or the first configuration to apply to every updated rule.

  • actionTokiMembershipRewardsBulkUpdateAction!Required

    add creates rewards, remove archives rules, and update applies the first reward configuration.

    addremoveupdate

Returns

TokiMembershipRewardsBulkUpdatePayload!

Confirmation of the bulk membership reward change.

  • okBoolean!

    True after the bulk change succeeds.

mutation MembershipRewardsBulkUpdate($input: TokiMembershipRewardsBulkUpdateInput!) {
  membershipRewardsBulkUpdate(input: $input) {
    ok
  }
}
Variables
{
  "input": {
    "membershipIds": [
      "8adc161e-8bdc-47b1-a8dc-12f889dc148b"
    ],
    "rewardIds": [
      "a442c737-a342-45a4-a642-ca5da542c8ca"
    ],
    "action": "add"
  }
}
Response
{
  "data": {
    "membershipRewardsBulkUpdate": {
      "ok": false
    }
  }
}
query

tapcartWebhookUrl#

Returns the secret Tapcart Clickstream webhook URL for the current shop. Keep this URL private.

Returns

String!
query TapcartWebhookUrl {
  tapcartWebhookUrl
}
Response
{
  "data": {
    "tapcartWebhookUrl": "https://example.com/toki/webhooks"
  }
}
query

activityPendingCompletions#

Lists pending completion jobs for a purchase or referral activity owned by the current merchant, twenty per page.

Arguments

  • idString!Required

    ID of an activity belonging to the current merchant.

  • searchString

    Case-insensitive substring matched against the serialized completion job payload.

  • pageInt

    Page number starting at 1. Defaults to 1.

Returns

TokiActivityPendingCompletionsPayload!

Pending completion jobs for an activity.

  • list[TokiActivityPendingCompletionsList!]!

    Pending completion jobs in this page.

query ActivityPendingCompletions($id: String!) {
  activityPendingCompletions(id: $id) {
    list {
      id
      orderId
      status
      createdAt
    }
  }
}
Variables
{
  "id": "058156df-0481-454c-a781-5a0506815872"
}
Response
{
  "data": {
    "activityPendingCompletions": {
      "list": [
        {
          "id": "fe5ad69b-fd5a-4508-a05a-d9c1ff5ad82e",
          "orderId": "d23c4e73-d13c-4ce0-a43c-5199d33c5006",
          "status": "active",
          "createdAt": "2026-10-14T09:30:00.000Z"
        }
      ]
    }
  }
}
query

activityLotteryTotals#

Returns the pool amount and number of pending tickets for an owned lottery activity.

Arguments

  • activityIdString!Required

    Owned lottery activity ID.

Returns

TokiActivityLotteryTotalsPayload!

Current pending lottery pool statistics.

  • totalPoolFloat!

    Total price of pending lottery tickets.

  • totalCountFloat!

    Number of pending lottery tickets.

query ActivityLotteryTotals($activityId: String!) {
  activityLotteryTotals(activityId: $activityId) {
    totalPool
    totalCount
  }
}
Variables
{
  "activityId": "3cae7bbe-3dae-4d51-aaae-78983bae7a2b"
}
Response
{
  "data": {
    "activityLotteryTotals": {
      "totalPool": 49.99,
      "totalCount": 49.99
    }
  }
}
mutation

activityLotteryDraw#

Draws a random pending ticket, rewards its member and completes pending tickets for an owned lottery activity.

Input

TokiActivityLotteryDrawInput!

Lottery activity from which to draw a winner.

  • activityIdString!Required

    ID of an activity belonging to the current merchant.

Returns

TokiActivityLotteryDrawPayload!

Winning lottery completion and its member.

  • idString!

    ID of the winning lottery ticket.

  • userIdString!

    ID of the winning member.

  • emailString

    Winner email address, or null when unavailable.

  • ticketPriceFloat!

    Ticket price for the lottery.

mutation ActivityLotteryDraw($input: TokiActivityLotteryDrawInput!) {
  activityLotteryDraw(input: $input) {
    id
    userId
    email
    ticketPrice
  }
}
Variables
{
  "input": {
    "activityId": "85be539f-84be-420c-a7be-56c586be5532"
  }
}
Response
{
  "data": {
    "activityLotteryDraw": {
      "id": "86650760-8765-48f3-a865-0a8689650c19",
      "userId": "22b7cd8b-21b7-4bf8-a4b7-d0b123b7cf1e",
      "email": "anna@example.com",
      "ticketPrice": 49.99
    }
  }
}
query

activityCharityTotals#

Returns donation totals for an owned charity activity.

Arguments

  • activityIdString!Required

    ID of an activity belonging to the current merchant.

Returns

TokiActivityCharityTotalsPayload!

Aggregate donation amount and completion count for a charity activity.

  • totalAmountFloat!

    Sum of recorded donation amounts.

  • totalCountFloat!

    Number of charity completions.

query ActivityCharityTotals($activityId: String!) {
  activityCharityTotals(activityId: $activityId) {
    totalAmount
    totalCount
  }
}
Variables
{
  "activityId": "7a39a6c5-7939-4532-a839-a39f7739a20c"
}
Response
{
  "data": {
    "activityCharityTotals": {
      "totalAmount": 49.99,
      "totalCount": 49.99
    }
  }
}
mutation

activityRedeemCodesGenerate#

Generates unique lowercase redeem codes for an owned activity. Reports inserted codes and skipped duplicates.

Input

TokiActivityRedeemCodesGenerateInput!

Batch of redeem codes to generate for an activity.

  • activityIdString!Required

    ID of an activity belonging to the current merchant.

  • countInt!Required

    Number of code generation attempts, from 1 to 100000.

  • prefixString

    Optional prefix prepended to every code. The complete code is lowercased.

  • expiresAtString

    Expiration date string. Omit to create codes without expiration.

  • codeLengthInt

    Length of the random part, excluding the prefix, from 6 to 128. Defaults to 8.

Returns

TokiActivityRedeemCodesGeneratePayload!

Counts from generating and inserting redeem codes.

  • successBoolean!

    True after the generation batch completes.

  • generatedFloat!

    Number of new codes inserted.

  • totalFloat!

    Number of code generation attempts.

  • skippedFloat!

    Number of generated codes skipped because they already exist for the activity.

mutation ActivityRedeemCodesGenerate($input: TokiActivityRedeemCodesGenerateInput!) {
  activityRedeemCodesGenerate(input: $input) {
    success
    generated
    total
    skipped
  }
}
Variables
{
  "input": {
    "activityId": "15c64c1d-14c6-4a8a-a3c6-48f712c64764",
    "count": 3,
    "prefix": "Prefix",
    "expiresAt": "2026-10-14T09:30:00.000Z",
    "codeLength": 1
  }
}
Response
{
  "data": {
    "activityRedeemCodesGenerate": {
      "success": false,
      "generated": 0.1,
      "total": 49.99,
      "skipped": 1.5
    }
  }
}
query

activityRedeemCodes#

Lists redeem codes for an owned activity, filtered by search and availability, using one-based page numbers.

Arguments

  • activityIdString!Required

    ID of an activity belonging to the current merchant.

  • searchString

    Case-insensitive substring matched against codes.

  • pageInt

    Page number starting at 1. Defaults to 1.

  • limitInt

    Maximum number of records to return, from 1 to 500. Defaults to 20.

  • statusTokiActivityRedeemCodesStatus

    Restrict codes to available, used or expired. Omit to include all statuses.

    availableusedexpired

Returns

TokiActivityRedeemCodesPayload!

Matching redeem codes and their total count.

  • codes[TokiActivityRedeemCodesCodes!]!

    Redeem codes in this page, newest first.

  • totalFloat!

    Total number of matching codes before pagination.

query ActivityRedeemCodes($activityId: String!) {
  activityRedeemCodes(activityId: $activityId) {
    total
    codes {
      code
      usageCount
      expiresAt
      createdAt
    }
  }
}
Variables
{
  "activityId": "617d1186-627d-4319-af7d-0e60607d0ff3"
}
Response
{
  "data": {
    "activityRedeemCodes": {
      "total": 49.99,
      "codes": [
        {
          "code": "TOKI-7Q2M-4KXD",
          "usageCount": 1.5,
          "expiresAt": "2026-10-14T09:30:00.000Z",
          "createdAt": "2026-10-14T09:30:00.000Z"
        }
      ]
    }
  }
}

ledgerGenerations#

Lists the current merchant ledger generation jobs and their progress.

Arguments

Returns

TokiLedgerGenerationSummaryConnection!

A page of TokiLedgerGenerationSummary in nodes, with pageInfo for the next page. Each item:

A ledger generation job and its progress.

  • idString!

    ID of the ledger generation job.

  • createdAtString!

    Creation timestamp in ISO 8601 format.

  • settingsTokiLedgerGenerationInput!

    Ledger generation settings. usd is the value assigned to each generated ledger.

  • totalRowsFloat!

    Total number of ledger rows to generate.

  • completedCountFloat!

    Number of processed ledger rows.

  • failedCountFloat!

    Number of failed jobs recorded for this generation.

  • progress[TokiLedgerGenerationSummaryProgress!]!

    Completed and failed progress bars.

query LedgerGenerations($first: Int) {
  ledgerGenerations(first: $first) {
    nodes {
      id
      createdAt
      totalRows
      completedCount
      settings {
        count
        usd
        emailPrefix
        codePrefix
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "ledgerGenerations": {
      "nodes": [
        {
          "id": "30014a5f-2f01-48cc-a201-4d8531014bf2",
          "createdAt": "2026-10-14T09:30:00.000Z",
          "totalRows": 49.99,
          "completedCount": 1.5,
          "settings": {
            "count": 3,
            "usd": 1,
            "emailPrefix": "anna@example.com",
            "codePrefix": "Code prefix"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
mutation

ledgerGenerationCreate#

Queues ledger generation for the current merchant and shop. Returns the generation ID.

Input

TokiLedgerGenerationCreateInput!

Settings for a new ledger generation job.

  • countInt!Required

    Number of ledgers to generate.

  • usdInt!Required

    Starting value of each ledger in currency units.

  • emailPrefixString!Required

    Prefix for generated member email addresses.

  • codePrefixString!Required

    Prefix for generated ledger codes.

  • codeLengthInt!Required

    Length of the random portion of each code, at least six characters.

  • expiresOnString

    Optional expiration date for generated ledgers.

Returns

TokiLedgerGenerationCreatePayload!

Identifier of the queued ledger generation job.

  • idString!

    ID of the newly created ledger generation job.

mutation LedgerGenerationCreate($input: TokiLedgerGenerationCreateInput!) {
  ledgerGenerationCreate(input: $input) {
    id
  }
}
Variables
{
  "input": {
    "count": 3,
    "usd": 1,
    "emailPrefix": "anna@example.com",
    "codePrefix": "Code prefix",
    "codeLength": 1
  }
}
Response
{
  "data": {
    "ledgerGenerationCreate": {
      "id": "4b73a57f-4a73-43ec-ad73-a8a54c73a712"
    }
  }
}
query

activityVotingResults#

Returns paginated answers and aggregated choice results for an owned voting, quiz or data collection activity.

Arguments

  • limitInt!Required

    Maximum number of records to return, from 1 to 500.

  • offsetInt!Required

    Number of matching records to skip, starting at zero.

  • activityIdString!Required

    ID of an activity belonging to the current merchant.

  • startDateString

    Optional start date for the answer report; null disables the lower date bound.

  • endDateString

    Optional end date for the answer report; null disables the upper date bound.

Returns

TokiActivityVotingResultsPayload!

Answer rows and aggregate choice counts for an activity.

  • dataTokiJSON!

    Answer rows keyed by question labels. Values are text or arrays of selected choices.

  • totalFloat!

    Total number of matching submissions.

  • activityTokiActivityVotingResultsActivity!

    Activity the answers belong to.

  • votingResults[TokiActivityVotingResultsVotingResults!]

    Aggregated single-choice and multiple-choice results, or null if the form contains neither.

query ActivityVotingResults($limit: Int!, $offset: Int!, $activityId: String!) {
  activityVotingResults(limit: $limit, offset: $offset, activityId: $activityId) {
    data
    total
    activity {
      name
    }
  }
}
Variables
{
  "limit": 3,
  "offset": 1,
  "activityId": "08434869-0743-46d6-a643-4543054343b0"
}
Response
{
  "data": {
    "activityVotingResults": {
      "data": {},
      "total": 49.99,
      "activity": {
        "name": "Gold"
      }
    }
  }
}