Сторнирање на испратен документ
Cancels an outbound document.
Cancelling does not delete: the document keeps being returned by its identifier, and the cancellation itself stays in the history.
Примерот важи само за demo околината.
Request
curl -i -X POST "https://sandbox.api.earhiva.mk/api/integration/v1/outbound/<docUid>/cancel" \
-H "X-Api-Key: <ВАШИОТ КЛУЧ>" \
-H "X-Software-Id: <ИМЕ И ВЕРЗИЈА НА ВАШАТА АПЛИКАЦИЈА>"
Секој повик носи X-Api-Key со клуч што го има опфатот IntegrationApi, и X-Software-Id со името и верзијата на твојот софтвер. Како се бара клуч стои во Автентикација.
Parameters
Сите параметри (2)
| Parameter | In | Type | Presence | Description |
|---|---|---|---|---|
docUid | path | string | always | Identifier of the document. |
X-Software-Id | header | string | always | Identifier of the calling software, e.g. SSBFocus/4.2.1. Free text, recorded in the audit trail. Required on every call; missing means EARH-1008. |
Error codes
EARH-1001 · EARH-1002 · EARH-1003 · EARH-1004 · EARH-1005 · EARH-1006 · EARH-1008 · EARH-3001 · EARH-3003 · EARH-3004
Целосниот список шифри, со што значат и што да се направи, е во Каталог на грешки.
Responses
Дел со наслов „ Responses “The document is now in status 60 (Cancelled).
{
"docUid": "",
"status": 0
}
Сите полиња во телото (2)
| Field | Type | Presence | Description |
|---|---|---|---|
docUid | string | nullable | Identifier of the cancelled document; it stays retrievable. |
status | integer · int32 | always | Status after cancellation — always 60 (Cancelled). |
The X-Software-Id header is missing — EARH-1008.
{
"type": "https://earhiva.mk/errors/EARH-1008",
"title": "X-Software-Id header is missing.",
"status": 400,
"code": "EARH-1008"
}
Сите полиња во телото (6)
| Field | Type | Presence | Description |
|---|---|---|---|
type | string | nullable | Address of this code in the error catalogue (RFC 7807). |
title | string | nullable | Short, stable English summary of the error — the same string that appears in your log. |
status | integer · int32 | always | HTTP status code, repeated in the body (RFC 7807). |
detail | string | nullable | What went wrong in this particular call, when there is more to say than the title. |
code | string | nullable | The EARH-xxxx code. This is the contract: match on it, not on the text. |
eventId | string | nullable | Only on EARH-9000. Quote it when reporting the problem — the same reference we record in our log. |
The API key is missing, unknown, expired or revoked — EARH-1001, EARH-1002, EARH-1003. Телото е стандардното тело на грешка — исто кај сите повици. Што да се направи со секоја шифра стои во Каталог на грешки.
The caller’s address is outside the allowed list, or the key does not carry the IntegrationApi scope — EARH-1004, EARH-1005. Телото е стандардното тело на грешка — исто кај сите повици. Што да се направи со секоја шифра стои во Каталог на грешки.
EARH-3001 — no such document.
{
"type": "https://earhiva.mk/errors/EARH-3001",
"title": "Document not found.",
"status": 404,
"code": "EARH-3001"
}
Сите полиња во телото (6)
| Field | Type | Presence | Description |
|---|---|---|---|
type | string | nullable | Address of this code in the error catalogue (RFC 7807). |
title | string | nullable | Short, stable English summary of the error — the same string that appears in your log. |
status | integer · int32 | always | HTTP status code, repeated in the body (RFC 7807). |
detail | string | nullable | What went wrong in this particular call, when there is more to say than the title. |
code | string | nullable | The EARH-xxxx code. This is the contract: match on it, not on the text. |
eventId | string | nullable | Only on EARH-9000. Quote it when reporting the problem — the same reference we record in our log. |
EARH-3004 — already cancelled; EARH-3003 — the current status does not allow cancelling.
{
"type": "https://earhiva.mk/errors/EARH-3004",
"title": "Document is already cancelled.",
"status": 409,
"code": "EARH-3004"
}
Сите полиња во телото (6)
| Field | Type | Presence | Description |
|---|---|---|---|
type | string | nullable | Address of this code in the error catalogue (RFC 7807). |
title | string | nullable | Short, stable English summary of the error — the same string that appears in your log. |
status | integer · int32 | always | HTTP status code, repeated in the body (RFC 7807). |
detail | string | nullable | What went wrong in this particular call, when there is more to say than the title. |
code | string | nullable | The EARH-xxxx code. This is the contract: match on it, not on the text. |
eventId | string | nullable | Only on EARH-9000. Quote it when reporting the problem — the same reference we record in our log. |
The traffic limit for this key has been reached — EARH-1006. The response carries Retry-After. Телото е стандардното тело на грешка — исто кај сите повици. Што да се направи со секоја шифра стои во Каталог на грешки.
Unexpected error on our side — EARH-9000. The body carries eventId; quote it when reporting the problem. Телото е стандардното тело на грешка — исто кај сите повици. Што да се направи со секоја шифра стои во Каталог на грешки.