Meet Toki Operator

Docs/Manage API

Paid memberships

Members' subscriptions: plans, prices, pauses, cancellations, trials and billing history.

A member has one subscription per paid membership (TokiUserPaidMembership). Operations that change a subscription take the member's customerId and the membershipId of an active paid membership; the plan-change operations treat membershipId as the membership to move to. Many of them charge the member or change their Shopify subscription contract.

Operations11 queries · 12 mutations

userPaidMemberships#

Lists your members' paid membership subscriptions, newest first. For one member's, select paidMemberships on TokiUser.

Arguments

  • queryString

    Filter with field:value terms such as created_at:>-30d. Operators: :, :!=, :>, :>=, :<, :<=; dates also accept relative values like -30d, -1w or -6m. Terms are combined with AND unless joined by OR. Fields: contract_id, created_at, current_price, expired_at, gift_by, membership_id, next_payment_at, pause_starts_at, paused_at, paused_remaining_seconds, paused_until, provider, selected_plan, status, trial_expires_at, updated_at, user_id.

  • reverseBoolean

    Reverse the sort order.

  • sortKeyTokiUserPaidMembershipSortKey

    The field to sort by.

    CREATED_ATUPDATED_AT

Returns

TokiUserPaidMembershipConnection!

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

A member's subscription to a paid membership. A member has one per membership, reused when they subscribe again.

  • membershipIdID!

    The paid membership (TokiMembership.id).

  • userIdID!

    The member.

  • contractIdString

    Numeric ID of the Shopify subscription contract that bills it. null when no contract does, as for fake and test subscriptions.

  • createdAtString!

    When the member first subscribed to this membership.

  • updatedAtString!
  • selectedPlanString!

    The plan: Monthly, Quarterly, Annually or Lifetime.

  • expiredAtString

    When the member's access ends. Once it passes, an active or pending subscription is cancelled. null means it doesn't expire.

  • nextPaymentAtString

    When the member is next charged. null when no charge is scheduled, for example after a cancellation or during an indefinite pause.

  • pausedAtString

    When the current pause started.

  • pausedUntilString

    When the current or scheduled pause ends and the membership resumes on its own. null for an indefinite pause.

  • pausedRemainingSecondsInt

    Paid time the member had left when an immediate pause started, in seconds. It counts again from the resume. null for a scheduled pause.

  • pauseStartsAtString

    Start of a scheduled pause, whether it is still upcoming or under way.

  • statusString!

    ACTIVE, PENDING, PAUSED or CANCELLED. PENDING subscriptions, such as a scheduled downgrade, and PAUSED ones don't give the membership's benefits.

  • giftByString

    TokiUser ID of the member who bought this membership as a gift; null if it wasn't a gift.

  • providerString!

    How it's billed: shopify, ko-fi, or fake and test for subscriptions created in Toki that are never charged.

  • currentPriceFloat

    What the member pays per billing cycle, or once for Lifetime, as a decimal amount in your store's currency.

  • trialExpiresAtString

    End of the trial the subscription started with. Cleared once it renews.

  • actionsTokiUserPaidMembershipActionConnection!

    What happened to this subscription, newest first.

  • cancellationHistoryTokiPaidMembershipCancellationHistoryConnection!

    Cancellations of this subscription, newest first.

  • addons[TokiUserPaidMembershipAddon!]!

    Active add-ons on this subscription.

