Meet Toki Operator

Docs/Manage API

Activities & rewards

Ways to earn, the rewards they issue, and what members can spend points on.

An activity is a way to earn, such as placing an order or referring a friend. Its reward rules decide what a member receives; memberships have reward rules too. Redemption options are the other side: what members can spend their points on.

Operations11 queries · 13 mutations
mutation

activityCreate#

Creates an activity, including its reward rules and schedule. Applies the merchant's billing limits.

Input

TokiActivityCreateInput!
  • configurationTokiActivityFormInput!Required

    All of an activity's settings, as the activity editor in the Toki app shows them: status, approval, limits, display and schedule, with the type-specific rules and the reward rules under configuration.

Returns

TokiActivityCreatePayload!

Saved activity.

  • idString!

    ID of the saved activity.

mutation ActivityCreate($input: TokiActivityCreateInput!) {
  activityCreate(input: $input) {
    id
  }
}
Variables
{
  "input": {
    "configuration": {
      "configuration": {
        "sHOPIFYPURCHASE": {
          "rules": {
            "configuration": {
              "all": {
                "url": "https://example.com/toki/webhooks"
              }
            }
          }
        }
      }
    }
  }
}
Response
{
  "data": {
    "activityCreate": {
      "id": "959f64ad-949f-431a-a39f-6187929f5ff4"
    }
  }
}
mutation

activityUpdate#

Updates an owned activity and its rewards, preserving the existing versioning and integration side effects.

Input

TokiActivityUpdateInput!
  • idString!Required

    ID of an activity owned by this merchant.

  • configurationTokiActivityFormInput!Required

    All of an activity's settings, as the activity editor in the Toki app shows them: status, approval, limits, display and schedule, with the type-specific rules and the reward rules under configuration.

Returns

TokiActivityCreatePayload!

Saved activity.

  • idString!

    ID of the saved activity.

mutation ActivityUpdate($input: TokiActivityUpdateInput!) {
  activityUpdate(input: $input) {
    id
  }
}
Variables
{
  "input": {
    "id": "1f0b54c4-200b-4657-a10b-57ea220b597d",
    "configuration": {
      "configuration": {
        "sHOPIFYPURCHASE": {
          "rules": {
            "configuration": {
              "all": {
                "url": "https://example.com/toki/webhooks"
              }
            }
          }
        }
      }
    }
  }
}
Response
{
  "data": {
    "activityUpdate": {
      "id": "e26fa566-e36f-46f9-a06f-a240e16fa3d3"
    }
  }
}
mutation

activityUpdateStatus#

Sets an owned activity to active or draft without resaving its configuration or reward rules. Activating a subscription continuation activity requires an order-count period.

Input

TokiActivityUpdateStatusInput!
  • idString!Required

    ID of an activity owned by this merchant.

  • statusTokiActivityUpdateStatusStatus!Required

    active makes the activity live for members, subject to its schedule. draft takes it offline.

    activedraft

Returns

TokiActivityUpdateStatusPayload!

Updated activity status.

  • idString!

    ID of the saved activity.

  • statusTokiActivityUpdateStatusStatus!

    active makes the activity live for members, subject to its schedule. draft takes it offline.

    activedraft
mutation ActivityUpdateStatus($input: TokiActivityUpdateStatusInput!) {
  activityUpdateStatus(input: $input) {
    id
    status
  }
}
Variables
{
  "input": {
    "id": "52cedbfa-53ce-4d8d-a0ce-d8d451ceda67",
    "status": "active"
  }
}
Response
{
  "data": {
    "activityUpdateStatus": {
      "id": "fc3aa41c-fd3a-45af-ae3a-a742ff3aa8d5",
      "status": "active"
    }
  }
}
mutation

activityDelete#

Deletes an owned activity using the same reward cleanup as the merchant editor.

Input

TokiActivityDeleteInput!
  • idString!Required

    ID of an activity owned by this merchant.

Returns

Boolean!

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

mutation ActivityDelete($input: TokiActivityDeleteInput!) {
  activityDelete(input: $input)
}
Variables
{
  "input": {
    "id": "0cea4e6a-0dea-4ffd-aaea-4b440bea4cd7"
  }
}
Response
{
  "data": {
    "activityDelete": true
  }
}
mutation

activityReferralCodesRefresh#

Queues referral code regeneration. Fails if referral codes are not configured as discount codes.

Input

TokiActivityReferralCodesRefreshInput!
  • idString!Required

    ID of an activity owned by this merchant.

Returns

Boolean!

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

mutation ActivityReferralCodesRefresh($input: TokiActivityReferralCodesRefreshInput!) {
  activityReferralCodesRefresh(input: $input)
}
Variables
{
  "input": {
    "id": "0ce81b0b-0be8-4978-aee8-1e310de81c9e"
  }
}
Response
{
  "data": {
    "activityReferralCodesRefresh": true
  }
}
mutation

activityReferralPropertiesRefresh#

Queues an update of referral properties for an owned activity.

Input

TokiActivityReferralPropertiesRefreshInput!
  • idString!Required

    ID of an activity owned by this merchant.

Returns

Boolean!

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

mutation ActivityReferralPropertiesRefresh($input: TokiActivityReferralPropertiesRefreshInput!) {
  activityReferralPropertiesRefresh(input: $input)
}
Variables
{
  "input": {
    "id": "1505ab8a-1605-4d1d-a305-a8641405a9f7"
  }
}
Response
{
  "data": {
    "activityReferralPropertiesRefresh": true
  }
}
mutation

activityBirthdayRewardsSend#

Processes birthday rewards for an owned activity, optionally for one merchant member.

Input

TokiActivityBirthdayRewardsSendInput!
  • idString!Required

    ID of an activity owned by this merchant.

  • onlyForUserIdString

    Restrict processing to this member; omit for all eligible members.

Returns

Boolean!

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

