Skip to main content

Confirm Card Setup

POST 

/api/customers/:customer/payment-methods/confirm-setup

Saves the card the browser just set up (see Create Card Setup Token). The card's brand, last four and expiry are read back from the processor, never taken from the request. Requires explicit, affirmative customer consent, recorded with the requesting user and their IP address. Saving the same card twice returns the existing card.

Required scope: customers:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

  • Stripe: send the confirmed setup_intent_id.
  • Authorize.net: send processor: authorize_net and the hosted form's opaque_data. The card is saved to the customer's Authorize.net customer profile (created on first use as sku-{customer id}) and verified with Authorize.net now (a $0/$1 validation in live mode; test mode in sandbox), so a bad card is refused here, not at the first charge.

Authentication: Requires Bearer token (PAT). Permission: customers.update.

Request body fields:

  • processor (string, nullable: stripe | authorize_net, default stripe).
  • setup_intent_id (string, required unless processor is authorize_net, starts with seti_, max 255) — the confirmed Stripe SetupIntent.
  • opaque_data.data_descriptor (string, required for authorize_net, max 100) — e.g. COMMON.ACCEPT.INAPP.PAYMENT.
  • opaque_data.data_value (string, required for authorize_net, max 8192) — the single-use card nonce (expires 15 minutes after the card was entered).
  • consent (required, must be accepted — true, 1, "yes", or "on") — the customer authorized saving this card.
  • is_default (boolean, nullable) — make this the customer's default card. Defaults to false.
  • integration_instance_id (integer, nullable) — the account the setup was created on, when there is more than one.
  • cardholder_name (string, nullable, max 255) — used only when the processor holds no name for the card.

Card fields: id, processor (square, stripe or authorize_net), brand, last_four, exp_month, exp_year, cardholder_name, is_default, is_expired, label, consent_given_at, consent_ip, consent_user_name, added_by_name and created_at.

Returns 201 with the card. Returns 422 when consent is missing, opaque_data is missing ("Enter the card in the Authorize.net form first.") or expired ("The card form timed out — enter the card again."), the card was declined during verification, Stripe hasn't confirmed the setup, or the processor can't be reached / rejected SKU.io's credentials.

Request​

Responses​

Created

Response Headers
    Content-Type