PlexySDK DOCS

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

CodeDescription
200 OKRequest succeeded
201 CreatedResource created successfully
204 No ContentRequest succeeded, no response body

Client error codes

CodeDescriptionAction
400 Bad RequestInvalid request parametersCheck request body
401 UnauthorizedInvalid or missing API keyVerify API credentials
403 ForbiddenInsufficient permissionsCheck API key permissions
404 Not FoundResource doesn't existVerify resource ID
405 Method Not AllowedInvalid HTTP methodCheck endpoint documentation
409 ConflictIdempotency conflictRequest already processed
422 Unprocessable EntityValid request but cannot processCheck business logic

Server error codes

CodeDescriptionAction
500 Internal Server ErrorUnexpected server errorRetry with backoff
502 Bad GatewayUpstream service errorRetry with backoff
503 Service UnavailableService temporarily downRetry with backoff
504 Gateway TimeoutRequest timed outRetry 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 rangeMeaningAction
2xxSuccessProcess the response
400Bad requestFix request parameters
401UnauthorizedVerify API key
5xxServer errorRetry 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"}'

See also

On this page