---
title: "Record a payment or pre-issue credit against an invoice. payment_method=manual_bank_transfer requires ISSUED (records received funds); issue_credit allowed on DRAFT or ISSUED (write-off / pre-issue discount, requires `notes`). Idempotent on (invoice_id, external_reference)."
method: POST
path: "/api/v1/admin/invoices/{invoiceId}/payments"
tags: ["Invoice", "Admin"]
---

# Record a payment or pre-issue credit against an invoice. payment_method=manual_bank_transfer requires ISSUED (records received funds); issue_credit allowed on DRAFT or ISSUED (write-off / pre-issue discount, requires `notes`). Idempotent on (invoice_id, external_reference).

`POST /api/v1/admin/invoices/{invoiceId}/payments`

Record a payment or pre-issue credit against an invoice. payment_method=manual_bank_transfer requires ISSUED (records received funds); issue_credit allowed on DRAFT or ISSUED (write-off / pre-issue discount, requires `notes`). Idempotent on (invoice_id, external_reference).

## Path parameters

- `invoiceId` string, uuid, required

## Request body

- InvoiceRecordPaymentInput — Request body for POST /admin/invoices/:id/payments
  - `amount` string, required — Payment amount in the invoice currency
  - `currency` string, required — Must match the invoice currency
  - `payment_method` union, required — manual_bank_transfer for received funds; issue_credit for admin write-offs (requires `notes`)
    - 'manual_bank_transfer'
    - 'issue_credit'
  - `external_reference` string, nullable — Bank statement reference; idempotency key per (invoice_id, external_reference)
  - `paid_at` string, date-time, required — When the funds actually moved
  - `notes` string, nullable — Required when payment_method=issue_credit (the reason)

## 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

---

[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/versions/f86d2bdbcb08/schema)
