# Record a refund `POST /api/v1/payments/{id}/refund` Records a full refund as an outgoing payment and marks the original incoming payment as refunded. ## Permissions Send your API key in `X-API-Key`. Required permissions are **Payments → Write**. ## Headers - `X-Sport-Id` (integer) — Send the sport ID when the payment belongs to a sport. ## Path parameters - `id` (integer, required) — ID of the payment. ## Body parameters - `payment_at_ts` (integer or date string or null) — Refund date. Defaults to today. Supply Unix seconds or a date. - `payment_method_id` (integer or null) — ID of the payment method. - `bank_account_id` (integer or null) — ID of the bank account. - `reason` (string or null) — Payment reason. This example refunds a workspace-wide payment. A sport-scoped refund requires access to that sport. ## Request Set ASDINCLOUD_API_KEY and any variables named in the example before running it. ```sh curl --request POST \ --url "https://api.asdincloud.com/api/v1/payments/${ID:?Set ID}/refund" \ --header "X-API-Key: $ASDINCLOUD_API_KEY" \ --header "X-Sport-Id: ${SPORT_ID:?Set SPORT_ID}" \ --header "Content-Type: application/json" \ --data '{"reason":"Registration refund"}' ``` ## Response **200 OK** Returns the refund payment. This records the transaction in the workspace. Example with fictional data and selected fields. ```json { "status": "success", "message": { "message_key": "entities.payment.messages.refunded" }, "data": { "id": 22, "payment_type": "outgoing", "status": "paid", "amount": 2500, "currency": "EUR", "metadata": { "parent_payment_id": 19 } } } ``` ## Errors - `401` — The API key is missing or invalid. - `403` — The API key lacks the required permission. - `400` — The supplied fields or payment state do not allow this action. - `404` — The requested record was not found.