Creates one or more AP invoices in batch. Each invoice's detail lines are either GL-account-based or item-based, determined by the vendor's entry type — not by a request flag. For by-account vendors, every detail line requires glAccountId. For by-item vendors, every detail line requires either glAccountId (for a GL-account row) or vendorItemNumber plus quantity (for an item row). See the field-level notes on glAccountId, vendorItemNumber, quantity, and eachAmount for the exact requirements in each mode.
Security
The requesting user must have one of the following permissions to create AP invoices:
- Accounts Payable → AP Invoices → Create AP Invoices
- Food → AP Invoices → Create AP Invoices (Food equivalent)
Create and approve are separate permissions — this permission does not grant approval rights.
Identifies the R365 tenant the request applies to. Required on every request.
The list of AP invoices to create.
The invoice number. Required.
The identifier of the vendor. Required.
The identifier of the location. Required.
The document date. Required.
The document amount. Required.
Optional due date.
Optional comment.
Optional payment terms identifier.
Optional purchase order identifier.
Indicates whether to mark the invoice as paid.
The list of invoice detail line items.
Optional GL account identifier. Required for GL-account rows and for by-account vendors. For by-item vendors, either this or vendorItemNumber must be provided.
Optional location identifier for this line. Falls back to the header location when omitted.
Optional vendor item number. Required for item rows on by-item vendors when glAccountId is not provided.
Optional quantity. Required for item rows on by-item vendors when glAccountId is not provided. Must be greater than zero.
Optional unit price. Derived from totalAmount divided by quantity when omitted on item rows. Must be greater than zero when supplied.
The total amount for this line item. Required.
Optional unit of measure identifier.
Optional line-level comment.
Multi-Status – batch operation result containing per-invoice success or failure.
Per-invoice results for the batch operation.
Zero-based index of the invoice in the original request array.
The invoice number from the original request.
Result status of this invoice. Valid values: Unknown, Succeeded, Failed.
Error code if the invoice failed, otherwise null.
Human-readable error message if the invoice failed, otherwise null.
The identifier of the created invoice if succeeded, otherwise null.
Bad Request — a parameter value is malformed, of the wrong type, or outside its allowed range.
Unauthorized — the bearer token is missing, invalid or expired, or is not valid for the specified tenant.
Forbidden — the caller lacks the permission required for this operation.
Not Found — the requested resource does not exist, or the supplied continuation token is unknown or has expired.
Conflict — the request conflicts with the current state of the resource and cannot be applied.
Unprocessable Entity — a required parameter is missing, or a supplied parameter value is invalid.
Too Many Requests — the caller has exceeded the rate limit; retry after a short delay.
Internal Server Error — an unexpected error occurred while processing the request.