salesInvoice resource type

Represents a sales invoice in Business Central.

Note

For information about enabling APIs for Business Central see Enabling the APIs for Dynamics 365 Business Central.

Methods

MethodReturn TypeDescription
GET salesInvoicesalesInvoiceGets a sales invoice object.
DELETE salesInvoicenoneDeletes a sales invoice object.
POST salesInvoicesalesInvoiceCreates a sales invoice object.
PATCH salesInvoicesalesInvoiceUpdates a sales invoice object.

Bound actions

The salesInvoice resource type offers a bound action called cancel, which cancels the corresponding salesInvoice batch. This is illustrated in the following example: CANCEL https://<server address>:<server API port>/<server instance name>/api/v2.0/companies({id})/salesInvoices({id})/Microsoft.NAV.cancel

The response has no content; the response code is 204.

The salesInvoice resource type offers a bound action called cancelAndSend, which cancels and sends the corresponding salesInvoice batch. This is illustrated in the following example: CANCELANDSEND https://<server address>:<server API port>/<server instance name>/api/v2.0/companies({id})/salesInvoices({id})/Microsoft.NAV.cancelAndSend

The response has no content; the response code is 204.

The salesInvoice resource type offers a bound action called makeCorrectiveCreditMemo, which makes corrective credit memos to the corresponding salesInvoice batch. This is illustrated in the following example: MAKECORRECTIVECREDITMEMO https://<server address>:<server API port>/<server instance name>/api/v2.0/companies({id})/salesInvoices({id})/Microsoft.NAV.makeCorrectiveCreditMemo

The response has no content; the response code is 204.

The salesInvoice resource type offers a bound action called post, which posts the corresponding salesInvoice batch. This is illustrated in the following example: POST https://<server address>:<server API port>/<server instance name>/api/v2.0/companies({id})/salesInvoices({id})/Microsoft.NAV.post

The response has no content; the response code is 204.

The salesInvoice resource type offers a bound action called postAndSend, which posts and sends the corresponding salesInvoice batch. This is illustrated in the following example: POSTANDSEND https://<server address>:<server API port>/<server instance name>/api/v2.0/companies({id})/salesInvoices({id})/Microsoft.NAV.postAndSend

The response has no content; the response code is 204.

The salesInvoice resource type offers a bound action called send which sends the corresponding salesInvoice batch. This is illustrated in the following example: SEND https://<server address>:<server API port>/<server instance name>/api/v2.0/companies({id})/salesInvoices({id})/Microsoft.NAV.send

The response has no content; the response code is 204.

NavigationReturn TypeDescription
customercustomerGets the customer of the salesInvoice.
currencycurrencyGets the currency of the salesInvoice.
dimensionValuedimensionValueGets the dimensionvalue of the salesInvoice.
paymentTermpaymentTermGets the paymentterm of the salesInvoice.
shipmentMethodshipmentMethodGets the shipmentmethod of the salesInvoice.
dimensionSetLinesdimensionSetLinesGets the dimensionsetlines of the salesInvoice.
salesInvoiceLinessalesInvoiceLinesGets the salesinvoicelines of the salesInvoice.
pdfDocumentpdfDocumentGets the pdfdocument of the salesInvoice.
attachmentsattachmentsGets the attachments of the salesInvoice.
documentAttachmentsdocumentAttachmentsGets the documentattachments of the salesInvoice.

Properties

PropertyTypeDescription
idGUIDThe unique ID of the sales invoice. Non-editable.
numberstringSpecifies the number of the sales invoice.
externalDocumentNumberstringSpecifies an external document number for the sales invoice.
invoiceDatedateThe invoice date .
postingDatedateThe date that the sales invoice is posted.
dueDatedateT he date the sales invoice is due.
promisedPayDatedate
customerPurchaseOrderReferencestringThe customer purchase order reference for the invoice.
customerIdGUIDThe unique ID of customer.
customerNumberstringThe customer's number.
customerNamestringThe customer's name.
billToNamestringBill to name.
billToCustomerIdGUIDBill to customer id.
billToCustomerNumberstringBill to customer number.
shipToNamestringShip to name.
shipToContactstringShip to contact.
sellToAddressLine1stringSell to address line 1.
sellToAddressLine2stringSell to address line 2.
sellToCitystringSell to city.
sellToCountrystringSell to country.
sellToStatestringSell to state.
sellToPostCodestringSell to post code.
billToAddressLine1stringBill to address line 1.
billToAddressLine2stringBill to address line 2.
billToCitystringBill to city.
billToCountrystringBill to country.
billToStatestringBill to state.
billToPostCodestringBill to post code.
shipToAddressLine1stringShip to address line 1.
shipToAddressLine2stringShip to address line 2.
shipToCitystringShip to city.
shipToCountrystringShip to country.
shipToStatestringShip to state.
shipToPostCodestringShip to post code.
currencyIdGUIDSpecifies which currency the sales invoice uses.
shortcutDimension1Codestring
shortcutDimension2Codestring
currencyCodestringThe default currency code for the sales invoice.
orderIdGUIDThe id of the order to which the sales invoice is associated to. Read-Only.
orderNumberstringThe number of the order to which the sales invoice is associated to. Read-Only.
paymentTermsIdGUIDSpecifies which payment term the sales invoice uses.
shipmentMethodIdGUIDSpecifies which shipment method the sales invoice uses.
salespersonstringThe salesperson code for the sales invoice.
disputeStatusIdGUID
disputeStatusstring
pricesIncludeTaxbooleanSpecifies whether the prices include Tax or not. Read-Only.
remainingAmountdecimalThe amount including VAT.
discountAmountdecimalThe sales invoice discount amount.
discountAppliedBeforeTaxbooleanSpecifies whether the discount is applied before tax.
totalAmountExcludingTaxdecimalThe total amount excluding tax. Read-Only.
totalTaxAmountdecimalThe total tax amount for the sales invoice. Read-Only.
totalAmountIncludingTaxdecimalThe total amount including tax. Read-Only.
statusNAV.invoiceEntityAggregateStatusThe status of the sales invoice. It can be " ", "Draft", "In Review", "Open", "Paid", "Canceled" or "Corrective".
lastModifiedDateTimedatetimeThe last datetime the sales invoice was modified. Read-Only.
phoneNumberstringSpecifies the sales invoice's telephone number.
emailstringSpecifies the sales invoice's email address.

JSON representation

Here's a JSON representation of the salesInvoice resource.

{
    "id": "GUID",
    "number": "string",
    "externalDocumentNumber": "string",
    "invoiceDate": "date",
    "postingDate": "date",
    "dueDate": "date",
    "promisedPayDate": "date",
    "customerPurchaseOrderReference": "string",
    "customerId": "GUID",
    "customerNumber": "string",
    "customerName": "string",
    "billToName": "string",
    "billToCustomerId": "GUID",
    "billToCustomerNumber": "string",
    "shipToName": "string",
    "shipToContact": "string",
    "sellToAddressLine1": "string",
    "sellToAddressLine2": "string",
    "sellToCity": "string",
    "sellToCountry": "string",
    "sellToState": "string",
    "sellToPostCode": "string",
    "billToAddressLine1": "string",
    "billToAddressLine2": "string",
    "billToCity": "string",
    "billToCountry": "string",
    "billToState": "string",
    "billToPostCode": "string",
    "shipToAddressLine1": "string",
    "shipToAddressLine2": "string",
    "shipToCity": "string",
    "shipToCountry": "string",
    "shipToState": "string",
    "shipToPostCode": "string",
    "currencyId": "GUID",
    "shortcutDimension1Code": "string",
    "shortcutDimension2Code": "string",
    "currencyCode": "string",
    "orderId": "GUID",
    "orderNumber": "string",
    "paymentTermsId": "GUID",
    "shipmentMethodId": "GUID",
    "salesperson": "string",
    "disputeStatusId": "GUID",
    "disputeStatus": "string",
    "pricesIncludeTax": "boolean",
    "remainingAmount": "decimal",
    "discountAmount": "decimal",
    "discountAppliedBeforeTax": "boolean",
    "totalAmountExcludingTax": "decimal",
    "totalTaxAmount": "decimal",
    "totalAmountIncludingTax": "decimal",
    "status": "NAV.invoiceEntityAggregateStatus",
    "lastModifiedDateTime": "datetime",
    "phoneNumber": "string",
    "email": "string"
}

Note


The id property value in this API resource might be different than the systemId of the corresponding record because the systemId of the unposted invoices are carried to posted invoices in the API, but not to the record. Use the https://{businesscentralPrefix}/microsoft/automate/v1.0/companies({id})/postedSalesInvoices({systemId}) route and extract the apiId property to map the systemId of a posted sales invoice record to the salesInvoice API resource.

GET salesInvoice
DELETE salesInvoice
POST salesInvoice
PATCH salesInvoice