commerce
POST /v1/carts/adopt
Carry a guest basket into the signed-in account.
Uwierzytelnianie
Wyślij klucz API jako token bearer. Klucz musi posiadać uprawnienie billing.payment.manage; klucz bez niego jest odrzucany z kodem 403, a nie 404.
Miejsce na identyfikator organizacji
Ten punkt końcowy przyjmuje org_id jako pole w treści JSON.
Identyfikator Twojej organizacji znajduje się na ekranie kluczy API w Twoim panelu, obok samego klucza. Jest to ten sam identyfikator w każdym wywołaniu, które wykonujesz.
Wypróbuj
Zastąp wszystko w nawiasach ostrych własnymi wartościami, a zastępczy znacznik klucza kluczem ze swojego pulpitu nawigacyjnego.
curl -X POST https://api.zinndigital.com/v1/carts/adopt \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "token": <string> }'Zalogowany? Konsola API w Twoim panelu uzupełnia rzeczywiste identyfikator organizacji oraz Twój własny klucz i wykonuje żądanie względem aktywnego API, dzięki czemu możesz zobaczyć rzeczywistą odpowiedź. Otwórz ten punkt końcowy w konsoli API
Szczegóły
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.
Treść żądania
| Nazwa | Typ | Wymagane | Co to jest |
|---|---|---|---|
token | string | Tak | 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 | Nie | Required only when the caller manages billing for more than one organization. |
Odpowiedź
| Nazwa | Typ | Wymagane | Co to jest |
|---|---|---|---|
cart_id | string | Tak | 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 | Tak | How many items were carried over. |
Błędy, które ten punkt końcowy może zwrócić
401 · 403 · 422 · 429