Skip to main content

Errors

Karla uses conventional HTTP response codes to indicate the success or failure of an API request. In general:

  • 2xx indicates success.
  • 4xx indicates an error that failed given the information provided (e.g. a required parameter was omitted).
  • 5xx indicates an error with Karla's servers.

Some 4xx errors that could be handled programmatically include an error detail that briefly explains the error reported.

Error structure

An error is composed of the following properties:

{
"errors": [], // Array of errors
"key": "string", // Unique error key in snake case
"message": "string", // Descriptive message of the error
"type": "string" // Error group
}

Error Types

Errors are grouped in the following types:

  • api_error: server-side errors
  • invalid_request_error: client-side errors (e.g. invalid parameters, resource already exists...)

Error Keys

Client errors (invalid_request_error type)

Payload validation (422)

  • campaign_type_invalid: the provided campaign type is invalid.
  • carrier_reference_invalid: the provided carrier reference for the shipment is invalid.
  • zip_code_invalid: the provided zip code is invalid.

Not Found (404)

  • announcement_not_found: the requested announcement was not found.
  • campaign_not_found: the requested campaign was not found.
  • campaign_product_not_found: the requested campaign product was not found.
  • discount_not_found: the requested discount was not found.
  • klaviyo_key_not_found: the requested klaviyo key was not found.
  • order_not_found: the requested order was not found.
  • shipment_not_found: the requested shipment was not found.
  • shop_not_found: the requested shop was not found.
  • shop_settings_not_found: the requested shop settings was not found.
  • webhook_not_found: the requested webhook was not found.

Resource Already exists (409)

  • announcement_exists: the announcement already exists.
  • campaign_exists: the campaign already exists.
  • campaign_active_segment_exists: a campaign with that segment is already in the system.
  • order_exists: the order already exists.
  • shipment_exists: the shipment already exists.
  • shop_exists: the shop already exists.
  • voucher_exists: the voucher already exists.

Unsupported payload (415)

  • image_media_unsupported: the uploaded image has an unexpected format.

Server errors (api_error type)

  • bad_gateway: a service external to Karla (that Karla calls) is having errors.
  • service_not_implemented: the requested service is under construction and will be available soon.
  • unexpected: something went wrong on Karla's end (these are rare).