# Payments

Generated from the OpenAPI spec: [openapi.json](https://asergaz.github.io/aikloop-demo/after/openapi.json)

Base URL: `https://api.aikloop.example/v3`

Send your secret key as a Bearer token in the Authorization header: Authorization: Bearer sk_live_... (or sk_test_... in test mode).

## POST /payments

Create a payment.

Request body: form-encoded (`application/x-www-form-urlencoded`).

| Field | Type | Description |
| --- | --- | --- |
| `amount_minor` | integer | Required. Amount in the currency's minor unit, for example 1050 for 10.50 EUR. |
| `currency` | string | Required. Three-letter ISO code, lowercase. No default. |
| `payment_method` | string | Required. Payment method ID from AIKloop.js, for example pm_123. |

| Header | Description |
| --- | --- |
| `Idempotency-Key` | Required. A unique value, such as a UUID v4. Retry a failed request with the same key. Keys are kept for 24 hours. |

## GET /payments

List payments, newest first.

| Field | Type | Description |
| --- | --- | --- |
| `limit` | integer | 1 to 100. Default 10. |
| `starting_after` | string | ID of the last object from the previous page. |



