Catch uses conventional HTTP response codes to indicate the success or failure of an API request.
Failure Response (400)
400 Bad Request
{
"error_type":"INVALID_REQUEST",
"message":"Gift card in cart."
}
Failure codes in the 4XX range indicate an error that occurred given the information provided.
Error Type | Status Code | Error Message(s) | Notes |
---|---|---|---|
BAD_REQUEST_BODY_FORMAT | 400 | "Request is invalid. Check data for specifics." | The data parameter that is also included will have the specifics of what fields are incorrect |
CHECKOUT_EXPIRED | 404 | N/A | The related checkout has expired. |
USER_DEACTIVATED | 400 | "Cannot create this order." | The attempted purchase/refund cannot be processed due to deactivated Catch account. |
GIFT_CARD_IN_CART | 400 | N/A | Catch cannot be used to purchase gift cards. |
INVALID_REQUEST | 400 | During checkout creation: - "Gift card in cart." - “Currency {currency} is not supported." - “Order total above limit." - "Merchant not live." During purchase creation: - "Unable to create purchase for checkout_id {checkout_id}. Error code: {description}.” During refund creation: - "Unable to create refund for purchase_id {purchase_id}. Error code: {description}” message | This error is possible during POST Checkout, POST Purchase, and POST Refund. |
NOT_AUTHORIZED | 401 | - "Missing required public-key header." - "Missing required x-api-key header." - "Missing secret for public key {public_key}." - "Invalid secret for public key {public_key}." | Applicable to all external Catch API endpoints |
NOT_FOUND | 404 | N/A | The resource in the request doesn’t exist or doesn’t match the associated private/public key pair. |
ORDER_TOTAL_EXCEEDS_MAXIMUM | 400 | N/A | The order total exceeds the maximum allowed by Catch. |
UNSUPPORTED_CURRENCY | 400 | N/A | The currency of this order is not currently supported by Catch. |