Troubleshooting API Requests
This section lists common errors with API requests and describes how to resolve issues with formatting and submission of API requests.
Common Errors
Error | Description | How to Resolve |
---|---|---|
Using the incorrect API endpoint | Merchants send their request to an incorrect API endpoint. | Check to ensure that you are pointing to the correct API endpoint. Where necessary, check that you have included your account number as part of the endpoint. Make sure there are no empty or white spaces in the URL or backslash symbols (/) at the end of the URL. |
Using HTTP | All API requests must be made over HTTPS. Calls made over plain HTTP will fail. | Always use HTTPS. |
Incorrect or missing authentication details | Merchant passes incorrect user name and password in their payment request, or these details are missing. | Refer to the section on Authentication for details. |
Payment method/currency not supported by this account number; accounts only support a single payment method/currency combination | The default Test account supports card payments (Visa/Mastercard) in the currency you selected when you created the account. Card Payments, Customer Vault, 3D Secure, and Hosted Payments (cards only) APIs are supported. | Contact support for additional Test accounts for different currencies or to make Alternate Payments or Direct Debit requests. You will also need additional accounts if you wish to use the alternate payments methods available with the Hosted Payments API. |
Incorrect account number/ID | Many calls require an account number (account ID). | Ensure that you use the account number in the email you received when you created your account. For example, in a settlement POST request to https://api.test.paysafe.com/cardpayments/v1/accounts/account_id/auths/auth_id/settlements, the account_id is the Test account number you received from Paysafe. |
Incorrect resource ID | Many calls require the unique ID of a resource created with a previous request – e.g., in order to submit a settlement request, you need the id returned in the response to the authorization-only request you want to settle. | Ensure that the unique id you are using as part of a request is in fact the correct one that you received in a previous response. For example, in a settlement POST request to https://api.test.paysafe.com/cardpayments/v1/accounts/account_id/auths/auth_id/settlements, the auth_id is the id returned in the response to the original authorization. |
Incorrect environment used | Merchants submit a request to the Test environment instead of the Production environment or the reverse. In this case the transaction is rejected because incorrect credentials are supplied. | Ensure you update your code to point to the correct environment. |
Incorrect content type | All calls to the Paysafe REST-based APIs should use a Content-Type header set to:
Use the latter if you are passing UTF-8 characters. | Refer to the section REST API Architecture for details. |
Invalid JSON | The structure of the API request body does not conform to the JSON schema standard – e.g., curly brackets are missing. | Use a JSON validator tool to verify that the structure of your JSON request is valid. See JSON Format Validation below. Ensure you are not using any invalid characters in the body of the request. See Global Invalid Characters. |
Invalid parameters | The request includes invalid parameters. | Examples and details of parameters to include are provided in the following API Reference sections:
|
JSON Format Validation
Problems relating to the formatting of API requests are common. We recommend that you use a JSON validator tool to check the formatting of your request to ensure that it is valid. Below is a list of online tools that provide JSON validation:
Links to third-party websites are provided as a convenience only. Paysafe makes no warranty related to these sites.