Meet Toki Operator

Docs/Manage API

Program settings

Program-wide settings, languages, translations, purchase rules and product recommendations.

Most settings apply to all your stores; email settings, currency, translations and the exclusive products validation ID belong to the current store. Several updates replace a saved list or object with what you send, so read the current settings first and send them back complete.

Operations9 queries · 8 mutations
query

loyaltySettings#

Returns your loyalty program settings. emailSettings and currency belong to the current store; the other groups apply to all your stores.

Returns

TokiLoyaltySettingsPayload!

Your loyalty program settings, in the groups that loyaltySettingsUpdate accepts.

  • loyaltySettingsTokiLoyaltySettings!

    Settings shared by all your stores, such as your default store credit, redemption rules and options, and the discount codes Toki creates.

  • emailSettingsTokiLoyaltySettingsEmailSettings!

    The sender, subjects and templates of the emails Toki sends members from the current store, with Toki's defaults where you haven't set your own.

  • segmentsSettingsTokiSegmentsSettings!

    How Toki updates members' segments when orders come in.

  • paidMembershipSettingsTokiPaidMembershipSettings!

    Paid membership settings: prorations, and the checkout validation for paid memberships in each store.

  • currencyTokiLoyaltySettingsCurrency!

    The current store's currency.

query LoyaltySettings {
  loyaltySettings {
    loyaltySettings {
      storeCreditName
      conversionRate
      rewardDisplayPreference
      isShopifyAutoLogin
    }
    emailSettings {
      magicLinkTemplate
      magicLinkSubject
      authenticationCodeSubject
      authenticationCodeTemplate
    }
    segmentsSettings {
      calculationPriority
    }
  }
}
Response
{
  "data": {
    "loyaltySettings": {
      "loyaltySettings": {
        "storeCreditName": "Store credit name",
        "conversionRate": 0.1,
        "rewardDisplayPreference": "both",
        "isShopifyAutoLogin": true
      },
      "emailSettings": {
        "magicLinkTemplate": "Magic link template",
        "magicLinkSubject": "Magic link subject",
        "authenticationCodeSubject": "Authentication code subject",
        "authenticationCodeTemplate": "Authentication code template"
      },
      "segmentsSettings": {
        "calculationPriority": "beforeRewards"
      }
    }
  }
}
mutation

loyaltySettingsUpdate#

Updates your loyalty program settings and returns them. Groups you leave out don't change and most fields you omit keep their saved values. Omitted redemptionRules and redemptionOptionsSettings stay unchanged. Supplied redemptionRules and redemptionOptionsSettings.options lists replace their saved lists; omitted options keeps saved options. An empty or null options list clears them. Send every rule and option you want to keep in a supplied list, in full (to change one option, use redemptionOptionUpdate). emailSettings and currency apply to the current store only, and changes that Shopify needs, such as gift card restrictions, reach your stores in the background.

Input

TokiLoyaltySettingsUpdateInput!
  • loyaltySettingsTokiLoyaltySettingsInput

    Settings shared by all your stores. Omitted redemptionRules and redemptionOptionsSettings keep their saved values. Supplied redemptionRules and redemptionOptionsSettings.options lists replace their saved lists. Leaving options out keeps the saved options, so you can change isCustomAmountEnabled on its own.

  • emailSettingsTokiEmailSettingsInput

    The sender, subjects and templates of the emails Toki sends members from the current store. Fields you leave out keep their saved values, and an empty string brings back Toki's default.

  • currencyTokiCurrencySettingsInput

    The current store's currency in Toki.

  • segmentsSettingsTokiSegmentsSettingsInput

    How Toki updates members' segments when orders come in.

  • paidMembershipSettingsTokiPaidMembershipSettingsInput

    Paid membership settings: prorations, and the checkout validation for paid memberships in each store.

Returns

TokiLoyaltySettingsPayload!

Your loyalty program settings, in the groups that loyaltySettingsUpdate accepts.

  • loyaltySettingsTokiLoyaltySettings!

    Settings shared by all your stores, such as your default store credit, redemption rules and options, and the discount codes Toki creates.

  • emailSettingsTokiLoyaltySettingsEmailSettings!

    The sender, subjects and templates of the emails Toki sends members from the current store, with Toki's defaults where you haven't set your own.

  • segmentsSettingsTokiSegmentsSettings!

    How Toki updates members' segments when orders come in.

  • paidMembershipSettingsTokiPaidMembershipSettings!

    Paid membership settings: prorations, and the checkout validation for paid memberships in each store.

  • currencyTokiLoyaltySettingsCurrency!

    The current store's currency.

