---
title: "Creates a draft invoice for a job."
method: POST
path: "/api/v1/invoices/from-job"
tags: ["Invoices"]
---

# Creates a draft invoice for a job.

`POST /api/v1/invoices/from-job`

## Request

- Base URL: `https://app.flexonthejob.com`
- URL: `https://app.flexonthejob.com/api/v1/invoices/from-job`
- Auth: HTTP bearer

Requires `ManageInvoices` and an `Idempotency-Key` header. Bills the job's
full price — or, once a finalized invoice exists, only its unbilled remainder (a
supplemental invoice). The job's down payment transfers onto the invoice; store credit
is applied when requested. Every omitted field defaults exactly as the Generate Invoice
page does. The result is a `Draft`: finalize it with
`POST /api/v1/invoices/{id}/mark-sent`, or discard it with
`DELETE /api/v1/invoices/{id}` (a pending draft blocks a second one).

## Request body

- CreateInvoiceFromJobRequest: Body of `POST /api/v1/invoices/from-job`. Only `jobId` is required; every omitted field defaults exactly as the Generate Invoice page does (number `INV-{jobNumber}` or `INV-{jobNumber}-{n}`, today, due date from the customer's payment terms, the job's tax rate, the organization's payment instructions). Amounts are never accepted: the subtotal and taxable portion come from the job — or, once a finalized invoice exists, from its unbilled remainder (a supplemental invoice).
  - `jobId` integer: Numeric id of the job to bill.
  - `invoiceNumber` string, nullable: Invoice number. Defaults to `INV-{jobNumber}`, or `INV-{jobNumber}-{n}` for the n-th invoice on the job.
  - `invoiceDate` string, date-time, nullable: Issue date (UTC, date part only). Defaults to today.
  - `dueDate` string, date-time, nullable: Due date (UTC, date part only). Defaults from the customer's payment terms; must not precede `invoiceDate`.
  - `taxRate` number, double, nullable: Tax rate percentage. Defaults to the job's rate; always 0 for a tax-exempt customer.
  - `terms` string, nullable: Payment terms text printed on the invoice. Defaults to the customer's terms (e.g. "Net 30").
  - `notes` string, nullable: Notes shown to the customer.
  - `paymentInstructions` string, nullable: Payment instructions printed on the invoice. Defaults to the organization's default instructions.
  - `applyStoreCredit` boolean: Apply `storeCreditToApply` of the customer's store credit to the new invoice.
  - `storeCreditToApply` number, double: Store credit amount to apply when `applyStoreCredit` is true (capped at the customer's balance and the invoice balance). Ignored otherwise.

## Response `201`

The new draft invoice; `Location` points at it.

- 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 job in the calling organization.
- `409`: The job cannot be invoiced (cancelled, estimate option not chosen), a draft is already pending, the invoice number is taken, or the key's creator is unknown on this server.
- `422`: Nothing left to bill, or `dueDate` precedes `invoiceDate`.
- `429`: Too Many Requests
- `500`: The invoice 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)
