Phoenix Pay
API Reference

Status Codes

Complete reference for HTTP status codes and error responses from Phoenix Pay.

Status Codes

This page documents all HTTP status codes returned by the Phoenix Pay API, along with their meanings and common causes.

HTTP Status Codes

Success Codes

StatusNameWhen Used
200 OKSuccessGET requests, successful updates
201 CreatedResource CreatedPOST requests that create a new deposit or payout

Client Error Codes

StatusNameDescription
400 Bad RequestInvalid RequestThe request is malformed or missing required parameters. The error field in the response describes which parameter is missing or invalid.
401 UnauthorizedAuthentication FailedNo valid authentication token was provided. The token may be missing, expired, have an invalid signature, or be missing the required audience claim.
403 ForbiddenInsufficient PermissionsThe token is valid but the authenticated user does not have permission for the requested action. Commonly returned when a tenant user tries to access admin-only endpoints.
404 Not FoundResource Not FoundThe requested resource does not exist, or it belongs to a different tenant. Phoenix Pay does not distinguish between "does not exist" and "belongs to another tenant" to prevent information leakage.
422 Unprocessable EntityProcessing ErrorThe request was syntactically valid but could not be processed. Common causes: no PSP configured for the currency, duplicate reference ID, or PSP rejected the request.
429 Too Many RequestsRate LimitedYou have exceeded the rate limit. Wait for the duration specified in the Retry-After header before retrying.

Server Error Codes

StatusNameDescription
500 Internal Server ErrorServer ErrorAn unexpected error occurred on the server. The response body contains {"error": "internal_error"}. If this persists, contact support.

Error Response Format

All error responses follow a consistent format:

Error response
{
  "error": "description of the error"
}

The error field is always a string containing a human-readable description of what went wrong.

Common Error Messages

Authentication Errors (401)

ErrorCauseResolution
"unauthorized"Missing Authorization headerInclude Authorization: Bearer <token> in your request
"unauthorized"Token has expiredRequest a new token using the client credentials grant
"unauthorized"Invalid token signatureEnsure you are using a valid token from the correct Zitadel instance
"unauthorized"Wrong audience claimInclude the correct project scope when requesting the token

Validation Errors (400)

ErrorCauseResolution
"missing required parameter: reference_id"The reference_id field is missing or emptyProvide a unique reference_id string
"missing required parameter: amount"The amount field is missing or emptyProvide the amount as a decimal string
"missing required parameter: currency"The currency field is missing or emptyProvide a currency code (e.g., "USDT", "ETB")
"missing required parameter: destination_id"Payout is missing destination_idProvide the destination ID from the List Destinations endpoint

Processing Errors (422)

ErrorCauseResolution
"no_psp_configured"No PSP is configured for the requested currency in your tenantConfigure a PSP that supports the requested currency via the admin panel or config API
"has already been taken"The reference_id is already in use for your tenantUse a unique reference_id for each payment
PSP-specific errorThe PSP rejected the payment requestCheck the error message for details; verify your PSP credentials are correct

Permission Errors (403)

ErrorCauseResolution
"forbidden"Tenant user accessing admin endpointsAdmin endpoints (/api/admin/*) are restricted to platform users

Payment Status Values

These are the possible values for the status field on payments, not HTTP status codes. See Payment Lifecycle for the full state machine.

StatusDescriptionTerminal?
pendingPayment record created, initial stateNo
awaiting_paymentWaiting for customer to complete paymentNo
processingPayment detected, being confirmed by PSPNo
partialPartial amount received (crypto deposits)No
settledPayment completed successfullyYes
failedPayment failed or was rejectedYes
expiredPayment window expired before completionYes
cancelledPayment was cancelledYes

Terminal means no further status changes are possible. Once a payment reaches a terminal state, all subsequent status update attempts are silently ignored.

PSP Identifiers

ValuePSPType
nowpaymentsNOWPaymentsCrypto payments
chapaChapaFiat payments (ETB)

Payment Types

ValueDescription
depositInbound payment (customer pays you)
payoutOutbound payment (you pay a recipient)

On this page