---
title: "Generates a pain file."
method: POST
path: "/payments/refundPayout"
tags: ["XS2A.pay"]
---

# Generates a pain file.

`POST /payments/refundPayout`

The payout & refund feature offers the possibility to initiate a payout or refund that are based on XS2A.pay transactions. A SEPA pain file is created that can be processed by your bank.

## Request body

- RefundPayout
  - `pain_type` 'pain.001.001.03', required — The format of pain file.
  - `batch_booking` boolean
  - `transactions` RefundPayoutTransactions[], required
    - `transaction` string, required — Internal XS2A transaction id. This id will be the same for the whole transaction.
    - `amount` number, float, required — The amount of a given payout or refund.
    - `type` 'refund' | 'payout', required — The type is payout or refund.

## Response `200`

Request successfully processed

- RefundPayoutResponse
  - `message_id` string, required — The message id to get the pain file.

## Other responses

- `401` — Authentication failed API key missing or not valid
- `403` — Forbidden Access blocked
- `404` — Product not enabled or Not found The requested object does not exist on the server
- `422` — Validation failed Something is wrong with the user input
- `500` — An internal server problem occurred

---

[API](https://skmtc.dev/xs2a/apis/xs2a-api.md) · [All operations](https://skmtc.dev/xs2a/apis/xs2a-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/xs2a/xs2a-api/revisions/ae5fbc5feee3/schema)
