commerce
PUT /v1/carts/{cartId}/promo-code
Type a discount code into a cart.
Authentication
Send an API key as a bearer token. The endpoint checks billing.payment.manage; a key without it is refused with 403, not 404.
This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.
Try it
Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.
curl -X PUT https://api.zinndigital.com/v1/carts/{cartId}/promo-code \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "code": <string> }'Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console
Details
Applies a hosting/SEO-tool coupon (docs/1311) to the basket. The saving is taken off the FIRST billing period of each eligible line only; renewals are never discounted, and VAT is computed on the discounted net at checkout. A code that cannot apply to this customer at all is a 422 whose details[0].code is one of not_found, inactive, not_started, expired, exhausted, already_used. A code that applies to nothing in the basket YET is accepted and reported on Cart.coupon.reason (not_eligible, currency_mismatch), because a customer may type it before choosing the plan. A domain promotion code is accepted here too and priced by the domain path.
Parameters
| Name | Type | Required | What it is |
|---|---|---|---|
cartId (path) | Uuid | Yes | The cart's id. |
Request body
| Name | Type | Required | What it is |
|---|---|---|---|
code | string | Yes | — |
Response
| Name | Type | Required | What it is |
|---|---|---|---|
id | Uuid | Yes | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Yes | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
status | string<open, checking_out, converted, abandoned, expired> | Yes | — |
currency | CurrencyCode | null | No | 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_line | object | No | — |
lines | CartLine[] | Yes | — |
subtotal | MoneyAmount | Yes | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
discount | MoneyAmount | Yes | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
total | MoneyAmount | Yes | A money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8). |
promo_code | object | No | The discount code typed into this basket (docs/1311), or null. |
coupon | CartCoupon | null | No | What the typed hosting/SEO coupon did to this basket, or null when no coupon code is typed (a domain promotion code is reported on its lines instead). |
created_at | string | Yes | — |
updated_at | string | No | — |
Errors this endpoint can return
401 · 403 · 404 · 422 · 429