commerce
POST /v1/carts/adopt
Carry a guest basket into the signed-in account.
प्रमाणीकरण
बेरर टोकन म्हणून API की पाठवा. की मध्ये billing.payment.manage परवानगी असणे आवश्यक आहे; ती नसलेली की 404 ऐवजी 403 सह नाकारली जाते.
जिथे तुमचा ऑर्गनायझेशन आयडी (organization id) जाईल
हा एंडपॉइंट JSON बॉडीमधील फील्ड म्हणून org_id घेतो.
तुमची संस्था आयडी (organisation id) तुमच्या डॅशबोर्डवरील API की स्क्रीनवर, की च्या बाजूला आहे. तुम्ही केलेल्या प्रत्येक कॉलमधील तोच आयडी असतो.
प्रयत्न करा
कोनसांस्कृतिक कंसात (<>) असलेली कोणतीही गोष्ट तुमच्या स्वतःच्या मूल्यांनी बदला आणि key प्लेसहोल्डरला तुमच्या डॅशबोर्डवरील किने बदला.
curl -X POST https://api.zinndigital.com/v1/carts/adopt \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "token": <string> }'साइन इन केलेले आहे? तुमच्या डॅशबोर्डमधील 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