Error Handling
The Strictly API uses standard HTTP status codes and a consistent JSON error body to communicate
problems. Always check the status code first, then inspect the response object for the specific
application-level error code.
Error response shape
All error responses follow this structure:
Code
| Field | Type | Description |
|---|---|---|
statusCode | integer | HTTP status code |
timestamp | string | ISO 8601 datetime of the error |
path | string | The request path that caused the error |
response.code | string | Application-level error code |
response.text | string | Human-readable error message |
message | string | High-level error category |
HTTP status codes
| Status | Meaning |
|---|---|
200 | Success |
201 | Resource created |
400 | Bad request โ invalid input, validation failure, or declined transaction |
401 | Unauthorized โ missing or invalid credentials |
403 | Forbidden โ valid credentials but insufficient permissions |
404 | Not found โ resource does not exist |
409 | Conflict โ resource already exists or state conflict |
422 | Unprocessable entity โ semantic validation error |
500 | Internal server error โ unexpected server-side failure |
Application error codes
The response.code field contains a numeric string that pinpoints the specific failure reason.
Payment errors
| Code | Description |
|---|---|
300 | Transaction rejected by gateway |
301 | Insufficient funds |
302 | Card expired |
303 | Card declined โ contact issuer |
304 | Invalid card number |
305 | CVV mismatch |
306 | Card not supported |
307 | Duplicate transaction |
Validation errors
| Code | Description |
|---|---|
100 | Required field missing |
101 | Invalid field value |
102 | Amount must be greater than zero |
103 | Unsupported currency |
Authentication errors
| Code | Description |
|---|---|
401 | Invalid credentials |
403 | Key hash is invalid or expired |
Handling errors in code
JavaScript โ check status and code
Python โ handle error codes
Retrying requests
:::warning Do not retry declined transactions automatically
A 400 with a payment error code (e.g. 300 โ declined) indicates a definitive gateway response.
Retrying the same request will not succeed and may trigger fraud detection.
:::
You may safely retry requests that fail with:
500โ server errors, with exponential backoff- Network timeouts or connection errors
Always use idempotency when retrying write operations: store the transaction ID on your first successful attempt and check for it before retrying to avoid duplicate charges.