Invoicing

invoices.create

Create a draft invoice for a customer. By default it starts from the customer's last invoice (lines, currency, notes, payment methods, terms); pass startFrom blank to start empty. Totals and sales tax are calculated on the server. Pass projectId to tie it to a project.

POST/api/v1/accounting/invoices.create

Permissions

accounting:readaccounting:write

Who can call it

admin, finance

Retries

Idempotency key required

MCP

accounting_invoices_create

Fields

  • partyIdstring (ID)Required

    The ID of a customer or vendor account, from parties.list.

  • startFromenum
    lastblank

    Default "last"

  • titlestring

    A short title.

    at most 200 characters

  • issueDatestring or null

    The date the document was issued, as YYYY-MM-DD.

  • dueDatestring or null

    The date payment is due, as YYYY-MM-DD.

  • currencystring

    Three-letter currency code, such as CAD or USD.

  • linesarray of objects

    at most 100 items

  • taxTreatmentenum or null
    autohstgstgst_qstzero_ratedexemptnonecustom
  • taxRateCodeenum or string or null
  • paymentMethodIdsarray of strings (ID)

    A list of record IDs.

    at most 10 items

  • payUrlstring (uri) or null
  • notesstring

    Notes kept with the record.

    at most 4000 characters

  • memostring

    at most 4000 characters

  • termsobject

    No other fields

  • billToContactIdstring or null
  • projectIdstring (ID) or null
  • idempotencyKeystringRequired

    Any unique text you generate once per intended change, so a retried request only happens once. Send it as the Idempotency-Key header instead if you prefer; if you send both they must match.

    8–200 characters

Example

curl https://app.getoatmilk.com/api/v1/accounting/invoices.create \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "partyId": "7f0f6c1e-1c1f-4b5e-9c8d-2f5e8e3c1a10"
}'
Response
{
  "data": { … }
}

Try it

Try it

Checks your input with this action’s real schema and answers like the API, with synthetic data. No key needed, and nothing changes.

POST/api/v1/accounting/invoices.create
curl https://app.getoatmilk.com/api/v1/accounting/invoices.create \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "partyId": "7f0f6c1e-1c1f-4b5e-9c8d-2f5e8e3c1a10"
}'

More in Invoicing.