Generate a payment batch's SEPA file
POST/api/v1/payment_batches/:id/sepa_export
Generates the pain.001 file of an approved sepa_file batch through the same approval, reservation and single-attempt controls as the payment centre, and returns the export resource. A 202 never means a payment was executed - the batch reads submitted once the file is handed over, and only its instructions' status report what the bank did. A batch whose export was already requested is never generated again: the call answers the existing export, whatever expected_version it carries. The optional expected_version is the payment centre's version control: a batch that changed since you read it is refused rather than generated.
Request
Responses
- 202
- 403
- 404
- 409
- 422
The export resource. Poll GET on the same path until state is available.
The token does not hold the write scope.
No payment batch with this id is reachable by the token's grants.
stale_version: the expected_version you sent is no longer the batch's current one. NOTHING WAS GENERATED. details carries the current version and batch, so re-render from it and retry with details.current_version. A batch whose export already exists answers 202 with it instead, whatever version you send. idempotency_key_reuse and idempotency_request_in_progress also answer 409, with no details.
The request was refused. code says why: validation_failed - the Idempotency-Key header is missing, expected_version is not an integer, or the batch fails pain.001 business validation (details names the failing rules and instructions); batch_not_submittable - the batch is not approved, its channel is hosted_consent, its handover attempt ended without a file, or a handover attempt is still running without an export (retry shortly: message says which).