---
title: "Records a payment and/or applies store credit to an invoice."
method: POST
path: "/api/v1/invoices/{id}/payments"
tags: ["Invoices"]
---

# Records a payment and/or applies store credit to an invoice.

`POST /api/v1/invoices/{id}/payments`

## Request

- Base URL: `https://app.flexonthejob.com`
- URL: `https://app.flexonthejob.com/api/v1/invoices/{id}/payments`
- Auth: HTTP bearer

Requires `ManageInvoices` and an `Idempotency-Key` header. Same rules as the
Record Payment dialog: at least one of `amount` or store credit is required, a
payment needs a `paymentMethod`, and the total may not exceed the balance due
(extra money belongs in store credit, not on the invoice). Only a finalized invoice
takes payments — a draft must be marked sent first; a consolidated member is paid
through the consolidated invoice. The invoice moves to `PartiallyPaid` or
`Paid` (which fires `invoice.paid`), and the job's or sales order's payment
status follows. Returns the updated invoice; the payment itself appears in
`GET /api/v1/invoices/{id}`.

## Path parameters

- `id` integer, required

## Request body

- RecordPaymentApiRequest: Body of `POST /api/v1/invoices/{id}/payments`. Records a payment and/or applies store credit to a finalized invoice — the same rules as the Record Payment dialog: at least one of `amount` or store credit is required, a payment needs a `paymentMethod`, and the total may not exceed the balance due (extra money belongs in store credit, not on the invoice).
  - `amount` number, double: Amount paid. May be 0 when only store credit is applied.
  - `paymentDate` string, date-time, nullable: Payment date (UTC). Defaults to now.
  - `paymentMethod` string, nullable: How the customer paid, e.g. `Cash`, `Check`, `CreditCard`, `Other`. Required when `amount` is greater than 0.
  - `referenceNumber` string, nullable: Check number or transaction reference.
  - `applyStoreCredit` boolean: Apply `storeCreditToApply` of the customer's store credit to the invoice.
  - `storeCreditToApply` number, double: Store credit amount to apply when `applyStoreCredit` is true (capped at the customer's balance and the balance due). Ignored otherwise.

## Response `200`

The invoice after the payment (status, `amountPaid`, `balanceDue`).

- InvoiceSummary: Invoice header as listed by `GET /api/v1/invoices`. Timestamps are ISO-8601 UTC (`2026-09-05T14:30:00Z`).
  - `id` integer: Numeric id, usable in `/api/v1/invoices/{id}`.
  - `syncId` string, uuid: Stable cross-device id; also the pagination cursor.
  - `invoiceNumber` string: Human-readable invoice number, e.g. `INV-1042`.
  - `status` 'Draft' | 'Sent' | 'Viewed' | 'PartiallyPaid' | 'Paid' | 'Overdue' | 'Cancelled' | 'Outstanding' | 'Consolidated'
  - `customerId` integer, nullable: Billed customer id, if any.
  - `customerName` string, nullable: Billed customer name, if any.
  - `jobId` integer, nullable: Job the invoice bills, if any.
  - `jobNumber` string, nullable: Job number, if any.
  - `salesOrderId` integer, nullable: Sales order the invoice bills, if any.
  - `description` string, nullable: Optional description.
  - `invoiceDate` string, date-time: Issue date, ISO-8601 UTC at midnight, e.g. `2026-09-05T00:00:00Z`.
  - `dueDate` string, date-time: Due date, ISO-8601 UTC at midnight, e.g. `2026-10-05T00:00:00Z`.
  - `subtotal` number, double: Sum of lines before tax.
  - `taxAmount` number, double: Tax charged.
  - `total` number, double: Subtotal plus tax.
  - `amountPaid` number, double: Payments applied.
  - `storeCreditApplied` number, double: Store credit applied.
  - `balanceDue` number, double: Total minus payments and store credit.
  - `isConsolidated` boolean: True when this invoice consolidates other invoices.
  - `consolidatedIntoInvoiceId` integer, nullable: Id of the consolidated invoice that absorbed this one, if any.
  - `sentDate` string, date-time, nullable: When the invoice was first sent, ISO-8601 UTC (e.g. `2026-09-05T14:30:00Z`); null if never sent.
  - `paidDate` string, date-time, nullable: When the invoice was paid in full, ISO-8601 UTC; null until paid.
  - `createdAt` string, date-time: Creation time, ISO-8601 UTC.
  - `updatedAt` string, date-time, nullable: Last modification time, ISO-8601 UTC; null when never edited. Use with the `updatedSince` filter to poll for changes.

## Other responses

- `400`: Malformed body or out-of-range value.
- `401`: Unauthorized
- `403`: Forbidden
- `404`: No such invoice in the calling organization.
- `409`: The invoice is a draft or was consolidated into another invoice, or the key's creator is unknown on this server.
- `422`: Nothing to apply, a payment without a method, or the payment exceeds the balance due.
- `429`: Too Many Requests
- `500`: The payment could not be saved.

---

[API](https://skmtc.dev/flexonthejob/apis/flex-api.md) · [All operations](https://skmtc.dev/flexonthejob/apis/flex-api/llms.txt) · [OpenAPI document](https://skmtc.dev/flexonthejob/apis/flex-api/revisions/19c8f4d27acf?raw)
