commerce

POST /v1/carts/adopt

Carry a guest basket into the signed-in account.

Alle commerce-eindpunten

Authenticatie

Stuur een API-sleutel mee als bearer token. De sleutel moet over de permissie billing.payment.manage beschikken; een sleutel zonder deze permissie wordt geweigerd met een 403 in plaats van een 404.

Waar je organisatie-id komt te staan

Dit eindpunt verwacht org_id als een veld in de JSON-body.

Uw organisatie-id staat op het scherm met API-sleutels in uw dashboard, naast de sleutel zelf. Dit is in elke aanroep die u doet dezelfde id.

Probeer het

Vervang alles tussen punthaakjes door uw eigen waarden en de sleutelplaatsvervanger door een sleutel uit uw dashboard.

curl -X POST https://api.zinndigital.com/v1/carts/adopt \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "token": <string> }'

Ingelogd? De API-console in je dashboard vult je echte organisatie-id en je eigen sleutel in, en voert het verzoek uit tegen de live API zodat je de daadwerkelijke respons kunt zien. Open dit eindpunt in de API-console

Details

Moves the items of an anonymous guest cart into the caller's organization cart, so a visitor who built a basket on the public site and then signed in continues instead of starting again (`docs/87` §575, #2599). ⛔ **Two credentials, both required.** The raw cart `token` proves the caller built the basket; the authenticated principal decides which organization it lands in. Neither alone is sufficient — a token cannot name a destination and a session cannot claim a basket it never held. One-way and idempotent: the guest cart is closed under a conditional update, so a double-submit or a refresh adopts once. Requires `billing.payment.manage`. ⛔ Declared before `/v1/carts/{cartId}` so the literal `adopt` is not read as a cart id.

Aanvraaglichaam

NaamTypeVerplichtWat dit is
tokenstringJaThe guest cart's **raw** bearer token — never its digest. The caller proves possession of the credential that already lets them read and modify that cart, so adoption grants not…
org_idstringNeeRequired only when the caller manages billing for more than one organization.

Reactie

NaamTypeVerplichtWat dit is
cart_idstringJaThe organization cart the items now live in. Empty when the guest basket held nothing — which is a success with zero moved, not a failure.
adoptedintegerJaHow many items were carried over.

Fouten die dit eindpunt kan retourneren

401 · 403 · 422 · 429