In-store and online
Authentication
Errors
Stronghold.Pay.JS
Postman Collection
Charge Authorization
PaymentSources
BalanceTransfers
Context
Customers
PayLinks
Charges
Reports
Sandbox
Settlements
Tips
Utility
Models
Countries
Currencies

Errors

Stronghold Pay 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. Codes in the 5xx range indicate an error with Stronghold Pay’s servers.

All 4xx errors include an error code that briefly explains the error reported and could be handled programmatically.

Overview

Error types categorize the different potential returned errors.

Type Description
api_error API errors cover any other type of problem (e.g., a temporary problem with the servers).
auth_error Failure to properly authenticate and/or authorize the client of the request.
invalid_request_error The request has invalid parameters due to a wrong usage of the endpoint.
object_error An object status or processing causes an error. The error is tied to the object specificities.
validation_error The validation of the fields passed has failed.

Error Object

type

string

A broad categorization of the error. Safe for programatic use.

code

string

The particular error code. Safe for programmatic use.

message

string [Optional]

A human friendly description of the error code. This may change over time and is not safe for programmatic use.

attribute

string [Optional]

The path of the attribute where the error come from. Generally it is pointing to an attribute given in the request body. Safe for programmatic use.

reference

string [Optional]

The reference provides further information about the error.

Example Error Response

{
    "error": {
        "code": "invalid_charge_amount",
        "message": "Charge amount must be between $1.00 and $999.99, inclusive.",
        "type": "object_error"
    },
    "response_id": "resp_bdFOammVLNVRqxjawhgR-XjS",
    "time": "2021-01-13T03:52:00.7347899Z",
    "status_code": 400
}

Error Code List

When handling errors, you can use the error.type to broadly categorize the error, and the error.code field for specific handling.

Api Errors

server_error

Stronghold was unable to process the request.

merchant_software_error

A problem occurred while accessing the software of the merchant.

Auth Errors

invalid_api_key

The API Key provided is not valid. Either because the value or the scope (publishable or not) is wrong.

live_not_approved

The request requires the client to have the live environment approved. The secret key provided is valid but not approved yet.

invalid_customer_token

The customer token provided is wrong or outdated.

Invalid Request Errors

not_found

The referenced object is not found.

invalid_id

The object ID passed is not valid.

sandbox_only

The request is meant for the sandbox environment only.

Object Errors

invalid_operation

The operation on the object is invalid.

payment_source_already_exists

The payment source already exists. The new one can not be add.

payment_source_login_required

The customer needs to update his payment source in order to perform this request.

payment_source_unavailable

The payment source is unavailable and can’t be used temporary.

payment_source_login_unavailable

The authentication to the payment source is currently unavailable.

payment_source_inactive

The payment source has been deactivated.

payment_source_action_required

The customer needs to take some action before Stronghold can access the payment source.

insufficient_balance

The balance associated to the payment source is insufficient.

customer_blocked

The request cannot be performed on a blocked customer.

pay_link_canceled

The action cannot be performed on a canceled pay link.

pay_link_expired

The action cannot be performed on a expired pay link.

pay_link_already_used

The action cannot be performed on a used pay link.

pay_link_charge_amount_modified

The charge associated to the pay link has been modified.

invalid_charge_amount

The amount of the charge is invalid. It must be between 100 (1$) and 100000 (1000$).

charge_tip_already_created

A tip has already be created for a charge.

Validation Errors

missing_field

The field is missing for that object.

invalid_field

The field value is invalid.

value_taken

The value has already be taken.