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

Method Return Type Description
GET salesInvoice salesInvoice Gets a sales invoice object.
DELETE salesInvoice none Deletes a sales invoice object.
POST salesInvoice salesInvoice Creates a sales invoice object.
PATCH salesInvoice salesInvoice Updates a sales invoice object.

Bound Actions

The salesInvoice resource type offers a bound action called cancelAndSend which cancel 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 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 makeCorrectiveCreditMemo which make corrective credit memos 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 postAndSend which post 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 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 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.

Navigation Return Type Description
customer customer Gets the customer of the salesInvoice.
currency currency Gets the currency of the salesInvoice.
dimensionValue dimensionValue Gets the dimensionvalue of the salesInvoice.
paymentTerm paymentTerm Gets the paymentterm of the salesInvoice.
shipmentMethod shipmentMethod Gets the shipmentmethod of the salesInvoice.
dimensionSetLines dimensionSetLines Gets the dimensionsetlines of the salesInvoice.
salesInvoiceLines salesInvoiceLines Gets the salesinvoicelines of the salesInvoice.
pdfDocument pdfDocument Gets the pdfdocument of the salesInvoice.
attachments attachments Gets the attachments of the salesInvoice.
documentAttachments documentAttachments Gets the documentattachments of the salesInvoice.

Properties

Property Type Description
id GUID The unique ID of the sales invoice. Non-editable.
number string Specifies the number of the sales invoice.
externalDocumentNumber string Specifies an external document number for the sales invoice.
invoiceDate date The invoice date .
postingDate date The date that the sales invoice is posted.
dueDate date T he date the sales invoice is due.
promisedPayDate date
customerPurchaseOrderReference string The customer purchase order reference for the invoice.
customerId GUID The unique ID of customer.
customerNumber string The customer's number.
customerName string The customer's name.
billToName string Bill to name.
billToCustomerId GUID Bill to customer id.
billToCustomerNumber string Bill to customer number.
shipToName string Ship to name.
shipToContact string Ship to contact.
sellToAddressLine1 string Sell to address line 1.
sellToAddressLine2 string Sell to address line 2.
sellToCity string Sell to city.
sellToCountry string Sell to country.
sellToState string Sell to state.
sellToPostCode string Sell to post code.
billToAddressLine1 string Bill to address line 1.
billToAddressLine2 string Bill to address line 2.
billToCity string Bill to city.
billToCountry string Bill to country.
billToState string Bill to state.
billToPostCode string Bill to post code.
shipToAddressLine1 string Ship to address line 1.
shipToAddressLine2 string Ship to address line 2.
shipToCity string Ship to city.
shipToCountry string Ship to country.
shipToState string Ship to state.
shipToPostCode string Ship to post code.
currencyId GUID Specifies which currency the sales invoice uses.
shortcutDimension1Code string
shortcutDimension2Code string
currencyCode string The default currency code for the sales invoice.
orderId GUID The id of the order to which the sales invoice is associated to. Read-Only.
orderNumber string The number of the order to which the sales invoice is associated to. Read-Only.
paymentTermsId GUID Specifies which payment term the sales invoice uses.
shipmentMethodId GUID Specifies which shipment method the sales invoice uses.
salesperson string The salesperson code for the sales invoice.
disputeStatusId GUID
disputeStatus string
pricesIncludeTax boolean Specifies whether the prices include Tax or not. Read-Only.
remainingAmount decimal The amount including VAT.
discountAmount decimal The sales invoice discount amount.
discountAppliedBeforeTax boolean Specifies whether the discount is applied before tax.
totalAmountExcludingTax decimal The total amount excluding tax. Read-Only.
totalTaxAmount decimal The total tax amount for the sales invoice. Read-Only.
totalAmountIncludingTax decimal The total amount including tax. Read-Only.
status NAV.invoiceEntityAggregateStatus The status of the sales invoice. It can be " ", "Draft", "In Review", "Open", "Paid", "Canceled" or "Corrective".
lastModifiedDateTime datetime The last datetime the sales invoice was modified. Read-Only.
phoneNumber string Specifies the sales invoice's telephone number.
email string Specifies the sales invoice's email address.

JSON representation

Here is 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"
}

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

