# FarPay API Documentation

Welcome to the FarPay API documentation. This comprehensive guide will help you integrate with FarPay's payment processing platform to handle invoices, payments, customer management, and recurring payment agreements.

## Quick Start

1. **Get your API key** from the [FarPay web application](https://app.farpay.io/pages/settings.aspx)
2. **Test the API** using our [interactive documentation](https://api.farpay.io/docs)
3. **Review examples** in our [integration examples](examples.md)

## Base URL

```
https://api.farpay.io/v2
```

## Authentication

All API requests require an API key in the header:

```
X-API-KEY: your-api-key-here
Accept: application/json
```

## Core Concepts

| Resource         | Description                                        | Endpoint       |
| ---------------- | -------------------------------------------------- | -------------- |
| **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`  |
| **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`

## Getting Help

* **API Testing**: Use our [interactive documentation](https://api.farpay.io/docs)
* **Support**: Contact us through [our website](https://farpay.io)
* **Examples**: Check our [integration examples](examples.md)

***

## Documentation Sections

### [Authentication & Setup](authentication/authentication.md)

Learn how to obtain and use your API key, understand request headers, and get started with the API.

### [Customers](customers/customers.md)

Manage customer information, create payment agreements, and handle customer data.

### [Orders](orders/orders.md)

Create payment flows, manage user interactions, and handle payment agreements.

### [Invoices](invoices/invoices.md)

Generate invoices, track payment status, and manage invoice lifecycle.

### [Invoice Extensions](invoices/invoice-extensions.md)

Configure invoice delivery behavior and payment flow overrides using the Invoice Delivery Extension.

### [Invoice Sending](invoice-sending.md)

Configure how invoices are sent to customers using different channels and scheduling options.

### [Invoice Refunds](invoices/invoice-refunds.md)

Process refunds for paid invoices using the refund endpoint.

### [Instant Payments](installments/instant-payments.md)

Process immediate card payments when creating invoices using the `schedulePayment=Instant` parameter.

### [Payments](payments/payments.md)

View payment history, process refunds, and track payment status.

### [Agreements](agreements/agreements.md)

Manage recurring payment instruments and payment agreements.

### [Payment Sets](paymentsets/payment-sets.md)

Access aggregated payment information for reconciliation and reporting.

### [Deliveries](deliveries/deliveries.md)

Upload files for batch processing and file-based integrations.

### [Bill Deliveries](deliveries/bill-deliveries.md)

Upload bill files for batch processing using the FarPay Bill format, including Overførselsservice (OS) bills.

### [Settings & Metadata](settings/settings.md)

Access API version information and system metadata.

### [Examples](deliveries/delivery/examples.md)

Complete integration examples and use case scenarios.

### [Release Notes](release-notes.md)

Latest updates and changes to the API.