Decline codes
Pay.com maps decline reasons from different networks to unified decline codes, for one error-handling path and consistent customer messages.
When a payment is declined, Pay.com maps the result to a unified decline code, a consistent set of error identifiers that work the same way regardless of which bank or card network processed the transaction. This lets you build a single error-handling path in your integration instead of parsing provider-specific strings from each network.
Decline code format
Declined transactions return HTTP 400. The error object has type: "payment_method_error"
and code: "card_declined", a decline_code identifying the reason, a message with a
developer-facing description, and the ID of the declined transaction (charge, hold,
refund, or payout, depending on what you created):
{
"error": {
"type": "payment_method_error",
"code": "card_declined",
"decline_code": "insufficient_funds",
"message": "The card has insufficient funds to complete the purchase.",
"charge": "chrg_686511195653406720"
}
}The error can also include payment_method, payment_method_details, and
underlying_network_details for the declined attempt. A charge blocked by a payment rule
returns the same 400 error shape.
Map decline_code to your own localized, customer-facing messages in your UI. The raw
message field is intended for developer logs and debugging, not for display to
customers.
Common decline codes
These are the most frequent decline codes, with what each means and the recommended action:
| Code | Description | Recommended action |
|---|---|---|
insufficient_funds | The card has insufficient funds or has exceeded its credit limit. | Ask the customer to use a different card or add funds. |
expired_card | The card's expiration date has passed. | Ask the customer to update their card details. |
invalid_cvc | The CVV check failed. | Ask the customer to re-enter their security code. |
do_not_honour | The issuer declined without giving a specific reason. | Ask the customer to use a different card or contact their bank. |
stolen_card | The card has been reported as stolen. | Do not retry. Ask the customer to use a different payment method. |
lost_card | The card has been reported as lost. | Do not retry. Ask the customer to use a different payment method. |
processing_error | An error occurred while processing the card. | Retry the transaction after a short delay. |
For the complete list of decline codes, see error codes.
Network-specific codes
In addition to the unified decline code, Pay.com includes the original network-level code
in the response for deeper troubleshooting. These are available under
underlying_network_details and vary by network.
For Mastercard transactions, Pay.com surfaces the Merchant Advice Code (MAC) under
underlying_network_details.mastercard.advice_code:
| MAC | Meaning |
|---|---|
01 | New account information available. Update card details and retry. |
02 | Cannot approve at this time. Retry after a delay. |
03 | Do not retry. Contact the customer to resolve with their bank. |
21 | Payment cancellation: the cardholder canceled the recurring agreement. Do not retry. |
For the full list, see Mastercard merchant advice codes.
Next steps
- Find your use case: compare the Pay.com.js integrations and the server-to-server API.
- Webhooks: listen for
charge.failedevents to capture and log decline codes automatically. - Create a charge: see how decline codes appear in a charge integration.
- Errors: view the full reference for HTTP status codes and error response formats.