commerce

POST /v1/carts/{cartId}/lines

Add a line to a cart.

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

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

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

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

ทดลองใช้เลย

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

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

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

รายละเอียด

Adds a priced line. A `hosting_plan` line needs a `plan_version_id`; a `domain_register`/`domain_transfer`/`domain_renew` line needs a `domain_name`, `tld` and `period_years`. The line shape and price are validated + stamped by the server; a bad shape (or a plan version with no price) is a `422`.

พารามิเตอร์

ชื่อประเภทจำเป็นต้องมีลักษณะของสิ่งนี้
cartId (path)Uuidใช่The cart's id.

เนื้อหาคำขอ

ชื่อประเภทจำเป็นต้องมีลักษณะของสิ่งนี้
kindSellableLineKindใช่The line kinds a cart will accept **today** — the write-side subset of `LineKind`. Narrower than `LineKind` on purpose. `LineKind` is what a line can *be* (a read shape, includi…
domain_namestringไม่ใช่Required for a domain line.
tldstringไม่ใช่Required for a domain line.
period_yearsintegerไม่ใช่Required for a register/transfer/renew line.
privacybooleanไม่ใช่
auto_renewbooleanไม่ใช่
availability_tokenstringไม่ใช่The signed token from `searchDomains` for this exact name. Optional: an ordinary name prices from the TLD catalogue without one. It is **required to buy a premium name**, becaus…
auth_codestringไม่ใช่The EPP/authorization code issued by the registrar the domain is currently held at. **Required for a `domain_transfer` line** — no registry will initiate a transfer without it,…
registrar_routeRegistrationRouteKeyไม่ใช่Which registrar buys the name, on a `domain_register` or `domain_transfer` line. Omit it for the organisation's own registrar, which is the behaviour every caller had before thi…
plan_version_idUuid | nullไม่ใช่Required for a `hosting_plan` line — the immutable plan version to bill.
listing_package_idUuid | nullไม่ใช่Required for a `marketplace_package` line — the package on a **live** listing being bought. The price is the seller's and is re-read on every basket read, so a client-sent amoun…
intervalBillingIntervalไม่ใช่The recurrence a price is quoted for.
regionstringไม่ใช่The data centre this hosting is bought for — carried onto the resulting subscription and used as the default region for sites created against it (docs/370). Blank or omitted mea…
computeComputeLineConfigไม่ใช่How one machine on a `compute_server` cart line is built. The values are **not trusted from here**: the engine re-resolves the whole order against the live vendor before the lin…
databaseDatabaseLineConfigไม่ใช่The managed database a `managed_database` cart line buys (`docs/497` §8). The values are **not trusted from here**: the engine re-resolves the whole purchase through the same va…

การตอบกลับ

ชื่อประเภทจำเป็นต้องมีลักษณะของสิ่งนี้
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 · 404 · 422 · 429