Troubleshooting API Requests
This page 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 | You sent a 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 | You passed the incorrect user name and password in your payment request, or these details are missing. | Refer to Authentication for more 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. | Contact support for additional Test accounts for different currencies or to make Local Payments or Direct Debit requests. |
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/paymenthub/v1/payments/payment_id/settlementsthe payment_id is the id returned in the response to the original authorization. |
Incorrect environment used | You submitted 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 REST API Architecture for more 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 Payments API Reference. |
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: