Errors
The Flowlix API uses conventional HTTP response codes and returns structured JSON error objects to help you diagnose and handle problems programmatically.HTTP status codes
| Code | Meaning |
|---|---|
200 | OK — The request succeeded. |
201 | Created — A new resource was created (e.g., a payment). |
400 | Bad Request — The request was malformed or missing required parameters. |
401 | Unauthorized — The API key is missing or invalid. |
402 | Payment Required — The card was declined. |
404 | Not Found — The requested resource does not exist. |
409 | Conflict — Idempotency key was reused with different parameters. |
422 | Unprocessable Entity — The request was well-formed but semantically invalid. |
429 | Too Many Requests — Rate limit exceeded. |
500 | Internal Server Error — Something went wrong on our end. |
Error object structure
All errors follow the same shape:Error fields
| Field | Type | Description |
|---|---|---|
type | string | The category of error. See error types below. |
code | string or null | A machine-readable code providing more detail. |
message | string | A human-readable explanation of what went wrong. |
param | string or null | The specific request parameter that caused the error. |
decline_code | string or null | For card errors, the reason the card was declined. |
doc_url | string or null | A link to the relevant documentation page. |
request_id | string | The unique request ID for support reference. |
Error types
| Type | Description |
|---|---|
api_error | An unexpected error on Flowlix’s servers. These are rare and should be retried. |
authentication_error | The API key is missing, invalid, or revoked. |
card_error | The card was declined. Check decline_code for the specific reason. |
idempotency_error | An idempotency key was reused with different request parameters. |
invalid_request_error | The request was malformed, missing a required parameter, or had an invalid value. |
rate_limit_error | Too many requests in a short period. Back off and retry. |
Common error codes
| Code | Type | Description |
|---|---|---|
parameter_missing | invalid_request_error | A required parameter was not provided. |
parameter_invalid | invalid_request_error | A parameter value is invalid (e.g., negative amount). |
resource_missing | invalid_request_error | The requested resource (e.g., payment ID) does not exist. |
invalid_api_key | authentication_error | The API key is not valid. |
card_declined | card_error | The card was declined by the issuer. |
expired_card | card_error | The card has expired. |
invalid_cvc | card_error | The CVC code is incorrect. |
payment_already_refunded | invalid_request_error | The payment has already been refunded. |
idempotency_key_in_use | idempotency_error | The idempotency key was previously used with different parameters. |
rate_limit_exceeded | rate_limit_error | Too many requests. Check the Retry-After header. |
Handling errors in code
Here is a recommended pattern for handling Flowlix API errors:Decline codes
Whenerror.type is card_error, the decline_code field tells you why the card was declined. Common decline codes:
| Decline code | Meaning |
|---|---|
insufficient_funds | The card does not have enough funds. |
do_not_honor | The issuer declined without a specific reason. |
expired_card | The card has expired. |
generic_decline | The card was declined for an unspecified reason. |
Tips
- Always check
error.typeto determine how to handle the error. - Log
request_idfrom every error response — you will need it if you contact support. - Use
decline_codefor card errors to show appropriate messages to customers. - Retry on
api_errorwith exponential backoff (start at 1 second, max 30 seconds). - Respect
Retry-Afteron rate limit errors instead of guessing a wait time.