Search Overlay

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 send your 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 pass an incorrect user name and password in your payment request, or these details are missing.

See Authentication for more details.
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 You 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:

  • Content-Type: application/json

  • Content-Type: application/json; charset=UTF-8

Use the latter if you are passing UTF-8 characters.

See 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.

See the Payment Scheduler API Reference for examples and details of parameters to include in your requests.

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: