# Refunds

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 /refunds

Refund all or part of a payment.

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

| Field | Type | Description |
| --- | --- | --- |
| `payment_id` | string | Required. The payment to refund, for example pay_123. |
| `amount_minor` | integer | Optional. Partial refund amount in minor units. Leave it out to refund the full amount. |

| Header | Description |
| --- | --- |
| `Idempotency-Key` | Required. |



