Create Card Setup Token
POST/api/customers/:customer/payment-methods/setup-token
Starts saving a card for the customer.
customers:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
- Stripe (
processor: stripe): returns a Stripe SetupIntent client secret plus the keys Stripe.js needs (the publishable key and the connected account it acts on). Collect the card with Stripe Elements and confirm the SetupIntent in the browser, then call Confirm Card Setup with thesetup_intent_id. The customer's existing Stripe customer on that account is reused; otherwise, when the customer has an email address, one is found or created. - Authorize.net (
processor: authorize_net): returnsaccept_js— the configuration for Authorize.net's hosted card form (Accept.js / AcceptUI):script_url,api_login_id,public_client_key,environment. Open the hosted form in the browser; it returns single-use opaque card data (valid 15 minutes) to send to Confirm Card Setup.
The card number never reaches SKU.io.
Authentication: Requires Bearer token (PAT).
Permission: customers.update.
Request body fields:
processor(string, nullable:stripe|authorize_net) — which processor to save the card with. Defaults to the default card processor (Payment Collection settings).integration_instance_id(integer, nullable) — which connected account to save the card on, when there is more than one. Defaults to the first connected account that can take payments.
Response fields: processor, integration_instance_id, client_secret and setup_intent_id (Stripe; empty strings for Authorize.net), publishable_key (Stripe publishable key; for Authorize.net the account's Public Client Key), connected_account_id (Stripe connected account; for Authorize.net the gateway id) and accept_js (Authorize.net: environment (sandbox | production), script_url (hosted AcceptUI form), accept_js_url (Accept.js library), api_login_id, public_client_key; null for Stripe).
Returns 422 when no account of that processor can take payments, the Authorize.net account has no Public Client Key (card entry is off until one is generated), or the processor refuses the request.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.