# Introduction

## 👋 Welcome to the Alternative Payments API

The Alternative Payments API lets you create and manage customers, issue invoices, collect payments, track transactions, and reconcile payouts, all through secure, RESTful endpoints. It’s designed for partners, MSPs, and platforms that want to integrate billing and payment operations directly into their own systems.

***

## 🔧 What you can do with the API ?

Use the Alternative Payments API to create and manage customers and invoices, generate one-time payment links, track transactions, and reconcile payouts. It follows a simple OAuth 2.0 client-credentials flow and returns JSON over HTTPS.

* **One-off checkout experiences.** Create a Payment Request, share the hosted link, redirect users back to your app, and poll for status. [Payment Request](https://docs.alternativepayments.io/broken-reference)
* **Invoice-based payments.** Create invoices with line items, fetch a hosted payment link for the invoice, and download a signed PDF URL. [Invoices](https://docs.alternativepayments.io/broken-reference)
* **Customer management.** Create customers, list and fetch them, archive when needed, list payment methods, and manage customer users. [Customers](https://docs.alternativepayments.io/broken-reference)
* **Transaction history.** List payments with filters like type, status, customer, invoice, and method. [Transactions](https://docs.alternativepayments.io/broken-reference)
* **Payout reconciliation.** List payouts, fetch a payout by ID, and retrieve the transactions that rolled into a payout. [Payouts](https://docs.alternativepayments.io/broken-reference)

***

## :question:How does it work?

* **Protocol:** REST over HTTPS
* **Format:** JSON requests and responses
* **Auth:** OAuth 2.0 client credentials flow using API keys

{% hint style="warning" %}

### <mark style="color:$primary;">Authentication</mark>

1. Generate an [API key in the Partner Dashboard](https://docs.alternativepayments.io/getting-started/quick-start/api-keys).
2. Exchange it for an access token using the `client_credentials` grant.
3. Include `Authorization: Bearer <token>` in every request.\
   Tokens expire as indicated by `expires_in` and are scoped per environment.
   {% endhint %}

{% hint style="warning" %}

### Pagination & filters

Most list endpoints use **cursor-based pagination** with `after`, `before`, `start_cursor`, and `end_cursor`. Filters vary by endpoint (status, date, type, customer ID, etc.).
{% endhint %}

{% hint style="warning" %}

### Errors & limits

* Standard HTTP status codes with JSON error objects
* Rate limit: **5 requests/sec** per API key
* Handle 429s with exponential backoff
  {% endhint %}

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.alternativepayments.io/readme.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
