commerce
POST /v1/carts/adopt
Carry a guest basket into the signed-in account.
Аутентификација
Пошаљите API кључ као bearer токен. Кључ мора имати дозволу billing.payment.manage; кључ без ње се одбија уз 403, а не 404.
Где се уноси ID ваше организације
Ова крајња тачка узима org_id као поље у JSON телу.
Идентификатор ваше организације се налази на екрану са API кључевима на вашој контролној табли, поред самог кључа. То је исти идентификатор у сваком позиву који упутите.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
curl -X POST https://api.zinndigital.com/v1/carts/adopt \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "token": <string> }'Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
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.
Тело захтева
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
token | string | Да | The 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… |
org_id | string | Не | Required only when the caller manages billing for more than one organization. |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
cart_id | string | Да | The organization cart the items now live in. Empty when the guest basket held nothing — which is a success with zero moved, not a failure. |
adopted | integer | Да | How many items were carried over. |
Грешке које ова крајња тачка може вратити
401 · 403 · 422 · 429