Authentication

Authenticate your API calls by including your secret key in the Authorization header of each request you initiate. You can oversee and manage your API keys directly from FanitePay dashboard.

Test vs Live Environment

Environment

The FanitePay API caters to both Live and Test environments. It’s essential to grasp that the test environment is solely intended for testing purposes and employs simulated data. Conversely, the live environment supports real integrations and operational data.

Accounts generated in the test environment cannot be transferred to the live environment due to the inherent differences between these environments. As a result, you’ll encounter discrepancies in business IDs, API keys, and other pertinent identifiers.

Listed below are the URLs for the environments we support:

Test Environment URL: [https://sandbox.fanitepay.com]

Live Environment URL: [https://api.fanitepay.com]

API keys

When you sign up for a FanitePay account, you receive three types of API keys:

  • Secret key:

    The most potent type of key is granted, capable of authorizing any action within your account. It’s paramount to safeguard this key from public exposure.

  • Public key:

    This key is intended for ‘public’ scenarios, like in front-end JavaScript code (e.g., FanitePay Inline).

  • Encryption key

Retrieving your API Keys

Your API keys are crucial for successfully making requests to our servers.

  • Log into your FanitePay dashboard.

  • Navigate to Settings

  • To view and copy your keys, navigate to the Developers section of the menu and select API Keys. To secure your live transactions, we mask them so no one can have access to them.

    Secure your secret key

    If you suspect that your keys might have been compromised (e.g., accidentally committed to Git), it’s imperative to generate new ones promptly. You can do this by accessing the Generate new keys button located on the Settings > API page within your dashboard.

Authorizing API calls

Authentication is required for all API calls on FanitePay. Requests made without proper authorization will result in a status code 401: Unauthorized.

To authorize API calls from your server, include your secret key as a bearer token. This involves adding an Authorization header with a value of 'Bearer: YOUR_SECRET_KEY'.

Node.js
const response = await got.post("https://sandbox.fanitepay.com/", {
headers: {
Authorization: `Bearer ${process.env.FNTPSECK_TEST}`
},
json: {
// Your payload
}
});