Baskets
Set the customer on a Basket
Attaches a Customer to the basket so the resulting Order is correctly attributed and surfaced in the customer's history. There are three modes:
- Authenticated customer — the request is authenticated as a Customer for the basket's brand. The authenticated customer is linked directly. If they don't have a phone number on file, supply one with phone (and optionally phone_country).
- Existing customer by email — pass email, first_name, last_name, and optionally phone. If a customer with that email already exists for the brand they are linked; otherwise a new Customer is created using these details.
- Guest checkout — the same payload as mode 2 is used; the newly-created customer is linked to the basket and saved against any marketing preferences supplied.
Phone numbers are normalised to E.164 using phone_country (or the site's country code) as the default region.
post/shop/basket/{basketId}/customer
Request body
Example request
{
"email": "avery.lin@example.com",
"first_name": "Avery",
"last_name": "Lin",
"phone": "+447700900100",
"phone_country": "GB",
"marketing_preferences": [
"5f5555555555555555555555"
]
}Response
The updated Basket with the customer attached.
Changes
No recorded changes to this endpoint across all 1 revision of this API.