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.

Permissionorders:read
AuthenticationSigned read
Anis’s answerSigned
Staff-set limits it counts towardAll requests
.NET SDKanis.Orders.GetAsync(operationId)
  • Allowed with orders:read, or with orders:create for your own orders.
  • For an order that failed, failureCode says why.

Parameters

NameInTypeNotes
operationIdrequiredpathUUIDA 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

StatusMeaningBody
200Success.Order
400Refused: the signed request is badly built.Problem
401Refused: not authenticated.Problem
403Refused: not allowed.Problem
404Refused: not found, or not yours.Problem
429Refused: a limit was reached.Problem
503No 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.

ErrorCodeStatus
Invalid credentialsinvalid_credentials401
Malformed signed requestmalformed_signed_request400
Insufficient scopeinsufficient_scope403
Source address not allowedsource_ip_not_allowed403
Rate limitedrate_limited429
Not foundresource_not_found404
Service unavailabledependency_unavailable503
Request timeoutrequest_timeout504
Internal errorinternal_error500

Types

Order

FieldTypeNotes
operationIdalways presentUUIDThe operation id you chose and sent as Idempotency-Key.
statusalways presentstringprocessing: 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
invoiceIdUUIDThe invoice the cards are on. Use it to reveal them again later.
walletIdUUIDThe wallet the order was paid from.
cardIdanyThe catalogue card ordered. On every answer for the order — the first one, a repeat of it and a read.
quantityintegerHow many cards were ordered. On every answer for the order, a repeat and a read included.
totalanyWhat 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.
externalReferencestringYour 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.
failureCodestringWhy 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.
codesWithheldbooleantrue 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”.
soldCardslist of RevealedCredentialThe card codes. Present only on the answer that FIRST reports the order completed — store them before anything else.
completedAtstring (date-time)When the order completed.

RevealedCredential

FieldTypeNotes
soldCardIdalways presentUUIDThe sold card these codes belong to.
serialNumberstringThe card’s serial number. A secret: store it where you keep secrets and never log it.
voucherstringThe card’s voucher code. A secret: store it where you keep secrets and never log it.
revealedAtstring (date-time)When it was revealed.
expiryDatestring (date)The last day the card can be used, as yyyy-MM-dd. Tell your end customer. Absent when the card has none.
invoiceIdanyThe invoice the card is on. Also inside an order’s soldCards.
cardCardSummaryThe catalogue card that was sold, so you know which card these codes are for. Also inside an order’s soldCards.
purchasedAtstring (date-time)When the card was bought. Also inside an order’s soldCards.

CardSummary

FieldTypeNotes
idUUIDThe catalogue card’s id.
nameLocalizedTextThe card name in Arabic and English; empty localized text is omitted.
faceValuestringOptional printed value; absent when empty.
logostringOptional absolute URL of the subcategory logo; absent when empty.
subcategoryobjectThe card’s subcategory, with id and localized name.
subcategory.idUUIDThe subcategory’s id.
subcategory.nameLocalizedTextThe subcategory’s name in Arabic and English.
categoryobjectThe card’s category, with id and localized name.
category.idUUIDThe category’s id.
category.nameLocalizedTextThe category’s name in Arabic and English.

LocalizedText

FieldTypeNotes
arstringThe Arabic text; omitted when empty.
enstringThe English text; omitted when empty.