mutation ActivityBirthdayRewardsSend($input: TokiActivityBirthdayRewardsSendInput!) {
  activityBirthdayRewardsSend(input: $input)
}
Variables
{
  "input": {
    "id": "95deccdc-96de-4e6f-a7de-d00298ded195",
    "onlyForUserId": "659d9fe4-669d-4177-a79d-a30a689da49d"
  }
}
Response
{
  "data": {
    "activityBirthdayRewardsSend": true
  }
}
query

activityGroups#

Available activity templates grouped by purpose, with integration and billing requirements.

Returns

[TokiActivityGroupsPayload!]!

Activity template group.

  • titleString!

    Group title.

  • activities[TokiActivityGroupsPayloadActivities!]!

    Templates in this group.

query ActivityGroups {
  activityGroups {
    title
    activities {
      type
      title
      subtitle
      titleKey
    }
  }
}
Response
{
  "data": {
    "activityGroups": [
      {
        "title": "Summer double points",
        "activities": [
          {
            "type": "default",
            "title": "Summer double points",
            "subtitle": "Subtitle",
            "titleKey": "Title key"
          }
        ]
      }
    ]
  }
}
query

activityRewardPlaceholder#

Formats a reward preview without saving it. Accepts draft settings so incomplete editor values can be previewed.

Arguments

  • rewardTokiRewardPreviewInput!Required

    Reward settings for a description preview. Accepts settings from any activity or workflow, including absent or null referral settings on non-referral rewards. Never used to validate a saved rule.

  • typeTokiActivityRewardPlaceholderType!Required

    Activity type identifier, or workflow for a workflow reward.

    SHOPIFY_PURCHASESHOPIFY_BASED_ON_SPENDKLAVIYO_SIGNUPTIKTOK_FOLLOWTIKTOK_LIKE_POSTINSTAGRAM_FOLLOWINSTAGRAM_LIKE_POSTINSTAGRAM_COMMENT_POSTINSTAGRAM_POST_UGCTWITTER_FOLLOWTWITTER_LIKE_POSTTWITTER_COMMENT_POSTTWITTER_RETWEETDISCORD_JOIN_CHANNELFACEBOOK_JOIN_GROUPFACEBOOK_LIKE_POSTFACEBOOK_COMMENT_POSTFACEBOOK_LIKE_PAGENON_INTEGRATION_REFERRALNON_INTEGRATION_CUSTOMTAPCART_ACTIONTIKTOK_VIDEO_CREATIONAIRDROP_CLAIMREFER_A_FRIENDREFER_A_FRIEND_TO_COMPLETE_AN_ACTIVITYLINK_CLICKSSHARE_PURCHASE_ON_SOCIALCOLLECT_ZERO_PARTY_DATAJOIN_REWARDS_PROGRAMPICTURE_SUBMISSIONSHARE_WITH_FRIENDSSUBSCRIPTION_SIGN_UPSUBSCRIPTION_CONTINUATIONSUBSCRIPTION_CHARGEVOTINGQUIZDOWNLOAD_PASSPOSTSCRIPT_SMS_SIGN_UPBIRTHDAYLOYALTY_ANNIVERSARYCHALLENGENEWSLETTER_SIGN_UPJUDGE_ME_CREATE_REVIEWREVIEWSACTION_LOOX_REVIEWSACTION_OKENDOACTION_REVIEWS_IOACTION_STAMPEDACTION_YOTPOACTION_FAIRINGACTION_GORGIASSIGN_IN_REWARDSSCAN_QR_CODETAGGUN_SEND_RECEIPTYOUTUBE_SUBSCRIBEPINTEREST_FOLLOWGREENSPARK_IMPACTSPIN_WHEELLOTTERYCHARITYREDEEM_CODEworkflow

Returns

String!
query ActivityRewardPlaceholder($reward: TokiRewardPreviewInput!, $type: TokiActivityRewardPlaceholderType!) {
  activityRewardPlaceholder(reward: $reward, type: $type)
}
Variables
{
  "reward": {
    "configuration": {
      "withoutReward": {
        "isOneTimeReward": true
      }
    }
  },
  "type": "SHOPIFY_PURCHASE"
}
Response
{
  "data": {
    "activityRewardPlaceholder": "Activity reward placeholder"
  }
}

activities#

Lists your activities, most recently updated first. Select configuration for an activity's full settings, or activityCompletions for its completions.

