This guide covers everything you need to get started with the FarPay API, including obtaining your API key and understanding request requirements.
Quick Start
Generating an API Key
To access FarPay's API, you need to generate an API key:
- Log in to your FarPay account.
- Navigate to Settings → API Access.
- Click Generate.
- 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:
|
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.
Core Concepts
Resource | Description | Endpoint | Status |
---|---|---|---|
Customers | Manage customer information and payment agreements | /customers | |
Orders | Create payment flows and agreements | /orders | |
Invoices | Generate and manage invoices | /invoices | |
Payments | Track payment history and process refunds | /payments | |
Agreements | Manage recurring payment instruments | /agreements | |
Subscriptions | Handle subscription-based recurring payments | /subscriptions | Deprecated |
Payment Sets | Access aggregated payment information | /paymentsets | |
Deliveries | Upload files for batch processing | /deliveries |
Payment Methods Supported
- MobilePay - Mobile payment solution
- Cards - Visa, MasterCard, Dankort
- Betalingsservice - Direct debit for private customers
- Leverandørservice - Direct debit for businesses
Date Formats
- Input dates:
YYYY-MM-DD
- Response dates:
YYYY-MM-DDTHH:mm:ssZ