Skip to main content

Error Reference

This page is a complete lookup for every error type you may encounter when integrating with AccruPay, including API-level errors, transaction outcomes, and provider decline reasons.


API errors

API errors appear in the GraphQL errors array. The response data is null or the failing field resolves to null.

{
"errors": [
{
"message": "Not found",
"extensions": {
"code": "NOT_FOUND"
}
}
],
"data": null
}

Always check extensions.code — the message field is for human reading only and may change between releases.

CodeCauseFix
UNAUTHENTICATEDThe accrupay-api-secret header is missing, malformed, or the secret has been rotatedVerify the API secret value in your environment; ensure the header name is lowercase accrupay-api-secret
FORBIDDENThe credentials are valid but the authenticated merchant does not have permission to access the requested resourceConfirm the API key belongs to the correct merchant account; check that the resource was created by this merchant
NOT_FOUNDThe resource ID does not exist or does not belong to this merchantVerify the UUID is correct; confirm the resource has not been deleted
VALIDATION_ERRORA required field is missing, a value fails format validation (e.g. non-numeric amount), or a business rule is violated (e.g. duplicate merchantInternalTransactionCode)Check the message field for field-level detail; correct the input and retry
INTERNAL_SERVER_ERRORUnexpected server-side failure not caused by the inputRetry with exponential backoff; if the issue persists, open a support ticket with the full error response body

Transaction errors

Transaction declines and failures are not GraphQL errors. The mutation resolves with HTTP 200 and a successful GraphQL response. The failure is indicated by transaction.status in the response data.

{
"data": {
"merchantApiServerPaymentMethodTransactionCreate": {
"id": "txn-uuid",
"status": "DECLINED",
"providerError": "Do not honor"
}
}
}
StatusCauseWhat to show the customer
DECLINEDThe card network or issuer rejected the charge (e.g. insufficient funds, card blocked, card expired)"Your payment was declined. Please try a different payment method."
FAILEDA processing failure prevented the transaction from being submitted (e.g. invalid card data, provider timeout, configuration error)"Something went wrong processing your payment. Please try again or contact support."

Neither status is retryable with the same payment method without customer action. For DECLINED, prompt the customer to re-enter payment details or use a different card. For FAILED, a retry may succeed if the cause was transient (e.g. a provider timeout), but use a new merchantInternalTransactionCode to avoid duplicate charge detection.


providerError field

Most transaction return types include a providerError field. It is populated when status is DECLINED or FAILED.

{
id
status
providerError
}

providerError contains the raw reason string from the provider (e.g. "Insufficient funds", "Do not honor", "Invalid card number", "Expired card").

How to use providerError

UseRecommendation
Internal loggingLog the full providerError value for every non-approved transaction
Support ticketsInclude providerError in support context to help diagnose declines
Customer-facing messagesDo not show providerError directly; map to a user-friendly message
Retry logicUse providerError to distinguish hard declines (do not retry) from soft declines (may retry)

Common hard decline indicators in providerError: "Do not honor", "Stolen card", "Lost card", "Restricted card". These should not be retried.

Common soft decline indicators: "Insufficient funds", "Exceeds withdrawal limit". These may succeed after the customer resolves the underlying issue.


Network and transport errors

HTTP-level failures do not produce a GraphQL response body. Handle these separately from GraphQL errors.

ScenarioBehaviorRecommendation
HTTP 200, errors[] presentGraphQL errorBranch on extensions.code
HTTP 200, data presentSuccessCheck transaction.status
HTTP 401Request rejected before reaching GraphQLCheck the accrupay-api-secret header
HTTP 5xxServer error before GraphQL processingRetry with backoff
Timeout / no responseTransport failureQuery by merchantInternalTransactionCode before retrying to avoid duplicate charges

SDK error classes

The @accrupay/node SDK throws typed errors that map to the codes above:

SDK error classMaps to
AccruPayUnauthenticatedErrorUNAUTHENTICATED
AccruPayForbiddenErrorFORBIDDEN
AccruPayNotFoundErrorNOT_FOUND
AccruPayValidationErrorVALIDATION_ERROR
AccruPayInternalErrorINTERNAL_SERVER_ERROR
AccruPayNetworkErrorTransport-level failure (timeout, DNS, etc.)

Catch AccruPayValidationError to surface field-level messages to users. Catch AccruPayNetworkError to trigger retry logic.