commerce

POST /v1/carts

Open a shopping cart.

Todos os endpoints de commerce

Autenticação

Envie uma chave de API como um token de portador. A chave deve ter a permissão billing.payment.manage; uma chave sem ela é recusada com 403, e não 404.

Onde vai o ID da sua organização

Este endpoint aceita org_id como um campo no corpo JSON.

O ID da sua organização está na tela de chaves de API no seu painel, ao lado da própria chave. É o mesmo ID em todas as chamadas que você fizer.

Experimente

Substitua qualquer item entre colchetes por seus próprios valores e o espaço reservado para a chave por uma chave do seu painel.

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

Conectado? O console da API no seu painel preenche o ID da sua organização real e a sua própria chave, e executa a requisição contra a API de produção para que você possa ver a resposta real. Abra este endpoint no console da API

Detalhes

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`.

Corpo da requisição

NomeTipoObrigatórioO que é
org_idUuid | nullNãoDefaults to the caller's org; the caller must hold `billing.payment.manage` there.
product_linestringNão
currencyCurrencyCode | nullNãoThe 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…

Resposta

NomeTipoObrigatórioO que é
idUuidSimUUIDv7 identifier — sortable by creation time (docs/02 §8).
org_idUuidSimUUIDv7 identifier — sortable by creation time (docs/02 §8).
statusstring<open, checking_out, converted, abandoned, expired>Sim
currencyCurrencyCode | nullNãoFixed 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_lineobjectNão
linesCartLine[]Sim
subtotalMoneyAmountSimA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
discountMoneyAmountSimA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
totalMoneyAmountSimA money value — integer minor units + an ISO 4217 code (CLAUDE.md §2.8).
created_atstringSim
updated_atstringNão

Erros que este endpoint pode retornar

401 · 403 · 422 · 429