mutation LoyaltySettingsUpdate($input: TokiLoyaltySettingsUpdateInput!) {
  loyaltySettingsUpdate(input: $input) {
    loyaltySettings {
      storeCreditName
      conversionRate
      rewardDisplayPreference
      isShopifyAutoLogin
    }
    emailSettings {
      magicLinkTemplate
      magicLinkSubject
      authenticationCodeSubject
      authenticationCodeTemplate
    }
    segmentsSettings {
      calculationPriority
    }
  }
}
Variables
{
  "input": {}
}
Response
{
  "data": {
    "loyaltySettingsUpdate": {
      "loyaltySettings": {
        "storeCreditName": "Store credit name",
        "conversionRate": 0.1,
        "rewardDisplayPreference": "both",
        "isShopifyAutoLogin": true
      },
      "emailSettings": {
        "magicLinkTemplate": "Magic link template",
        "magicLinkSubject": "Magic link subject",
        "authenticationCodeSubject": "Authentication code subject",
        "authenticationCodeTemplate": "Authentication code template"
      },
      "segmentsSettings": {
        "calculationPriority": "beforeRewards"
      }
    }
  }
}
query

languageSettings#

Returns how Toki picks the language of its storefront modules and wallet, as set on the Design page. The settings apply to all your stores.

Returns

TokiLanguageSettingsPayload!

How Toki picks the language of its storefront modules and wallet, for all your stores.

  • languageString!

    auto follows each visitor's browser language and falls back to English. page-based tests the pageBase…Regex patterns against the full page URL in the order listed below, and uses the first language that matches, or defaultLng. Any other value is the language every visitor sees: en, fr, es, de, it, nl, ro, pl, da, sv, no, fi, pt, ca, cs, sk, sl, hr, lt, et, lv, hu, zh-TW (Traditional Chinese), zh-CN (Simplified Chinese), ja or ko.

  • defaultLngString

    With page-based, the language for pages that match no pattern.

  • pageBaseEnRegexString

    Regular expression for the URLs of your English pages.

  • pageBaseFrRegexString

    Regular expression for the URLs of your French pages.

  • pageBaseESRegexString

    Regular expression for the URLs of your Spanish pages.

  • pageBaseDeRegexString

    Regular expression for the URLs of your German pages.

  • pageBaseItRegexString

    Regular expression for the URLs of your Italian pages.

  • pageBaseNlRegexString

    Regular expression for the URLs of your Dutch pages.

  • pageBaseRoRegexString

    Regular expression for the URLs of your Romanian pages.

  • pageBasePlRegexString

    Regular expression for the URLs of your Polish pages.

  • pageBaseDaRegexString

    Regular expression for the URLs of your Danish pages.

  • pageBaseSvRegexString

    Regular expression for the URLs of your Swedish pages.

  • pageBaseNoRegexString

    Regular expression for the URLs of your Norwegian pages.

  • pageBaseFiRegexString

    Regular expression for the URLs of your Finnish pages.

  • pageBasePtRegexString

    Regular expression for the URLs of your Portuguese pages.

  • pageBaseCaRegexString

    Regular expression for the URLs of your Catalan pages.

  • pageBaseCsRegexString

    Regular expression for the URLs of your Czech pages.

  • pageBaseSkRegexString

    Regular expression for the URLs of your Slovak pages.

  • pageBaseSlRegexString

    Regular expression for the URLs of your Slovenian pages.

  • pageBaseHrRegexString

    Regular expression for the URLs of your Croatian pages.

  • pageBaseLtRegexString

    Regular expression for the URLs of your Lithuanian pages.

  • pageBaseEtRegexString

    Regular expression for the URLs of your Estonian pages.

  • pageBaseLvRegexString

    Regular expression for the URLs of your Latvian pages.

  • pageBaseHuRegexString

    Regular expression for the URLs of your Hungarian pages.

  • pageBaseZhTwRegexString

    Regular expression for the URLs of your Traditional Chinese pages.

  • pageBaseZhCnRegexString

    Regular expression for the URLs of your Simplified Chinese pages.

  • pageBaseJaRegexString

    Regular expression for the URLs of your Japanese pages.

  • pageBaseKoRegexString

    Regular expression for the URLs of your Korean pages.

query LanguageSettings {
  languageSettings {
    language
    defaultLng
    pageBaseEnRegex
    pageBaseFrRegex
    pageBaseESRegex
    pageBaseDeRegex
    pageBaseItRegex
  }
}
Response
{
  "data": {
    "languageSettings": {
      "language": "en",
      "defaultLng": "en",
      "pageBaseEnRegex": "Page base en regex",
      "pageBaseFrRegex": "Page base fr regex",
      "pageBaseESRegex": "Page base esregex",
      "pageBaseDeRegex": "Page base de regex",
      "pageBaseItRegex": "Page base it regex"
    }
  }
}
mutation