Arguments

  • queryString

    Text in the activity's name or type, ignoring case.

  • reverseBoolean

    Reverse the sort order.

  • ids[String!]

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

  • nameString

    Case-insensitive substring matched only against the activity name.

  • types[TokiActivitiesTypes!]

    Only activities of these types. An empty list doesn't filter.

    SHOPIFY_PURCHASESHOPIFY_BASED_ON_SPENDKLAVIYO_SIGNUPTIKTOK_FOLLOWTIKTOK_LIKE_POSTINSTAGRAM_FOLLOWINSTAGRAM_LIKE_POSTINSTAGRAM_COMMENT_POSTINSTAGRAM_POST_UGCTWITTER_FOLLOWTWITTER_LIKE_POSTTWITTER_COMMENT_POSTTWITTER_RETWEETDISCORD_JOIN_CHANNELFACEBOOK_JOIN_GROUPFACEBOOK_LIKE_POSTFACEBOOK_COMMENT_POSTFACEBOOK_LIKE_PAGENON_INTEGRATION_REFERRALNON_INTEGRATION_CUSTOMTAPCART_ACTIONTIKTOK_VIDEO_CREATIONAIRDROP_CLAIMREFER_A_FRIENDREFER_A_FRIEND_TO_COMPLETE_AN_ACTIVITYLINK_CLICKSSHARE_PURCHASE_ON_SOCIALCOLLECT_ZERO_PARTY_DATAJOIN_REWARDS_PROGRAMPICTURE_SUBMISSIONSHARE_WITH_FRIENDSSUBSCRIPTION_SIGN_UPSUBSCRIPTION_CONTINUATIONSUBSCRIPTION_CHARGEVOTINGQUIZDOWNLOAD_PASSPOSTSCRIPT_SMS_SIGN_UPBIRTHDAYLOYALTY_ANNIVERSARYCHALLENGENEWSLETTER_SIGN_UPJUDGE_ME_CREATE_REVIEWREVIEWSACTION_LOOX_REVIEWSACTION_OKENDOACTION_REVIEWS_IOACTION_STAMPEDACTION_YOTPOACTION_FAIRINGACTION_GORGIASSIGN_IN_REWARDSSCAN_QR_CODETAGGUN_SEND_RECEIPTYOUTUBE_SUBSCRIBEPINTEREST_FOLLOWGREENSPARK_IMPACTSPIN_WHEELLOTTERYCHARITYREDEEM_CODE
  • withoutTypes[TokiActivitiesWithoutTypes!]

    Leaves out activities of these types. An empty list leaves out none.

    SHOPIFY_PURCHASESHOPIFY_BASED_ON_SPENDKLAVIYO_SIGNUPTIKTOK_FOLLOWTIKTOK_LIKE_POSTINSTAGRAM_FOLLOWINSTAGRAM_LIKE_POSTINSTAGRAM_COMMENT_POSTINSTAGRAM_POST_UGCTWITTER_FOLLOWTWITTER_LIKE_POSTTWITTER_COMMENT_POSTTWITTER_RETWEETDISCORD_JOIN_CHANNELFACEBOOK_JOIN_GROUPFACEBOOK_LIKE_POSTFACEBOOK_COMMENT_POSTFACEBOOK_LIKE_PAGENON_INTEGRATION_REFERRALNON_INTEGRATION_CUSTOMTAPCART_ACTIONTIKTOK_VIDEO_CREATIONAIRDROP_CLAIMREFER_A_FRIENDREFER_A_FRIEND_TO_COMPLETE_AN_ACTIVITYLINK_CLICKSSHARE_PURCHASE_ON_SOCIALCOLLECT_ZERO_PARTY_DATAJOIN_REWARDS_PROGRAMPICTURE_SUBMISSIONSHARE_WITH_FRIENDSSUBSCRIPTION_SIGN_UPSUBSCRIPTION_CONTINUATIONSUBSCRIPTION_CHARGEVOTINGQUIZDOWNLOAD_PASSPOSTSCRIPT_SMS_SIGN_UPBIRTHDAYLOYALTY_ANNIVERSARYCHALLENGENEWSLETTER_SIGN_UPJUDGE_ME_CREATE_REVIEWREVIEWSACTION_LOOX_REVIEWSACTION_OKENDOACTION_REVIEWS_IOACTION_STAMPEDACTION_YOTPOACTION_FAIRINGACTION_GORGIASSIGN_IN_REWARDSSCAN_QR_CODETAGGUN_SEND_RECEIPTYOUTUBE_SUBSCRIBEPINTEREST_FOLLOWGREENSPARK_IMPACTSPIN_WHEELLOTTERYCHARITYREDEEM_CODE
  • statusTokiActivitiesStatus

    active for activities that are live for members, draft for the rest.

    activedraft
  • idID

    Only items whose id equals this value.

  • typeString

    Only items whose type equals this value.

Returns

TokiActivityConnection!

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

A way to earn in your program, such as placing an order or referring a friend.

  • idID!
  • typeNameString!

    Display name of the activity type.

  • completionLimitTokiActivityCompletionLimit!

    Activity completion limits with numeric amounts and periods.

  • challenges[TokiContainingChallenge!]!

    Challenges that include this activity as a step.

  • typeString!

    The activity type, such as SHOPIFY_PURCHASE, REFER_A_FRIEND or PICTURE_SUBMISSION. Filter on it with the type, types and withoutTypes arguments of activities.

  • statusTokiActivityStatus!

    active activities are live for members; draft ones are not.

    activedraft
  • updatedAtString!
  • displayTokiActivityDisplay!

    How members see the activity.

  • rewards[TokiActivityReward!]!

    The activity's reward rules in editor order, lowest priority first: a member gets the last rule they qualify for, for example by segment.

  • relatedActivities[TokiActivitySummary!]!

    The activities a CHALLENGE is made of, or that a referred friend must complete for a REFER_A_FRIEND_TO_COMPLETE_AN_ACTIVITY activity. Empty for other types.

  • configurationTokiActivityConfiguration!

    All of an activity's settings, as the activity editor in the Toki app shows them: status, approval, limits, display and schedule, with the type-specific rules and the reward rules under configuration.

  • activityCompletionsTokiActivityCompletionConnection!

    Completions of this activity, newest first.

