---
title: "Create a draft invoice for a merchant over a (period, currency) window. Claims eligible transactions atomically; pre-settled fees produce an immediately_settled payment row."
method: POST
path: "/api/v1/admin/invoices"
tags: ["Invoice", "Admin"]
---

# Create a draft invoice for a merchant over a (period, currency) window. Claims eligible transactions atomically; pre-settled fees produce an immediately_settled payment row.

`POST /api/v1/admin/invoices`

Create a draft invoice for a merchant over a (period, currency) window. Claims eligible transactions atomically; pre-settled fees produce an immediately_settled payment row.

## Request body

- InvoiceCreateInput — Request body for POST /admin/invoices
  - `merchant_id` string, uuid, required
  - `period_start` string, date, required — UTC date, inclusive
  - `period_end` string, date, required — UTC date, exclusive
  - `currency` string, required — ISO-4217 invoice currency (defaults to merchant home currency)
  - `notes` string, nullable

## Response `201`

Created

- InvoiceResponse — Response containing a single invoice
  - `success` boolean, required — Indicates if the request was successful
  - `data` object, required — A claim over a set of fees billed to a merchant
    - `id` string, uuid, required
    - `invoice_number` string, required — Per-merchant monthly sequence (e.g. INV-202605-000123)
    - `payment_reference` string, required — 12-character payment reference for bank statements
    - `merchant_id` string, uuid, required
    - `status` union, required — Lifecycle status of the invoice
      - 'draft'
      - 'issued'
      - 'paid'
      - 'void'
    - `currency` string, required — Currency of the invoice
    - `period_start` string, date, required — UTC period start (inclusive)
    - `period_end` string, date, required — UTC period end (exclusive)
    - `total_amount` string, required — Gross billable fees in invoice currency
    - `amount_paid` string, required — Sum of recorded invoice payments
    - `outstanding_amount` string, required — Server-computed total_amount − amount_paid. Use this instead of deriving outstanding client-side.
    - `transaction_count` number, required — Number of transactions claimed by this invoice
    - `due_date` string, date, nullable, required
    - `issued_at` string, date-time, nullable, required
    - `issued_by_user_id` string, uuid, nullable, required
    - `paid_at` string, date-time, nullable, required
    - `voided_at` string, date-time, nullable, required
    - `voided_reason` string, nullable, required
    - `voided_by_user_id` string, uuid, nullable, required
    - `notes` string, nullable, required
    - `created_by_user_id` string, uuid, nullable, required
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
    - `payments` object[], required
      - `id` string, uuid, required
      - `amount` string, required — Payment amount in the invoice currency
      - `currency` string, required — Currency of the payment
      - `payment_method` union, required — How a payment against an invoice was recorded
        - 'manual_bank_transfer'
        - 'immediately_settled'
        - 'issue_credit'
      - `external_reference` string, nullable, required — Bank statement reference or similar correlation key; null for system-inserted
      - `paid_at` string, date-time, required
      - `recorded_by_user_id` string, uuid, nullable, required
      - `recorded_at` string, date-time, required
      - `notes` string, nullable, required
    - `fx_rates` object[], required — FX rate snapshot captured at issue time, one row per source currency
      - `source_currency` string, required — The fee currency the rate converts FROM
      - `rate` string, required — Multiplier applied to convert from source_currency to the invoice currency
      - `captured_at` string, date-time, required — Provider's data-freshness timestamp (rate age)
      - `fetched_at` string, date-time, nullable, required — When our service called the FX provider to lock this rate. Null for rows created before this column existed.
      - `provider` string, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found
- `409` — Response
- `422` — Response

---

[API](https://skmtc.net/banqzinc/apis/quidkey-api.md) · [All operations](https://skmtc.net/banqzinc/apis/quidkey-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/banqzinc/quidkey-api/revisions/f86d2bdbcb08/schema)