languageSettingsUpdate#

Replaces your language settings for all your stores, so fields you leave out are cleared. Storefront modules use the new settings from their next page load (a browser can keep the old ones for up to five minutes), and Toki rewrites the module designs stored in each Shopify store with the new language.

Input

TokiLanguageSettingsUpdateInput!

How Toki picks the language of its storefront modules and wallet, for all your stores.

  • languageString!Required

    auto follows each visitor's browser language and falls back to English. page-based tests the pageBase…Regex patterns against the full page URL in the order listed below, and uses the first language that matches, or defaultLng. Any other value is the language every visitor sees: en, fr, es, de, it, nl, ro, pl, da, sv, no, fi, pt, ca, cs, sk, sl, hr, lt, et, lv, hu, zh-TW (Traditional Chinese), zh-CN (Simplified Chinese), ja or ko.

  • defaultLngString

    With page-based, the language for pages that match no pattern.

  • pageBaseEnRegexString

    Regular expression for the URLs of your English pages.

  • pageBaseFrRegexString

    Regular expression for the URLs of your French pages.

  • pageBaseESRegexString

    Regular expression for the URLs of your Spanish pages.

  • pageBaseDeRegexString

    Regular expression for the URLs of your German pages.

  • pageBaseItRegexString

    Regular expression for the URLs of your Italian pages.

  • pageBaseNlRegexString

    Regular expression for the URLs of your Dutch pages.

  • pageBaseRoRegexString

    Regular expression for the URLs of your Romanian pages.

  • pageBasePlRegexString

    Regular expression for the URLs of your Polish pages.

  • pageBaseDaRegexString

    Regular expression for the URLs of your Danish pages.

  • pageBaseSvRegexString

    Regular expression for the URLs of your Swedish pages.

  • pageBaseNoRegexString

    Regular expression for the URLs of your Norwegian pages.

  • pageBaseFiRegexString

    Regular expression for the URLs of your Finnish pages.

  • pageBasePtRegexString

    Regular expression for the URLs of your Portuguese pages.

  • pageBaseCaRegexString

    Regular expression for the URLs of your Catalan pages.

  • pageBaseCsRegexString

    Regular expression for the URLs of your Czech pages.

  • pageBaseSkRegexString

    Regular expression for the URLs of your Slovak pages.

  • pageBaseSlRegexString

    Regular expression for the URLs of your Slovenian pages.

  • pageBaseHrRegexString

    Regular expression for the URLs of your Croatian pages.

  • pageBaseLtRegexString

    Regular expression for the URLs of your Lithuanian pages.

  • pageBaseEtRegexString

    Regular expression for the URLs of your Estonian pages.

  • pageBaseLvRegexString

    Regular expression for the URLs of your Latvian pages.

  • pageBaseHuRegexString

    Regular expression for the URLs of your Hungarian pages.

  • pageBaseZhTwRegexString

    Regular expression for the URLs of your Traditional Chinese pages.

  • pageBaseZhCnRegexString

    Regular expression for the URLs of your Simplified Chinese pages.

  • pageBaseJaRegexString

    Regular expression for the URLs of your Japanese pages.

  • pageBaseKoRegexString

    Regular expression for the URLs of your Korean pages.

Returns

TokiLanguageSettingsPayload!

