Meet Toki Operator

Docs/Manage API

Members

Look up, create and update members, their notes, suspensions, referrals and total codes.

A member is a customer in your loyalty program. TokiUser connects to everything else about them — balances, orders, activity completions, segments, perks and paid memberships — so a single request can load a complete profile. Related data is only loaded when you select it. A member has a profile in each of your stores they belong to, and most member operations work on the current store.

Operations10 queries · 18 mutations
query

usersCount#

Counts member profiles matching the same filters as users, without pagination. A member in several selected stores counts once per store.

Arguments

  • queryString

    Search text. Plain text matches part of the email or name, ignoring case, and a number also matches the phone number; a member ID finds that member. To filter instead, use field:value terms such as created_at:>-30d on created_at, first_activity_at, last_activity_at, email, first_name, last_name, phone_number, id and external_id, with the operators :, :!=, :>, :>=, :< and :<=. shop_id:<UUID> restricts store profiles within the selected scope. Use search:'text' to combine the same plain-text search with filters, or search_exact:'text' for case-sensitive exact email/name/phone matches. Members filters also support membership:<tier ID>, segment:<segment ID>, used_discounts:true, discounts:'WELCOME BACK' (code contains), referral_code:CODE (case-insensitive exact code), birthdays:2026-01-01,2026-03-31 (inclusive month/day range), joined_loyalty_program:true or a date (joined on or after), email_exists:true, phone_exists:true, payment_retry_process:true and subscription_type:shopify|fake|test|ko-fi (choose one provider). Boolean filters also accept false, 1 and 0. Members filters support : and :!=. Membership means the highest active tier; subscriptiontype means an unexpired active subscription. Discount and retry filters use the current store even with allShops; referral codes use each profile's store. Terms combine with AND unless joined by OR. Quote values containing spaces. Plain words are ignored once there is a term; unknown filters and invalid values return BADUSER_INPUT.

  • allShopsBoolean

    true includes members of all your stores; by default only the current store's.

  • emailExactString

    Only the member with exactly this email. Toki lowercases the value first.

  • externalIdString

    Only the member whose shopifyCustomerId is this value.

  • includeHiddenBoolean

    true also returns hidden accounts, such as the master accounts of loyalty groups.

  • emailString

    Only items whose email contains this text (case-sensitive). null matches items without one.

  • nameString

    Only items whose name contains this text (case-sensitive). null matches items without one.

Returns

Int!
query UsersCount {
  usersCount
}
Response
{
  "data": {
    "usersCount": 3
  }
}

users#

Lists member profiles of the current store, newest first. Pass allShops: true to include all your stores; a member in several stores appears once per store. Use id together with shop.id as the row key. Sort by CREATEDAT (default) or LASTACTIVITY_AT; reverse: true puts oldest dates first. Members without a sign-in are last in either direction. Reset pagination when changing the sort.

Arguments

  • queryString

    Search text. Plain text matches part of the email or name, ignoring case, and a number also matches the phone number; a member ID finds that member. To filter instead, use field:value terms such as created_at:>-30d on created_at, first_activity_at, last_activity_at, email, first_name, last_name, phone_number, id and external_id, with the operators :, :!=, :>, :>=, :< and :<=. shop_id:<UUID> restricts store profiles within the selected scope. Use search:'text' to combine the same plain-text search with filters, or search_exact:'text' for case-sensitive exact email/name/phone matches. Members filters also support membership:<tier ID>, segment:<segment ID>, used_discounts:true, discounts:'WELCOME BACK' (code contains), referral_code:CODE (case-insensitive exact code), birthdays:2026-01-01,2026-03-31 (inclusive month/day range), joined_loyalty_program:true or a date (joined on or after), email_exists:true, phone_exists:true, payment_retry_process:true and subscription_type:shopify|fake|test|ko-fi (choose one provider). Boolean filters also accept false, 1 and 0. Members filters support : and :!=. Membership means the highest active tier; subscriptiontype means an unexpired active subscription. Discount and retry filters use the current store even with allShops; referral codes use each profile's store. Terms combine with AND unless joined by OR. Quote values containing spaces. Plain words are ignored once there is a term; unknown filters and invalid values return BADUSER_INPUT.

  • reverseBoolean

    Reverse the sort order.

  • allShopsBoolean

    true includes members of all your stores; by default only the current store's.

  • emailExactString

    Only the member with exactly this email. Toki lowercases the value first.

  • externalIdString

    Only the member whose shopifyCustomerId is this value.

  • includeHiddenBoolean

    true also returns hidden accounts, such as the master accounts of loyalty groups.

  • emailString

    Only items whose email contains this text (case-sensitive). null matches items without one.

  • nameString

    Only items whose name contains this text (case-sensitive). null matches items without one.

  • sortKeyTokiUserProfileSortKey

    The field to sort by.

    CREATED_ATLAST_ACTIVITY_AT

Returns

TokiUserConnection!

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

