Skip to content

Create a customer token

What the customer's first purchase must do to produce a reusable customer token — flag the order as recurring, let the customer complete it and read the token off the completed order.

A customer token is a by-product of an ordinary purchase. You don’t call an API to create one — you flag the checkout order, let the customer complete it and read the token off the finished order.

Recurring must be enabled on your merchant account. Contact Kustom merchant support. Without it the create-order call is rejected outright — 400 with error_code: BAD_VALUE naming the recurring field. Nothing is silently accepted.

You also need a working checkout integration — create an order and render the snippet — because this is that flow with two extra fields.

Two constraints shape what the customer sees, and neither is reversible on an open order:

  • Flagging an order as recurring removes the financing payment methods.
  • A token belongs to the merchant ID that created it. You can’t create a token under one MID and charge it under another.

Add recurring to the create-order call:

{
"recurring": true
}

The customer is told they are setting up a recurring payment by Kustom’s own notice in the checkout, which names your store. You don’t supply that copy.

Once the customer completes the purchase, the order carries a recurring_token. Read the order, store that token against your customer and treat it as a credential — it can charge them, and nothing downstream can tell you it belongs to somebody else.

In Playground:

  1. Create an order with recurring: true and complete it with test data.
  2. Confirm the checkout offers no financing methods — that’s the flag taking effect, not a fault.
  3. Read the completed order and confirm a recurring_token is present.
  4. Confirm your own store holds that token against exactly one customer.

This page is also available as Markdown — append .md to its URL — and is indexed in llms.txt.