Key concepts

Errors

Nexpay uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with Nexpay’s servers.


HTTP status code summary

NumberErrorDescription
200OkEverything worked as expected.
400Bad RequestThe request was unacceptable, often due to missing a required parameter.
401UnauthorizedNo valid API key provided.
403ForbiddenThe API key doesn’t have permissions to perform the request.
404Not FoundThe requested resource doesn’t exist.
409ConflictThe request conflicts with another request.
422Unprocessable EntityThe request could not be processed. This is returned when an idempotency key is reused with a different request body. See Idempotency.
429Too Many RequestsYou have exceeded the rate limit. See Rate limiting.
500, 502, 504Server ErrorsSomething went wrong on Nexpay's end.
503Service Unavailable / MaintenanceNexpay is undergoing scheduled maintenance or is temporarily unavailable. The response includes a Retry-After header. Check status page for updates.

Maintenance mode

In rare cases, Nexpay may enter maintenance mode for scheduled infrastructure work. When this happens, the API responds with HTTP status code 503 Service Unavailable and includes a Retry-After header indicating the estimated time (in seconds) until the maintenance window ends. These windows are communicated in advance and you can monitor real-time status at status.nexpay.com.

During maintenance:

  • New payment attempts will fail.
  • Dashboard login will be unavailable.
  • Background operations (notifications, bank-related events) are queued and processed automatically once maintenance is over.
  • Health checks, webhook subscriptions, and payment gateway callbacks continue to operate normally.

Error codes

In addition to HTTP status codes, Nexpay returns application-level error codes to help you identify the specific issue. Each error code follows the format [PREFIX####], where:

  • PREFIX is a 3-letter module identifier (e.g., PAY for Payments, AUT for Authentication)
  • #### is a zero-padded numeric code unique within that module

For example, [PAY0001] means "Payment not found" and [QOT0001] means "Quote has expired". These codes remain stable and can be used to programmatically handle specific error scenarios, even if the human-readable message changes over time.

Module prefixes

PrefixModule
GENGeneral
AUTAuthentication
PAYPayments
QOTQuotes
PYEPayees
DOCDocuments
GWYGateway
TNTTenant
PRXProxy (Legacy)
COMCommissions
ORGOrganizations
CNVConversations
DEVDeveloper (API Keys)
CHTChat

Error code reference

CodeMessageHTTP Status
[GEN9001]Internal server error500
[GEN9002]Bad request400
[GEN9003]Unauthorized401
[GEN9004]Forbidden403
[GEN9013]Service is under maintenance. Please try again later.503
[AUT0001]Invalid credentials401
[AUT0002]Session expired401
[AUT0003]Invalid API key401
[AUT0004]Invalid Firebase token401
[AUT0006]An account with this email already exists409
[PAY0001]Payment not found404
[PAY0002]Invalid payment status transition422
[PAY0003]Duplicate payment detected409
[PAY0004]Payment type not supported400
[QOT0001]Quote has expired422
[QOT0002]Quote not found404
[QOT0003]Currency pair unavailable422
[QOT0004]Amount below minimum422
[PYE0001]Payee not found404
[PYE0002]Duplicate payee409
[PYE0003]Payee validation failed400
[DOC0001]Document not found404
[DOC0002]File exceeds maximum size413
[DOC0003]Invalid file format400
[GWY0001]Checkout session expired422
[GWY0002]Payment gateway unavailable503
[GWY0003]Invalid gateway callback400
[TNT0001]Tenant not found404
[TNT0002]Tenant branding not configured404
[COM0001]Commission request not found404
[COM0002]Minimum commission threshold not met422
[COM0003]Payment not eligible for commission422
[COM0004]Commission request already paid409
[COM0005]Commission request rejected422
[ORG0001]Organization not found404
[ORG0002]Organization update validation failed400
[ORG0003]Invalid document type400
[CNV0001]Conversation not found404
[CNV0002]Conversation is already closed422
[CNV0003]Conversation attachment not found404
[DEV0001]API key not found404
[DEV0002]Only authenticated users can perform this action403
[CHT0001]Chat conversation not found404
[CHT0002]AI is still processing. Please wait for the response.429
[CHT0003]This conversation has been closed422
[CHT0004]AI service temporarily unavailable503

Error response

Error responses include the HTTP status code, the error code, a human-readable message, a timestamp, and optionally details with additional context:

{
  "statusCode": 404,
  "code": "[PAY0001]",
  "message": "[PAY0001] Payment not found",
  "timestamp": "2026-01-15T10:30:00.000Z"
}

Some errors may include a details field with additional context about the issue:

{
  "statusCode": 422,
  "code": "[QOT0003]",
  "message": "[QOT0003] Currency pair unavailable",
  "timestamp": "2026-01-15T10:30:00.000Z",
  "details": {
    "fromCurrency": "BRL",
    "toCurrency": "USD"
  }
}

If the request failed due to the lack of permissions, Nexpay will return a 403 Forbidden error:

{
  "statusCode": 403,
  "code": "[GEN9004]",
  "message": "[GEN9004] Forbidden",
  "timestamp": "2026-01-15T10:30:00.000Z"
}
Previous
Currencies & countries