API reference · Orders
Read an order
GET
/v1/orders/{operationId}Where an order stands, and which order it is: your reference, the card, the quantity and — once completed — the total. It never carries card codes and never moves an order forward — to recover an order, send it again.
Permission
orders:readAuthenticationSigned read
Anis’s answerSigned
Staff-set limits it counts towardAll requests
.NET SDK
anis.Orders.GetAsync(operationId)- Allowed with
orders:read, or withorders:createfor your own orders. - For an order that failed,
failureCodesays why.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
operationIdrequired | path | UUID | A UUID, lower-case with hyphens. |
Request
Signed with your key. No body, no nonce.
Headers: Signature-Input, Signature, X-Anis-Date, Accept-Language (optional). The SDKs set all of them for you.
Body: none.
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Success. | Order |
| 400 | Refused: the signed request is badly built. | Problem |
| 401 | Refused: not authenticated. | Problem |
| 403 | Refused: not allowed. | Problem |
| 404 | Refused: not found, or not yours. | Problem |
| 429 | Refused: a limit was reached. | Problem |
| 503 | No decision: a dependency was unavailable. | Problem |
Every answer of this call is signed by Anis — success and every refusal. Require the signature and verify it before you act on the answer; an answer without one is a failure, never an answer (how).
Refusals
Every refusal of this call is a signed problem. Branch on its code; each links to what it means and what to do.
| Error | Code | Status |
|---|---|---|
| Invalid credentials | invalid_credentials | 401 |
| Malformed signed request | malformed_signed_request | 400 |
| Insufficient scope | insufficient_scope | 403 |
| Source address not allowed | source_ip_not_allowed | 403 |
| Rate limited | rate_limited | 429 |
| Not found | resource_not_found | 404 |
| Service unavailable | dependency_unavailable | 503 |
| Request timeout | request_timeout | 504 |
| Internal error | internal_error | 500 |
Types
Order
| Field | Type | Notes |
|---|---|---|
operationIdalways present | UUID | The operation id you chose and sent as Idempotency-Key. |
statusalways present | string | processing: accepted, no outcome yet. completed: bought. failed: refused by a business rule, nothing bought. recoveryExhausted: Anis could not learn the outcome yet — it may have completed; keep resuming slowly and write to support@anis.ly with the operation id. Values: processing, recoveryExhausted, completed, failed |
invoiceId | UUID | The invoice the cards are on. Use it to reveal them again later. |
walletId | UUID | The wallet the order was paid from. |
cardId | any | The catalogue card ordered. On every answer for the order — the first one, a repeat of it and a read. |
quantity | integer | How many cards were ordered. On every answer for the order, a repeat and a read included. |
total | any | What the order cost. On every answer whose status is completed, a repeat and a read included; absent while it is processing or after it failed. |
externalReference | string | Your own reference, exactly as you sent it. On every answer for the order, a repeat and a read included — it tells you which of your sales this is. Absent when the order had none. |
failureCode | string | Why the order failed: the refusal code Anis recorded, one of the Error codes. Only on a read of an order whose status is failed. Absent when that refusal has no public code. |
codesWithheld | boolean | true only on the answer that first reports an order that is paid and complete but whose codes could not be released. Do not buy it again, and write to support@anis.ly with the operation id. Never false: on every other answer it is absent, and on a repeat or a read that means “not stated”. |
soldCards | list of RevealedCredential | The card codes. Present only on the answer that FIRST reports the order completed — store them before anything else. |
completedAt | string (date-time) | When the order completed. |
RevealedCredential
| Field | Type | Notes |
|---|---|---|
soldCardIdalways present | UUID | The sold card these codes belong to. |
serialNumber | string | The card’s serial number. A secret: store it where you keep secrets and never log it. |
voucher | string | The card’s voucher code. A secret: store it where you keep secrets and never log it. |
revealedAt | string (date-time) | When it was revealed. |
expiryDate | string (date) | The last day the card can be used, as yyyy-MM-dd. Tell your end customer. Absent when the card has none. |
invoiceId | any | The invoice the card is on. Also inside an order’s soldCards. |
card | CardSummary | The catalogue card that was sold, so you know which card these codes are for. Also inside an order’s soldCards. |
purchasedAt | string (date-time) | When the card was bought. Also inside an order’s soldCards. |
CardSummary
| Field | Type | Notes |
|---|---|---|
id | UUID | The catalogue card’s id. |
name | LocalizedText | The card name in Arabic and English; empty localized text is omitted. |
faceValue | string | Optional printed value; absent when empty. |
logo | string | Optional absolute URL of the subcategory logo; absent when empty. |
subcategory | object | The card’s subcategory, with id and localized name. |
subcategory.id | UUID | The subcategory’s id. |
subcategory.name | LocalizedText | The subcategory’s name in Arabic and English. |
category | object | The card’s category, with id and localized name. |
category.id | UUID | The category’s id. |
category.name | LocalizedText | The category’s name in Arabic and English. |
LocalizedText
| Field | Type | Notes |
|---|---|---|
ar | string | The Arabic text; omitted when empty. |
en | string | The English text; omitted when empty. |