Skip to main content

Errors

NextAPI uses standard HTTP status codes combined with structured error responses that include machine-readable error codes and human-readable messages.

Error response format

All errors return JSON with a consistent structure:

{
"error": {
"code": "INSUFFICIENT_FUNDS",
"message": "The account does not have enough available balance to complete this request.",
"details": {
"available_balance": 5000,
"requested_amount": 10000
}
}
}
FieldDescription
error.codeMachine-readable error identifier — use this in your error handling logic
error.messageHuman-readable description — suitable for logging, not for showing end users
error.detailsOptional additional context — varies by error type

HTTP status codes

StatusMeaningWhen it occurs
200 OKSuccessRequest completed successfully
201 CreatedResource createdPOST request created a new resource
400 Bad RequestInvalid requestMissing required fields, wrong data types, or malformed JSON
401 UnauthorizedAuthentication failedInvalid or missing Authorization header
403 ForbiddenAccess deniedValid credentials but insufficient permissions
404 Not FoundResource not foundThe requested ID does not exist or is not accessible to your account
409 ConflictDuplicate requestIdempotency key reuse with different parameters
422 Unprocessable EntityBusiness rule violationRequest is valid but cannot be processed (e.g., insufficient funds)
429 Too Many RequestsRate limitedToo many requests in a short period
500 Internal Server ErrorServer errorUnexpected server-side failure — retry with backoff

Domain error codes

Funds and balances

CodeStatusDescriptionResolution
INSUFFICIENT_FUNDS422Account available balance is too lowCheck balance via GET /v2/accounts/{id}/balances before requesting payout
ACCOUNT_FROZEN422Account is frozen for compliance reasonsContact NextPay support
AMOUNT_BELOW_MINIMUM422Amount is below the rail minimumIncrease amount or use a different rail
AMOUNT_ABOVE_MAXIMUM422Amount exceeds the rail maximum (e.g., InstaPay PHP 50k)Split into multiple requests or use PESONet

Recipients and accounts

CodeStatusDescriptionResolution
INVALID_ACCOUNT422Recipient account number is invalid or does not existVerify the account number with the recipient
ACCOUNT_CLOSED422Recipient account is closedUse a different account for this recipient
INVALID_INSTITUTION400Bank or e-wallet code is not recognizedCheck valid codes via GET /v2/receiving-institutions

Payment rails

CodeStatusDescriptionResolution
BANK_UNAVAILABLE422The target bank is temporarily unavailableRetry later; check GET /v2/service-health
RAIL_UNAVAILABLE422InstaPay or PESONet is downRetry later or wait for scheduled batch window
PROCESSING_FAILED422Payout was rejected by the payment networkSee payout details for provider-specific reason

Authentication and authorization

CodeStatusDescriptionResolution
INVALID_CREDENTIALS401Client ID or Client Secret is incorrectVerify credentials in your dashboard
UNAUTHORIZED401Authorization header missing or malformedInclude Authorization: Basic <base64> in every request
FORBIDDEN403Credentials valid but access deniedVerify your account has the required permissions

Requests

CodeStatusDescriptionResolution
VALIDATION_ERROR400Request body failed validationRead error.details for the specific field and constraint
RESOURCE_NOT_FOUND404Requested ID does not existVerify the ID is correct and belongs to your account
IDEMPOTENCY_CONFLICT409Same idempotency key used with different parametersUse a new key or replay the exact same request
RATE_LIMITED429Too many requestsBack off and retry after the Retry-After header value