Source: https://billingmart.com/developers/api/invoices # Invoices Drafts, lines, deposits, progress billing and reminders. Every write here produces or edits a draft; sending is an action, approved by a person or the owner’s capped rule. [All sections](https://billingmart.com/developers/api) [Authentication](https://billingmart.com/developers/authentication) **On this page** - GET List - POST Create draft - GET Get - PATCH Update draft - POST Create from job - POST Set job - POST Draft - POST Add line - DELETE Remove line - POST Add sources - GET Pdf - POST Create deposit - POST Create progress - POST Create retainage release - GET List - POST Create - GET Get - PATCH Update - GET Validate intake - GET Get overview - GET Get payables - GET List billing - GET Preview delete - GET Tree - POST Move - POST Set contract total - POST Set stage - POST Assign - POST Set next action - POST Close - POST Reopen - POST Discard - GET Activity - POST Notes - GET Messages - POST Messages - POST Documents - GET Documents - POST Documents - GET Documents - PATCH Documents - DELETE Documents - GET Adjustments - POST Adjustments - GET Adjustments - PATCH Adjustments - DELETE Adjustments - GET Preview - GET Ledger - GET Pay link status - POST Discard - POST Set dunning paused - POST Propose ladder - OBJ Invoice - OBJ PdfPreview - OBJ JobSummary - OBJ Job - OBJ JobIntakeValidation - OBJ JobOverview - OBJ JobPayables - OBJ JobBilling - OBJ JobDeletePlan - OBJ JobLogEntry - OBJ Message - OBJ JobDocument - OBJ JobDocumentUrl - OBJ JobAdjustment - OBJ UnbilledPreview - OBJ LedgerEntry - OBJ PayLinkStatus On this page - GET List - POST Create draft - GET Get - PATCH Update draft - POST Create from job - POST Set job - POST Draft - POST Add line - DELETE Remove line - POST Add sources - GET Pdf - POST Create deposit - POST Create progress - POST Create retainage release - GET List - POST Create - GET Get - PATCH Update - GET Validate intake - GET Get overview - GET Get payables - GET List billing - GET Preview delete - GET Tree - POST Move - POST Set contract total - POST Set stage - POST Assign - POST Set next action - POST Close - POST Reopen - POST Discard - GET Activity - POST Notes - GET Messages - POST Messages - POST Documents - GET Documents - POST Documents - GET Documents - PATCH Documents - DELETE Documents - GET Adjustments - POST Adjustments - GET Adjustments - PATCH Adjustments - DELETE Adjustments - GET Preview - GET Ledger - GET Pay link status - POST Discard - POST Set dunning paused - POST Propose ladder - OBJ Invoice - OBJ PdfPreview - OBJ JobSummary - OBJ Job - OBJ JobIntakeValidation - OBJ JobOverview - OBJ JobPayables - OBJ JobBilling - OBJ JobDeletePlan - OBJ JobLogEntry - OBJ Message - OBJ JobDocument - OBJ JobDocumentUrl - OBJ JobAdjustment - OBJ UnbilledPreview - OBJ LedgerEntry - OBJ PayLinkStatus invoices ## List GET `/v1/invoices` List invoices, newest first. A discarded draft is left out unless discarded=true. Scope `invoices:read` Effect Read only MCP tool `list_invoices` Retries Safe to repeat ### Parameters List parameters | Name | In | Type | Notes | | --- | --- | --- | --- | | `limit`optional | query | `integer` | min 1 · max 50 | | `cursor`optional | query | `string` | up to 256 chars | | `status`optional | query | `enum` | One of `draft`, `sent`, `viewed`, `partiallyPaid`, `paid`, `overdue`, `void`, `uncollectible` | | `clientId`optional | query | `id` | — | | `discarded`optional | query | `boolean` | — | ### Returns `data`: [`Invoice[]`](https://billingmart.com/developers/api/invoices#object-Invoice) . Pass `meta.cursor` back as `cursor` for the next page. Example request Sample ``` curl -X GET "https://api.billingmart.com/v1/invoices" \ -H "Authorization: Bearer $BILLINGMART_API_KEY" ``` invoices ## Create draft POST `/v1/invoices` Create a DRAFT invoice. Never a send. Scope `invoices:write` Effect Writes a draft or record MCP tool `create_draft_invoice` Retries Send an Idempotency-Key; a repeat replays the stored answer for 24 hours ### Request body JSON. Money is an integer count of minor units beside its currency; quantities are thousandths. Create draft request body | Field | Type | Notes | | --- | --- | --- | | `businessId`required | `id` | — | | `clientId`required | `id` | — | | `currency`optional | `Currency` | — | | `language`optional | `string` | up to 8 chars | | `lineItems[]`optional | `object[]` | up to 200 items | | `lineItems[].id`optional | `id` | — | | `lineItems[].description`optional | `string` | What the line is for. Optional with a presetKey (the item’s name is used). — up to 2000 chars | | `lineItems[].quantityMilli`optional | `integer` | Quantity in thousandths: 1000 is one unit, 1500 is 1.5 hours. Defaults to 1000. | | `lineItems[].rateBasis`optional | `enum` | How the price applies: fixed for one flat charge, hourly, daily, perUnit, percentage… Optional with a presetKey. — One of `fixed`, `hourly`, `daily`, `weekly`, `monthly`, `perUnit`, `perMile`, `perKilometre`, `percentage` | | `lineItems[].unitPrice`optional | `object` | Price per unit in integer minor units of the document currency ($5,000.00 is 500000). | | `lineItems[].unitPrice.minorUnits`required | `integer` | — | | `lineItems[].unitPrice.currency`required | `Currency` | — | | `lineItems[].rateBasisPoints`optional | `integer` | — | | `lineItems[].taxTreatment`optional | `string` | — | | `lineItems[].taxRateBasisPoints`optional | `integer` | — | | `lineItems[].discountBasisPoints`optional | `integer` | — | | `lineItems[].presetKey`optional | `string` | The key of one of the business’s products and services (get_business_context lists them); the server fills what the line leaves out. — up to 64 chars | | `customFields`optional | `object` | — | | `notes`optional | `string` | up to 4000 chars | | `internalNotes`optional | `string` | up to 4000 chars | | `terms`optional | `string` | up to 4000 chars | | `poNumber`optional | `string` | up to 64 chars | | `issueDate`optional | `string` | matches `^\d{4}-\d{2}-\d{2}$` | | `dueDate`optional | `string` | matches `^\d{4}-\d{2}-\d{2}$` | | `templateId`optional | `id` | — | | `feeOverride`optional | `object \| null` | — | | `merchantAccountId`optional | `id \| null` | — | ### Returns `data`: `object` Example request Sample ``` curl -X POST "https://api.billingmart.com/v1/invoices" \ -H "Authorization: Bearer $BILLINGMART_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"businessId":"","clientId":""}' ``` invoices ## Get GET `/v1/invoices/{invoiceId}` One invoice with lines and totals. Scope `invoices:read` Effect Read only MCP tool `get_invoice` Retries Safe to repeat ### Parameters Get parameters | Name | In | Type | Notes | | --- | --- | --- | --- | | `invoiceId`required | path | `id` | — | ### Returns `data`: [`Invoice`](https://billingmart.com/developers/api/invoices#object-Invoice) Example request Sample ``` curl -X GET "https://api.billingmart.com/v1/invoices/{invoiceId}" \ -H "Authorization: Bearer $BILLINGMART_API_KEY" ``` invoices ## Update draft PATCH `/v1/invoices/{invoiceId}` Update a DRAFT invoice’s lines, fields and notes. Scope `invoices:write` Effect Writes a draft or record MCP tool `update_draft_invoice` Retries No Idempotency-Key on this route ### Parameters Update draft parameters | Name | In | Type | Notes | | --- | --- | --- | --- | | `invoiceId`required | path | `id` | — | ### Request body JSON. Money is an integer count of minor units beside its currency; quantities are thousandths. Update draft request body | Field | Type | Notes | | --- | --- | --- | | `expectedUpdatedAt`optional | `string` | up to 40 chars | | `lineItems[]`optional | `object[]` | up to 200 items | | `lineItems[].id`optional | `id` | — | | `lineItems[].description`optional | `string` | What the line is for. Optional with a presetKey (the item’s name is used). — up to 2000 chars | | `lineItems[].quantityMilli`optional | `integer` | Quantity in thousandths: 1000 is one unit, 1500 is 1.5 hours. Defaults to 1000. | | `lineItems[].rateBasis`optional | `enum` | How the price applies: fixed for one flat charge, hourly, daily, perUnit, percentage… Optional with a presetKey. — One of `fixed`, `hourly`, `daily`, `weekly`, `monthly`, `perUnit`, `perMile`, `perKilometre`, `percentage` | | `lineItems[].unitPrice`optional | `object` | Price per unit in integer minor units of the document currency ($5,000.00 is 500000). | | `lineItems[].unitPrice.minorUnits`required | `integer` | — | | `lineItems[].unitPrice.currency`required | `Currency` | — | | `lineItems[].rateBasisPoints`optional | `integer` | — | | `lineItems[].taxTreatment`optional | `string` | — | | `lineItems[].taxRateBasisPoints`optional | `integer` | — | | `lineItems[].discountBasisPoints`optional | `integer` | — | | `lineItems[].presetKey`optional | `string` | The key of one of the business’s products and services (get_business_context lists them); the server fills what the line leaves out. — up to 64 chars | | `customFields`optional | `object` | — | | `notes`optional | `string` | up to 4000 chars | | `internalNotes`optional | `string` | up to 4000 chars | | `terms`optional | `string` | up to 4000 chars | | `poNumber`optional | `string` | up to 64 chars | | `issueDate`optional | `string` | matches `^\d{4}-\d{2}-\d{2}$` | | `dueDate`optional | `string` | matches `^\d{4}-\d{2}-\d{2}$` | | `templateId`optional | `id \| null` | — | | `feeOverride`optional | `object \| null` | — | | `merchantAccountId`optional | `id \| null` | — | ### Returns `data`: [`Invoice`](https://billingmart.com/developers/api/invoices#object-Invoice) Errors this route can answer besides the shared ones: `ACTION_PENDING_ON_TARGET` , `NOT_A_DRAFT` . Example request Sample ``` curl -X PATCH "https://api.billingmart.com/v1/invoices/{invoiceId}" \ -H "Authorization: Bearer $BILLINGMART_API_KEY" ``` invoices ## Create from job POST `/v1/jobs/{jobId}/invoices` Create a DRAFT invoice from a work record: its client, business and currency, linked to the record, with the answers its type maps onto the invoice’s fields. Never a send. Scope `invoices:write` Effect Writes a draft or record MCP tool `create_invoice_from_job` Retries Send an Idempotency-Key; a repeat replays the stored answer for 24 hours ### Parameters Create from job parameters | Name | In | Type | Notes | | --- | --- | --- | --- | | `jobId`required | path | `id` | — | ### Request body JSON. Money is an integer count of minor units beside its currency; quantities are thousandths. Create from job request body | Field | Type | Notes | | --- | --- | --- | | `lineItems[]`optional | `object[]` | up to 200 items | | `lineItems[].id`optional | `id` | — | | `lineItems[].description`optional | `string` | What the line is for. Optional with a presetKey (the item’s name is used). — up to 2000 chars | | `lineItems[].quantityMilli`optional | `integer` | Quantity in thousandths: 1000 is one unit, 1500 is 1.5 hours. Defaults to 1000. | | `lineItems[].rateBasis`optional | `enum` | How the price applies: fixed for one flat charge, hourly, daily, perUnit, percentage… Optional with a presetKey. — One of `fixed`, `hourly`, `daily`, `weekly`, `monthly`, `perUnit`, `perMile`, `perKilometre`, `percentage` | | `lineItems[].unitPrice`optional | `object` | Price per unit in integer minor units of the document currency ($5,000.00 is 500000). | | `lineItems[].unitPrice.minorUnits`required | `integer` | — | | `lineItems[].unitPrice.currency`required | `Currency` | — | | `lineItems[].rateBasisPoints`optional | `integer` | — | | `lineItems[].taxTreatment`optional | `string` | — | | `lineItems[].taxRateBasisPoints`optional | `integer` | — | | `lineItems[].discountBasisPoints`optional | `integer` | — | | `lineItems[].presetKey`optional | `string` | The key of one of the business’s products and services (get_business_context lists them); the server fills what the line leaves out. — up to 64 chars | | `customFields`optional | `object` | — | | `notes`optional | `string` | up to 4000 chars | | `internalNotes`optional | `string` | up to 4000 chars | | `terms`optional | `string` | up to 4000 chars | | `poNumber`optional | `string` | up to 64 chars | | `issueDate`optional | `string` | matches `^\d{4}-\d{2}-\d{2}$` | | `dueDate`optional | `string` | matches `^\d{4}-\d{2}-\d{2}$` | | `templateId`optional | `id` | — | | `merchantAccountId`optional | `id \| null` | — | | `notesTemplate`optional | `string` | up to 4000 chars | | `language`optional | `string` | up to 8 chars | | `kind`optional | `enum` | One of `unbilled` | | `through`optional | `string` | matches `^\d{4}-\d{2}-\d{2}$` | | `fromAdjustmentId`optional | `id` | — | ### Returns `data`: `object` Errors this route can answer besides the shared ones: `FIELD_FORBIDDEN` , `JOB_CLOSED` , `INVALID_TRANSITION` , `NOT_FOUND` . Example request Sample ``` curl -X POST "https://api.billingmart.com/v1/jobs/{jobId}/invoices" \ -H "Authorization: Bearer $BILLINGMART_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` invoices ## Set job POST `/v1/invoices/{invoiceId}/job` Link a DRAFT invoice to a work record of the same client, business and currency, move it to another, or unlink it with null. A deposit, progress or retainage invoice stays with its job. Scope `invoices:write` Effect Writes a draft or record MCP tool `set_invoice_job` Retries Send an Idempotency-Key; a repeat replays the stored answer for 24 hours ### Parameters Set job parameters | Name | In | Type | Notes | | --- | --- | --- | --- | | `invoiceId`required | path | `id` | — | ### Request body JSON. Money is an integer count of minor units beside its currency; quantities are thousandths. Set job request body | Field | Type | Notes | | --- | --- | --- | | `jobId`required | `id \| null` | — | | `expectedUpdatedAt`optional | `string` | up to 40 chars | ### Returns `data`: `object` Errors this route can answer besides the shared ones: `NOT_FOUND` , `NOT_A_DRAFT` , `INVALID_TRANSITION` , `VALIDATION_FAILED` , `JOB_CLOSED` , `EDIT_CONFLICT` . Example request Sample ``` curl -X POST "https://api.billingmart.com/v1/invoices/{invoiceId}/job" \ -H "Authorization: Bearer $BILLINGMART_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"jobId":""}' ``` reminders ## Draft POST `/v1/invoices/{invoiceId}/reminder-draft` Draft the subject and body of a payment reminder for an open invoice. Text only — nothing is sent; a person sends it or proposes it. Scope `invoices:write` Effect Read only MCP tool `draft_reminder_text` Retries Send an Idempotency-Key; a repeat replays the stored answer for 24 hours ### Parameters Draft parameters | Name | In | Type | Notes | | --- | --- | --- | --- | | `invoiceId`required | path | `id` | — | ### Request body JSON. Money is an integer count of minor units beside its currency; quantities are thousandths. Draft request body | Field | Type | Notes | | --- | --- | --- | | `tone`optional | `enum` | One of `friendly`, `neutral`, `firm` | ### Returns `data`: `object` Example request Sample ``` curl -X POST "https://api.billingmart.com/v1/invoices/{invoiceId}/reminder-draft" \ -H "Authorization: Bearer $BILLINGMART_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` invoices ## Add line POST `/v1/invoices/{invoiceId}/lines` Append one line to a draft. Scope `invoices:write` Effect Writes a draft or record MCP tool `add_line_item` Retries Send an Idempotency-Key; a repeat replays the stored answer for 24 hours ### Parameters Add line parameters | Name | In | Type | Notes | | --- | --- | --- | --- | | `invoiceId`required | path | `id` | — | ### Request body JSON. Money is an integer count of minor units beside its currency; quantities are thousandths. Add line request body | Field | Type | Notes | | --- | --- | --- | | `line`required | `object` | — | | `line.id`optional | `id` | — | | `line.description`optional | `string` | What the line is for. Optional with a presetKey (the item’s name is used). — up to 2000 chars | | `line.quantityMilli`optional | `integer` | Quantity in thousandths: 1000 is one unit, 1500 is 1.5 hours. Defaults to 1000. | | `line.rateBasis`optional | `enum` | How the price applies: fixed for one flat charge, hourly, daily, perUnit, percentage… Optional with a presetKey. — One of `fixed`, `hourly`, `daily`, `weekly`, `monthly`, `perUnit`, `perMile`, `perKilometre`, `percentage` | | `line.unitPrice`optional | `object` | Price per unit in integer minor units of the document currency ($5,000.00 is 500000). | | `line.unitPrice.minorUnits`required | `integer` | — | | `line.unitPrice.currency`required | `Currency` | — | | `line.rateBasisPoints`optional | `integer` | — | | `line.taxTreatment`optional | `string` | — | | `line.taxRateBasisPoints`optional | `integer` | — | | `line.discountBasisPoints`optional | `integer` | — | | `line.presetKey`optional | `string` | The key of one of the business’s products and services (get_business_context lists them); the server fills what the line leaves out. — up to 64 chars | ### Returns `data`: `object` Errors this route can answer besides the shared ones: `ACTION_PENDING_ON_TARGET` , `NOT_A_DRAFT` . Example request Sample ``` curl -X POST "https://api.billingmart.com/v1/invoices/{invoiceId}/lines" \ -H "Authorization: Bearer $BILLINGMART_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"line":{"unitPrice":{"minorUnits":0,"currency":"USD"}}}' ``` invoices ## Remove line DELETE `/v1/invoices/{invoiceId}/lines/{lineId}` Remove one line from a draft. Scope `invoices:write` Effect Writes a draft or record MCP tool `remove_line_item` Retries No Idempotency-Key on this route ### Parameters Remove line parameters | Name | In | Type | Notes | | --- | --- | --- | --- | | `invoiceId`required | path | `id` | — | | `lineId`required | path | `id` | — | ### Returns `data`: [`Invoice`](https://billingmart.com/developers/api/invoices#object-Invoice) Errors this route can answer besides the shared ones: `ACTION_PENDING_ON_TARGET` , `NOT_A_DRAFT` . Example request Sample ``` curl -X DELETE "https://api.billingmart.com/v1/invoices/{invoiceId}/lines/{lineId}" \ -H "Authorization: Bearer $BILLINGMART_API_KEY" ``` invoices ## Add sources POST `/v1/invoices/{invoiceId}/sources` Add chosen unbilled time entries, expenses, mileage or an accepted estimate to a DRAFT: one line per record (an estimate brings all its lines), each record marked billed in the same write. Removing the line later releases the record. Scope `invoices:write` Effect Writes a draft or record MCP tool `add_to_invoice` Retries Send an Idempotency-Key; a repeat replays the stored answer for 24 hours ### Parameters Add sources parameters | Name | In | Type | Notes | | --- | --- | --- | --- | | `invoiceId`required | path | `id` | — | ### Request body JSON. Money is an integer count of minor units beside its currency; quantities are thousandths. Add sources request body | Field | Type | Notes | | --- | --- | --- | | `sources[]`required | `object[]` | up to 200 items · at least 1 | | `sources[].kind`required | `enum` | One of `timeEntry`, `expense`, `mileage`, `estimate` | | `sources[].id`required | `id` | — | ### Returns `data`: `object` Errors this route can answer besides the shared ones: `ACTION_PENDING_ON_TARGET` , `NOT_A_DRAFT` . Example request Sample ``` curl -X POST "https://api.billingmart.com/v1/invoices/{invoiceId}/sources" \ -H "Authorization: Bearer $BILLINGMART_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` invoices ## Pdf GET `/v1/invoices/{invoiceId}/pdf` Render (or reuse) the invoice PDF and return a short-lived signed URL. Needs contacts:read as well: the PDF prints the client’s address and email. Scope `invoices:read` Effect Read only MCP tool `preview_invoice_pdf` Retries Safe to repeat ### Parameters Pdf parameters | Name | In | Type | Notes | | --- | --- | --- | --- | | `invoiceId`required | path | `id` | — | ### Returns `data`: [`PdfPreview`](https://billingmart.com/developers/api/invoices#object-PdfPreview) Example request Sample ``` curl -X GET "https://api.billingmart.com/v1/invoices/{invoiceId}/pdf" \ -H "Authorization: Bearer $BILLINGMART_API_KEY" ``` invoices ## Create deposit POST `/v1/invoices/deposit` Draft a deposit invoice for a job: depositBasisPoints of jobRef.total (default from the business’s terms). One per job. Scope `invoices:write` Effect Writes a draft or record MCP tool `create_deposit_invoice` Retries Send an Idempotency-Key; a repeat replays the stored answer for 24 hours ### Request body JSON. Money is an integer count of minor units beside its currency; quantities are thousandths. Create deposit request body | Field | Type | Notes | | --- | --- | --- | | `businessId`required | `id` | — | | `clientId`required | `id` | — | | `jobId`optional | `id` | — | | `jobRef`optional | `object` | — | | `jobRef.id`required | `id` | — | | `jobRef.label`required | `string` | up to 200 chars | | `jobRef.total`required | `object` | — | | `jobRef.total.minorUnits`required | `integer` | — | | `jobRef.total.currency`required | `Currency` | — | | `depositBasisPoints`optional | `integer` | min 0 · max 10000 | | `currency`optional | `Currency` | — | | `language`optional | `string` | up to 8 chars | | `notes`optional | `string` | up to 4000 chars | | `customFields`optional | `object` | — | ### Returns `data`: `object` Errors this route can answer besides the shared ones: `INVALID_TRANSITION` . Example request Sample ``` curl -X POST "https://api.billingmart.com/v1/invoices/deposit" \ -H "Authorization: Bearer $BILLINGMART_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"businessId":"","clientId":"","jobRef":{"id":"","label":"