Authentication Authentication

Requests to the Fatora REST API must be authenticated using one of two methods: API key-based authentication or bearer token authentication. Below is an explanation of both methods:

1. API Key-Based Authentication

This method is used for payment-related APIs such as checkout, refund, recurring, and verify. With API key authentication, you must send a key-value pair to the API in the request headers.

curl -v https://api.fatora.io/v1/payments/endpoint
  -H "Content-Type: application/json"
  -H "api_key": <Merchant-APIKey>"
2. Bearer Token Authentication

This method is required for APIs related to creating invoices, clients, and products. Thoses APIs require a bearer token for authentication, which can be obtained by making a call to the Authorize endpoint. The Authorize endpoint validates the provided API key and returns a bearer token if the API key is valid. This token must then be included in the headers of API requests.

https://api.fatora.io/v1/Authorization/Authorize
curl -v 'https://api.fatora.io/v1/Authorization/Authorize' \ 
-H 'api_key: E4B73FEE-F492-4607-A38D-852B0EBC91C9' \
-H 'Content-Type: application/json' \
{
"success": true,
"bearer_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6IjcyOTEyLTpyYW1pcmVzc2xhbkBnbWFpbC5jb20iLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9oYXNoIjoiOTExM2Y2OWEtMTYzMi00Nzg2LWE4NTctYmEzNWQ5YmEwMDc0IiwibmJmIjoxNzE5OTI0NDkzLCJleHAiOjE3NTEwMjg0OTMsImlhdCI6MTcxOTkyNDQ5M30.-rP1DT8LKk5jvBT_PpvaqFuUf_H6FhFiqAq9FM-34cw"
}
{
  "status": "ERROR",
  "error": "Invalid API Key"
}
All API requests must be made over HTTPS; calls made over plain HTTP will fail, as will API requests without authentication.

user-rights The API Key

The API key is a unique identifier associated with your Fatora account for integration purposes. To get the API key, please follow the below steps:

  1. Log in to your Fatora account, or sign up for new one.
  2. Click on the Integration link in the sidebar navigation.
integration

Do not share your API key with anyone or on any public platforms. This can pose security threats for your Fatora account. The API key should be protected the same way you would protect your password.

To test requests you could use general API key "E4B73FEE-F492-4607-A38D-852B0EBC91C9".

go-live Go Live:

You can change your account mode from "Test" to "Live" by following the below step:

  1. Choose the Integration from the sidebar navigation, then click on Settings.

live_mode

At the beginning the account will be in test mode, to go-live and enable online payment you would have to upgrade your account
technical-support

🛠️ Technical Support