A member's profile in a store. The users list returns one row per user and store. The single-user lookup and user references choose the current store's profile, or the newest profile if absent. Dates, shopifyCustomerId and referrerId belong to the selected profile.

  • idID!
  • emailString

    null for accounts without an email, such as the master account of a loyalty group.

  • nameString

    The member's full name, usually firstName and lastName joined with a space.

  • firstNameString
  • lastNameString
  • phoneNumberString
  • createdAtString!

    When the member was added to the store, for example by their first order or sign-in.

  • firstActivityAtString

    When the member joined your loyalty program, usually by first signing in to their wallet; null if they haven't joined.

  • lastActivityAtString

    When the member was last active. Updated each time they open their wallet while signed in.

  • shopifyCustomerIdString

    The member's Shopify customer ID, a numeric ID rather than a GID. shopifyCustomers lists every store.

  • referrerIdID

    The member who referred them; null if none is set. userReferrals lists referrals in every store.

  • avatarUrlString

    URL of the member's profile photo, if they have one.

  • birthdayTokiUserBirthday

    The member's birthday; null if Toki doesn't have it.

  • socialsTokiUserSocials!

    The member's handles on social networks. An empty string means no handle.

  • customerUrlString

    Link to the member's customer page in your store's admin; null without a customer ID.

  • notesString!

    Your note about the member, shared by all your stores and never shown to the member; an empty string if there is none.

  • activeMembershipTokiUserActiveMembership

    The membership tier the member is in. If they're in several, the one that comes last in the order on your Memberships page; null if they're in none.

  • propertiesTokiJSON!

    The member's profile properties for the current store, as a JSON object: the toki_* values Toki keeps current in your email and SMS tools, such as toki_point_balance and toki_tier_name.

  • shopTokiUserShop!

    The store of this profile. Together, user id and shop id identify a row of the users list.

  • recentInteractionTokiUserRecentInteraction

    Latest approved completion across the merchant's stores, including deleted activities; null if none.

  • activityCompletionsTokiActivityCompletionConnection!

    The member's activity completions in all your stores, newest first.

  • paidMembershipsTokiUserPaidMembershipConnection!

    The member's paid memberships, including cancelled ones, newest first.

  • paidMembershipActionsTokiUserPaidMembershipActionConnection!

    Events in the member's paid memberships, such as payments, plan changes, pauses and cancellations, newest first.

  • paidMembershipCancellationHistoryTokiPaidMembershipCancellationHistoryConnection!

    Cancellations of the member's paid memberships, most recent first.

  • paidMembershipTrialBlocksTokiPaidMembershipTrialBlockConnection!

    Paid memberships whose trial is blocked for the member, newest first. A block with unlockedAt set was lifted.

  • paidMembershipTrialUsagesTokiPaidMembershipTrialUsageConnection!

    Trials of paid memberships the member has started, newest first.

  • balancesTokiUserBalanceConnection!

    The member's balance in each of your store credits, including zero balances, oldest store credit first.

  • shopifyCustomers[TokiUserShopifyCustomer!]!

    The member's customer record in each of your stores where they have one, sorted by store domain.

  • userSegmentsTokiUserSegmentConnection!

    The segments the member is in, most recently entered first. Empty if the member isn't in the current store.

  • userPerksTokiUserPerkConnection!

    Perks issued to the member, such as discount codes, newest first. Only the current store's unless you pass allShops: true.

  • userSuspendsTokiUserSuspendConnection!

    The member's suspensions in the current store, newest first. Only active ones unless you set visibility.

  • transfersTokiTransferConnection!

    Every change to the member's balances, newest first.

  • ordersTokiOrderConnection!

    The member's orders, newest first. Only the current store's unless you pass allShops: true.