How Toki picks the language of its storefront modules and wallet, for all your stores.

  • languageString!

    auto follows each visitor's browser language and falls back to English. page-based tests the pageBase…Regex patterns against the full page URL in the order listed below, and uses the first language that matches, or defaultLng. Any other value is the language every visitor sees: en, fr, es, de, it, nl, ro, pl, da, sv, no, fi, pt, ca, cs, sk, sl, hr, lt, et, lv, hu, zh-TW (Traditional Chinese), zh-CN (Simplified Chinese), ja or ko.

  • defaultLngString

    With page-based, the language for pages that match no pattern.

  • pageBaseEnRegexString

    Regular expression for the URLs of your English pages.

  • pageBaseFrRegexString

    Regular expression for the URLs of your French pages.

  • pageBaseESRegexString

    Regular expression for the URLs of your Spanish pages.

  • pageBaseDeRegexString

    Regular expression for the URLs of your German pages.

  • pageBaseItRegexString

    Regular expression for the URLs of your Italian pages.

  • pageBaseNlRegexString

    Regular expression for the URLs of your Dutch pages.

  • pageBaseRoRegexString

    Regular expression for the URLs of your Romanian pages.

  • pageBasePlRegexString

    Regular expression for the URLs of your Polish pages.

  • pageBaseDaRegexString

    Regular expression for the URLs of your Danish pages.

  • pageBaseSvRegexString

    Regular expression for the URLs of your Swedish pages.

  • pageBaseNoRegexString

    Regular expression for the URLs of your Norwegian pages.

  • pageBaseFiRegexString

    Regular expression for the URLs of your Finnish pages.

  • pageBasePtRegexString

    Regular expression for the URLs of your Portuguese pages.

  • pageBaseCaRegexString

    Regular expression for the URLs of your Catalan pages.

  • pageBaseCsRegexString

    Regular expression for the URLs of your Czech pages.

  • pageBaseSkRegexString

    Regular expression for the URLs of your Slovak pages.

  • pageBaseSlRegexString

    Regular expression for the URLs of your Slovenian pages.

  • pageBaseHrRegexString

    Regular expression for the URLs of your Croatian pages.

  • pageBaseLtRegexString

    Regular expression for the URLs of your Lithuanian pages.

  • pageBaseEtRegexString

    Regular expression for the URLs of your Estonian pages.

  • pageBaseLvRegexString

    Regular expression for the URLs of your Latvian pages.

  • pageBaseHuRegexString

    Regular expression for the URLs of your Hungarian pages.

  • pageBaseZhTwRegexString

    Regular expression for the URLs of your Traditional Chinese pages.

  • pageBaseZhCnRegexString

    Regular expression for the URLs of your Simplified Chinese pages.

  • pageBaseJaRegexString

    Regular expression for the URLs of your Japanese pages.

  • pageBaseKoRegexString

    Regular expression for the URLs of your Korean pages.

mutation LanguageSettingsUpdate($input: TokiLanguageSettingsUpdateInput!) {
  languageSettingsUpdate(input: $input) {
    language
    defaultLng
    pageBaseEnRegex
    pageBaseFrRegex
    pageBaseESRegex
    pageBaseDeRegex
    pageBaseItRegex
  }
}
Variables
{
  "input": {
    "language": "en"
  }
}
Response
{
  "data": {
    "languageSettingsUpdate": {
      "language": "en",
      "defaultLng": "en",
      "pageBaseEnRegex": "Page base en regex",
      "pageBaseFrRegex": "Page base fr regex",
      "pageBaseESRegex": "Page base esregex",
      "pageBaseDeRegex": "Page base de regex",
      "pageBaseItRegex": "Page base it regex"
    }
  }
}
query

translations#

Returns every text Toki shows members in the current store's storefront modules and wallet, in each supported language. Texts you haven't changed show Toki's own wording, or the English text where Toki has no translation.

Returns

TokiTranslationsPayload!

The texts Toki shows members in the current store, in every supported language.

  • translationsTokiJSON!

    An object keyed by translation key. Each value maps language codes, such as en, to the text.

query Translations {
  translations {
    translations
  }
}
Response
{
  "data": {
    "translations": {
      "translations": {}
    }
  }
}
mutation

translationsUpdate#

Saves your own wording for the current store and returns all texts. For each language you include, what you send replaces your saved texts in that language: texts you leave out go back to Toki's wording and keys of your own are removed, so send every text you changed. Storefront modules show the new texts from their next page load; a browser can keep the old ones for up to five minutes.

Input

TokiTranslationsUpdateInput!
  • translations[TokiTranslationsUpdateTranslationsEntryInput!]!Required

    The texts to save. Each entry's key is a translation key, such as createCoupon; a key that Toki doesn't have adds a text of your own.

Returns

TokiTranslationsPayload!

The texts Toki shows members in the current store, in every supported language.

  • translationsTokiJSON!

    An object keyed by translation key. Each value maps language codes, such as en, to the text.

mutation TranslationsUpdate($input: TokiTranslationsUpdateInput!) {
  translationsUpdate(input: $input) {
    translations
  }
}
Variables
{
  "input": {
    "translations": [
      {
        "key": "Key",
        "value": [
          {
            "key": "Key",
            "value": "Value"
          }
        ]
      }
    ]
  }
}
Response
{
  "data": {
    "translationsUpdate": {
      "translations": {}
    }
  }
}
query

cartValidationRules#

Returns your cart validation rules for all your stores, and the Shopify checkout validation that applies them in each store.

Returns

TokiCartValidationRulesPayload!

Your cart validation rules, and the Shopify checkout validation that applies them in each store.

  • functionIds[TokiCartValidationRulesFunctionIdsEntry!]!

    The checkout validation that applies the rules in each store. Each entry's key is a store's .myshopify.com domain, and its value is the numeric ID of the checkout rule in that store's Shopify admin that uses Toki's Cart Checkout Validation function.

  • rules[TokiCartValidationRule!]!

    Your rules in all your stores. Deleted rules aren't listed.

