Authorization Guide

Overview

FarPay uses API key-based authentication to secure access to its API. This guide outlines how to generate and use the API key, as well as best practices and common errors.

Generating an API Key

To access FarPay's API, you need to generate an API key:

  1. Log in to your FarPay account.
  2. Navigate to Settings → API Access.
  3. Click Generate.
  4. Save the generated key securely — you will use it to authenticate your API requests.

Common for all requests

All requests must comply to following terms.

Term

Description

API Key

A key - the identifyer, that is added to the header of each request in FarPay API

Accept

The accept term in the header, asks the API to deliver the results in a given format. Available formats are:

  • application/json
  • application/xml

Using the API Key

To authenticate your request, include the API key in the X-API-KEY header of your HTTP request. Here’s an example using curl:

`curl -X GET \
  --header 'Accept: application/json' \
  --header 'X-API-KEY: {api-key}' \
  'https://api.farpay.io/v2/customers'

Replace {api-key} with your actual API key.

Error Handling

If the provided API key is invalid or unauthorized, the API will return the following error message:

{
  "Message": "9000::X-API-KEY is not authenticated"
}

Possible Reasons

Possible Reasons:

  • The API key has been deleted.
  • The API key has been regenerated, and you're using an old one.

Best Practices

Although API keys do not expire, it is recommended to rotate them at least every 6 months.

Store your API keys securely and avoid exposing them in public code or logs.

Remove any unused or compromised keys from the FarPay dashboard immediately.