commerce
POST /v1/carts/adopt
Carry a guest basket into the signed-in account.
Tabbatar da Asali
Aika maɓallin API azaman alamar ɗauka (bearer token). Dole ne maɓallin ya kasance yana da izinin billing.payment.manage; idan babu shi, za a ƙi amfani da maɓallin tare da lambar 403, ba 404 ba.
Inda ID ɗin kungiyar ku ke zuwa
Wannan ma'ajiyar tana karɓar org_id a matsayin fili a cikin jikin JSON.
Ana samun lambar kungiyar ku a kan shafin maɓallan API a cikin madanninku, kusa da maɓallin kansa. Shi ne lambar da ta dace a kowane kiran da kuka yi.
Gwada
May gurbin komai da ke cikin kusurwa da ƙimar ka, kuma may gurbin maballi da maballi daga allon sarrafa ka.
curl -X POST https://api.zinndigital.com/v1/carts/adopt \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "token": <string> }'An shiga? Na'urar sarrafa API da ke cikin sashin kulawarka tana cika ainihin lambar ƙungiyarka da maɓallinka naka, sannan tana gudanar da buƙatar a kan ainihin API don haka zaka iya ganin amsar gaske. Buɗe wannan tashar a cikin na'urar kula da API
Bayani
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.
Jikin buƙata
| Suna | Nau'i | Ana buƙata | Abin da yake |
|---|---|---|---|
token | string | Eh | 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 not… |
org_id | string | A'a | Required only when the caller manages billing for more than one organization. |
Martani
| Suna | Nau'i | Ana buƙata | Abin da yake |
|---|---|---|---|
cart_id | string | Eh | 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 | Eh | How many items were carried over. |
Kuskuren da wannan matsaya za ta iya maido wa
401 · 403 · 422 · 429