Invoices

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

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}.

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

Path parameters

idinteger required

Numeric invoice id.

Request body

amountnumber double

Amount paid. May be 0 when only store credit is applied.

paymentDatestring date-time nullable

Payment date (UTC). Defaults to now.

paymentMethodstring nullable

How the customer paid, e.g. Cash, Check, CreditCard, Other. Required when amount is greater than 0.

referenceNumberstring nullable

Check number or transaction reference.

applyStoreCreditboolean

Apply storeCreditToApply of the customer's store credit to the invoice.

storeCreditToApplynumber double

Store credit amount to apply when applyStoreCredit is true (capped at the customer's balance and the balance due). Ignored otherwise.

Response

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

idinteger

Numeric id, usable in /api/v1/invoices/{id}.

syncIdstring uuid

Stable cross-device id; also the pagination cursor.

invoiceNumberstring

Human-readable invoice number, e.g. INV-1042.

status'Draft' | 'Sent' | 'Viewed' | 'PartiallyPaid' | 'Paid' | 'Overdue' | 'Cancelled' | 'Outstanding' | 'Consolidated'
customerIdinteger nullable

Billed customer id, if any.

customerNamestring nullable

Billed customer name, if any.

jobIdinteger nullable

Job the invoice bills, if any.

jobNumberstring nullable

Job number, if any.

salesOrderIdinteger nullable

Sales order the invoice bills, if any.

descriptionstring nullable

Optional description.

invoiceDatestring date-time

Issue date, ISO-8601 UTC at midnight, e.g. 2026-09-05T00:00:00Z.

dueDatestring date-time

Due date, ISO-8601 UTC at midnight, e.g. 2026-10-05T00:00:00Z.

subtotalnumber double

Sum of lines before tax.

taxAmountnumber double

Tax charged.

totalnumber double

Subtotal plus tax.

amountPaidnumber double

Payments applied.

storeCreditAppliednumber double

Store credit applied.

balanceDuenumber double

Total minus payments and store credit.

isConsolidatedboolean

True when this invoice consolidates other invoices.

consolidatedIntoInvoiceIdinteger nullable

Id of the consolidated invoice that absorbed this one, if any.

sentDatestring date-time nullable

When the invoice was first sent, ISO-8601 UTC (e.g. 2026-09-05T14:30:00Z); null if never sent.

paidDatestring date-time nullable

When the invoice was paid in full, ISO-8601 UTC; null until paid.

createdAtstring date-time

Creation time, ISO-8601 UTC.

updatedAtstring date-time nullable

Last modification time, ISO-8601 UTC; null when never edited. Use with the updatedSince filter to poll for changes.

Changes

No recorded changes to this operation across all 1 revision of this API.