query UserPaidMemberships($first: Int) {
  userPaidMemberships(first: $first) {
    nodes {
      membershipId
      userId
      createdAt
      status
      addons {
        addonId
        name
        price
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "userPaidMemberships": {
      "nodes": [
        {
          "membershipId": "68be095d-67be-47ca-a6be-063765be04a4",
          "userId": "4fd7db2e-50d7-4cc1-add7-d8084ed7d99b",
          "createdAt": "2026-10-14T09:30:00.000Z",
          "status": "active",
          "addons": [
            {
              "addonId": "868d90ae-878d-4241-a48d-8d88858d8f1b",
              "name": "Anna Petrova",
              "price": 49.99
            }
          ]
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}

userPaidMembershipActions#

Lists what happened to your members' paid memberships, newest first: payments, renewals, plan changes, pauses, cancellations and changes made in Toki. For one member's history including cancellations, use paidMembershipActionHistory.

Arguments

  • queryString

    Filter with field:value terms such as created_at:>-30d. Operators: :, :!=, :>, :>=, :<, :<=; dates also accept relative values like -30d, -1w or -6m. Terms are combined with AND unless joined by OR. Fields: action, action_id, contract_id, created_at, membership_id, order_id, plan, shop_domain, user_id.

  • reverseBoolean

    Reverse the sort order.

  • sortKeyTokiUserPaidMembershipActionSortKey

    The field to sort by.

    CREATED_AT

Returns

TokiUserPaidMembershipActionConnection!

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

Something that happened to a member's paid membership, such as a payment, a plan change or a pause.

  • actionIdID!
  • createdAtString!

    When it happened.

  • userIdID!

    The member.

  • membershipIdID!

    The paid membership (TokiMembership.id).

  • actionString!

    What happened, such as FIRST_PAYMENT, RENEWAL, UPGRADE, DOWNGRADE, CHANGED, PAUSED, RESUMED, CANCELLATION_REQUESTED, CANCEL or EXPIRE.

  • planString!

    The plan at the time, such as Monthly.

  • orderIdID

    The order behind it, such as the order of a payment.

  • dataTokiJSON

    Details as JSON, when there are any. Its message describes the action, such as the old and new date of a date change. For merchant-initiated CHANGED entries, changedBy is the acting merchant user's ID; userId remains the customer whose plan changed.

  • contractIdString

    Numeric ID of the Shopify subscription contract involved.

  • shopDomainString

    The store it happened in, as its myshopify.com domain.

query UserPaidMembershipActions($first: Int) {
  userPaidMembershipActions(first: $first) {
    nodes {
      actionId
      createdAt
      userId
      membershipId
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "userPaidMembershipActions": {
      "nodes": [
        {
          "actionId": "fdc6174d-fcc6-45ba-abc6-1427fac61294",
          "createdAt": "2026-10-14T09:30:00.000Z",
          "userId": "b26c961c-b36c-47af-a46c-9942b56c9ad5",
          "membershipId": "2f295f9f-2e29-4e0c-a129-62c530296132"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}

paidMembershipCancellationHistory#

Lists cancellations of your members' paid memberships, newest first, with who cancelled and why.

Arguments

  • queryString

    Filter with field:value terms such as created_at:>-30d. Operators: :, :!=, :>, :>=, :<, :<=; dates also accept relative values like -30d, -1w or -6m. Terms are combined with AND unless joined by OR. Fields: cancelled_at, cancelled_by, contract_id, expired_at, history_id, membership_id, name, original_expired_at, original_next_payment_at, reason, reason_description, user_id.

  • reverseBoolean

    Reverse the sort order.

  • sortKeyTokiPaidMembershipCancellationHistorySortKey

    The field to sort by.

    CANCELLED_AT

Returns

TokiPaidMembershipCancellationHistoryConnection!

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

A cancellation of a member's paid membership, with who cancelled it and why.

  • historyIdID!
  • membershipIdID!

    The paid membership (TokiMembership.id).

  • userIdID!

    The member.

  • nameString

    Name of the paid membership.

  • expiredAtString!

    When the member's access ended, or ends, after this cancellation.

  • originalExpiredAtString

    The subscription's expiry date before the cancellation.

  • originalNextPaymentAtString

    The subscription's next payment date before the cancellation.

  • cancelledAtString!

    When the subscription was cancelled. Access can last until expiredAt.

  • cancelledByString

    TokiUser ID of whoever cancelled, such as the member. null when Toki did, for example on expiry.

  • cancelledByLabelString!

    Email of whoever cancelled, or System when Toki did.

  • reasonString

    Why, such as expired, manually-cancelled, merchant-cancelled or plan-changed.

  • reasonDescriptionString

    Free-text details, such as the reasonDescription passed to paidMembershipCancel.

  • contractIdString

    Numeric ID of the subscription's Shopify subscription contract.

  • remainingEntitlementSecondsInt

    Paid time left at the cancellation, in seconds: from cancelledAt to originalNextPaymentAt, or to the expiry date when there was no next payment.

query PaidMembershipCancellationHistory($first: Int) {
  paidMembershipCancellationHistory(first: $first) {
    nodes {
      historyId
      membershipId
      userId
      name
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "paidMembershipCancellationHistory": {
      "nodes": [
        {
          "historyId": "45652b2a-4665-4cbd-a365-280444652997",
          "membershipId": "db198d84-dc19-4f17-ad19-90aade19923d",
          "userId": "57b98f57-56b9-4dc4-a9b9-927d58b990ea",
          "name": "Anna Petrova"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}
query

paidMembershipPriceInfo#

Returns what the member pays for a paid membership, line by line: the membership and its add-ons on their Shopify subscription contract, in the contract's currency. Change prices with paidMembershipUpdatePrice.

Arguments

  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

Returns

TokiPaidMembershipPriceInfoPayload!

What a member pays for a paid membership, line by line.

  • lines[TokiPaidMembershipPriceInfoLines!]!

    The membership line and any other lines on the contract, such as add-ons.

  • currencyCodeString!

    ISO 4217 code of the prices' currency: the contract's, or your store's without a contract.

  • hasContractBoolean!

    Whether a Shopify subscription contract bills the subscription. Without one, there is a single membership line.

query PaidMembershipPriceInfo($customerId: ID!, $membershipId: ID!) {
  paidMembershipPriceInfo(customerId: $customerId, membershipId: $membershipId) {
    currencyCode
    hasContract
    lines {
      lineId
      name
      kind
      price
    }
  }
}
Variables
{
  "customerId": "b933a739-b833-45a6-a733-a413b633a280",
  "membershipId": "c3e609cd-c2e6-483a-a1e6-06a7c0e60514"
}
Response
{
  "data": {
    "paidMembershipPriceInfo": {
      "currencyCode": "TOKI-7Q2M-4KXD",
      "hasContract": true,
      "lines": [
        {
          "lineId": "03cec1b0-04ce-4343-a5ce-c4d606cec669",
          "name": "Anna Petrova",
          "kind": "membership",
          "price": 49.99
        }
      ]
    }
  }
}
query

paidMembershipPlanChangeProrationPreview#

Previews what paidMembershipChangePlanWithProration would do with the same arguments, without changing the subscription: whether it's an upgrade or a downgrade, what the member pays and when. membershipId and selectedPlan are the plan to move to.

Arguments

  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

  • selectedPlanString!Required

    The plan: Monthly, Quarterly, Annually or Lifetime.

Returns

TokiPaidMembershipPlanChangeProrationPreviewPayload

What a plan change would do.

  • actionString

    upgrade or downgrade. A membership later in your membership order, or a pricier plan of the same membership, is an upgrade. Ignore it when ok is false.

  • okBoolean

    false when the change can't be made this way, with the reason in code and message. Otherwise null.

  • messageString

    A note in English, such as why ok is false or why proration doesn't apply.

  • codeString

    Why ok is false: lifetime_plan, no_active_membership, no_active_contract, no_shopify_provider or no_shopify_customer_id.

  • storefrontActionString

    How the wallet handles this change: require_confirmation shows it to the member to confirm; otherwise, such as with add_to_cart, the plan goes into their cart for checkout.

  • resultTokiPaidMembershipPlanChangeProrationPreviewResult

    What the change costs and when. null when ok is false, when the member can start a trial of the new plan, or when proration can't be calculated.

query PaidMembershipPlanChangeProrationPreview($customerId: ID!, $membershipId: ID!, $selectedPlan: String!) {
  paidMembershipPlanChangeProrationPreview(customerId: $customerId, membershipId: $membershipId, selectedPlan: $selectedPlan) {
    action
    ok
    message
    code
    storefrontAction
    result {
      action
      nextPayment
      nextScheduledPayment
      nextPaymentAt
      currency {
        symbol
      }
    }
  }
}
Variables
{
  "customerId": "3fd80c79-3ed8-4ae6-add8-09533cd807c0",
  "membershipId": "4ec90f0d-4dc9-4d7a-acc9-0be74bc90a54",
  "selectedPlan": "Selected plan"
}
Response
{
  "data": {
    "paidMembershipPlanChangeProrationPreview": {
      "action": "Action",
      "ok": false,
      "message": "Message",
      "code": "TOKI-7Q2M-4KXD",
      "storefrontAction": "Storefront action",
      "result": {
        "action": "Action",
        "nextPayment": 1.5,
        "nextScheduledPayment": 1.5,
        "nextPaymentAt": "2026-10-14T09:30:00.000Z",
        "currency": {
          "symbol": "Symbol"
        }
      }
    }
  }
}
mutation

paidMembershipUpdateExpirationDate#

Sets when the member's access to the paid membership ends; null means it never expires. When that time passes, an active or pending subscription is cancelled. The next payment date doesn't change.

Input

TokiPaidMembershipUpdateExpirationDateInput!
  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

  • expiresAtString

    When access ends, in ISO 8601 with a time and offset, such as 2026-07-01T00:00:00Z. null means it never expires.

Returns

Boolean!

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

mutation PaidMembershipUpdateExpirationDate($input: TokiPaidMembershipUpdateExpirationDateInput!) {
  paidMembershipUpdateExpirationDate(input: $input)
}
Variables
{
  "input": {
    "customerId": "d238915a-d338-42ed-a038-8e34d1388fc7",
    "membershipId": "2a6d5232-2b6d-43c5-a86d-4f0c296d509f",
    "expiresAt": "2026-10-14T09:30:00.000Z"
  }
}
Response
{
  "data": {
    "paidMembershipUpdateExpirationDate": true
  }
}
mutation

paidMembershipUpdateNextPaymentDate#

Sets when the member is next charged for the paid membership; null stops renewals. The expiry date doesn't move with it, so also update it with paidMembershipUpdateExpirationDate when access should last until the new date.

Input

TokiPaidMembershipUpdateNextPaymentDateInput!
  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

  • nextPaymentAtString

    When to charge the member next, in ISO 8601 with a time and offset, such as 2026-07-01T00:00:00Z. null stops renewals.

Returns

Boolean!

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

mutation PaidMembershipUpdateNextPaymentDate($input: TokiPaidMembershipUpdateNextPaymentDateInput!) {
  paidMembershipUpdateNextPaymentDate(input: $input)
}
Variables
{
  "input": {
    "customerId": "20667632-2166-47c5-ae66-730c1f66749f",
    "membershipId": "4d287d2a-4e28-4ebd-ab28-7a044c287b97",
    "nextPaymentAt": "2026-10-14T09:30:00.000Z"
  }
}
Response
{
  "data": {
    "paidMembershipUpdateNextPaymentDate": true
  }
}
mutation

paidMembershipUpdateStatus#

Switches a subscription between ACTIVE and PENDING; it must already be one of the two. The member gains or loses the membership's benefits right away, while billing and dates stay as they are.

Input

TokiPaidMembershipUpdateStatusInput!
  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

  • statusTokiPaidMembershipUpdateStatusStatus!Required

    Only ACTIVE gives the member the membership's benefits.

    ACTIVEPENDING

Returns

Boolean!

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

mutation PaidMembershipUpdateStatus($input: TokiPaidMembershipUpdateStatusInput!) {
  paidMembershipUpdateStatus(input: $input)
}
Variables
{
  "input": {
    "customerId": "c788d067-c688-4ed4-a988-d38dc888d1fa",
    "membershipId": "2605e407-2505-4274-a805-e72d2705e59a",
    "status": "ACTIVE"
  }
}
Response
{
  "data": {
    "paidMembershipUpdateStatus": true
  }
}
mutation

paidMembershipPause#

Pauses the member's subscription: Toki pauses its Shopify subscription contract, charges no renewals and puts the membership's benefits on hold until it resumes, at pausedUntil or through paidMembershipResume. Unless you schedule the pause with pauseStartsAt, the paid time left is kept and counts again from the resume. Your pause rules don't apply; only active subscriptions can be paused, except Lifetime and fake ones.

Input

TokiPaidMembershipPauseInput!
  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

  • pausedUntilString

    When the membership resumes on its own, in ISO 8601 with a time and offset. It must be in the future. Omit it or pass null to pause indefinitely.

  • pauseStartsAtString

    Schedules the pause to start at this time instead of now, in ISO 8601 with a time and offset. It must be in the future and no later than the next payment date, and pausedUntil must come after it. The next payment then moves to pausedUntil.

Returns

Boolean!

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

mutation PaidMembershipPause($input: TokiPaidMembershipPauseInput!) {
  paidMembershipPause(input: $input)
}
Variables
{
  "input": {
    "customerId": "094dc77e-0a4d-4911-a74d-c458084dc5eb",
    "membershipId": "f52177fe-f621-4991-a321-74d8f421766b",
    "pausedUntil": "2026-10-14T09:30:00.000Z",
    "pauseStartsAt": "2026-10-14T09:30:00.000Z"
  }
}
Response
{
  "data": {
    "paidMembershipPause": true
  }
}
mutation

paidMembershipResume#

Resumes a paused subscription now: Toki reactivates its Shopify subscription contract, the member gets the membership's benefits back, and the next payment is set to now plus pausedRemainingSeconds. For a pause that hasn't started yet, cancels it instead and sets the next payment to its planned start.

Input

TokiPaidMembershipResumeInput!
  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

Returns

Boolean!

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

mutation PaidMembershipResume($input: TokiPaidMembershipResumeInput!) {
  paidMembershipResume(input: $input)
}
Variables
{
  "input": {
    "customerId": "e441fb8b-e341-49f8-a641-feb1e541fd1e",
    "membershipId": "3ec847c3-3dc8-4630-a0c8-4ae93fc84956"
  }
}
Response
{
  "data": {
    "paidMembershipResume": true
  }
}
mutation

paidMembershipUpdatePrice#

Changes what the member pays per billing cycle for the membership and its add-ons, from the next charge on. With a Shopify subscription contract, pass the lines to change by their lineId from paidMembershipPriceInfo and Toki updates the contract; without one, pass a single line with lineId: null.

Input

TokiPaidMembershipUpdatePriceInput!
  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

  • lines[TokiPaidMembershipUpdatePriceLinesInput!]!Required

    The lines to change, each at most once.

Returns

Boolean!

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

mutation PaidMembershipUpdatePrice($input: TokiPaidMembershipUpdatePriceInput!) {
  paidMembershipUpdatePrice(input: $input)
}
Variables
{
  "input": {
    "customerId": "bab8e27e-bbb8-4411-a8b8-df58b9b8e0eb",
    "membershipId": "faed8afe-fbed-4c91-a8ed-87d8f9ed896b",
    "lines": [
      {
        "price": 49.99
      }
    ]
  }
}
Response
{
  "data": {
    "paidMembershipUpdatePrice": true
  }
}
mutation

paidMembershipCancel#

Cancels the member's subscription and its add-ons, and fires PAID_MEMBERSHIP_CANCELLED when access ends. With immediately, Toki cancels the Shopify subscription contract and access ends now; with endOfBillingCycle, renewals stop and access lasts until the expiry date. A PENDING subscription, such as a scheduled downgrade, is always cancelled right away, keeping the member on their current plan.

Input

TokiPaidMembershipCancelInput!
  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

  • cancellationPolicyTokiPaidMembershipCancelCancellationPolicy

    When access ends. Defaults to the membership's Cancellation Policy; Lifetime subscriptions always end immediately.

    endOfBillingCycleimmediately
  • reasonDescriptionString

    Why you cancelled, kept in the cancellation history. Ignored for a PENDING subscription.

Returns

Boolean!

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

mutation PaidMembershipCancel($input: TokiPaidMembershipCancelInput!) {
  paidMembershipCancel(input: $input)
}
Variables
{
  "input": {
    "customerId": "2c17411c-2d17-42af-ae17-44422f1745d5",
    "membershipId": "fdc9ff70-feca-4103-afca-029600ca0429",
    "cancellationPolicy": "endOfBillingCycle",
    "reasonDescription": "Duplicate account"
  }
}
Response
{
  "data": {
    "paidMembershipCancel": true
  }
}
mutation

paidMembershipCreateSubscription#

Subscribes the member to a paid membership: Toki creates a Shopify subscription contract with their saved payment method at the plan's price, for any plan but Lifetime. Without nextPaymentAt it charges them right away; otherwise the subscription waits as PENDING until the first charge on that date. Once paid, it replaces their active and paused subscriptions other than Lifetime ones.

Input

TokiPaidMembershipCreateSubscriptionInput!
  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

  • selectedPlanString!Required

    The plan: Monthly, Quarterly, Annually or Lifetime.

  • paymentMethodIdString!Required

    The member's saved Shopify payment method, as a GID (gid://shopify/CustomerPaymentMethod/…).

  • nextPaymentAtString

    When to charge the member first, in ISO 8601 with a time and offset, such as 2026-07-01T00:00:00Z. null charges right away.

Returns

Boolean!

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

mutation PaidMembershipCreateSubscription($input: TokiPaidMembershipCreateSubscriptionInput!) {
  paidMembershipCreateSubscription(input: $input)
}
Variables
{
  "input": {
    "customerId": "990c19d5-980c-4842-a70c-16af960c151c",
    "membershipId": "4ca4e381-4ba4-41ee-aaa4-e05b49a4dec8",
    "selectedPlan": "Selected plan",
    "paymentMethodId": "0443b47e-0543-4611-a243-b1580343b2eb",
    "nextPaymentAt": "2026-10-14T09:30:00.000Z"
  }
}
Response
{
  "data": {
    "paidMembershipCreateSubscription": true
  }
}
mutation

paidMembershipCreateFakeSubscription#

Gives the member a paid membership without charging them: a fake subscription with a price of 0 and no renewals, active until expiredAt. The member gets the membership's benefits right away; to change plans in their wallet, they have to buy the new plan at checkout. Any active or pending subscription they have is cancelled first, except Lifetime ones.

Input

TokiPaidMembershipCreateFakeSubscriptionInput!
  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

  • selectedPlanString!Required

    The plan: Monthly, Quarterly, Annually or Lifetime.

  • expiredAtString

    When the membership ends, in ISO 8601 with a time and offset, such as 2026-07-01T00:00:00Z. null means it never ends.

Returns

Boolean!

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

mutation PaidMembershipCreateFakeSubscription($input: TokiPaidMembershipCreateFakeSubscriptionInput!) {
  paidMembershipCreateFakeSubscription(input: $input)
}
Variables
{
  "input": {
    "customerId": "7438e50a-7538-469d-a238-e1e47338e377",
    "membershipId": "dfafb342-e0af-44d5-adaf-b01cdeafb1af",
    "selectedPlan": "Selected plan",
    "expiredAt": "2026-10-14T09:30:00.000Z"
  }
}
Response
{
  "data": {
    "paidMembershipCreateFakeSubscription": true
  }
}
mutation

paidMembershipCreateTestSubscription#

Gives the member a test subscription for trying out paid memberships. It works like paidMembershipCreateFakeSubscription and is never charged, but the member can change plans in their wallet, also without being charged.

Input

TokiPaidMembershipCreateTestSubscriptionInput!
  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

  • selectedPlanString!Required

    The plan: Monthly, Quarterly, Annually or Lifetime.

  • expiredAtString

    When the membership ends, in ISO 8601 with a time and offset, such as 2026-07-01T00:00:00Z. null means it never ends.

Returns

Boolean!

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

mutation PaidMembershipCreateTestSubscription($input: TokiPaidMembershipCreateTestSubscriptionInput!) {
  paidMembershipCreateTestSubscription(input: $input)
}
Variables
{
  "input": {
    "customerId": "66dc1791-65dc-45fe-a4dc-146b63dc12d8",
    "membershipId": "00989fe5-ff98-4e52-ae98-9cbffd989b2c",
    "selectedPlan": "Selected plan",
    "expiredAt": "2026-10-14T09:30:00.000Z"
  }
}
Response
{
  "data": {
    "paidMembershipCreateTestSubscription": true
  }
}
mutation

paidMembershipChangePlan#

Switches the member to a plan of membershipId right away, without charging now: the new price is charged from their current next payment date, and for Shopify billing a new subscription contract replaces the old one. If membershipId isn't the membership they have, their current subscription is cancelled, which fires PAID_MEMBERSHIP_CANCELLED. Requires an active subscription other than Lifetime.

Input

TokiPaidMembershipChangePlanInput!
  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

  • selectedPlanString!Required

    The plan: Monthly, Quarterly, Annually or Lifetime.

Returns

Boolean!

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

mutation PaidMembershipChangePlan($input: TokiPaidMembershipChangePlanInput!) {
  paidMembershipChangePlan(input: $input)
}
Variables
{
  "input": {
    "customerId": "dc9138db-db91-4748-ae91-3c01dd913a6e",
    "membershipId": "22f557b3-21f5-4620-a4f5-5ad923f55946",
    "selectedPlan": "Selected plan"
  }
}
Response
{
  "data": {
    "paidMembershipChangePlan": true
  }
}
mutation

paidMembershipChangePlanWithProration#

Moves the member to a plan of membershipId the way a plan change in their wallet does. An upgrade takes effect right away and is charged at the full price now; with Enable Prorations on, the member pays less for the days left on their current plan, or nothing now with their next payment moved later. A downgrade is scheduled for later; preview either with paidMembershipPlanChangeProrationPreview.

Input

TokiPaidMembershipChangePlanWithProrationInput!
  • customerIdID!Required

    The member, by TokiUser ID.

  • membershipIdID!Required

    The paid membership, by TokiMembership ID. Existing subscriptions can be managed after the membership returns to draft. Select an active membership for a new subscription or plan change.

  • selectedPlanString!Required

    The plan: Monthly, Quarterly, Annually or Lifetime.

Returns

Boolean!

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

mutation PaidMembershipChangePlanWithProration($input: TokiPaidMembershipChangePlanWithProrationInput!) {
  paidMembershipChangePlanWithProration(input: $input)
}
Variables
{
  "input": {
    "customerId": "c789349b-c689-4308-a989-37c1c889362e",
    "membershipId": "1890b673-1790-44e0-aa90-b9991990b806",
    "selectedPlan": "Selected plan"
  }
}
Response
{
  "data": {
    "paidMembershipChangePlanWithProration": true
  }
}

paidMembershipActionHistory#

Lists a member's paid membership history, newest first: the actions on their subscriptions, together with cancellations from the cancellation history. This is the Paid membership actions table on the member's page in the Toki app.

Arguments

  • reverseBoolean

    Reverse the sort order.

  • userIdID!Required

    The member.

  • startDateString

    Inclusive bound on the time of the entry, in ISO 8601. A date without a time means midnight UTC.

  • endDateString

    Inclusive bound on the time of the entry, in ISO 8601. A date without a time means midnight UTC.

Returns

TokiPaidMembershipActionHistoryConnection!

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

An entry in a member's paid membership history: an action on a subscription, or a cancellation.

  • idID!
  • membershipIdID!

    The paid membership (TokiMembership.id).

  • nameString

    Name of the paid membership.

  • createdAtString!

    When it happened; for CANCELLED entries, when the membership was cancelled.

  • actionString!

    What happened, such as FIRST_PAYMENT, RENEWAL, PAUSED or CANCELLATION_REQUESTED. Entries from the cancellation history are CANCELLED.

  • orderIdID

    The order behind it, such as the order of a payment.

  • planString

    The plan at the time, such as Monthly. null for CANCELLED entries.

  • messageString

    Details, such as the old and new date of a date change. For CANCELLED entries, the reason and its description.

  • cancelledByString

    Who cancelled, as their email, phone number or TokiUser ID. Only on CANCELLED entries, and null when Toki cancelled.

query PaidMembershipActionHistory($userId: ID!, $first: Int) {
  paidMembershipActionHistory(userId: $userId, first: $first) {
    nodes {
      id
      membershipId
      name
      createdAt
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "userId": "f6506bcf-f550-4a3c-a850-6ef5f7506d62",
  "first": 10
}
Response
{
  "data": {
    "paidMembershipActionHistory": {
      "nodes": [
        {
          "id": "492e62b3-482e-4120-ab2e-65d94a2e6446",
          "membershipId": "5bcba45b-5acb-42c8-adcb-a7815ccba5ee",
          "name": "Anna Petrova",
          "createdAt": "2026-10-14T09:30:00.000Z"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}

paidMembershipBillingAttempts#

Lists the charges attempted for a member's paid memberships, newest first, with Shopify's error for failed ones. This is the Billing attempts table on the member's page in the Toki app.

Arguments

  • reverseBoolean

    Reverse the sort order.

  • userIdID!Required

    The member.

  • startDateString

    Inclusive bound on the time of the entry, in ISO 8601. A date without a time means midnight UTC.

  • endDateString

    Inclusive bound on the time of the entry, in ISO 8601. A date without a time means midnight UTC.

Returns

TokiPaidMembershipBillingAttemptConnection!

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

A charge attempted for a member's paid membership, and its outcome.

  • idID!
  • idempotencyKeyString!

    The idempotency key of the charge. Charges for add-ons start with addon-purchase:.

  • contractIdString!

    Numeric ID of the Shopify subscription contract charged. Empty for Ko-fi payments.

  • statusString!

    PENDING, SUCCESS, FAILED or CANCELLED. After repeated failures Toki stops retrying, cancels the subscription contract and marks the last attempt CANCELLED.

  • createdAtString!

    When Toki recorded the attempt.

  • orderIdID

    The order a successful charge created.

  • dataTokiPaidMembershipBillingAttemptData!

    Why a charge failed, as Shopify reported it.

query PaidMembershipBillingAttempts($userId: ID!, $first: Int) {
  paidMembershipBillingAttempts(userId: $userId, first: $first) {
    nodes {
      id
      idempotencyKey
      status
      createdAt
      data {
        errorCode
        errorMessage
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "userId": "65e299a2-66e2-4b35-a3e2-967c64e2980f",
  "first": 10
}
Response
{
  "data": {
    "paidMembershipBillingAttempts": {
      "nodes": [
        {
          "id": "c4b4f068-c5b4-41fb-a6b4-f38ec7b4f521",
          "idempotencyKey": "Idempotency key",
          "status": "active",
          "createdAt": "2026-10-14T09:30:00.000Z",
          "data": {
            "errorCode": "TOKI-7Q2M-4KXD",
            "errorMessage": "Error message"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}

paidMembershipBasedOnSpendReceived#

Lists the points a member received from one based-on-spend reward of their paid membership, newest first. Get reward IDs from paidMembershipBasedOnSpendStatistics.

Arguments

  • reverseBoolean

    Reverse the sort order.

  • userIdID!Required

    The member.

  • rewardIdString!Required

    The reward, as rewardId from paidMembershipBasedOnSpendStatistics.

  • startDateString

    Inclusive bound on the time of the entry, in ISO 8601. A date without a time means midnight UTC.

  • endDateString

    Inclusive bound on the time of the entry, in ISO 8601. A date without a time means midnight UTC.

Returns

TokiPaidMembershipBasedOnSpendReceivedConnection!

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

Points a member received from a based-on-spend reward of their paid membership.

  • transferIdID!

    The TokiTransfer that credited the points.

  • amountFloat!

    Points credited.

  • createdAtString!

    When the points were credited.

query PaidMembershipBasedOnSpendReceived($userId: ID!, $rewardId: String!, $first: Int) {
  paidMembershipBasedOnSpendReceived(userId: $userId, rewardId: $rewardId, first: $first) {
    nodes {
      transferId
      amount
      createdAt
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "userId": "3ebbe068-3fbb-41fb-a0bb-e38e41bbe521",
  "rewardId": "9ac7835c-9bc7-44ef-acc7-86829dc78815",
  "first": 10
}
Response
{
  "data": {
    "paidMembershipBasedOnSpendReceived": {
      "nodes": [
        {
          "transferId": "a269ffcd-a169-4e3a-a069-fca79f69fb14",
          "amount": 49.99,
          "createdAt": "2026-10-14T09:30:00.000Z"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}

paidMembershipBasedOnSpendStatistics#

Returns the based-on-spend rewards of the member's active paid memberships, with the points due at the next payment and the points received so far. These rewards credit points at each renewal for what the member spent in the billing cycle before.

Arguments

  • userIdID!Required

    The member.

  • startDateString

    Count only points credited at or after this time in amountReceived, in ISO 8601.

  • endDateString

    Count only points credited at or before this time in amountReceived, in ISO 8601.

Returns

TokiPaidMembershipBasedOnSpendStatisticConnection!

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

A based-on-spend reward of a member's paid membership, with the points due and received.

  • rewardIdString!

    The reward, as a TokiReward ID. Pass it to paidMembershipBasedOnSpendReceived for its payouts.

  • tierNameString!

    Name of the paid membership.

  • rewardMessageString!

    The reward's name: the one you gave it, or one generated from its settings.

  • amountToRewardFloat!

    Points due at the next payment for the member's spending so far, rounded.

  • amountReceivedFloat!

    Points the reward has credited so far, within startDate and endDate when given.

  • nextPaymentAtString!

    When the member is next charged and the points are credited, in ISO 8601.

query PaidMembershipBasedOnSpendStatistics($userId: ID!, $first: Int) {
  paidMembershipBasedOnSpendStatistics(userId: $userId, first: $first) {
    nodes {
      rewardId
      tierName
      rewardMessage
      amountToReward
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "userId": "3e448050-3f44-41e3-a044-837641448509",
  "first": 10
}
Response
{
  "data": {
    "paidMembershipBasedOnSpendStatistics": {
      "nodes": [
        {
          "rewardId": "f5f7f979-f4f7-47e6-a3f7-f653f2f7f4c0",
          "tierName": "Tier name",
          "rewardMessage": "Reward message",
          "amountToReward": 49.99
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}

paidMembershipTrialBlocks#

Lists trial blocks, newest first, including lifted ones. A block keeps a member from starting a paid membership's trial: Toki blocks every membership's trial for a member once they subscribe, and the Unblock Membership Trial workflow action lifts blocks.

Arguments

  • queryString

    Filter with field:value terms such as created_at:>-30d. Operators: :, :!=, :>, :>=, :<, :<=; dates also accept relative values like -30d, -1w or -6m. Terms are combined with AND unless joined by OR. Fields: created_at, membership_id, merchant_id, unlocked_at, updated_at, user_id.

  • reverseBoolean

    Reverse the sort order.

  • userIdID

    Only for this member.

Returns

TokiPaidMembershipTrialBlockConnection!

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

A block that keeps a member from starting a paid membership's trial until it's lifted.

  • membershipIdID!

    The paid membership whose trial is blocked (TokiMembership.id).

  • merchantIdID!

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

  • userIdID!

    The member.

  • createdAtString!

    When Toki first blocked the trial.

  • updatedAtString!
  • unlockedAtString

    When the block was lifted, so the member can start the trial again. null while it applies.

query PaidMembershipTrialBlocks($first: Int) {
  paidMembershipTrialBlocks(first: $first) {
    nodes {
      membershipId
      merchantId
      userId
      createdAt
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "paidMembershipTrialBlocks": {
      "nodes": [
        {
          "membershipId": "6461bae7-6361-4954-a661-be0d6561bc7a",
          "merchantId": "be044ad7-bd04-4944-a004-4dfdbf044c6a",
          "userId": "90f282e4-91f2-4477-a2f2-860a93f2879d",
          "createdAt": "2026-10-14T09:30:00.000Z"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}

paidMembershipTrialUsages#

Lists the paid membership trials members have started, newest first.

Arguments

  • queryString

    Filter with field:value terms such as created_at:>-30d. Operators: :, :!=, :>, :>=, :<, :<=; dates also accept relative values like -30d, -1w or -6m. Terms are combined with AND unless joined by OR. Fields: created_at, membership_id, merchant_id, plan, trial_usage_id, user_id.

  • reverseBoolean

    Reverse the sort order.

  • userIdID

    Only for this member.

Returns

TokiPaidMembershipTrialUsageConnection!

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

A trial of a paid membership that a member started.

  • trialUsageIdID!
  • membershipIdID!

    The paid membership (TokiMembership.id).

  • merchantIdID!

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

  • userIdID!

    The member.

  • createdAtString!

    When the trial started.

  • planString!

    The plan the trial was for, such as Monthly.

query PaidMembershipTrialUsages($first: Int) {
  paidMembershipTrialUsages(first: $first) {
    nodes {
      trialUsageId
      membershipId
      merchantId
      createdAt
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
Variables
{
  "first": 10
}
Response
{
  "data": {
    "paidMembershipTrialUsages": {
      "nodes": [
        {
          "trialUsageId": "29354e02-2a35-4f95-a735-4adc28354c6f",
          "membershipId": "7b2f3505-7a2f-4372-a92f-31df782f304c",
          "merchantId": "7941762d-7841-449a-a741-730776417174",
          "createdAt": "2026-10-14T09:30:00.000Z"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "endCursor": "Y3Vyc29yOjE5"
      }
    }
  }
}