commerce

POST /v1/carts/adopt

Carry a guest basket into the signed-in account.

모든 commerce 엔드포인트

인증

Bearer 토큰으로 API 키를 전송하세요. 키는 반드시 billing.payment.manage 권한을 가지고 있어야 하며, 권한이 없는 키는 404가 아닌 403으로 거부됩니다.

조직 ID가 들어가는 위치

이 엔드포인트는 JSON 본문의 필드로 org_id을(를) 받습니다.

조직 ID는 대시보드의 API 키 화면에서 키 바로 옆에 있습니다. 이는 실행하는 모든 호출에서 동일한 ID입니다.

무료 체험하기

대괄호 안에 있는 모든 내용을 사용자 지정 값으로 바꾸고, 키 플레이스홀더는 대시보드의 키로 바꾸세요.

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.

요청 본문

이름유형필수설명
tokenstringThe 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_idstring아니요Required only when the caller manages billing for more than one organization.

응답

이름유형필수설명
cart_idstringThe organization cart the items now live in. Empty when the guest basket held nothing — which is a success with zero moved, not a failure.
adoptedintegerHow many items were carried over.

이 엔드포인트가 반환할 수 있는 오류

401 · 403 · 422 · 429