HTTP Status Codes
HTTP response codes returned by the Plexy API
HTTP Status Codes
The Plexy API uses standard HTTP status codes to indicate request outcomes.
Success codes
| Code | Description |
|---|---|
200 OK | Request succeeded |
201 Created | Resource created successfully |
204 No Content | Request succeeded, no response body |
Client error codes
| Code | Description | Action |
|---|---|---|
400 Bad Request | Invalid request parameters | Check request body |
401 Unauthorized | Invalid or missing API key | Verify API credentials |
403 Forbidden | Insufficient permissions | Check API key permissions |
404 Not Found | Resource doesn't exist | Verify resource ID |
405 Method Not Allowed | Invalid HTTP method | Check endpoint documentation |
409 Conflict | Idempotency conflict | Request already processed |
422 Unprocessable Entity | Valid request but cannot process | Check business logic |
Server error codes
| Code | Description | Action |
|---|---|---|
500 Internal Server Error | Unexpected server error | Retry with backoff |
502 Bad Gateway | Upstream service error | Retry with backoff |
503 Service Unavailable | Service temporarily down | Retry with backoff |
504 Gateway Timeout | Request timed out | Retry with backoff |
Handling responses
Check the HTTP status code of every response. Successful operations return 2xx; errors return 4xx or 5xx with an error object in the body:
HTTP/2 400
Content-Type: application/json
{
"error": {
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "Missing required parameter: amount"
}
}| Status range | Meaning | Action |
|---|---|---|
2xx | Success | Process the response |
400 | Bad request | Fix request parameters |
401 | Unauthorized | Verify API key |
5xx | Server error | Retry with exponential backoff |
Retry strategy
For 500, 502, 503, and 504 responses, retry the request with exponential backoff and the same Idempotency-Key:
# Attempt 1 — wait 1 s on failure, then attempt 2 — wait 2 s, then attempt 3
curl -X POST https://api.plexypay.com/v2/payments \
-H "x-api-key: YOUR_API_KEY" \
-H "Idempotency-Key: order_12345_payment" \
-H "Content-Type: application/json" \
-d '{"amount": 5000, "currency": "USD"}'