partner
POST /v1/partner/orders/{orderId}/cancel
Cancel an order of yours that has not been fulfilled.
Аутентификација
Пошаљите API кључ као bearer токен. Кључ мора имати дозволу partner.domains; кључ без ње се одбија уз 403, а не 404.
Ова крајња тачка не прихвата id организације. Ваш кључ већ идентификује организацију којој припада, а одговор је ограничен на њу.
Испробајте
Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.
curl -X POST https://api.zinndigital.com/v1/partner/orders/{orderId}/cancel \
-H "Authorization: Bearer zdk_live_…"Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли
Детаљи
Stops an order you placed that has not been paid for and not been fulfilled — the stale rows left behind by verification and abandoned checkouts. Requires partner.domains. It never moves money. An order that has been paid is refused, not refunded: a refund is a separate, deliberate conversation. This is enforced by the order lifecycle itself, which has no transition from a paid state to a cancelled one, and not merely by this endpoint. It is not a subscription control. It cannot end a subscription, stop a renewal or tear down anything already provisioned. A verb that did both is how somebody eventually ends a paying customer's hosting while meaning to tidy a test order. It is idempotent. Cancelling an order that is already cancelled is a 200 carrying the current state, not a refusal, so a retry after a timeout is safe. Refusals are machine-readable under error.details[].code — error.code is the HTTP class and is not what you branch on: - not_yours — the order exists in a customer's org you can reach, but you did not place it (it is the customer's own, or another partner's). Alert your staff; it means a reference has been crossed somewhere on your side. - already_paid — money has moved. This is a refund conversation, not a cancellation. An order that is mid-fulfilment reports this too: the money is the harder half to undo. - already_fulfilled — at least one line has been delivered. A registered domain cannot be un-registered, so the whole call is refused rather than half-applied — an order whose state did not describe reality would fail your reconciliation for ever. When a line is the cause, that detail entry carries field: "lines" and names the domain in its own domain key. Branch on domain, never on the text of message: the sentence is translated and its wording is not part of this contract. An order id that does not exist, or one you have no reach into at all, is a 404 carrying details[].code = unknown_reference. The two cases are deliberately indistinguishable: telling you that an id exists but is out of your reach would report on other tenants' data.
Параметри
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
orderId (path) | string | Да | Our order id, as returned in order_id when the order was placed — not your own reference. Keyed this way deliberately: it works for every order that already exists,… |
Одговор
| Назив | Тип | Обавезно | Шта је ово |
|---|---|---|---|
order_id | string | Да | — |
human_ref | string | Да | The reference the payment page returns to you as ?order=. |
pay_url | string | Не | Only in the response that placed (or replayed) the order: the hosted page the customer pays on. It carries a secret that is stored nowhere — treat it as one. |
pay_expires_at | string | Не | — |
org_id | string | Да | — |
status | string | Да | pending_payment for a freshly placed order; afterwards the order's lifecycle (paid, fulfilling, completed, partially_fulfilled, canceled, …). |
currency | string | Да | — |
subtotal_minor | integer | Да | — |
tax_minor | integer | Да | — |
total_minor | integer | Да | — |
lines | PartnerOrderLine[] | Да | — |
Грешке које ова крајња тачка може вратити
401 · 403 · 404 · 422 · 429