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.
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"
}
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:
- Log in to your Fatora account, or sign up for new one.
- Click on the Integration link in the sidebar navigation.
Go Live:
You can change your account mode from "Test" to "Live" by following the below step:
-
Choose the Integration from the sidebar navigation, then click on Settings.
🛠️ Technical Support
- if you need any help you can check our help center, or contact support team