commerce
POST /v1/carts/adopt
Carry a guest basket into the signed-in account.
ప్రమాణీకరణ
బీయర్ టోకెన్గా API కీని పంపండి. కీ తప్పనిసరిగా billing.payment.manage అనుమతిని కలిగి ఉండాలి; అది లేని కీని 404 కాకుండా 403తో తిరస్కరిస్తారు.
మీ సంస్థ ఐడీ ఎక్కడ ఉందో అక్కడ
ఈ ఎండ్పాయింట్ JSON బాడీలో ఫీల్డ్గా org_id ని తీసుకుంటుంది.
మీ సంస్థ ఐడి (organisation id) మీ డాష్బోర్డ్లోని 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 not… |
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