purchaseOrder resource type

Represents a purchase order 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 purchaseOrderpurchaseOrderGets a purchase order object.
DELETE purchaseOrdernoneDeletes a purchase order object.
POST purchaseOrderpurchaseOrderCreates a purchase order object.
PATCH purchaseOrderpurchaseOrderUpdates a purchase order object.

Bound actions

The purchaseOrder resource type offers a bound action called receiveAndInvoice, which receives and invoices the corresponding purchaseOrder batch. This is illustrated in the following example: RECEIVEANDINVOICE https://<server address>:<server API port>/<server instance name>/api/v2.0/companies({id})/purchaseOrders({id})/Microsoft.NAV.receiveAndInvoice

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

NavigationReturn TypeDescription
vendorvendorGets the vendor of the purchaseOrder.
dimensionValuedimensionValueGets the dimensionvalue of the purchaseOrder.
currencycurrencyGets the currency of the purchaseOrder.
paymentTermpaymentTermGets the paymentterm of the purchaseOrder.
shipmentMethodshipmentMethodGets the shipmentmethod of the purchaseOrder.
purchaseOrderLinespurchaseOrderLinesGets the purchaseorderlines of the purchaseOrder.
attachmentsattachmentsGets the attachments of the purchaseOrder.
dimensionSetLinesdimensionSetLinesGets the dimensionsetlines of the purchaseOrder.
documentAttachmentsdocumentAttachmentsGets the documentattachments of the purchaseOrder.
pdfDocumentpdfDocumentGets the pdfDocument of the purchaseOrder.

Properties

PropertyTypeDescription
idGUIDThe unique ID of the purchase order. Non-editable.
numberstringSpecifies the number of the purchase order.
orderDatedateThe order date.
postingDatedateThe date that the purchase order is posted.
vendorIdGUIDThe unique ID of vendor.
vendorNumberstringSpecifies vendor's number.
vendorNamestringSpecifies vendor's name.
payToNamestringPay to name of the purchase order.
payToVendorIdGUIDPay to vendor id.
payToVendorNumberstringPay to vendor number.
shipToNamestringShip to name.
shipToContactstringShip to contact.
buyFromAddressLine1stringBuy from address line 1.
buyFromAddressLine2stringBuy from address line 2.
buyFromCitystringBuy from city.
buyFromCountrystringBuy from country.
buyFromStatestringBuy from state.
buyFromPostCodestringBuy from post code.
payToAddressLine1stringPay to address line 1.
payToAddressLine2stringPay to address line 2.
payToCitystringPay to city.
payToCountrystringPay to country.
payToStatestringPay to state.
payToPostCodestringPay 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.
shortcutDimension1CodestringThe code for shortcut dimension 1.
shortcutDimension2CodestringThe code for shortcut dimension 2.
currencyIdGUIDSpecifies which currency the purchase order uses.
currencyCodestringThe default currency code for the purchase order.
pricesIncludeTaxbooleanSpecifies whether the prices include Tax or not. Read-Only.
paymentTermsIdGUIDSpecifies which payment term the purchase order uses.
shipmentMethodIdGUIDSpecifies which shipment method the purchase order uses.
purchaserstringThe purchaser in the purchase order.
requestedReceiptDatedateThe date the receipt was requested.
discountAmountdecimalThe purchase order discount amount.
discountAppliedBeforeTaxbooleanSpecifies whether the discount is applied before tax.
totalAmountExcludingTaxdecimalThe total amount excluding tax. Read-Only.
totalTaxAmountdecimalThe total tax amount for the purchase order. Read-Only.
totalAmountIncludingTaxdecimalThe total amount including tax. Read-Only.
fullyReceivedbooleanSpecifies whether the purchase order has been fully received.
statusNAV.purchaseOrderEntityBufferStatusThe status of the purchase order. It can be "Draft", "In Review" or "Open".
lastModifiedDateTimedatetimeThe last datetime the purchase order was modified. Read-Only.

JSON representation

Here's a JSON representation of the purchaseOrder resource.

{
    "id": "GUID",
    "number": "string",
    "orderDate": "date",
    "postingDate": "date",
    "vendorId": "GUID",
    "vendorNumber": "string",
    "vendorName": "string",
    "payToName": "string",
    "payToVendorId": "GUID",
    "payToVendorNumber": "string",
    "shipToName": "string",
    "shipToContact": "string",
    "buyFromAddressLine1": "string",
    "buyFromAddressLine2": "string",
    "buyFromCity": "string",
    "buyFromCountry": "string",
    "buyFromState": "string",
    "buyFromPostCode": "string",
    "payToAddressLine1": "string",
    "payToAddressLine2": "string",
    "payToCity": "string",
    "payToCountry": "string",
    "payToState": "string",
    "payToPostCode": "string",
    "shipToAddressLine1": "string",
    "shipToAddressLine2": "string",
    "shipToCity": "string",
    "shipToCountry": "string",
    "shipToState": "string",
    "shipToPostCode": "string",
    "shortcutDimension1Code": "string",
    "shortcutDimension2Code": "string",
    "currencyId": "GUID",
    "currencyCode": "string",
    "pricesIncludeTax": "boolean",
    "paymentTermsId": "GUID",
    "shipmentMethodId": "GUID",
    "purchaser": "string",
    "requestedReceiptDate": "date",
    "discountAmount": "decimal",
    "discountAppliedBeforeTax": "boolean",
    "totalAmountExcludingTax": "decimal",
    "totalTaxAmount": "decimal",
    "totalAmountIncludingTax": "decimal",
    "fullyReceived": "boolean",
    "status": "NAV.purchaseOrderEntityBufferStatus",
    "lastModifiedDateTime": "datetime"
}

GET purchaseOrder
DELETE purchaseOrder
POST purchaseOrder
PATCH purchaseOrder