---
title: "Create Payment Batch"
method: POST
path: "/companies/{company_id}/payment-batches"
tags: ["payments"]
---

# Create Payment Batch

`POST /companies/{company_id}/payment-batches`

## Request

- Base URL: `https://app.zeno-works.ch` (the document declares no server; this is the origin it was published from)
- URL: `https://app.zeno-works.ch/companies/{company_id}/payment-batches`
- Auth: none declared

Render + persist a draft pain.001 batch from the selected payables.

201 → the draft batch (nothing downloadable yet — submit + approve first).
422 ``{"msg": "..."}`` listing ALL offenders on any invalid/ineligible item,
bad debtor, or empty selection.

## Path parameters

- `company_id` string, required

## Headers

- `authorization` string, nullable

## Cookies

- `access_token` string, nullable

## Request body

- ApPaymentBatchCreate: ``POST /companies/{id}/payment-batches`` body (member) — create a draft. The pain.001 is rendered + blobstored immediately; the selection rules are the old payment-file ones (422 with every offender in one ``msg``).
  - `item_ids` string[], required
  - `debtor_bank_account_id` string, required
  - `execution_date` string, date, nullable

## Response `201`

Successful Response

- ApPaymentBatchOut: A persisted AP pain.001 batch + its approval audit trail.
  - `id` string, required
  - `company_id` string, required
  - `debtor_bank_account_id` string, required
  - `status` 'draft' | 'pending_approval' | 'approved' | 'exported' | 'cancelled', required: AP payment batch approval lifecycle (doc/pipeline.md §"Exports (accounting hand-off)"). ``draft → pending_approval → approved → exported`` (+ cancel from draft/pending/approved — ZENO-231; ``exported`` is final). Rejection is a *transition* back to ``draft``, not a state — the ``rejected_*`` audit columns record the last rejection. The XML is downloadable only in ``approved``/``exported``; the first download stamps ``approved → exported``.
  - `execution_date` string, date, required
  - `msg_id` string, required
  - `nb_of_txs` integer, required
  - `ctrl_sum` string, required
  - `filename` string, required
  - `created_by` string, nullable
  - `created_at` string, date-time, required
  - `submitted_by` string, nullable
  - `submitted_at` string, date-time, nullable
  - `approved_by` string, nullable
  - `approved_at` string, date-time, nullable
  - `rejected_by` string, nullable
  - `rejected_at` string, date-time, nullable
  - `reject_reason` string, nullable
  - `exported_by` string, nullable
  - `exported_at` string, date-time, nullable
  - `cancelled_by` string, nullable
  - `cancelled_at` string, date-time, nullable
  - `items` ApPaymentBatchItemOut[]
    - `id` string, required
    - `item_id` string, nullable
    - `creditor_name` string, required
    - `iban` string, required
    - `amount` string, required
    - `currency` string, required
    - `instr_id` string, required
    - `end_to_end_id` string, required
    - `first_time_supplier` boolean

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/zeno-works/apis/zeno-api.md) · [All operations](https://skmtc.dev/zeno-works/apis/zeno-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zeno-works/apis/zeno-api/revisions/1eb93dde146c?raw)
