Skip to main content

Error format

The Mage Loyalty API uses conventional HTTP status codes to indicate the success or failure of a request. Codes in the 2xx range indicate success, codes in the 4xx range indicate a client error, and codes in the 5xx range indicate a server-side problem. All errors return a JSON body following the JSON:API error format:
{
  "errors": [
    {
      "status": "422",
      "title": "Insufficient Points",
      "detail": "Customer has 200 points but this reward costs 500"
    }
  ]
}

Error response codes

StatusMeaning
400Bad Request — Missing or invalid fields in the request body
401Unauthorized — Missing, invalid, or revoked API key
403Forbidden — Read-only API key attempted a write operation, customer is excluded from the loyalty program, or customer is not on the required VIP tier
404Not Found — The requested resource does not exist for this shop
405Method Not Allowed — The HTTP method is not supported on this endpoint
409Conflict — Duplicate action, e.g. awarding an earning rule already completed by this customer
422Unprocessable Entity — The request is well-formed but cannot be completed, e.g. insufficient points
429Too Many Requests — Rate limit exceeded
500Internal Server Error — Something went wrong on our end
503Service Unavailable — Unable to connect to Shopify