Here you can find codes and descriptions of all errors that may occur when you communicate with the Switch APIs.
If after reading this section you are still not sure how to interpret and solve a specific error, please contact our Support Team.
- Error Code Format: XX.YY.ZZZZ (numeric)
- 01.YY.ZZZZ: Validation ErrorsThe request failed because there are issues with the data being sent.
- 02.YY.ZZZZ: Soft DeclinesThe request was declined. Yet, subsequent attempts may be successful.
- 03.YY.ZZZZ: Hard DeclinesThe request was declined. Most hard declines require the issuer or customer to rectify issues before a subsequent attempt can be made.
- 04.YY.ZZZZ: CommunicationProblems in the communication between Switch and the processor. If these issues are recurring, it is important to check for the root cause.
- 05.YY.ZZZZ: ImplementationErrors raised when the integration with Switch was performed incorrectly.
- 06.YY.ZZZZ: RiskPossible fraudulent activities.
- 99.YY.ZZZZ: Unhandled ErrorsThe request failed due to unspecified reasons. Further analysis might be needed.
Validation Errors
Error Code | Designation | Description |
---|---|---|
01.01.0000 | Invalid Parameters | Request containing invalid parameters (e.g. email address). |
01.02.0000 | Amount Mismatch | Invalid amount. The amount inputted does not match the request. |
01.03.0000 | Instrument Mismatch | Request containing invalid instrument details. The payment instrument used does not match the criteria set by the processor. |
Soft Declines
Error Code | Designation | Description |
---|---|---|
02.00.0001 | Failure | Failure originated in the processor. |
02.01.0000 | Too Many Tries | You have exceeded the maximum number of tries. |
02.02.0000 | Limit Exceeded | The customer exceeds the maximum allowed limit. |
02.03.0000 | Insufficient Funds | There are not enough funds to complete this payment. |
02.04.0000 | Temporary Issue | There is a temporary problem with your submission. Retry. |
Hard Declines
Error Code | Designation | Description |
---|---|---|
03.00.0001 | Processor Declined | The processor refused the transaction request. |
03.00.0002 | Instrument Expired | The payment Instrument being used has expired. |
03.01.0000 | Disabled Account | The customer’s account has been disabled. |
03.02.0000 | Unsupported Value | Unsupported value for this request. Review the content and retry. |
03.02.0001 | Unsupported Scheme | Your payment instrument does not support this type of purchase. |
03.02.0002 | Unsupported BIN | Unsupported bank identification number. |
03.03.0000 | Card is Declined | The transaction is refused by the issuer. Use a different card or contact your bank for further details. |
03.03.0001 | Card is Flagged as Lost/Stolen/Expired/ Restricted | Card flagged as lost, stolen, expired, or restricted. |
03.04.0000 | Duplicate Operation | A transaction request with the same information has already been submitted. |
Communication
Error Code | Designation | Description |
---|---|---|
04.01.0000 | Processor Unavailable | Processor not available to confirm the transaction. |
04.02.0000 | Timeout Communicating With Processor | The server took too long to respond. Check the status of the transaction. Retry if needed. |
Implementation
Error Code | Designation | Description | |
---|---|---|---|
05.01.0000 | Configuration Error | Channel is not correctly configured. | |
05.02.0000 | Processor Configuration Error | Processor is not correctly configured. | |
05.01.0002 | Merchant Configuration Error | Merchant account is not correctly configured in the processor. | |
05.02.0000 | Invalid Processor Credentials | The credentials supplied do not grant access to the requested resource. | |
05.03.0000 | Authorization Error | Permissions error. | |
05.03.0001 | Processor Authorization Error | Permissions error coming from the processor. | |
05.03.0002 | Merchant Authorization Error | Access to resource denied. Verify your account permissions. | |
05.04.0000 | Feature Not Available | Feature does not exist. | |
05.04.0001 | Instrument Already Captured | The status of the instrument does not allow for your request (eg. reversing a card authorization that is already captured). | |
05.04.0002 | Instrument Not Authorized | The instrument verification does not allow for your request (eg. reversing a card authorization with 3DS that is still not authorized). |
Risk
Error Code | Designation | Description |
---|---|---|
06.00.0000 | Security Risk | Risk declines that do not fit any other category. |
06.01.0000 | 3DS Error | Problems with the 3D Secure protocol. |
06.01.0001 | 3DS Not Allowed | 3D Secure not supported. |
06.01.0002 | 3DS Required | 3D Secure verification is required to complete your request. |
06.02.0000 | Unsafe Transaction | This transaction has been flagged by the processor’s set of Risk rules. |
Unhandled Errors
Error Code | Designation | Description |
---|---|---|
99.00.0000 | Unspecified Error | Unknown/unspecified errors that do not fit any other category. |
99.01.0000 | Internal Server Error | The server encountered an internal error or misconfiguration and was unable to complete your request. |
99.02.0000 | Processor Integration Error | Issue(s) with the processor integration. Please contact our Support Team for further details. |
99.02.0001 | Unexpected Processor Response | Processor response does not match the expected parameters. Please contact our Support Team for further details. |
99.02.0002 | Unable To Read Processor Response | Processor response cannot be interpreted. Please contact our Support Team for further details. |
99.02.0003 | Processor Resource Not Found | Processor issued resources do not match the needs of your request. Please contact our Support Team. |
99.02.0004 | Processor Unhandled Error | The request failed due to unspecified reasons. Issue not addressed by the processor. Please contact our Support Team. |
Error Testing
Error handling is an important step in integration. To aid with error testing we have made triggering these errors a straightforward process. You only need to mind the amount set when you create a transaction.
In order to come up with the right amount to trigger the error you are looking for, mind the following instructions.
- Amount: XZZZZ.YY (numeric);
- The integer part of the amount represents the error code that will be returned. The decimal part of the amount represents the element from which the error originates (e.g. 0.10 for
charge
, 0.20 forinstrument
, 0.30 forpayment
, 0.40 forrefund
, 0.50 forreversal
); - Do not include the "." separators and the leading "0"s in this number.
Examples:
"amount": 6020000.20
Results in an instrument error (0.20), error code 06.02.0000."amount": 3030001.30
Results in a payment error (0.30), error code 03.03.0001.
Let’s use the first amount to exemplify the procedures involved in triggering an error.
"amount": 6010000.20
Results in an instrument error (0.20), error code 06.01.0000.
CREATE CHARGE: REQUEST PARAMETERS$ curl -vX POST https://api-test.switchpayments.com/v2/charges -u accountId:privateKey -d '{"charge_type": "card_onetime","amount": 6020000.20,"currency": "EUR","events_url": "https://merchant.com/events","channels": ["card_onetime_no_processor"]}
"amount": 6020000.20
All transactions begin with a charge
. When creating this charge
, you should input the amount
that corresponds to the error you intend to trigger.
Additionally, you should note that the amount that defines the error is always the charge_amount
, even if the current resource allows for a different amount to be set (e.g. payments, refunds).
"channels": ["card_onetime_no_processor"]
You should use a no_processor
Switch channel for error testing. Channels result from a concatenation of the charge_type
applied and the actual channel
used for the transaction, hence the ["card_onetime_no_processor"]
in this case.
To gain access to this test channel and proceed with error testing you should contact our Support Department.
CREATE CHARGE: RESPONSE PARAMETERS{"id": "675d32208a91bd3ad70641ba7f810036c65f5bb75ea9897f","external_ids": null,"charge_type": "card_onetime","charge_type_label": "Card One-Time","amount": 6020000.2,"currency": "EUR","events_url": "https://merchant.com/events","redirect_url": "","metadata": {},"instrument_params": null,"failure_code": null,"failure_description": null,"channels": [{"id": "d33577bcdc1ed9e106c050ff02bcccc285d57c5c5ea98619","label": "card_onetime_no_processor","processor": "no_processor"}],"confirmed": true,"created_at": "2020-04-29T14:04:47.145730+00:00","expires_at": null,"updated_at": "2020-04-29T14:04:47.145770+00:00","request_log": {"ip_address": "89.155.14.252","country": "PT","user_agent": "PostmanRuntime/7.24.1","library_version": null},"external": false}
The error we are triggering is generated in an instrument
. Next, create an instrument
deriving from the previous charge
, using the correspondent charge_id
.
CREATE CHARGE: RESPONSE PARAMETERS{"charge": "675d32208a91bd3ad70641ba7f810036c65f5bb75ea9897f","name": "John doe","number": "4111111111111111","expiration_month": 12,"expiration_year": 2020,"cvc": "007"}
You should find the error in the response. In this case, we triggered a 06.02.0000: Unsafe Transaction
. The respective instrument
generated is invalid
, as observable in the Switch Dashboard.
CREATE INSTRUMENT: RESPONSE PARAMETERS{"message": "Transaction Error","metadata": {"failure_description": null},"failure_description": "Unsafe Transaction","failure_code": "06.02.0000"}
If after reading this section you are still not sure how to trigger a specific error, please contact our Support Department.