query Activities($first: Int) {
  activities(first: $first) {
    nodes {
      id
      typeName
      type
      status
      challenges {
        id
        name
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "activities": {
      "nodes": [
        {
          "id": "4ae4f1c0-4be4-4353-ace4-f4e64de4f679",
          "typeName": "Type name",
          "type": "default",
          "status": "active",
          "challenges": [
            {
              "id": "ae5f4d9e-af5f-4f31-ac5f-4a78ad5f4c0b",
              "name": "Gold"
            }
          ]
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
query

activity#

Returns one of your activities by ID, or null if none matches.

Arguments

  • idString!Required

Returns

TokiActivity

A way to earn in your program, such as placing an order or referring a friend.

  • idID!
  • typeNameString!

    Display name of the activity type.

  • completionLimitTokiActivityCompletionLimit!

    Activity completion limits with numeric amounts and periods.

  • challenges[TokiContainingChallenge!]!

    Challenges that include this activity as a step.

  • typeString!

    The activity type, such as SHOPIFY_PURCHASE, REFER_A_FRIEND or PICTURE_SUBMISSION. Filter on it with the type, types and withoutTypes arguments of activities.

  • statusTokiActivityStatus!

    active activities are live for members; draft ones are not.

    activedraft
  • updatedAtString!
  • displayTokiActivityDisplay!

    How members see the activity.

  • rewards[TokiActivityReward!]!

    The activity's reward rules in editor order, lowest priority first: a member gets the last rule they qualify for, for example by segment.

  • relatedActivities[TokiActivitySummary!]!

    The activities a CHALLENGE is made of, or that a referred friend must complete for a REFER_A_FRIEND_TO_COMPLETE_AN_ACTIVITY activity. Empty for other types.

  • configurationTokiActivityConfiguration!

    All of an activity's settings, as the activity editor in the Toki app shows them: status, approval, limits, display and schedule, with the type-specific rules and the reward rules under configuration.

  • activityCompletionsTokiActivityCompletionConnection!

    Completions of this activity, newest first.

query Activity($id: String!) {
  activity(id: $id) {
    id
    typeName
    type
    status
    updatedAt
    challenges {
      id
      name
    }
  }
}
Variables
{
  "id": "772cb559-762c-43c6-a52c-b233742cb0a0"
}
Response
{
  "data": {
    "activity": {
      "id": "772cb559-762c-43c6-a52c-b233742cb0a0",
      "typeName": "Type name",
      "type": "default",
      "status": "active",
      "updatedAt": "2026-10-14T09:30:00.000Z",
      "challenges": [
        {
          "id": "e278419f-e178-400c-a478-44c5e3784332",
          "name": "Gold"
        }
      ]
    }
  }
}

rewards#

Lists your reward rules: those of your activities and memberships, and your redemption options. Filter by activityId or tierId, or set both to null to get only redemption options. Rules are sorted by position, so an activity's rules come in the order its editor shows them.

Arguments

  • reverseBoolean

    Reverse the sort order.

  • searchString

    Case-insensitive text in the stored reward name or its owning activity/membership name. Literal substring search, applied in SQL before pagination; translated messages are not searched.

  • ids[String!]

    Only these reward IDs; an empty list returns none.

  • types[TokiRewardType!]

    Only these reward types. An empty list leaves types unrestricted.

    assetgiftmembership_carddiscounttokengatingmultiplierVotesfreeShippingcustomacceleratortremendousshopifyStoreCreditwithoutRewarddisabledxBetMultipliertotalPool
  • membershipOnlyBoolean

    When true, return only rules owned by memberships.

  • idID

    Only items whose id equals this value.

  • activityIdID

    Only items whose activityId equals this value. null matches items without one.

  • tierIdID

    Only items whose tierId equals this value. null matches items without one.

Returns

TokiRewardConnection!

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

A reward rule: what a member receives from an activity or a membership, or buys with a redemption option.

  • idID!
  • typeTokiRewardType!

    What a reward rule grants. asset: a balance such as points, as a fixed amount or based on spend. discount and freeShipping: a discount code. gift: free products. membership_card: a collectible. shopifyStoreCredit: Shopify store credit. tremendous: a Tremendous gift card. custom: something you fulfill yourself. gating, accelerator and multiplierVotes: membership rewards for gated access, faster earning and extra votes. xBetMultiplier and totalPool: spin wheel and lottery prizes. withoutReward grants nothing but still records the completion; disabled records nothing.

    assetgiftmembership_carddiscounttokengatingmultiplierVotesfreeShippingcustomacceleratortremendousshopifyStoreCreditwithoutRewarddisabledxBetMultipliertotalPool
  • orderNumberInt!

    Position of this rule within its activity or membership.

  • messageString!

    Translated description of the reward in the current shop's currency.

  • activityIdID

    The activity the rule belongs to. null for membership rewards and redemption options.

  • tierIdID

    The membership the rule belongs to (TokiMembership.id). null for activity rewards and redemption options.

  • configurationTokiRewardConfiguration!

    A stored reward rule, including purchase and review settings. Referral-only settings are null when absent.

  • activityTokiActivity

    Owning activity, or null for membership rewards, redemption options and deleted activities.

  • membershipTokiMembership

    Owning membership, or null for activity rewards, redemption options and deleted memberships.

query Rewards($first: Int) {
  rewards(first: $first) {
    nodes {
      id
      type
      orderNumber
      message
      configuration {
        id
        segment
        deletedAt
        discountType
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "rewards": {
      "nodes": [
        {
          "id": "766f402f-756f-4e9c-a86f-4355776f41c2",
          "type": "asset",
          "orderNumber": 3,
          "message": "Message",
          "configuration": {
            "id": "2e2a186b-2d2a-46d8-a02a-1b912f2a19fe",
            "segment": "Segment",
            "deletedAt": "2026-10-14T09:30:00.000Z",
            "discountType": "Discount type"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
query

reward#

Returns a reward rule of one of your activities, memberships or redemption options by ID, or null if none matches.

Arguments

  • idString!Required

Returns

TokiReward

A reward rule: what a member receives from an activity or a membership, or buys with a redemption option.

  • idID!
  • typeTokiRewardType!

    What a reward rule grants. asset: a balance such as points, as a fixed amount or based on spend. discount and freeShipping: a discount code. gift: free products. membership_card: a collectible. shopifyStoreCredit: Shopify store credit. tremendous: a Tremendous gift card. custom: something you fulfill yourself. gating, accelerator and multiplierVotes: membership rewards for gated access, faster earning and extra votes. xBetMultiplier and totalPool: spin wheel and lottery prizes. withoutReward grants nothing but still records the completion; disabled records nothing.

    assetgiftmembership_carddiscounttokengatingmultiplierVotesfreeShippingcustomacceleratortremendousshopifyStoreCreditwithoutRewarddisabledxBetMultipliertotalPool
  • orderNumberInt!

    Position of this rule within its activity or membership.

  • messageString!

    Translated description of the reward in the current shop's currency.

  • activityIdID

    The activity the rule belongs to. null for membership rewards and redemption options.

  • tierIdID

    The membership the rule belongs to (TokiMembership.id). null for activity rewards and redemption options.

  • configurationTokiRewardConfiguration!

    A stored reward rule, including purchase and review settings. Referral-only settings are null when absent.

  • activityTokiActivity

    Owning activity, or null for membership rewards, redemption options and deleted activities.

  • membershipTokiMembership

    Owning membership, or null for activity rewards, redemption options and deleted memberships.

query Reward($id: String!) {
  reward(id: $id) {
    id
    type
    orderNumber
    message
    activityId
    tierId
    configuration {
      id
      segment
      deletedAt
      discountType
      availabilitySettings {
        enabled
        channels
        posLocationIds
      }
    }
  }
}
Variables
{
  "id": "16e02613-15e0-4480-a8e0-293917e027a6"
}
Response
{
  "data": {
    "reward": {
      "id": "16e02613-15e0-4480-a8e0-293917e027a6",
      "type": "asset",
      "orderNumber": 3,
      "message": "Message",
      "activityId": "2167446e-2267-4601-af67-4148206742db",
      "tierId": "b04929af-af49-481c-a249-2cd5b1492b42",
      "configuration": {
        "id": "d151b617-d051-4484-a351-b93dd251b7aa",
        "segment": "Segment",
        "deletedAt": "2026-10-14T09:30:00.000Z",
        "discountType": "Discount type",
        "availabilitySettings": {
          "enabled": true,
          "channels": [
            "storefront"
          ],
          "posLocationIds": [
            "dc8e840b-db8e-4278-ae8e-8731dd8e859e"
          ]
        }
      }
    }
  }
}
mutation

redemptionOptionCreate#

Adds a redemption option to the end of your list and returns it as saved. If redemptionOption.id is the ID of one of your options, that option is replaced and moved to the end instead. List your options with loyaltySettings.

Input

TokiRedemptionOptionCreateInput!
  • redemptionOptionTokiRedemptionOptionInput!Required

    A redemption option: a reward members can buy with their points, and its price in amountToSpend.

Returns

TokiRedemptionOption

A redemption option: a reward members can buy with their points, and its price in amountToSpend.

  • idString

    The rule's ID, the same as TokiReward.id.

  • segmentString

    The ID of the segment the rule is for. null: every member. An activity gives a member the last of its rules they qualify for, and a redemption option is offered only to members in its segment. Memberships ignore it.

  • deletedAtString

    Always null when read. Leave it out when you write.

  • discountTypeString

    Always null, and ignored on input. Refer-a-friend rules set the referred friend's discount in discount.

  • descriptionString

    Memberships: a description of the reward. A gated access reward without a rewardName shows it as its name.

  • dropRateFloat

    Spin wheel activities: the rule's weight in the draw. Each spin picks one of the rules open to the member, in proportion to their dropRate. A rule without one is never picked, and if no rule has one, the spin wins nothing.

  • visibilitySettingsTokiVisibilitySettings!

    Memberships: who sees the reward in the wallet. owner shows it to members of this tier. Activities and redemption options ignore it.

  • availabilitySettingsTokiRewardAvailabilitySettings

    Limits a rule to some sales channels, Shopify markets and POS locations, when enabled is true. Redemption options are offered only there, and purchase activities reward only orders from there.

  • rewardNameString

    Your name for the reward, which members see instead of the one Toki generates (see rewardMessage).

  • rewardMessageString

    The reward's name as members see it: rewardName, or a name Toki generates from the reward. Ignored on input.

  • rewardDelayFloat

    How long Toki waits before giving the reward, in milliseconds. null or 0: right away. Purchase and refer-a-friend activities count from when the order was placed. Used by purchase, spend goal and refer-a-friend activities and by memberships.

  • excludedDiscountSettingsTokiRewardExcludedDiscountSettings

    Purchase, subscription and refer-a-friend activities: orders with these discounts get no reward from the rule.

  • includedDiscountSettingsTokiRewardIncludedDiscountSettings

    Purchase, subscription and refer-a-friend activities: discount codes an order must use to get a reward from the rule.

  • displayRuleTokiDisplayRule!

    Activities: the display settings for members who get this rule. They replace the activity's when custom is true.

  • generationsLimitTokiCompletionsLimit

    How many times each member can get the reward. Redemption options count redemptions. Memberships count used discount and free shipping codes, and manual free gifts given. Activities ignore it.

  • totalGenerationsLimitTokiCompletionsLimit

    How many times the reward can be given across all members. Redemption options count redemptions. Memberships count used discount and free shipping codes, and hide the reward once the limit is reached. Activities ignore it.

  • availabilityDelayTokiRewardAvailabilityDelay!

    Memberships: a wait, counted from when the member joined the membership, before they can use the reward. Applies when enabled is true.

  • availabilityAddonsTokiRewardAvailabilityAddons!

    Paid memberships: only members who have one of addonIds on their paid membership can use the reward. Applies when enabled is true.

  • schedulingTokiRewardScheduling

    When a redemption option, or a membership's accelerator reward, is available.

  • buttonSettingsTokiRewardButtonSettings!

    Memberships: the reward's button in the wallet's perks list.

  • impactSettingsTokiRewardImpactSettings

    Greenspark activities: the projects members can fund with their points.

  • ticketPriceFloat

    Lottery activities: the points a ticket costs, taken from the member's balance in your default store credit. Tickets are free when it is 0 or not set.

  • limitPerUserFloat

    Lottery activities: the most tickets a member can have in a draw. 0 or no value means no limit.

  • limitsTokiRewardLimits

    Charity activities: the smallest (minAmount) and largest (maxAmount) donation a member can make, in points of your default store credit. A limit that is 0 or not set doesn't apply.

  • charityList[TokiRewardCharity!]

    Charity activities: the charities a member can pick when they donate.

  • amountToSpendFloat!

    The price in points that a member spends to redeem the option.

  • configurationTokiRewardRuleConfiguration!

    What the reward rule grants, by reward type.

mutation RedemptionOptionCreate($input: TokiRedemptionOptionCreateInput!) {
  redemptionOptionCreate(input: $input) {
    id
    segment
    deletedAt
    discountType
    description
    dropRate
    rewardName
    availabilitySettings {
      enabled
      channels
      posLocationIds
      markets {
        id
        handle
      }
    }
  }
}
Variables
{
  "input": {
    "redemptionOption": {
      "amountToSpend": 49.99,
      "configuration": {
        "withoutReward": {
          "isOneTimeReward": true
        }
      }
    }
  }
}
Response
{
  "data": {
    "redemptionOptionCreate": {
      "id": "f913ee22-fa13-4fb5-a713-eafcf813ec8f",
      "segment": "Segment",
      "deletedAt": "2026-10-14T09:30:00.000Z",
      "discountType": "Discount type",
      "description": "Earn double points on every order in July.",
      "dropRate": 0.1,
      "rewardName": "Reward name",
      "availabilitySettings": {
        "enabled": true,
        "channels": [
          "storefront"
        ],
        "posLocationIds": [
          "69a1c07e-6aa1-4211-a7a1-bd5868a1beeb"
        ],
        "markets": [
          {
            "id": "343f416b-333f-4fd8-a63f-4491353f42fe",
            "handle": "Handle"
          }
        ]
      }
    }
  }
}
mutation

redemptionOptionUpdate#

Replaces a redemption option with redemptionOption, keeping its place in your list, and returns it as saved. Settings you leave out aren't kept.

Input

TokiRedemptionOptionUpdateInput!
  • idString!Required

    The option to replace. redemptionOption.id is ignored.

  • redemptionOptionTokiRedemptionOptionInput!Required

    A redemption option: a reward members can buy with their points, and its price in amountToSpend.

Returns

TokiRedemptionOption!

A redemption option: a reward members can buy with their points, and its price in amountToSpend.

  • idString

    The rule's ID, the same as TokiReward.id.

  • segmentString

    The ID of the segment the rule is for. null: every member. An activity gives a member the last of its rules they qualify for, and a redemption option is offered only to members in its segment. Memberships ignore it.

  • deletedAtString

    Always null when read. Leave it out when you write.

  • discountTypeString

    Always null, and ignored on input. Refer-a-friend rules set the referred friend's discount in discount.

  • descriptionString

    Memberships: a description of the reward. A gated access reward without a rewardName shows it as its name.

  • dropRateFloat

    Spin wheel activities: the rule's weight in the draw. Each spin picks one of the rules open to the member, in proportion to their dropRate. A rule without one is never picked, and if no rule has one, the spin wins nothing.

  • visibilitySettingsTokiVisibilitySettings!

    Memberships: who sees the reward in the wallet. owner shows it to members of this tier. Activities and redemption options ignore it.

  • availabilitySettingsTokiRewardAvailabilitySettings

    Limits a rule to some sales channels, Shopify markets and POS locations, when enabled is true. Redemption options are offered only there, and purchase activities reward only orders from there.

  • rewardNameString

    Your name for the reward, which members see instead of the one Toki generates (see rewardMessage).

  • rewardMessageString

    The reward's name as members see it: rewardName, or a name Toki generates from the reward. Ignored on input.

  • rewardDelayFloat

    How long Toki waits before giving the reward, in milliseconds. null or 0: right away. Purchase and refer-a-friend activities count from when the order was placed. Used by purchase, spend goal and refer-a-friend activities and by memberships.

  • excludedDiscountSettingsTokiRewardExcludedDiscountSettings

    Purchase, subscription and refer-a-friend activities: orders with these discounts get no reward from the rule.

  • includedDiscountSettingsTokiRewardIncludedDiscountSettings

    Purchase, subscription and refer-a-friend activities: discount codes an order must use to get a reward from the rule.

  • displayRuleTokiDisplayRule!

    Activities: the display settings for members who get this rule. They replace the activity's when custom is true.

  • generationsLimitTokiCompletionsLimit

    How many times each member can get the reward. Redemption options count redemptions. Memberships count used discount and free shipping codes, and manual free gifts given. Activities ignore it.

  • totalGenerationsLimitTokiCompletionsLimit

    How many times the reward can be given across all members. Redemption options count redemptions. Memberships count used discount and free shipping codes, and hide the reward once the limit is reached. Activities ignore it.

  • availabilityDelayTokiRewardAvailabilityDelay!

    Memberships: a wait, counted from when the member joined the membership, before they can use the reward. Applies when enabled is true.

  • availabilityAddonsTokiRewardAvailabilityAddons!

    Paid memberships: only members who have one of addonIds on their paid membership can use the reward. Applies when enabled is true.

  • schedulingTokiRewardScheduling

    When a redemption option, or a membership's accelerator reward, is available.

  • buttonSettingsTokiRewardButtonSettings!

    Memberships: the reward's button in the wallet's perks list.

  • impactSettingsTokiRewardImpactSettings

    Greenspark activities: the projects members can fund with their points.

  • ticketPriceFloat

    Lottery activities: the points a ticket costs, taken from the member's balance in your default store credit. Tickets are free when it is 0 or not set.

  • limitPerUserFloat

    Lottery activities: the most tickets a member can have in a draw. 0 or no value means no limit.

  • limitsTokiRewardLimits

    Charity activities: the smallest (minAmount) and largest (maxAmount) donation a member can make, in points of your default store credit. A limit that is 0 or not set doesn't apply.

  • charityList[TokiRewardCharity!]

    Charity activities: the charities a member can pick when they donate.

  • amountToSpendFloat!

    The price in points that a member spends to redeem the option.

  • configurationTokiRewardRuleConfiguration!

    What the reward rule grants, by reward type.

mutation RedemptionOptionUpdate($input: TokiRedemptionOptionUpdateInput!) {
  redemptionOptionUpdate(input: $input) {
    id
    segment
    deletedAt
    discountType
    description
    dropRate
    rewardName
    availabilitySettings {
      enabled
      channels
      posLocationIds
      markets {
        id
        handle
      }
    }
  }
}
Variables
{
  "input": {
    "id": "823b573f-813b-45ac-a43b-5a65833b58d2",
    "redemptionOption": {
      "amountToSpend": 49.99,
      "configuration": {
        "withoutReward": {
          "isOneTimeReward": true
        }
      }
    }
  }
}
Response
{
  "data": {
    "redemptionOptionUpdate": {
      "id": "828537f5-8185-4662-a085-34cf7f85333c",
      "segment": "Segment",
      "deletedAt": "2026-10-14T09:30:00.000Z",
      "discountType": "Discount type",
      "description": "Earn double points on every order in July.",
      "dropRate": 0.1,
      "rewardName": "Reward name",
      "availabilitySettings": {
        "enabled": true,
        "channels": [
          "storefront"
        ],
        "posLocationIds": [
          "9c901f45-9b90-4db2-aa90-1c1f99901a8c"
        ],
        "markets": [
          {
            "id": "08f7b4e4-09f7-4677-aaf7-b80a0bf7b99d",
            "handle": "Handle"
          }
        ]
      }
    }
  }
}

blacklistRules#

Lists the current merchant's blacklist rules, newest first, optionally filtering by name.

Arguments

  • searchString

    Case-insensitive substring to match against rule names.

Returns

TokiBlacklistRuleConnection!

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

A merchant-owned rule that restricts reward redemption.

  • idString!

    Unique blacklist rule ID. Generate a UUID when creating a rule.

  • merchantIdString!

    The merchant that owns this rule.

  • nameString!

    Rule name shown in the merchant portal.

  • statusTokiBlacklistRuleStatus!

    Only active rules restrict reward redemption.

    activedraft
  • configTokiBlacklistRuleConfig!

    Member segments whose rewards are blocked by this rule.

query BlacklistRules($first: Int) {
  blacklistRules(first: $first) {
    nodes {
      id
      merchantId
      name
      status
      config {
        type
        rewardIds
        segmentIds
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "blacklistRules": {
      "nodes": [
        {
          "id": "a75cbf57-a65c-4dc4-a95c-c27da85cc0ea",
          "merchantId": "014bb5cf-004b-443c-a34b-b8f5024bb762",
          "name": "Gold",
          "status": "active",
          "config": {
            "type": "default",
            "rewardIds": [
              "76d29b6d-75d2-49da-a4d2-984773d296b4"
            ],
            "segmentIds": [
              "b8960793-b796-4600-aa96-0ab9b9960926"
            ]
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
query

blacklistRule#

Returns one blacklist rule belonging to the current merchant. Deleted rules are not available.

Arguments

  • idString!Required

    ID of a blacklist rule belonging to the current merchant.

Returns

TokiBlacklistRule!

A merchant-owned rule that restricts reward redemption.

  • idString!

    Unique blacklist rule ID. Generate a UUID when creating a rule.

  • merchantIdString!

    The merchant that owns this rule.

  • nameString!

    Rule name shown in the merchant portal.

  • statusTokiBlacklistRuleStatus!

    Only active rules restrict reward redemption.

    activedraft
  • configTokiBlacklistRuleConfig!

    Member segments whose rewards are blocked by this rule.

query BlacklistRule($id: String!) {
  blacklistRule(id: $id) {
    id
    merchantId
    name
    status
    config {
      type
      rewardIds
      segmentIds
    }
  }
}
Variables
{
  "id": "468e720b-458e-4078-a88e-7531478e739e"
}
Response
{
  "data": {
    "blacklistRule": {
      "id": "468e720b-458e-4078-a88e-7531478e739e",
      "merchantId": "1c49cc23-1b49-4a90-ae49-cf491d49cdb6",
      "name": "Gold",
      "status": "active",
      "config": {
        "type": "default",
        "rewardIds": [
          "80a4e9f1-7fa4-485e-aea4-e6cb7da4e538"
        ],
        "segmentIds": [
          "ec90ee97-eb90-4d04-ae90-f1bded90f02a"
        ]
      }
    }
  }
}
mutation

blacklistRuleUpsert#

Creates or updates a blacklist rule for the current merchant and starts syncing blacklist metafields.

Input

TokiBlacklistRuleUpsertInput!

Reward blacklist rule to create or update.

  • idString!Required

    Unique blacklist rule ID. Generate a UUID when creating a rule.

  • nameString!Required

    Rule name shown in the merchant portal.

  • statusTokiBlacklistRuleStatus

    Only active rules restrict reward redemption.

    activedraft
  • configTokiBlacklistRuleConfigInput!Required

    Member segments whose rewards are blocked by this rule.

Returns

TokiBlacklistRuleUpsertPayload!

Identifier of the saved blacklist rule.

  • idString!

    ID of the saved blacklist rule.

mutation BlacklistRuleUpsert($input: TokiBlacklistRuleUpsertInput!) {
  blacklistRuleUpsert(input: $input) {
    id
  }
}
Variables
{
  "input": {
    "id": "7750c1bc-7850-434f-a950-c4e27a50c675",
    "name": "Gold",
    "status": "active",
    "config": {
      "type": "default"
    }
  }
}
Response
{
  "data": {
    "blacklistRuleUpsert": {
      "id": "9361b2ae-9461-4441-a161-af889261b11b"
    }
  }
}
mutation

blacklistRuleDelete#

Deletes one blacklist rule belonging to the current merchant and starts syncing blacklist metafields.

Input

TokiBlacklistRuleDeleteInput!

Merchant-owned blacklist rule to delete.

  • idString!Required

    ID of a blacklist rule belonging to the current merchant.

Returns

Boolean!

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

mutation BlacklistRuleDelete($input: TokiBlacklistRuleDeleteInput!) {
  blacklistRuleDelete(input: $input)
}
Variables
{
  "input": {
    "id": "92f4a844-93f4-49d7-a4f4-ab6a95f4acfd"
  }
}
Response
{
  "data": {
    "blacklistRuleDelete": true
  }
}

timers#

Lists the current merchant's timers, most recently updated first, optionally filtering by name.

Arguments

  • searchString

    Case-insensitive substring to match against timer names.

  • ids[String!]

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

Returns

TokiTimerConnection!

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

A merchant-owned timer that triggers workflow events on a schedule.

  • idString!

    Unique timer ID. Generate a UUID when creating a timer.

  • merchantIdString!

    The merchant that owns this timer.

  • nameString!

    Timer name shown in the merchant portal.

  • statusTokiTimerStatus!

    Active timers are scheduled; draft timers do not run.

    activedraft
  • configTokiTimerConfig!

    Schedule for a one-time or recurring timer.

query Timers($first: Int) {
  timers(first: $first) {
    nodes {
      id
      merchantId
      name
      status
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "timers": {
      "nodes": [
        {
          "id": "081c9747-071c-45b4-aa1c-9a6d091c98da",
          "merchantId": "d4293bff-d329-4a6c-a629-3f25d5293d92",
          "name": "Gold",
          "status": "active"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
query

timer#

Returns one timer belonging to the current merchant. Deleted timers are not available.

Arguments

  • idString!Required

    ID of a timer belonging to the current merchant.

Returns

TokiTimer!

A merchant-owned timer that triggers workflow events on a schedule.

  • idString!

    Unique timer ID. Generate a UUID when creating a timer.

  • merchantIdString!

    The merchant that owns this timer.

  • nameString!

    Timer name shown in the merchant portal.

  • statusTokiTimerStatus!

    Active timers are scheduled; draft timers do not run.

    activedraft
  • configTokiTimerConfig!

    Schedule for a one-time or recurring timer.

query Timer($id: String!) {
  timer(id: $id) {
    id
    merchantId
    name
    status
  }
}
Variables
{
  "id": "4320cddb-4220-4c48-a520-d1014420cf6e"
}
Response
{
  "data": {
    "timer": {
      "id": "4320cddb-4220-4c48-a520-d1014420cf6e",
      "merchantId": "de720cb3-dd72-4b20-a072-0fd9df720e46",
      "name": "Gold",
      "status": "active"
    }
  }
}
mutation

timerUpsert#

Creates or updates a timer for the current merchant and schedules it, or cancels waiting jobs when inactive.

Input

TokiTimerUpsertInput!

Workflow timer to create or update.

  • idString!Required

    Unique timer ID. Generate a UUID when creating a timer.

  • nameString!Required

    Timer name shown in the merchant portal.

  • statusTokiTimerStatus

    Active timers are scheduled; draft timers do not run.

    activedraft
  • configTokiTimerConfigInput!Required

    Schedule for a one-time or recurring timer.

Returns

TokiTimerUpsertPayload!

Identifier of the saved timer.

  • idString!

    ID of the saved timer.

mutation TimerUpsert($input: TokiTimerUpsertInput!) {
  timerUpsert(input: $input) {
    id
  }
}
Variables
{
  "input": {
    "id": "ea54b48c-eb54-461f-ac54-b7b2ed54b945",
    "name": "Gold",
    "status": "active",
    "config": {
      "oneTime": {
        "startDate": "2026-10-14T09:30:00.000Z"
      }
    }
  }
}
Response
{
  "data": {
    "timerUpsert": {
      "id": "9e08d99e-9f08-4b31-ac08-d6789d08d80b"
    }
  }
}
mutation

timerDelete#

Deletes one timer belonging to the current merchant and cancels its waiting jobs.

Input

TokiTimerDeleteInput!

Merchant-owned timer to delete.

  • idString!Required

    ID of a timer belonging to the current merchant.

Returns

Boolean!

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

mutation TimerDelete($input: TokiTimerDeleteInput!) {
  timerDelete(input: $input)
}
Variables
{
  "input": {
    "id": "46267f94-4726-4127-a826-82ba4926844d"
  }
}
Response
{
  "data": {
    "timerDelete": true
  }
}

timerExecutions#

Lists jobs for a timer belonging to the current merchant, newest first, with cursor pagination.

Arguments

  • timerIdString!Required

    ID of the timer whose execution history to read.

Returns

TokiTimerExecutionConnection!

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

One queued execution of a merchant timer.

  • idString!

    The queued job ID for this execution.

  • statusString!

    Queue status, such as waiting, processing, processed, failed or canceled.

  • scheduledAtString!

    Scheduled execution time as an ISO 8601 timestamp.

  • createdAtString!

    When the job was created, as an ISO 8601 timestamp.

  • updatedAtString!

    When the job last changed, as an ISO 8601 timestamp.

  • attemptsInt!

    Number of attempts to process this job.

  • errorString

    Job error message, or null if no message was recorded.

query TimerExecutions($timerId: String!, $first: Int) {
  timerExecutions(timerId: $timerId, first: $first) {
    nodes {
      id
      status
      scheduledAt
      createdAt
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "timerId": "90de3a0d-8fde-487a-aede-36e78dde3554",
  "first": 10
}
Response
{
  "data": {
    "timerExecutions": {
      "nodes": [
        {
          "id": "310272f9-3002-4166-af02-6fd32e026e40",
          "status": "active",
          "scheduledAt": "2026-10-14T09:30:00.000Z",
          "createdAt": "2026-10-14T09:30:00.000Z"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}