query CartValidationRules {
  cartValidationRules {
    functionIds {
      key
      value
    }
    rules {
      id
      deletedAt
      merchantId
      shopDomain
      settings {
        maxQuantityAtOneTime
        maxQuantityAtOneTimeError
        maxQuantityTotal
        maxQuantityTotalError
      }
    }
  }
}
Response
{
  "data": {
    "cartValidationRules": {
      "functionIds": [
        {
          "key": "Key",
          "value": "Value"
        }
      ],
      "rules": [
        {
          "id": "10bc29c1-0fbc-482e-aebc-269b0dbc2508",
          "deletedAt": "2026-10-14T09:30:00.000Z",
          "merchantId": "89aa95d5-88aa-4442-a7aa-92af86aa911c",
          "shopDomain": "your-store.myshopify.com",
          "settings": {
            "maxQuantityAtOneTime": 1.5,
            "maxQuantityAtOneTimeError": "Max quantity at one time error",
            "maxQuantityTotal": 49.99,
            "maxQuantityTotalError": "Max quantity total error"
          }
        }
      ]
    }
  }
}
mutation

cartValidationRulesUpdate#

Saves cart validation rules and sends them to Shopify, where each store's checkout validation enforces them. Rules you leave out stay saved, but send every rule each time: Toki rebuilds each store's validation from the rules in the request. Send id: null to create a rule, or deletedAt set to an ISO 8601 timestamp to delete one; functionIds replaces your saved validation IDs, so leaving it out clears them.

Input

TokiCartValidationRulesUpdateInput!
  • functionIds[TokiCartValidationRulesUpdateFunctionIdsEntryInput!]

    The checkout validation that applies the rules in each store. Each entry's key is a store's .myshopify.com domain, and its value is the numeric ID of the checkout rule in that store's Shopify admin that uses Toki's Cart Checkout Validation function.

  • rules[TokiCartValidationRulesUpdateRulesInput!]!Required

    All your rules, including the ones you don't change.

Returns

TokiCartValidationRulesPayload!

Your cart validation rules, and the Shopify checkout validation that applies them in each store.

  • functionIds[TokiCartValidationRulesFunctionIdsEntry!]!

    The checkout validation that applies the rules in each store. Each entry's key is a store's .myshopify.com domain, and its value is the numeric ID of the checkout rule in that store's Shopify admin that uses Toki's Cart Checkout Validation function.

  • rules[TokiCartValidationRule!]!

    Your rules in all your stores. Deleted rules aren't listed.

mutation CartValidationRulesUpdate($input: TokiCartValidationRulesUpdateInput!) {
  cartValidationRulesUpdate(input: $input) {
    functionIds {
      key
      value
    }
    rules {
      id
      deletedAt
      merchantId
      shopDomain
      settings {
        maxQuantityAtOneTime
        maxQuantityAtOneTimeError
        maxQuantityTotal
        maxQuantityTotalError
      }
    }
  }
}
Variables
{
  "input": {
    "rules": [
      {
        "shopDomain": "your-store.myshopify.com",
        "settings": {
          "maxQuantityAtOneTime": 1.5,
          "maxQuantityAtOneTimeError": "Max quantity at one time error"
        }
      }
    ]
  }
}
Response
{
  "data": {
    "cartValidationRulesUpdate": {
      "functionIds": [
        {
          "key": "Key",
          "value": "Value"
        }
      ],
      "rules": [
        {
          "id": "8ada5a78-8bda-4c0b-acda-5d9e8dda5f31",
          "deletedAt": "2026-10-14T09:30:00.000Z",
          "merchantId": "a3f2789c-a4f2-4a2f-a5f2-7bc2a6f27d55",
          "shopDomain": "your-store.myshopify.com",
          "settings": {
            "maxQuantityAtOneTime": 1.5,
            "maxQuantityAtOneTimeError": "Max quantity at one time error",
            "maxQuantityTotal": 49.99,
            "maxQuantityTotalError": "Max quantity total error"
          }
        }
      ]
    }
  }
}

exclusiveProductRules#

Lists exclusive product rules in creation order.

Arguments

  • reverseBoolean

    Reverse the sort order.

  • ids[String!]

    Only these rule IDs; an empty list returns none.

  • searchString

    Text in the collection ID or required segment name (case-insensitive).

Returns

TokiExclusiveProductRuleConnection!

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

A rule controlling access to a Shopify collection and how customers purchase its products.

  • idID!

    The rule's ID.

  • shopifyCollectionIdString!

    Numeric Shopify collection ID.

  • segmentIdID

    Required segment ID, or null when access is unrestricted.

  • purchaseStrategyTokiExclusiveProductsRulesPurchaseStrategy!

    How customers pay: money at the regular price, or points from a store credit balance in the wallet.

    pointsmoney
  • completionStrategyTokiExclusiveProductsRulesCompletionStrategy!

    How a points purchase completes: draft_order creates a draft order for the product, and checkout creates a cart with the product and a one-time discount for the member. Only checkout rules get the cart's free-product and quantity checks. Defaults to draft_order.

    draft_ordercheckout
  • segmentTokiSegment

    Required segment, or null when unrestricted or the segment was deleted.

