const url = 'https://example.com/api/Checkout/sessions/me/link-account';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"customerToken":"example"}'};
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/link-account \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "customerToken": "example" }'Attaches the platform account the customer just authenticated as (login/signup) to this checkout session. The account is trusted from the supplied customer-scope JWT - its id is never taken from the client - after which the wizard may proceed to payment.
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”Body of sessions/me/link-account: the customer-scope JWT proving which account the
customer authenticated as at the gate.
object
Example generated
{ "customerToken": "example"}Body of sessions/me/link-account: the customer-scope JWT proving which account the
customer authenticated as at the gate.
object
Example generated
{ "customerToken": "example"}Body of sessions/me/link-account: the customer-scope JWT proving which account the
customer authenticated as at the gate.
object
Example generated
{ "customerToken": "example"}Responses
Section titled “ Responses ”Account linked; returns the updated session.
object
object
Example
{ "purpose": "EnrolNew", "planFrequency": "OneOff", "status": "Pending", "items": [ { "planFrequency": "OneOff" } ]}Missing/invalid customer token.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}The session updates an existing member’s payment method and this account does not own that member.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Session is no longer linkable.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}