Reference guide for HTTP status codes and error responses returned by the Measura API.
The Measura API uses standard HTTP status codes to indicate the success or failure of a request. When an error occurs, the response body includes detailed error information in a consistent format.
All error responses follow a consistent structure:
{
"success": false,
"data": null,
"error": {
"code": "error_code",
"message": "Human-readable error message",
"details": { ... }
},
"meta": { ... },
"requestId": "optional-request-id"
}Note
The requestId field can be used when contacting support to help identify and debug specific requests. For detailed information about the error object structure, see the ApiError object documentation.
The following HTTP status codes are used by the API:
| Status code | Description | Common causes |
|---|---|---|
| 400 | Bad Request | The request was malformed or contained invalid parameters. Check your request parameters and try again. |
| 401 | Unauthorized | Invalid or missing API key. Verify your API key is correct and properly formatted as {keyId}:{secret}. |
| 404 | Not Found | The requested resource was not found. Verify the product ID, variant ID, or endpoint path is correct. |
| 429 | Too Many Requests | Rate limit exceeded. Wait before making additional requests. Check the Retry-After header if provided. |
| 500 | Internal Server Error | An unexpected error occurred on the server. If this persists, contact support with the requestId. |
The error.code field contains a specific error code that can be used for programmatic error handling:
| Error code | HTTP status | Description |
|---|---|---|
| unauthorized | 401 | Invalid or missing API key. The API key may be expired, inactive, or incorrectly formatted. |
| bad_request | 400 | The request parameters are invalid. Common causes include invalid product ID format, invalid limit value, or missing required parameters. |
| not_found | 404 | The requested resource was not found. This may occur when a product or variant doesn't exist, or when a variant doesn't belong to the specified product. |
| rate_limited | 429 | Too many requests in a given time period. Rate limiting may be applied to prevent abuse. Wait before retrying. |
| internal_error | 500 | An unexpected server error occurred. This is typically a temporary issue. If it persists, contact support. |
{
"success": false,
"data": null,
"error": {
"code": "unauthorized",
"message": "Unauthorized",
"details": {}
},
"meta": {},
"requestId": "req_abc123"
}{
"success": false,
"data": null,
"error": {
"code": "bad_request",
"message": "Invalid product ID format",
"details": {
"field": "productId",
"reason": "Expected a valid Shopify product REST ID"
}
},
"meta": {},
"requestId": "req_abc123"
}{
"success": false,
"data": null,
"error": {
"code": "not_found",
"message": "Product not found",
"details": {
"resource": "product",
"id": "123"
}
},
"meta": {},
"requestId": "req_abc123"
}{
"success": false,
"data": null,
"error": {
"code": "rate_limited",
"message": "Too Many Requests",
"details": {
"retryAfter": 60
}
},
"meta": {},
"requestId": "req_abc123"
}{
"success": false,
"data": null,
"error": {
"code": "internal_error",
"message": "Internal Server Error",
"details": {}
},
"meta": {},
"requestId": "req_abc123"
}When handling errors in your application, consider the following:
error.details field for specific validation errors.Retry-After header or error.details.retryAfter value.requestId.