Skip to content

Link Customer Account

POST
/api/Checkout/sessions/me/link-account
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.

Body of sessions/me/link-account: the customer-scope JWT proving which account the customer authenticated as at the gate.

object
customerToken
string
nullable
Example generated
{
"customerToken": "example"
}

Account linked; returns the updated session.

Media type application/json
object
id
string format: uuid
merchantId
string format: uuid
merchantName
string
nullable
purpose
string
Allowed values: EnrolNew UpdatePaymentMethod
planId
string format: uuid
nullable
planName
string
nullable
planPrice
number format: double
nullable
planFrequency
string
nullable
Allowed values: OneOff Daily Weekly Fortnightly Monthly Quarterly Yearly
planTrialDays
integer format: int32
nullable
status
string
Allowed values: Pending AwaitingPayment Completed Failed Expired
firstName
string
nullable
lastName
string
nullable
email
string
nullable
phone
string
nullable
addressLine1
string
nullable
addressLine2
string
nullable
city
string
nullable
state
string
nullable
postCode
string
nullable
country
string
nullable
returnUrl
string
nullable
expiresAt
string format: date-time
accountId
string format: uuid
nullable
items
Array<object>
nullable
object
planId
string format: uuid
planName
string
nullable
planPrice
number format: double
planFrequency
string
Allowed values: OneOff Daily Weekly Fortnightly Monthly Quarterly Yearly
planTrialDays
integer format: int32
planSetupFee
number format: double
nullable
ref
string
nullable
label
string
nullable
setupFeeTotal
number format: double
nullable
dueToday
number format: double
nullable
Example
{
"purpose": "EnrolNew",
"planFrequency": "OneOff",
"status": "Pending",
"items": [
{
"planFrequency": "OneOff"
}
]
}

Missing/invalid customer token.

Media type application/json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
key
additional properties
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.

Media type application/json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
key
additional properties
Example generated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Session is no longer linkable.

Media type application/json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
key
additional properties
Example generated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}