commerce

POST /v1/carts

Open a shopping cart.

จุดสิ้นสุด commerce ทั้งหมด

การยืนยันตัวตน

ส่ง API key ในรูปแบบ bearer token คีย์ดังกล่าวต้องมีสิทธิ์ billing.payment.manage หากไม่มีสิทธิ์ ระบบจะปฏิเสธด้วยรหัส 403 แทนที่จะเป็น 404

ตำแหน่งสำหรับใส่รหัสองค์กรของคุณ

Endpoint นี้รับ org_id เป็นฟิลด์ใน JSON body

รหัสองค์กรของคุณจะแสดงอยู่บนหน้าคีย์ API ในแดชบอร์ดของคุณ โดยอยู่ถัดจากคีย์นั้นๆ รหัสนี้จะเป็นรหัสเดิมในการเรียกใช้งานทุกครั้งของคุณ

ทดลองใช้เลย

แทนที่สิ่งใดๆ ที่อยู่ภายในวงเล็บแหลมด้วยค่าของคุณเอง และตัวยึดตำแหน่งคีย์ด้วยคีย์จากแดชบอร์ดของคุณ

curl -X POST https://api.zinndigital.com/v1/carts \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{  }'

เข้าสู่ระบบแล้วใช่ไหม คอนโซล API ในแดชบอร์ดของคุณจะเติมรหัสองค์กรจริงและคีย์ของคุณเองโดยอัตโนมัติ และทำการส่งคำขอไปยัง API จริง เพื่อให้คุณเห็นผลลัพธ์ที่เป็นข้อมูลจริง เปิดจุดสิ้นสุดนี้ในคอนโซล API

รายละเอียด

Creates an empty open cart for the organization. Prices on its lines are server-authoritative and re-computed on every read (the client price is never trusted). Requires `billing.payment.manage`.

เนื้อหาคำขอ

ชื่อประเภทจำเป็นต้องมีลักษณะของสิ่งนี้
org_idUuid | nullไม่ใช่Defaults to the caller's org; the caller must hold `billing.payment.manage` there.
product_linestringไม่ใช่
currencyCurrencyCode | nullไม่ใช่The currency to open the basket in — what the customer will be **billed** in. Omit it and the engine uses the `X-Zinn-Currency` header the dashboard already sends, falling back…

การตอบกลับ

ชื่อประเภทจำเป็นต้องมีลักษณะของสิ่งนี้
idUuidใช่UUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidใช่UUIDv7 identifier — sortable by creation time (docs/02 §8).
statusstring<open, checking_out, converted, abandoned, expired>ใช่
currencyCurrencyCode | nullไม่ใช่Fixed when the cart is opened, from `CartCreate.currency` or the `X-Zinn-Currency` header, and then locked — every line must match it. Null only on a legacy cart created before…
product_lineobjectไม่ใช่
linesCartLine[]ใช่
subtotalMoneyAmountใช่A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
discountMoneyAmountใช่A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
totalMoneyAmountใช่A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
created_atstringใช่
updated_atstringไม่ใช่

ข้อผิดพลาดที่เอนด์พอยต์นี้สามารถส่งกลับได้

401 · 403 · 422 · 429