Table of Contents

API - Purchase Orders

This is a fork of page 30066 "APIV2 - Purchase Orders" from version 27.0.38460.40573. Added support for Extra Values.

Object Definition

Object TypePage
Object ID70314191
Object NameQWESR API - Purchase Orders
Source TablePurchase Order Entity Buffer

API Definition

APIPublishersmartApps
APIGroupspider
APIVersionv1.0
EntitySetNamepurchaseOrders
EntityNamepurchaseOrder

Service Enabled Procedures

Name Description
ReceiveAndInvoice(WebServiceActionContext) Receives and Invoices the current Order.
Release(WebServiceActionContext) Releases the current Purchase Order.
Reopen(WebServiceActionContext) Reopens the current Purchase Order.

Events

Name Description
OnAfterInsert(Record "Purchase Order Entity Buffer"; Record "Purchase Header"; Text; Text; Text; Text; Text; Text; Text; Text; Text; Text; List of [Integer]) Raised after a record is inserted.
OnAfterModify(Record "Purchase Order Entity Buffer"; Record "Purchase Header"; Text; Text; Text; Text; Text; Text; Text; Text; Text; Text; List of [Integer]) Raised after a record is modified.
OnGetExtraValues(Record "Purchase Order Entity Buffer"; Record "Purchase Header"; Text; Text; Text; Text; Text; Text; Text; Text; Text; Text) Raised after a record is read from the database. Makes it possible to set the ExtraValues 1..10, to be returned to the client.

Example

Read

Get a list of Purchase Orders.

GET businesscentralPrefix/companies({id})/purchaseOrders?$schemaversion=2.0

Get a single Purchase Order and it's lines.

GET businesscentralPrefix/companies({id})/purchaseOrders({id})?$expand=purchaseOrderLines&$schemaversion=2.0

Create

Create a new Purchase Order and a Purchase Order Line.

POST businesscentralPrefix/companies({id})/purchaseOrders?$expand=purchaseOrderLines&$schemaversion=2.0
Content-type: application/json
{
   "vendorNumber": "10000",
   "purchaseOrderLines": [
       {
           "lineType": "Item",
           "lineObjectNumber": "1896-S",
           "quantity": 5
   	    }
   ]
}

Controls

Type Name Data Type Read-only
Field id Yes
Field number Yes
Field orderDate
Field postingDate
Field vendorId
Field vendorNumber
Field vendorName Yes
Field payToName Yes
Field payToVendorId
Field payToVendorNumber
Field shipToName
Field shipToContact
Field buyFromAddressLine1
Field buyFromAddressLine2
Field buyFromCity
Field buyFromCountry
Field buyFromState
Field buyFromPostCode
Field payToAddressLine1 Yes
Field payToAddressLine2 Yes
Field payToCity Yes
Field payToCountry Yes
Field payToState Yes
Field payToPostCode Yes
Field shipToAddressLine1
Field shipToAddressLine2
Field shipToCity
Field shipToCountry
Field shipToState
Field shipToPostCode
Field shortcutDimension1Code
Field shortcutDimension2Code
Field currencyId
Field currencyCode Text
Field pricesIncludeTax
Field paymentTermsId
Field shipmentMethodId
Field purchaser
Field requestedReceiptDate
Sub page purchaseOrderLines
Field discountAmount
Field discountAppliedBeforeTax Yes
Field totalAmountExcludingTax Yes
Field totalTaxAmount Yes
Field totalAmountIncludingTax Yes
Field fullyReceived
Field status Yes
Field lastModifiedDateTime Yes
Field extraValue1 Text
Field extraValue2 Text
Field extraValue3 Text
Field extraValue4 Text
Field extraValue5 Text
Field extraValue6 Text
Field extraValue7 Text
Field extraValue8 Text
Field extraValue9 Text
Field extraValue10 Text
Sub page attachments
Sub page dimensionSetLines
Sub page documentAttachments

This documentation is generated from Spider v27.4