Errors
Denne vejledning er skrevet på engelsk.
Every error is JSON with a fitting HTTP status:
{
"error": "price_above_max",
"message": "Every offer costs more than max_unit_price_cents. Nothing was ordered.",
"kind": "ProductUnavailable",
"reason": "price_above_max"
}
kind: the class to branch on.reason: the exact cause (in a few older errors a more detailed cause;erroralways holds the code).- Extra fields tell you more:
fieldfor bad input,retry_afteron 429,neededfor a missing permission.
Kinds
Authentication, Authorization, Conflict, ConstraintViolation, Frozen, Gone, Idempotency, MethodNotAllowed, NotFound, ProductUnavailable, RateLimit, ServerError, SpendCap, Unavailable
Common reasons
| Status | reason | What to do |
|---|---|---|
| 400 | idempotency_key_required | Send an Idempotency-Key with every order. |
| 400 | max_price_required | Send max_unit_price_cents. |
| 401 | invalid_api_key, api_key_expired | Check the key, or make a new one. |
| 403 | permission_required, ip_not_allowed | Add the permission, call from an allowed address. |
| 403 | api_key_frozen | Wait for the review; write to support. |
| 403 | showcase_mode | The shop is not open yet. |
| 404 | product_not_found, order_not_found | Check the id. Many 404s freeze the key. |
| 409 | price_above_max, no_offers | Nothing was ordered. Try later or raise the ceiling. |
| 409 | spend_cap_reached | Daily order limit reached. |
| 409 | external_id_not_unique | You sent this order before; the answer has its order_id. |
| 422 | idempotency_key_reused | The same Idempotency-Key with a different body. |
| 429 | rate_limited | Wait Retry-After seconds. |