Error object
When a request fails, Paypercut returns a structured error object describing the cause of the failure.
This object is designed to support both programmatic handling and user-facing messaging.
Example
Example error response
{
"type": "card_error",
"code": "card_declined",
"decline_code": "insufficient_funds",
"advice_code": "do_not_try_again",
"network_decline_code": "51",
"message": "Your card has insufficient funds. Please try another card or use a different payment method.",
"param": null,
"trace_id": "trc_123"
}
Attributes
type
Indicates the high-level category of the error.
Common values:
invalid_request_errorapi_errorcard_errorauthentication_error
Use this field as the primary branch for handling logic.
code
A stable programmatic identifier for the error.
Use this field to implement conditional handling in your integration.
Example:
card_declinedparameter_invalid
decline_code
Provides a normalized reason for card-related failures.
Example:
insufficient_fundsexpired_cardauthentication_required
Use this field to determine how to respond to payment failures.
advice_code
Indicates how to proceed after an error.
Typical values include:
try_again_laterdo_not_try_againconfirm_card_dataadjust_amount
Use this field to guide retry and user interaction strategies.
network_decline_code
The raw response code returned by the card network or issuer.
Example:
055154
This field is primarily used for diagnostics and reporting.
network_advice_code
The raw advice code provided by the network, if available.
Use this for advanced diagnostics and operational analysis.
message
A human-readable description of the error.
For card errors, this message is safe to display to end users.
param
Indicates which request parameter caused the error, if applicable.
Example:
{
"param": "card_number"
}
Use this field to highlight the relevant input field in your UI.
violation_code
A short identifier for rule or validation violations.
Use this field for advanced validation handling if needed.
trace_id
A unique identifier for the request.
Always log the trace_id. Include it when contacting support.
How to use the error object
Your integration should:
- Use
typeandcodefor programmatic handling - Use
decline_codeandadvice_codefor payment decisions - Use
messagefor user-facing feedback - Use
paramto guide form validation - Use
trace_idfor debugging and support

