- Checkout
- Features
Create a customer token
Create a reusable Kustom customer token by setting recurring on a Checkout order, completing the purchase and storing the recurring_token from the order.
Set recurring: true on a Checkout order. After the customer completes the purchase, read
its recurring_token and store it for later charges.
Before you start
Section titled “Before you start”Recurring must be enabled on your merchant account. Contact Kustom merchant support.
Without it, order creation returns 400 with error_code: BAD_VALUE naming the
recurring field.
You also need a working checkout integration — create an order and render the snippet.
These constraints can’t be changed 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.
Step by step
Section titled “Step by step”1. Flag the order as recurring
Section titled “1. Flag the order as recurring”Add recurring to the create-order call:
{ "recurring": true}Kustom displays a recurring payment notice naming your store. You don’t supply this text.
2. Read the token off the completed order
Section titled “2. Read the token off the completed order”Read the completed order and store its recurring_token against the correct customer.
Treat it as a credential: the API can’t detect a token assigned to the wrong customer.
Check that it works
Section titled “Check that it works”In Playground:
- Create an order with
recurring: trueand complete it with test data. - Confirm the checkout offers no financing methods.
- Read the completed order and confirm a
recurring_tokenis present. - Confirm your own store holds that token against exactly one customer.
Related
Section titled “Related”- Charge a customer token — what to do with the token you just created
This page is also available as Markdown — append .md to its URL — and is indexed in llms.txt.