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.
/api/v1/accounting/invoices.createPermissions
Who can call it
Retries
MCP
accounting_invoices_createFields
partyIdstring (ID)RequiredThe ID of a customer or vendor account, from parties.list.
startFromenumlastblankDefault "last"
titlestringA short title.
at most 200 characters
issueDatestring or nullThe date the document was issued, as YYYY-MM-DD.
dueDatestring or nullThe date payment is due, as YYYY-MM-DD.
currencystringThree-letter currency code, such as CAD or USD.
linesarray of objectsat most 100 items
taxTreatmentenum or nullautohstgstgst_qstzero_ratedexemptnonecustomtaxRateCodeenum or string or nullpaymentMethodIdsarray of strings (ID)A list of record IDs.
at most 10 items
payUrlstring (uri) or nullnotesstringNotes kept with the record.
at most 4000 characters
memostringat most 4000 characters
termsobjectNo other fields
billToContactIdstring or nullprojectIdstring (ID) or nullidempotencyKeystringRequiredAny 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"
}'{
"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.
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.