Podgląd: Capydra wkrótce rusza. Składanie zamówień nie jest jeszcze możliwe.

Capydra
Help Cart
Deal of the week

Errors

Ten przewodnik jest napisany po angielsku.

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; error always holds the code).
  • Extra fields tell you more: field for bad input, retry_after on 429, needed for a missing permission.

Kinds

Authentication, Authorization, Conflict, ConstraintViolation, Frozen, Gone, Idempotency, MethodNotAllowed, NotFound, ProductUnavailable, RateLimit, ServerError, SpendCap, Unavailable

Common reasons

StatusreasonWhat to do
400idempotency_key_requiredSend an Idempotency-Key with every order.
400max_price_requiredSend max_unit_price_cents.
401invalid_api_key, api_key_expiredCheck the key, or make a new one.
403permission_required, ip_not_allowedAdd the permission, call from an allowed address.
403api_key_frozenWait for the review; write to support.
403showcase_modeThe shop is not open yet.
404product_not_found, order_not_foundCheck the id. Many 404s freeze the key.
409price_above_max, no_offersNothing was ordered. Try later or raise the ceiling.
409spend_cap_reachedDaily order limit reached.
409external_id_not_uniqueYou sent this order before; the answer has its order_id.
422idempotency_key_reusedThe same Idempotency-Key with a different body.
429rate_limitedWait Retry-After seconds.