commerce

POST /v1/carts/adopt

Carry a guest basket into the signed-in account.

Todos los endpoints de commerce

Autenticación

Envía una clave de API como token de portador. La clave debe tener el permiso billing.payment.manage; una clave que no lo tenga se rechazará con un código 403, no 404.

Donde va el ID de tu organización

Este endpoint toma org_id como un campo en el cuerpo JSON.

El id de tu organización se encuentra en la pantalla de claves de API en tu panel de control, junto a la propia clave. Es el mismo id en cada llamada que realices.

Pruébalo

Reemplaza cualquier elemento entre corchetes angulares por tus propios valores, y el marcador de posición key con una clave de tu panel de control.

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

¿Has iniciado sesión? La consola de la API en tu panel de control rellena el ID de tu organización real y tu propia clave, y ejecuta la solicitud contra la API en vivo para que puedas ver la respuesta real. Abre este endpoint en la consola de la API

Detalles

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.

Cuerpo de la solicitud

NombreTipoObligatorio¿Qué es esto?
tokenstringThe 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_idstringNoRequired only when the caller manages billing for more than one organization.

Respuesta

NombreTipoObligatorio¿Qué es esto?
cart_idstringThe organization cart the items now live in. Empty when the guest basket held nothing — which is a success with zero moved, not a failure.
adoptedintegerHow many items were carried over.

Errores que este endpoint puede devolver

401 · 403 · 422 · 429