query ExclusiveProductRules($first: Int) {
  exclusiveProductRules(first: $first) {
    nodes {
      id
      shopifyCollectionId
      segmentId
      purchaseStrategy
      segment {
        id
        name
        alias
        memberLimit
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "exclusiveProductRules": {
      "nodes": [
        {
          "id": "2cd559d5-2bd5-4842-aad5-56af29d5551c",
          "shopifyCollectionId": "e2fcfcfb-e1fc-4b68-a4fd-0021e3fcfe8e",
          "segmentId": "49ca524c-4aca-43df-abca-55724cca5705",
          "purchaseStrategy": "points",
          "segment": {
            "id": "9c48e118-9d48-42ab-ae48-e43e9f48e5d1",
            "name": "Gold",
            "alias": "Alias",
            "memberLimit": 1.5
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
query

exclusiveProducts#

Returns your exclusive product rules, which apply to all your stores, and the validation ID saved for the current store.

Returns

TokiExclusiveProductsPayload!

Your exclusive product rules, and the validation that checks carts against them in the current store.

  • validationFunctionIdString!

    The validation ID last saved for the current store, or an empty string if there is none.

  • rules[TokiExclusiveProductsRules!]!

    All your exclusive product rules.

query ExclusiveProducts {
  exclusiveProducts {
    validationFunctionId
    rules {
      shopifyCollectionId
      exclusiveProductRuleId
      segmentId
      blacklistSegmentId
      quantitySelection {
        enabled
      }
    }
  }
}
Response
{
  "data": {
    "exclusiveProducts": {
      "validationFunctionId": "61d8c84f-60d8-46bc-a3d8-cb7562d8c9e2",
      "rules": [
        {
          "shopifyCollectionId": "dffa075b-defa-45c8-a1fa-0a81e0fa08ee",
          "exclusiveProductRuleId": "72b0f4d8-73b0-466b-a4b0-f7fe75b0f991",
          "segmentId": "7605d16c-7705-42ff-a805-d4927905d625",
          "blacklistSegmentId": "ced59bc5-cdd5-4a32-acd5-989fcbd5970c",
          "quantitySelection": {
            "enabled": true
          }
        }
      ]
    }
  }
}
mutation

exclusiveProductsUpdate#

Replaces your exclusive product rules with rules. Send each saved rule's exclusiveProductRuleId to update it in place; rules without IDs are created, and omitted rules are deleted. With validationFunctionId, Toki also sends the money and checkout rules to that validation in the current store's Shopify checkout; without it, Shopify keeps checking carts against the rules it last received. Requires a plan that includes Exclusive Products.

Input

TokiExclusiveProductsUpdateInput!
  • validationFunctionIdString

    The numeric ID of the checkout rule in the current store's Shopify admin that uses Toki's Exclusive Products Validation. If Shopify has no validation with this ID, the call fails with a BAD_USER_INPUT error before any rule changes are saved.

  • rules[TokiExclusiveProductsUpdateRulesInput!]!Required

    All your rules. They replace the saved ones, so an empty list deletes them all.

Returns

TokiExclusiveProductsPayload!

Your exclusive product rules, and the validation that checks carts against them in the current store.

  • validationFunctionIdString!

    The validation ID last saved for the current store, or an empty string if there is none.

  • rules[TokiExclusiveProductsRules!]!

    All your exclusive product rules.

mutation ExclusiveProductsUpdate($input: TokiExclusiveProductsUpdateInput!) {
  exclusiveProductsUpdate(input: $input) {
    validationFunctionId
    rules {
      shopifyCollectionId
      exclusiveProductRuleId
      segmentId
      blacklistSegmentId
      quantitySelection {
        enabled
      }
    }
  }
}
Variables
{
  "input": {
    "validationFunctionId": "42daba2a-43da-4bbd-a0da-b70441dab897",
    "rules": [
      {
        "shopifyCollectionId": "629d849e-639d-4631-a09d-8178619d830b",
        "purchaseStrategy": "points"
      }
    ]
  }
}
Response
{
  "data": {
    "exclusiveProductsUpdate": {
      "validationFunctionId": "27a527f0-28a5-4983-a9a5-2b162aa52ca9",
      "rules": [
        {
          "shopifyCollectionId": "e24bc800-e34b-4993-a44b-cb26e54bccb9",
          "exclusiveProductRuleId": "777423d9-7674-4246-a574-20b374741f20",
          "segmentId": "478c02eb-468c-4158-a98c-0611488c047e",
          "blacklistSegmentId": "a8349910-a934-4aa3-aa34-9c36ab349dc9",
          "quantitySelection": {
            "enabled": true
          }
        }
      ]
    }
  }
}

productRecommendationRules#

Lists your product recommendation rules, most recently updated first.

Arguments

  • queryString

    Text in the rule's name (case-insensitive).

  • reverseBoolean

    Reverse the sort order.

  • ids[String!]

    Restrict results to these rule IDs. An empty list returns none.

  • activeBoolean

    Select active rules or drafts.

Returns

TokiProductRecommendationRuleConnection!

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

A rule that picks products to recommend in the wallet, from one or more strategies.

  • idID!

    The rule's ID. Pass it as id to productRecommendationRuleUpsert to replace the rule; a wallet Product Recommendations Block refers to the rule by it in its productRecommendationRuleId setting.

  • nameString!

    The rule's name in the Toki app.

  • merchantIdID!

    Your merchant ID, shown under Settings in the Toki app.

  • statusTokiProductRecommendationRuleStatus!

    Only active rules show products in the wallet; a draft rule is saved but shows none.

    activedraft
  • settingsTokiProductRecommendationRuleSettings!

    The strategies that pick the products, in the order their products are listed, and whether to shuffle the combined list.

query ProductRecommendationRules($first: Int) {
  productRecommendationRules(first: $first) {
    nodes {
      id
      name
      merchantId
      status
      settings {
        randomize
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "productRecommendationRules": {
      "nodes": [
        {
          "id": "e07ce262-e17c-43f5-ae7c-df3cdf7ce0cf",
          "name": "Gold",
          "merchantId": "aa464662-ab46-47f5-a846-433ca94644cf",
          "status": "active",
          "settings": {
            "randomize": false
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
query

productRecommendationRule#

Returns a product recommendation rule, or null if you have none with this ID.

Arguments

  • idID!Required

Returns

TokiProductRecommendationRule

A rule that picks products to recommend in the wallet, from one or more strategies.

  • idID!

    The rule's ID. Pass it as id to productRecommendationRuleUpsert to replace the rule; a wallet Product Recommendations Block refers to the rule by it in its productRecommendationRuleId setting.

  • nameString!

    The rule's name in the Toki app.

  • merchantIdID!

    Your merchant ID, shown under Settings in the Toki app.

  • statusTokiProductRecommendationRuleStatus!

    Only active rules show products in the wallet; a draft rule is saved but shows none.

    activedraft
  • settingsTokiProductRecommendationRuleSettings!

    The strategies that pick the products, in the order their products are listed, and whether to shuffle the combined list.

query ProductRecommendationRule($id: ID!) {
  productRecommendationRule(id: $id) {
    id
    name
    merchantId
    status
    settings {
      randomize
    }
  }
}
Variables
{
  "id": "7253d05a-7353-41ed-a053-cd347153cec7"
}
Response
{
  "data": {
    "productRecommendationRule": {
      "id": "7253d05a-7353-41ed-a053-cd347153cec7",
      "name": "Gold",
      "merchantId": "25ed290a-26ed-4a9d-a3ed-25e424ed2777",
      "status": "active",
      "settings": {
        "randomize": false
      }
    }
  }
}
mutation

productRecommendationRuleUpsert#

Creates a product recommendation rule, or replaces the one with the same id. Use a new UUID as the id of a new rule or strategy; only active rules show products in the wallet. Toki recalculates best-selling and co-purchase products in the background after each save, and daily for active rules.

Input

TokiProductRecommendationRuleUpsertInput!
  • idString!Required

    The rule's ID, a UUID.

  • nameString!Required

    The rule's name in the Toki app. Can't be empty.

  • statusTokiProductRecommendationRuleStatus!Required

    Only active rules show products in the wallet; a draft rule is saved but shows none.

    activedraft
  • settingsTokiProductRecommendationRuleSettingsInput!Required

    How a rule picks its products: its strategies, in the order their products are listed, and whether to shuffle the combined list.

Returns

TokiProductRecommendationRule!

A rule that picks products to recommend in the wallet, from one or more strategies.

  • idID!

    The rule's ID. Pass it as id to productRecommendationRuleUpsert to replace the rule; a wallet Product Recommendations Block refers to the rule by it in its productRecommendationRuleId setting.

  • nameString!

    The rule's name in the Toki app.

  • merchantIdID!

    Your merchant ID, shown under Settings in the Toki app.

  • statusTokiProductRecommendationRuleStatus!

    Only active rules show products in the wallet; a draft rule is saved but shows none.

    activedraft
  • settingsTokiProductRecommendationRuleSettings!

    The strategies that pick the products, in the order their products are listed, and whether to shuffle the combined list.

mutation ProductRecommendationRuleUpsert($input: TokiProductRecommendationRuleUpsertInput!) {
  productRecommendationRuleUpsert(input: $input) {
    id
    name
    merchantId
    status
    settings {
      randomize
    }
  }
}
Variables
{
  "input": {
    "id": "1e9b0ce1-1d9b-4b4e-ac9b-09bb1b9b0828",
    "name": "Gold",
    "status": "active",
    "settings": {
      "strategies": [
        {
          "manualSelection": {
            "id": "92f8f901-91f8-476e-a0f8-f5db8ff8f448",
            "productLimit": 1.5
          }
        }
      ]
    }
  }
}
Response
{
  "data": {
    "productRecommendationRuleUpsert": {
      "id": "3d3e479f-3c3e-460c-af3e-4ac53e3e4932",
      "name": "Gold",
      "merchantId": "c7e6c107-c6e6-4f74-a9e6-c42dc8e6c29a",
      "status": "active",
      "settings": {
        "randomize": false
      }
    }
  }
}
mutation

productRecommendationRuleDelete#

Deletes a product recommendation rule. Wallet blocks that use it stop showing products.

Input

TokiProductRecommendationRuleDeleteInput!
  • idID!Required

    The rule to delete.

Returns

Boolean!

true when the change was made. Anything that stops it comes back as an error.

mutation ProductRecommendationRuleDelete($input: TokiProductRecommendationRuleDeleteInput!) {
  productRecommendationRuleDelete(input: $input)
}
Variables
{
  "input": {
    "id": "ce716771-cd71-45de-ac71-644bcb7162b8"
  }
}
Response
{
  "data": {
    "productRecommendationRuleDelete": true
  }
}
query

walletOrderSettings#

Returns Apple Wallet order tracking settings for the current store, including whether the server is configured to issue orders, the merchant name and the store website URL.

Returns

TokiWalletOrderSettingsPayload!
  • appleWalletEnabledBoolean!
  • logoFileIdString
  • supportEmailString!
  • supportPhoneString!
  • supportURLString!
  • businessChatURLString!
  • appleWalletAvailableBoolean!
  • merchantNameString!
  • websiteURLString!
query WalletOrderSettings {
  walletOrderSettings {
    appleWalletEnabled
    logoFileId
    supportEmail
    supportPhone
    supportURL
    businessChatURL
    appleWalletAvailable
  }
}
Response
{
  "data": {
    "walletOrderSettings": {
      "appleWalletEnabled": true,
      "logoFileId": "afb5d8d3-aeb5-4740-a1b5-dbf9b0b5da66",
      "supportEmail": "anna@example.com",
      "supportPhone": "+15555550123",
      "supportURL": "https://example.com/toki/webhooks",
      "businessChatURL": "https://example.com/toki/webhooks",
      "appleWalletAvailable": false
    }
  }
}
mutation

walletOrderSettingsUpdate#

Updates Apple Wallet order tracking settings for the current store and returns the saved settings. Optional fields you leave out keep their current values. When enabled and configured, Toki queues a refresh of wallet orders. Enabling with a logo requires a valid logo image of up to 5 MB.

Input

TokiWalletOrderSettingsUpdateInput!
  • appleWalletEnabledBoolean!Required
  • logoFileIdString
  • supportEmailString
  • supportPhoneString
  • supportURLString
  • businessChatURLString

Returns

TokiWalletOrderSettingsPayload!
  • appleWalletEnabledBoolean!
  • logoFileIdString
  • supportEmailString!
  • supportPhoneString!
  • supportURLString!
  • businessChatURLString!
  • appleWalletAvailableBoolean!
  • merchantNameString!
  • websiteURLString!
mutation WalletOrderSettingsUpdate($input: TokiWalletOrderSettingsUpdateInput!) {
  walletOrderSettingsUpdate(input: $input) {
    appleWalletEnabled
    logoFileId
    supportEmail
    supportPhone
    supportURL
    businessChatURL
    appleWalletAvailable
  }
}
Variables
{
  "input": {
    "appleWalletEnabled": true
  }
}
Response
{
  "data": {
    "walletOrderSettingsUpdate": {
      "appleWalletEnabled": true,
      "logoFileId": "1cb4fe54-1db4-4fe7-aeb5-017a1fb5030d",
      "supportEmail": "anna@example.com",
      "supportPhone": "+15555550123",
      "supportURL": "https://example.com/toki/webhooks",
      "businessChatURL": "https://example.com/toki/webhooks",
      "appleWalletAvailable": false
    }
  }
}