query Users($first: Int) {
  users(first: $first) {
    nodes {
      id
      email
      name
      firstName
      birthday {
        day
        month
        year
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "users": {
      "nodes": [
        {
          "id": "6f3c2e97-6e3c-4d04-a13c-31bd703c302a",
          "email": "anna@example.com",
          "name": "Anna Petrova",
          "firstName": "Anna",
          "birthday": {
            "day": 14,
            "month": 3,
            "year": 1992
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
query

user#

Finds one member by id, email or externalId, or returns null. Pass at least one; if you pass several, they must all match the same member. By default only members of the current store are found.

Arguments

  • idID
  • emailString

    The member's email, matched exactly. Toki lowercases the value first.

  • externalIdString

    The member's Shopify customer ID, a numeric ID rather than a GID. With allShops, their ID in any of your stores.

  • allShopsBoolean

    true also finds members who aren't in the current store.

Returns

TokiUser

A member's profile in a store. The users list returns one row per user and store. The single-user lookup and user references choose the current store's profile, or the newest profile if absent. Dates, shopifyCustomerId and referrerId belong to the selected profile.

  • idID!
  • emailString

    null for accounts without an email, such as the master account of a loyalty group.

  • nameString

    The member's full name, usually firstName and lastName joined with a space.

  • firstNameString
  • lastNameString
  • phoneNumberString
  • createdAtString!

    When the member was added to the store, for example by their first order or sign-in.

  • firstActivityAtString

    When the member joined your loyalty program, usually by first signing in to their wallet; null if they haven't joined.

  • lastActivityAtString

    When the member was last active. Updated each time they open their wallet while signed in.

  • shopifyCustomerIdString

    The member's Shopify customer ID, a numeric ID rather than a GID. shopifyCustomers lists every store.

  • referrerIdID

    The member who referred them; null if none is set. userReferrals lists referrals in every store.

  • avatarUrlString

    URL of the member's profile photo, if they have one.

  • birthdayTokiUserBirthday

    The member's birthday; null if Toki doesn't have it.

  • socialsTokiUserSocials!

    The member's handles on social networks. An empty string means no handle.

  • customerUrlString

    Link to the member's customer page in your store's admin; null without a customer ID.

  • notesString!

    Your note about the member, shared by all your stores and never shown to the member; an empty string if there is none.

  • activeMembershipTokiUserActiveMembership

    The membership tier the member is in. If they're in several, the one that comes last in the order on your Memberships page; null if they're in none.

  • propertiesTokiJSON!

    The member's profile properties for the current store, as a JSON object: the toki_* values Toki keeps current in your email and SMS tools, such as toki_point_balance and toki_tier_name.

  • shopTokiUserShop!

    The store of this profile. Together, user id and shop id identify a row of the users list.

  • recentInteractionTokiUserRecentInteraction

    Latest approved completion across the merchant's stores, including deleted activities; null if none.

  • activityCompletionsTokiActivityCompletionConnection!

    The member's activity completions in all your stores, newest first.

  • paidMembershipsTokiUserPaidMembershipConnection!

    The member's paid memberships, including cancelled ones, newest first.

  • paidMembershipActionsTokiUserPaidMembershipActionConnection!

    Events in the member's paid memberships, such as payments, plan changes, pauses and cancellations, newest first.

  • paidMembershipCancellationHistoryTokiPaidMembershipCancellationHistoryConnection!

    Cancellations of the member's paid memberships, most recent first.

  • paidMembershipTrialBlocksTokiPaidMembershipTrialBlockConnection!

    Paid memberships whose trial is blocked for the member, newest first. A block with unlockedAt set was lifted.

  • paidMembershipTrialUsagesTokiPaidMembershipTrialUsageConnection!

    Trials of paid memberships the member has started, newest first.

  • balancesTokiUserBalanceConnection!

    The member's balance in each of your store credits, including zero balances, oldest store credit first.

  • shopifyCustomers[TokiUserShopifyCustomer!]!

    The member's customer record in each of your stores where they have one, sorted by store domain.

  • userSegmentsTokiUserSegmentConnection!

    The segments the member is in, most recently entered first. Empty if the member isn't in the current store.

  • userPerksTokiUserPerkConnection!

    Perks issued to the member, such as discount codes, newest first. Only the current store's unless you pass allShops: true.

  • userSuspendsTokiUserSuspendConnection!

    The member's suspensions in the current store, newest first. Only active ones unless you set visibility.

  • transfersTokiTransferConnection!

    Every change to the member's balances, newest first.

  • ordersTokiOrderConnection!

    The member's orders, newest first. Only the current store's unless you pass allShops: true.

query User($id: ID) {
  user(id: $id) {
    id
    email
    name
    firstName
    lastName
    phoneNumber
    createdAt
    birthday {
      day
      month
      year
    }
  }
}
Variables
{
  "id": "da8aeb4b-d98a-49b8-ac8a-ee71db8aecde"
}
Response
{
  "data": {
    "user": {
      "id": "da8aeb4b-d98a-49b8-ac8a-ee71db8aecde",
      "email": "anna@example.com",
      "name": "Anna Petrova",
      "firstName": "Anna",
      "lastName": "Petrova",
      "phoneNumber": "+15555550123",
      "createdAt": "2026-10-14T09:30:00.000Z",
      "birthday": {
        "day": 14,
        "month": 3,
        "year": 1992
      }
    }
  }
}
mutation

userCreate#

Adds a member to the current store by email and returns their ID; calling it again with the same email returns the same ID. If no Toki account has the email yet, Toki creates one and, in a Shopify store, finds or creates the Shopify customer with that email. When the member is new to the store, Toki fires the Toki Account Created event for your event-triggered campaigns, workflows and email and SMS tools.

Input

TokiUserCreateInput!
  • emailString!Required

    The member's email. Toki lowercases it, so addresses that differ only in case are one member.

  • firstNameString

    Used only when no Toki account has the email yet.

  • lastNameString

    Used only when no Toki account has the email yet.

Returns

TokiUserCreatePayload!
  • userIdID!
mutation UserCreate($input: TokiUserCreateInput!) {
  userCreate(input: $input) {
    userId
  }
}
Variables
{
  "input": {
    "email": "anna@example.com",
    "firstName": "Anna",
    "lastName": "Petrova"
  }
}
Response
{
  "data": {
    "userCreate": {
      "userId": "2497199c-2597-4b2f-a697-1cc227971e55"
    }
  }
}
mutation

userUpdate#

Replaces the member's first and last name, birthday and social handles, so send the current values of anything you keep. The new name is also saved on the member's Shopify customer in each store where they have one. Sending a birthday, even an unchanged one, fires the Toki Birthdate Changed event for your event-triggered campaigns, workflows and email and SMS tools.

Input

TokiUserUpdateInput!
  • userIdID!Required

    The member.

  • firstNameString!Required
  • lastNameString!Required
  • birthdayTokiUserBirthdayInput

    The birthday, or null to remove it. Leaving the field out is an error, and the date must exist in the calendar.

  • socialsTokiUserSocialsInput!Required

    The member's handles on social networks. An empty string means no handle.

Returns

Boolean!

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

mutation UserUpdate($input: TokiUserUpdateInput!) {
  userUpdate(input: $input)
}
Variables
{
  "input": {
    "userId": "c9fe8599-c8fe-4406-a7fe-8273c6fe80e0",
    "firstName": "Anna",
    "lastName": "Petrova",
    "socials": {
      "TIKTOK": "annapetrova",
      "INSTAGRAM": "annapetrova",
      "TWITTER": "annapetrova",
      "DISCORD": "annapetrova",
      "FACEBOOK": "annapetrova"
    }
  }
}
Response
{
  "data": {
    "userUpdate": true
  }
}
mutation

userDelete#

Removes the member from the current store by deleting their profile there. Their Toki account, their profiles in your other stores and their Shopify customer are kept, and they can rejoin, for example by signing in to their wallet.

Input

TokiUserDeleteInput!
  • userIdID!Required

    The member.

Returns

Boolean!

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

mutation UserDelete($input: TokiUserDeleteInput!) {
  userDelete(input: $input)
}
Variables
{
  "input": {
    "userId": "43609ecf-4260-4d3c-a560-a1f54460a062"
  }
}
Response
{
  "data": {
    "userDelete": true
  }
}
mutation

userNotesUpdate#

Replaces your note on the member. Notes are shared by all your stores and never shown to the member.

Input

TokiUserNotesUpdateInput!
  • userIdID!Required

    The member.

  • noteString!Required

    The new note. An empty string clears it.

Returns

Boolean!

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

mutation UserNotesUpdate($input: TokiUserNotesUpdateInput!) {
  userNotesUpdate(input: $input)
}
Variables
{
  "input": {
    "userId": "bd64f3c6-be64-4559-ab64-f0a0bc64f233",
    "note": "Prefers email over SMS."
  }
}
Response
{
  "data": {
    "userNotesUpdate": true
  }
}
mutation

userTagsSync#

Updates the member's customer tags in each of your Shopify stores they belong to, in the background: Toki adds the tags of their segments, membership tier and paid memberships, and removes its tags that no longer apply. If the member has no Shopify customer in a store yet, Toki finds or creates one by email.

Input

TokiUserTagsSyncInput!
  • userIdID!Required

    The member.

Returns

Boolean!

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

mutation UserTagsSync($input: TokiUserTagsSyncInput!) {
  userTagsSync(input: $input)
}
Variables
{
  "input": {
    "userId": "042c28d8-052c-4a6b-a62c-2bfe072c2d91"
  }
}
Response
{
  "data": {
    "userTagsSync": true
  }
}
mutation

userSegmentAdd#

Adds the member to a segment by putting their email on its Specific customers list, then re-checks them, so they enter it unless its member limit is reached. The segment's conditions must be joined with or and the member needs an email; calling it again for a member already on the list does nothing.

Input

TokiUserSegmentAddInput!
  • userIdID!Required

    The member.

  • segmentIdID!Required

    The segment to add the member to.

Returns

Boolean!

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

mutation UserSegmentAdd($input: TokiUserSegmentAddInput!) {
  userSegmentAdd(input: $input)
}
Variables
{
  "input": {
    "userId": "fdc42606-fec4-4799-abc4-22e0fcc42473",
    "segmentId": "3ca8d6d8-3da8-486b-aea8-d9fe3fa8db91"
  }
}
Response
{
  "data": {
    "userSegmentAdd": true
  }
}

userSuspends#

Lists suspensions in the current store, newest first. By default only those that apply now; set visibility to include expired and lifted ones, and userId to see one member's.

Arguments

  • reverseBoolean

    Reverse the sort order.

  • userIdID

    Only this member's suspensions.

  • visibilityTokiUserSuspendsVisibility

    Which suspensions to return: active (the default) for those that apply now, current to add expired ones, or all to add lifted ones too.

    activecurrentall

Returns

TokiUserSuspendConnection!

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

A suspension of a member in the current store. While it is active, the member can't use their wallet or redeem there.

  • idID!

    Pass it to userSuspendDelete to lift the suspension.

  • userIdID!

    The suspended member.

  • shopIdID!

    The store the suspension applies to.

  • createdAtString!

    When the member was suspended.

  • updatedAtString!
  • deletedAtString

    When the suspension was lifted; null if it hasn't been.

  • untilString

    When the suspension ends; null if it lasts until it's lifted.

  • reasonString

    Why the member is suspended. The member sees it.

  • blockedByIdID!

    Who created the suspension, such as a member of your team; blockedByEmail is their email.

  • blockedByEmailString

    The email of blockedById.

  • statusTokiUserSuspendStatus!

    active while the suspension applies, expired once until has passed, and deleted once it is lifted.

    activeexpireddeleted
query UserSuspends($first: Int) {
  userSuspends(first: $first) {
    nodes {
      id
      userId
      createdAt
      status
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "userSuspends": {
      "nodes": [
        {
          "id": "ae019acb-ad01-4938-a001-9df1af019c5e",
          "userId": "d45a1e30-d55a-4fc3-a65a-2156d75a22e9",
          "createdAt": "2026-10-14T09:30:00.000Z",
          "status": "active"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
mutation

userSuspendCreate#

Suspends the member in the current store until until, or until you lift it with userSuspendDelete. While it lasts, they can't use their wallet or redeem their balance or perks there and are shown reason, and their events no longer reach the email and SMS tools connected to that store. Each call adds a separate suspension.

Input

TokiUserSuspendCreateInput!
  • userIdID!Required

    The member.

  • reasonString

    Why the member is suspended. The member sees it.

  • untilString

    When the suspension ends, as an ISO 8601 date and time in UTC, such as 2025-12-31T23:00:00Z. Leave it out or pass null to suspend the member until you lift it.

Returns

Boolean!

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

mutation UserSuspendCreate($input: TokiUserSuspendCreateInput!) {
  userSuspendCreate(input: $input)
}
Variables
{
  "input": {
    "userId": "f11d0552-f21d-46e5-af1d-022cf01d03bf",
    "reason": "Duplicate account",
    "until": "2026-10-14T09:30:00.000Z"
  }
}
Response
{
  "data": {
    "userSuspendCreate": true
  }
}
mutation

userSuspendDelete#

Lifts a suspension right away. id must be a suspension of userId in the current store, or nothing changes. If the member has another active suspension, they stay suspended.

Input

TokiUserSuspendDeleteInput!
  • userIdID!Required

    The member.

  • idID!Required

    The suspension to lift.

Returns

Boolean!

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

mutation UserSuspendDelete($input: TokiUserSuspendDeleteInput!) {
  userSuspendDelete(input: $input)
}
Variables
{
  "input": {
    "userId": "c90f6b93-c80f-4a00-ab0f-6eb9ca0f6d26",
    "id": "6f3b26a8-703b-483b-a13b-29ce723b2b61"
  }
}
Response
{
  "data": {
    "userSuspendDelete": true
  }
}
query

userReferralDiscounts#

Lists the current shop's referral discount for the member's applicable reward rule. Empty when the activity is missing or does not use referral codes as discounts.

Arguments

  • customerIdString!Required

    The member whose referral codes are managed.

  • activityIdID

    An active referral activity. Omit to use the first active referral activity.

Returns

[TokiUserReferralDiscountsPayload!]!

A referral discount available to the member.

  • activityIdString!

    The referral activity.

  • rewardRuleIdID

    The applicable reward rule, if assigned.

  • discountCodeString

    Current discount code, or null if it has not been created.

  • discountRedeemCodeIdString

    External redeem-code ID, if available.

  • parentDiscountIdString

    External parent discount ID, if available.

  • asDiscountCodeBoolean!

    Whether referral codes are used as discount codes.

  • rewardMessageString!

    Description of the referral reward in the shop's language.

query UserReferralDiscounts($customerId: String!) {
  userReferralDiscounts(customerId: $customerId) {
    activityId
    rewardRuleId
    discountCode
    discountRedeemCodeId
    parentDiscountId
    asDiscountCode
    rewardMessage
  }
}
Variables
{
  "customerId": "68ae5fd2-69ae-4165-a6ae-5cac67ae5e3f"
}
Response
{
  "data": {
    "userReferralDiscounts": [
      {
        "activityId": "33de4db3-32de-4c20-a5de-50d934de4f46",
        "rewardRuleId": "dc16eaf3-db16-4960-ae16-ee19dd16ec86",
        "discountCode": "TOKI-7Q2M-4KXD",
        "discountRedeemCodeId": "5fcb5bec-60cb-4d7f-a1cb-5f1262cb60a5",
        "parentDiscountId": "801b9a49-7f1b-48b6-ae1b-97237d1b9590",
        "asDiscountCode": false,
        "rewardMessage": "Reward message"
      }
    ]
  }
}
mutation

userReferenceCodeUpdate#

Replaces the member's reference code in the current shop and emits the existing referral-code update event. Leading and trailing whitespace is removed.

Input

TokiUserReferenceCodeUpdateInput!
  • customerIdString!Required

    The member whose referral codes are managed.

  • activityIdString!Required

    The active referral activity that owns the code.

  • newCodeString!Required

    Replacement code.

Returns

Boolean!

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

mutation UserReferenceCodeUpdate($input: TokiUserReferenceCodeUpdateInput!) {
  userReferenceCodeUpdate(input: $input)
}
Variables
{
  "input": {
    "customerId": "31b58b4e-32b5-4ce1-afb5-882830b589bb",
    "activityId": "7a47721b-7947-4088-ac47-75417b4773ae",
    "newCode": "TOKI-7Q2M-4KXD"
  }
}
Response
{
  "data": {
    "userReferenceCodeUpdate": true
  }
}
mutation

userReferralDiscountUpdate#

Replaces the member's referral discount code across the merchant's shops through the existing Shopify service. Duplicate codes are rejected; external writes are not retried automatically.

Input

TokiUserReferralDiscountUpdateInput!
  • customerIdString!Required

    The member whose referral codes are managed.

  • activityIdString!Required

    The active referral activity that owns the code.

  • newCodeString!Required

    Replacement code.

Returns

Boolean!

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

mutation UserReferralDiscountUpdate($input: TokiUserReferralDiscountUpdateInput!) {
  userReferralDiscountUpdate(input: $input)
}
Variables
{
  "input": {
    "customerId": "9b0629f8-9c06-4b8b-ad06-2d1e9e062eb1",
    "activityId": "618126ad-6081-451a-af81-23875e8121f4",
    "newCode": "TOKI-7Q2M-4KXD"
  }
}
Response
{
  "data": {
    "userReferralDiscountUpdate": true
  }
}

userReferrals#

Lists who referred the member, sorted by store domain. Each entry comes from one of the member's orders that Toki linked to a referral, or from the referrer set on the member's profile in a store, for example with userReferralsUpdate.

Arguments

  • userIdID!Required

    The member who was referred.

Returns

TokiUserReferralConnection!

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

A referral of the member in one of your stores: who referred them and, if it came through an order, which one.

  • idID!
  • referrerTokiUserReferralReferrer!

    The member who made the referral.

  • shopDomainString!

    Domain of the store the referral belongs to.

  • activityIdID

    The referral activity the referral is attributed to; null if none is recorded.

  • orderTokiUserReferralOrder

    The member's order linked to the referral; null for a referrer set on the member's profile.

query UserReferrals($userId: ID!, $first: Int) {
  userReferrals(userId: $userId, first: $first) {
    nodes {
      id
      shopDomain
      activityId
      referrer {
        id
        name
        email
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "userId": "df047d82-e004-4f15-ad04-7a5cde047bef",
  "first": 10
}
Response
{
  "data": {
    "userReferrals": {
      "nodes": [
        {
          "id": "3838e208-3938-439b-aa38-e52e3b38e6c1",
          "shopDomain": "your-store.myshopify.com",
          "activityId": "ac418fa1-ab41-4e0e-aa41-8c7ba9418ae8",
          "referrer": {
            "id": "6a418be1-6941-4a4e-a841-88bb67418728",
            "name": "Anna Petrova",
            "email": "anna@example.com"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
mutation

userReferralsUpdate#

Sets or removes the member's referrer in the stores you list; other stores keep theirs. A referrer needs a referral activity: when that activity rewards each order, the referrer earns on the member's orders from now on, but nothing is credited for past orders. Setting a referrer in a store the member isn't in adds them to it.

Input

TokiUserReferralsUpdateInput!
  • userIdID!Required

    The member who was referred.

  • referrals[TokiUserReferralsUpdateReferralsInput!]!Required

    One entry per store to change.

Returns

Boolean!

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

mutation UserReferralsUpdate($input: TokiUserReferralsUpdateInput!) {
  userReferralsUpdate(input: $input)
}
Variables
{
  "input": {
    "userId": "f5d521db-f4d5-4048-a7d5-2501f6d5236e",
    "referrals": [
      {
        "shopId": "b625e594-b725-4727-a825-e8bab925ea4d"
      }
    ]
  }
}
Response
{
  "data": {
    "userReferralsUpdate": true
  }
}

userSubmittedPictures#

Lists the member's picture submissions across this merchant's stores, newest first, including pending and denied submissions. Attachments and related challenges are batched.

Arguments

  • reverseBoolean

    Reverse the sort order.

  • customerIdString!Required

    The member whose pictures to list.

Returns

TokiUserSubmissionConnection!

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

A member's picture submission, including its review status and attachments.

  • idID!
  • activityNameString!

    Name of the submitted activity.

  • verificationStatusString!

    Review status: pending, approved or denied.

  • createdAtString!

    When the member submitted the activity.

  • files[TokiUserSubmissionFile!]!

    Files attached to the submission.

  • challenges[TokiUserSubmissionChallenge!]!

    Challenges containing the activity.

query UserSubmittedPictures($customerId: String!, $first: Int) {
  userSubmittedPictures(customerId: $customerId, first: $first) {
    nodes {
      id
      activityName
      verificationStatus
      createdAt
      files {
        id
        publicUrl
        fileKey
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "customerId": "6a4cd035-694c-4ea2-a84c-cd0f674ccb7c",
  "first": 10
}
Response
{
  "data": {
    "userSubmittedPictures": {
      "nodes": [
        {
          "id": "cf56b9e8-d056-4b7b-a156-bd0ed256bea1",
          "activityName": "Activity name",
          "verificationStatus": "Verification status",
          "createdAt": "2026-10-14T09:30:00.000Z",
          "files": [
            {
              "id": "adc2f27d-acc2-40ea-abc2-ef57aac2edc4",
              "publicUrl": "https://example.com/toki/webhooks",
              "fileKey": "File key"
            }
          ]
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}

totalCodes#

Lists a member's total codes, active ones first, including codes that have been retired.

Arguments

  • reverseBoolean

    Reverse the sort order.

  • customerIdID!Required

    The member's ID (TokiUser.id), not a Shopify customer ID.

Returns

TokiTotalCodeConnection!

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

A member's total code: a personal discount code or gift card that lets them spend their balance at checkout.

  • codeString!

    The code the member enters at checkout.

  • shopDomainString!

    The store this entry is for. Toki issues each code in all your stores, so it appears once per store.

  • createdAtString!

    When Toki issued the code.

  • deletedAtString

    When the code was retired; null while it is active.

  • redemptionRuleIdID!

    The redemption rule whose total code settings the code follows.

  • urlString

    Link to the code's discount or gift card in your Shopify admin; null until Toki has created it there.

query TotalCodes($customerId: ID!, $first: Int) {
  totalCodes(customerId: $customerId, first: $first) {
    nodes {
      code
      shopDomain
      createdAt
      deletedAt
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "customerId": "eb5d5b4a-ec5d-4cdd-a95d-5824ea5d59b7",
  "first": 10
}
Response
{
  "data": {
    "totalCodes": {
      "nodes": [
        {
          "code": "TOKI-7Q2M-4KXD",
          "shopDomain": "your-store.myshopify.com",
          "createdAt": "2026-10-14T09:30:00.000Z",
          "deletedAt": "2026-10-14T09:30:00.000Z"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
mutation

totalCodeGenerateNew#

Replaces a member's total codes: Toki retires all their active codes, then issues a new code, valid in all your stores, for each redemption rule the member qualifies for, if their balance meets the rule's minimum. The member can end up with no code. Shopify is updated in the background.

Input

TokiTotalCodeGenerateNewInput!
  • customerIdID!Required

    The member's ID (TokiUser.id), not a Shopify customer ID.

Returns

Boolean!

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

mutation TotalCodeGenerateNew($input: TokiTotalCodeGenerateNewInput!) {
  totalCodeGenerateNew(input: $input)
}
Variables
{
  "input": {
    "customerId": "a058450a-a158-469d-ae58-41e49f584377"
  }
}
Response
{
  "data": {
    "totalCodeGenerateNew": true
  }
}
mutation

userBalanceUpdate#

Adds or subtracts a member's store credits using the existing balance service and events. Subtraction can make the balance negative.

Input

TokiUserBalanceUpdateInput!

Manual adjustment of one member's store credit balance.

  • customerIdString!Required

    Member belonging to this merchant.

  • operationTokiUserBalanceUpdateOperation!Required

    Balance adjustment direction.

    addsubtract
  • amountFloat!Required

    Positive amount in store credit units.

  • storeCreditIdString

    Merchant-owned store credit; omit for the default.

  • descriptionString

    Transfer description; empty or omitted uses manually added.

  • asPenaltyBoolean

    For subtraction, count the adjustment as a penalty.

  • asNonCumulativeBoolean

    For additions, exclude the points from cumulative tier progress.

Returns

Boolean!

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

mutation UserBalanceUpdate($input: TokiUserBalanceUpdateInput!) {
  userBalanceUpdate(input: $input)
}
Variables
{
  "input": {
    "customerId": "a427be9e-a527-4031-a227-bb78a327bd0b",
    "operation": "add",
    "amount": 49.99
  }
}
Response
{
  "data": {
    "userBalanceUpdate": true
  }
}
mutation

userMerge#

Merges the source profile in the current shop into another member of this merchant using the existing merge service and audit log.

Input

TokiUserMergeInput!

Source and destination members for a profile merge.

  • fromUserIdString!Required

    Source member whose profile is merged.

  • toUserIdString!Required

    Destination member receiving the profile.

Returns

Boolean!

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

mutation UserMerge($input: TokiUserMergeInput!) {
  userMerge(input: $input)
}
Variables
{
  "input": {
    "fromUserId": "e9e32c7e-eae3-4e11-a7e3-2958e8e32aeb",
    "toUserId": "e7938923-e693-4790-a993-8c49e8938ab6"
  }
}
Response
{
  "data": {
    "userMerge": true
  }
}
mutation

usersBulkBalanceUpdate#

Queues balance changes for all members matching the existing Members filters. Returns the import ID after queue submission, not completion; processing and failures use the existing import jobs. No automatic retries are added.

Input

TokiUsersBulkBalanceUpdateInput!

A queued balance operation over members selected by the existing Members filters.

  • storeCreditIdString

    Store credit ID; omit to use the merchant's default.

  • amountFloat!Required

    Positive balance amount, with the existing import conversion semantics.

  • operationTokiUsersBulkBalanceUpdateOperation!Required

    Whether to add or subtract balance.

    addsubtract
  • descriptionString

    Transfer description; omitted or empty uses the bulk operation reference.

  • searchString

    The current Members search string, unchanged.

  • filterString

    The current semicolon-separated Members filters, unchanged.

  • sParamsString

    Existing Members search mode; defaults to ilike.

  • shopIdsString

    Comma-separated shop IDs; defaults to the current shop. Only merchant-owned shops are eligible.

Returns

TokiUsersBulkBalanceUpdatePayload!

Queued member balance operation.

  • importIdString!

    Import ID for tracking background processing and failures.

mutation UsersBulkBalanceUpdate($input: TokiUsersBulkBalanceUpdateInput!) {
  usersBulkBalanceUpdate(input: $input) {
    importId
  }
}
Variables
{
  "input": {
    "amount": 49.99,
    "operation": "add"
  }
}
Response
{
  "data": {
    "usersBulkBalanceUpdate": {
      "importId": "44d66020-45d6-41b3-a6d6-634647d664d9"
    }
  }
}
mutation

userSocialsUpdate#

Updates the social handles of a member belonging to the current merchant.

Input

TokiUserSocialsUpdateInput!

Replacement social handles for a merchant member.

  • customerIdString!Required

    ID of a member belonging to the current merchant.

  • socialsTokiUserSocialsUpdateSocialsInput!Required

    Complete replacement of the member social handles.

Returns

Boolean!

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

mutation UserSocialsUpdate($input: TokiUserSocialsUpdateInput!) {
  userSocialsUpdate(input: $input)
}
Variables
{
  "input": {
    "customerId": "136ac2b6-146a-4449-a16a-bf90126ac123",
    "socials": {
      "TIKTOK": "annapetrova",
      "INSTAGRAM": "annapetrova",
      "TWITTER": "annapetrova",
      "DISCORD": "annapetrova",
      "FACEBOOK": "annapetrova"
    }
  }
}
Response
{
  "data": {
    "userSocialsUpdate": true
  }
}
mutation

userBirthdayUpdate#

Updates a member's birthday and emits the birthdate-changed event. The year can be omitted.

Input

TokiUserBirthdayUpdateInput!

Birthday and year-visibility settings for a merchant member.

  • customerIdString!Required

    ID of a member belonging to the current merchant.

  • birthdayString!Required

    Birthday as a date string parseable by JavaScript Date, such as 2000-04-15.

  • specifyYearBoolean!Required

    Whether to retain the birth year. False clears the stored year.

Returns

TokiUserBirthdayUpdatePayload!

Confirmation that the member birthday was updated.

  • okBoolean!

    True after the birthday update succeeds.

mutation UserBirthdayUpdate($input: TokiUserBirthdayUpdateInput!) {
  userBirthdayUpdate(input: $input) {
    ok
  }
}
Variables
{
  "input": {
    "customerId": "0d0c1aa5-0c0c-4912-ab0c-177f0a0c15ec",
    "birthday": "Birthday",
    "specifyYear": false
  }
}
Response
{
  "data": {
    "userBirthdayUpdate": {
      "ok": false
    }
  }
}
mutation

userSegmentsReevaluate#

Reevaluates the current merchant's segments for one of its members.

Input

TokiUserSegmentsReevaluateInput!

Member whose segment membership should be recalculated.

  • customerIdString!Required

    ID of a member belonging to the current merchant.

Returns

Boolean!

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

mutation UserSegmentsReevaluate($input: TokiUserSegmentsReevaluateInput!) {
  userSegmentsReevaluate(input: $input)
}
Variables
{
  "input": {
    "customerId": "e93345c9-e833-4436-a733-42a3e6334110"
  }
}
Response
{
  "data": {
    "userSegmentsReevaluate": true
  }
}
query

userBlockedRewards#

Lists a member's currently blocked rewards and the reasons they are blocked.

Arguments

  • customerIdString!Required

    ID of a member belonging to the current merchant.

Returns

TokiUserBlockedRewardsPayload!

Current reward blocks for a merchant member.

  • blockedRewards[TokiUserBlockedRewardsBlockedRewards!]!

    Reward blocks that have no unlock timestamp.

query UserBlockedRewards($customerId: String!) {
  userBlockedRewards(customerId: $customerId) {
    blockedRewards {
      rewardRuleId
      rewardRuleName
      reason
      createdAt
    }
  }
}
Variables
{
  "customerId": "f597bad7-f497-4944-a797-bdfdf697bc6a"
}
Response
{
  "data": {
    "userBlockedRewards": {
      "blockedRewards": [
        {
          "rewardRuleId": "44508c86-4550-4e19-a250-896043508af3",
          "rewardRuleName": "Reward rule name",
          "reason": "Duplicate account",
          "createdAt": "2026-10-14T09:30:00.000Z"
        }
      ]
    }
  }
}