Overview
The Digitzs API uses standard HTTP status codes to indicate the success or failure of API requests. When an error occurs, the API returns a status code that helps you understand what went wrong and how to fix it.Status codes follow the Internet Engineering Task Force (IETF) Request for Comments (RFCs) standards.
Status Code Categories
HTTP status codes are organized into five categories based on the first digit:1xx - Informational
The request was received, continuing process
2xx - Successful
The request was successfully received, understood, and accepted
3xx - Redirection
Further action is necessary to complete the request
4xx - Client Error
The request contains bad syntax or cannot be fulfilled
5xx - Server Error
The server failed to fulfill an apparently valid request
HTTP Status Codes
Success Codes (2xx)
The request was successful and the server returned the requested data.When you’ll see it:
- Successfully retrieving merchant data
- Successfully retrieving payment information
- Successfully listing resources
The request was successful and a new resource was created.When you’ll see it:
- Creating a new merchant account
- Processing a new payment
- Generating authentication tokens
Client Error Codes (4xx)
The server cannot process the request due to invalid syntax or missing required parameters.Common causes:
- Missing required fields in request body
- Invalid data format (e.g., non-numeric amount)
- Malformed JSON
- Invalid parameter values
- Verify all required fields are included
- Check data types match the API specification
- Validate JSON syntax
- Review the error message for specific field issues
Authentication is required or has failed. The request lacks valid authentication credentials.Common causes:
- Missing Authorization header
- Expired app token (tokens expire after 1 hour)
- Invalid or malformed token
- Missing x-api-key header
- Generate a new app token using
/auth/token - Ensure Authorization header format is
Bearer {token}with capital “B” - Verify your API key is correct
- Include all required authentication headers
Reserved for future use. This status code is not currently used by the Digitzs API.
The server understood the request but refuses to authorize it.Common causes:
- Account is not authorized to access the resource
- API key has been revoked or suspended
- Insufficient permissions for the requested operation
- Attempting to access another merchant’s data
- Contact Digitzs support to verify account status
- Check that you’re accessing resources you own
- Verify your account permissions
The requested resource could not be found on the server.Common causes:
- Invalid resource ID (merchant ID, payment ID, etc.)
- Resource has been deleted
- Incorrect API endpoint URL
- Typo in the request path
- Verify the resource ID exists and is correct
- Check the endpoint URL for typos
- Ensure you’re using the correct HTTP method
- Confirm the resource hasn’t been deleted
The server timed out waiting for the request.Common causes:
- Slow network connection
- Large request payload
- Server processing delays
- Retry the request
- Check your network connection
- Reduce request payload size if possible
- Implement retry logic with exponential backoff
The request conflicts with the current state of the server.Common causes:
- Attempting to create a duplicate resource
- Race condition with concurrent requests
- Editing conflict with another user’s changes
- Check if the resource already exists
- Implement optimistic locking if handling concurrent updates
- Retry the request with updated data
The user has sent too many requests in a given amount of time (rate limiting).Common causes:
- Exceeding API rate limits
- Making too many requests in a short time period
- Not implementing proper request throttling
- Implement exponential backoff
- Add delays between requests
- Cache responses when possible
- Contact support if you need higher rate limits
Server Error Codes (5xx)
The server encountered an unexpected condition that prevented it from fulfilling the request.Common causes:
- Unexpected server-side error
- Database connection issues
- Unhandled exception in server code
- Retry the request after a short delay
- If the error persists, contact Digitzs support
- Check Digitzs status page for known issues
The server does not recognize the request method or lacks the ability to fulfill it.Common causes:
- Using an unsupported HTTP method
- Calling an endpoint that doesn’t support the method
- Feature not yet implemented
- Verify you’re using the correct HTTP method (GET, POST, PUT, DELETE)
- Check the API documentation for supported methods
- Ensure the endpoint supports the requested operation
The server received an invalid response from an upstream server.Common causes:
- Payment processor connection issues
- Third-party service unavailable
- Network problems between servers
- Retry the request
- Wait a few moments and try again
- If the error persists, contact Digitzs support
The server is currently unable to handle the request due to temporary overload or maintenance.Common causes:
- Scheduled maintenance
- Server overload
- Temporary service disruption
- Wait and retry the request
- Check Digitzs status page
- Implement retry logic with exponential backoff
The server did not receive a timely response from an upstream server.Common causes:
- Payment processor timeout
- Long-running operation exceeded timeout
- Network latency issues
- Retry the request
- Check payment status before retrying payment operations
- Contact support if timeouts persist
Error Response Format
All error responses from the Digitzs API follow a consistent JSON format:Error Object Fields
| Field | Type | Description |
|---|---|---|
status | string | HTTP status code as a string |
title | string | Short, human-readable summary of the error |
detail | string | Detailed explanation of the specific error |
source | object | Optional pointer to the source of the error in the request |
source.pointer | string | JSON Pointer to the field that caused the error |
Handling Errors
Best Practices
Log All Errors
Log error responses with full details for debugging and monitoring
Implement Retry Logic
Retry transient errors (5xx, 408, 429) with exponential backoff
Parse Error Details
Read the error detail field for specific information about what went wrong
Handle Gracefully
Display user-friendly error messages instead of raw error responses
Example Error Handling
Quick Reference Table
| Status Code | Meaning | Action Required |
|---|---|---|
| 200 | OK | Request successful |
| 201 | Created | Resource created successfully |
| 400 | Bad Request | Fix request parameters |
| 401 | Unauthorized | Refresh authentication token |
| 403 | Forbidden | Check account permissions |
| 404 | Not Found | Verify resource ID |
| 408 | Request Timeout | Retry the request |
| 409 | Conflict | Resolve resource conflict |
| 429 | Too Many Requests | Implement rate limiting |
| 500 | Internal Server Error | Retry or contact support |
| 501 | Not Implemented | Check HTTP method |
| 502 | Bad Gateway | Retry the request |
| 503 | Service Unavailable | Wait and retry |
| 504 | Gateway Timeout | Retry the request |
Preventing Common Errors
Preventing 401 Errors
Preventing 401 Errors
- Implement automatic token refresh before expiration
- Cache tokens and track their expiration time
- Use the correct Authorization header format:
Bearer {token} - Include all required headers:
Authorization,x-api-key, andappId
Preventing 400 Errors
Preventing 400 Errors
- Validate all input data before sending requests
- Use the correct data types (strings, numbers, etc.)
- Include all required fields
- Test with the API documentation examples
Preventing 429 Errors
Preventing 429 Errors
- Implement request throttling in your application
- Cache responses when possible
- Use batch operations instead of individual requests
- Monitor your request rate
Handling 5xx Errors
Handling 5xx Errors
- Implement exponential backoff for retries
- Set reasonable timeout values
- Log errors for monitoring
- Have a fallback strategy for critical operations
Need Help?
Contact Support
If you encounter persistent errors or need assistance troubleshooting, our support team is here to help.