Method Return Type Description
GET salesInvoice salesInvoice Gets a sales invoice object.
DELETE salesInvoice none Deletes a sales invoice object.
POST salesInvoice salesInvoice Creates a sales invoice object.
PATCH salesInvoice salesInvoice Updates a sales invoice object.

Bound Actions

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 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 makeCorrectiveCreditMemo which make corrective credit memos 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 postAndSend which post 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 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 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.

Navigation Return Type Description
customer customer Gets the customer of the salesInvoice.
countryRegion countryRegion Gets the countryregion of the salesInvoice.
currency currency Gets the currency of the salesInvoice.
dimensionValue dimensionValue Gets the dimensionvalue of the salesInvoice.
paymentTerm paymentTerm Gets the paymentterm of the salesInvoice.
shipmentMethod shipmentMethod Gets the shipmentmethod of the salesInvoice.
dimensionSetLines dimensionSetLines Gets the dimensionsetlines of the salesInvoice.
salesInvoiceLines salesInvoiceLines Gets the salesinvoicelines of the salesInvoice.
pdfDocument pdfDocument Gets the pdfdocument of the salesInvoice.
attachments attachments Gets the attachments of the salesInvoice.
dimensionSetLines dimensionSetLines Gets the dimensionsetlines of the salesInvoice.

Properties

Property Type Description
id GUID The unique ID of the sales invoice. Non-editable.
number string Specifies the number of the sales invoice.
externalDocumentNumber string Specifies an external document number for the sales invoice.
invoiceDate date The invoice date .
postingDate date The date that the sales invoice is posted.
dueDate date The date the sales invoice is due.
customerPurchaseOrderReference string The customer purchase order reference for the invoice.
customerId GUID The unique ID of customer.
customerNumber string The customer's number.
customerName string The customer's name.
billToName string Bill to name.
billToCustomerId GUID Bill to customer id.
billToCustomerNumber string Bill to customer number.
shipToName string Ship to name.
shipToContact string Ship to contact.
sellToAddressLine1 string Sell to address line 1.
sellToAddressLine2 string Sell to address line 2.
sellToCity string Sell to city.
sellToCountry string Sell to country.
sellToState string Sell to state.
sellToPostCode string Sell to post code.
billToAddressLine1 string Bill to address line 1.
billToAddressLine2 string Bill to address line 2.
billToCity string Bill to city.
billToCountry string Bill to country.
billToState string Bill to state.
billToPostCode string Bill to post code.
shipToAddressLine1 string Ship to address line 1.
shipToAddressLine2 string Ship to address line 2.
shipToCity string Ship to city.
shipToCountry string Ship to country.
shipToState string Ship to state.
shipToPostCode string Ship to post code.
currencyId GUID Specifies which currency the sales invoice uses.
shortcutDimension1Code string
shortcutDimension2Code string
currencyCode string The default currency code for the sales invoice.
orderId GUID The id of the order to which the sales invoice is associated to. Read-Only.
orderNumber string The number of the order to which the sales invoice is associated to. Read-Only.
paymentTermsId GUID Specifies which payment term the sales invoice uses.
shipmentMethodId GUID Specifies which shipment method the sales invoice uses.
salesperson string The salesperson code for the sales invoice.
pricesIncludeTax boolean Specifies whether the prices include Tax or not. Read-Only.
remainingAmount decimal The amount including VAT.
discountAmount decimal The sales invoice discount amount.
discountAppliedBeforeTax boolean Specifies whether the discount is applied before tax.
totalAmountExcludingTax decimal The total amount excluding tax. Read-Only.
totalTaxAmount decimal The total tax amount for the sales invoice. Read-Only.
totalAmountIncludingTax decimal The total amount including tax. Read-Only.
status NAV.invoiceEntityAggregateStatus The status of the sales invoice. It can be " ", "Draft", "In Review", "Open", "Paid", "Canceled" or "Corrective".
lastModifiedDateTime datetime The last datetime the sales invoice was modified. Read-Only.
phoneNumber string Specifies the sales invoice's telephone number.
email string Specifies the sales invoice's email address.

JSON representation

Here is a JSON representation of the salesInvoice resource.

{
    "id": "GUID",
    "number": "string",
    "externalDocumentNumber": "string",
    "invoiceDate": "date",
    "postingDate": "date",
    "dueDate": "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",
    "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.

See Also

GET salesInvoice
DELETE salesInvoice
POST salesInvoice
PATCH salesInvoice