Error Handling
This guide covers error responses, common error codes, and troubleshooting strategies for the Consignly API.
Error Response Format
When an API request fails, Consignly returns an error response with an appropriate HTTP status code and error details in the response body.
Error Response Schema:
{
"ErrorType": "string",
"ErrorMessages": ["string", "string"],
}
| Field | Type | Description |
|---|---|---|
ErrorType |
string | Category of the error (e.g., "Validation Failed", "Verification Failed") |
ErrorMessages |
array | List of error message strings describing what went wrong |
Example Error Response:
{
"ErrorType": "Validation Failed",
"ErrorMessages": [
"Client code is required.",
"Expected dispatch date must be in the future."
]
}
HTTP Status Codes
The Consignly API uses standard HTTP status codes to indicate the success or failure of requests.
Success Codes
| Code | Status | Description |
|---|---|---|
200 |
OK | Request succeeded |
201 |
Created | Resource was created successfully |
202 |
Accepted | Request accepted for processing (async operations) |
304 |
Not Modified | Resource has not changed (for update operations) |
Client Error Codes
| Code | Status | Description |
|---|---|---|
400 |
Bad Request | Invalid request format or parameters, validation or verification failed |
401 |
Unauthorized | Missing or invalid authentication token |
403 |
Forbidden | Authenticated but not authorized for this action |
404 |
Not Found | Requested resource does not exist |
409 |
Conflict | Request conflicts with current state (e.g., duplicate idempotency key on import) |
422 |
Unprocessable Entity | Request is valid but cannot be processed |
429 |
Too Many Requests | Rate limit exceeded |
Rate Limiting
The Consignly API enforces rate limits to ensure fair usage and platform stability. Rate limits are applied on a sliding window basis at different scopes.
Rate Limit Thresholds
| Scope | Limit | Description |
|---|---|---|
| Organisation (Standard) | 3,000/min | Standard API endpoints, per organization |
| Identity Connection | 600/min | Per custom app connection (authentication/token requests) |
| Organisation (Reports) | 150/min | Report generation endpoints, per organization |
Rate Limit Response
When exceeding the rate limit, the API returns a 429 Too Many Requests response:
{
"ErrorType": "RateLimitExceeded",
"ErrorMessages": ["Connection has exceeded the request quota. Please try again after XYZ second(s)."]
}
Handling Rate Limits
When rate limited (429 Too Many Requests):
- Check the
Retry-Afterheader for recommended wait time (if provided) - Implement exponential backoff
- Consider caching frequently accessed data to reduce API calls
- Batch requests where possible (e.g., use consignment import instead of individual creates)
- Spread requests over time rather than bursting
Common Errors and Solutions
Authentication Errors
401 Unauthorized
Cause: Missing, expired, or invalid access token.
Solutions:
- Ensure the
Authorizationheader is included:Authorization: Bearer ACCESS_TOKEN - Check if the token has expired and refresh if necessary
- Verify the token was obtained with correct credentials
403 Forbidden
Cause: The authenticated user lacks permission for the requested operation.
Solutions:
- Verify the app has the required scopes
- Confirm the user has appropriate permissions in Consignly
- Check if the resource belongs to the organization
Validation Errors
400 Bad Request
Cause: Invalid request format, missing required fields, or invalid parameter values.
Solutions:
- Check that all required fields are included
- Verify data types match the expected format
- Ensure dates use ISO 8601 format (
YYYY-MM-DDTHH:MM:SSZ) - Confirm UUIDs are properly formatted
Resource Errors
404 Not Found
Cause: The requested resource does not exist or is not accessible.
Solutions:
- Verify the resource ID is correct
- Confirm the resource exists in the organization
- Check for typos in the endpoint path
The Consignment Check Exists Response Codes
The GET /v1/consignments/{consignmentId}/check-exists endpoint can be used to resolve if a consignment exists or is a pending import:
| Code | Meaning |
|---|---|
201 |
Consignment exists |
202 |
Consignment import exists (pending consignment creation) |
404 |
Consignment or consignment import not found |
Idempotency Errors
409 Conflict
Cause: A request with the same idempotency key has already been processed.
Solutions:
- Use a unique idempotency key for each new request
- If retrying a failed request, use the same idempotency key
- Check if the original request was successful
Getting Help
If encountering persistent errors:
- Check this documentation for known solutions
- Review the Consignly Help Center
- Contact support at https://www.consignlyhq.com/contact
When contacting support, include:
- The API endpoint and HTTP method
- Request headers (excluding sensitive data)
- Request body
- Response status code and body
- Timestamp of the request