Skip to main content
POST
Typescript (SDK)
Atomically exchanges the IDs of two customers. Nothing else moves: plans, entities, balances, invoices and Stripe links stay with each underlying customer. If cus_a has Pro and cus_b has Premium, after the swap cus_a has Premium and cus_b has Pro. Stripe, Vercel Marketplace and webhooks keep working unchanged, because they’re linked to the underlying customer rather than its ID.
Customers linked to RevenueCat can’t be swapped. The request is rejected with a 400 if either customer has a RevenueCat subscription or identity.
Every customer JWT minted for either customer is revoked. Requests with those tokens return 401, so mint new tokens for both customers after the swap.
Only one swap can run per customer at a time. A swap that touches a customer already being swapped is rejected with a 423; retry it once the first swap finishes.

Body Parameters

Response

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-api-version
string
default:2.6.0
required

Body

application/json
customer_id
string
required

ID of the first customer

swap_with_customer_id
string
required

ID of the customer whose ID is exchanged with the first customer's

Response

200 - application/json

OK

success
boolean
required