const url = 'https://example.com/api/Checkout/sessions/me/complete';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"sessionId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","providerToken":"example","methodType":"Card"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/Checkout/sessions/me/complete \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "sessionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "providerToken": "example", "methodType": "Card" }'Validates the gateway token, provisions member + payment method + one subscription per line of the checkout (all or nothing), fires the checkout.completed webhook. Setup fees of a multi-line checkout are taken as one combined charge. A member may hold only one live (non-cancelled) subscription per plan and partner ref, and each session completes at most once - concurrent submits of the same session are serialised, so only the first provisions.
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”object
object
object
Responses
Section titled “ Responses ”Checkout completed.
object
Example
{ "status": "Pending"}The capture token was rejected; the session is marked Failed.
object
Example
{ "status": "Pending"}The setup fee was declined; the session is marked Failed and checkout.failed is sent.
object
Example
{ "status": "Pending"}The linked account does not own the member whose payment method this session updates. The session is unchanged.
object
Example
{ "status": "Pending"}Either the session already ended (completed, failed or expired), or the member already has a live
subscription matching one of the lines (same plan and ref). In the latter case the whole checkout is refused: the session is marked Failed, nothing is charged, the
captured payment method is not stored, and checkout.failed carries existingSubscriptionId.
object
Example
{ "status": "Pending"}A temporary failure (e.g. payment gateway unavailable, or a setup fee whose outcome at the gateway is unknown). Nothing was saved and the session is unchanged - retry; a fee already taken is reused rather than charged again.
object
Example
{ "status": "Pending"}