curl --request POST \
--url https://{host}/bonus/v1/members/{memberId}/accounts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"isActive": true,
"isAllowedToSpend": true
}
'{
"accountId": 48213
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}Create a customer account
Your backend calls this to open the account a customer’s bonus is kept on.
The call does not create a second account. When the customer already has an active account of the accountType,
or an account with the externalId exists, the id of that account is returned and nothing is changed: the
values in the request are not applied to it. That makes the call safe to repeat.
With an Operation-Id header the call is also idempotent on that id: a repeat with the same id returns the
first answer, and the same id with other values is refused with InconsistentRetry.
curl --request POST \
--url https://{host}/bonus/v1/members/{memberId}/accounts \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"isActive": true,
"isAllowedToSpend": true
}
'{
"accountId": 48213
}{
"name": "<string>",
"message": "<string>",
"details": null
}{
"name": "<string>",
"message": "<string>",
"details": null
}Authorizations
Headers
Path Parameters
Body
The account to create.
The account to create for a customer.
Response
The id of the customer's account: the new one, or the one that existed already. The memberId is not checked, so an account is created for an unknown customer as well.