Show / Hide Table of Contents

    API - Purchase Orders

    This is a fork of page 30066 "APIV2 - Purchase Orders" from version 23.3.14876.15704. 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 Guid Yes
    Field number Code[20] Yes
    Field orderDate Date
    Field postingDate Date
    Field vendorId Guid
    Field vendorNumber Code[20]
    Field vendorName Text[100] Yes
    Field payToName Text[100] Yes
    Field payToVendorId Guid
    Field payToVendorNumber Code[20]
    Field shipToName Text[100]
    Field shipToContact Text[100]
    Field buyFromAddressLine1 Text[100]
    Field buyFromAddressLine2 Text[50]
    Field buyFromCity Text[30]
    Field buyFromCountry Code[10]
    Field buyFromState Text[30]
    Field buyFromPostCode Code[20]
    Field payToAddressLine1 Text[100] Yes
    Field payToAddressLine2 Text[50] Yes
    Field payToCity Text[30] Yes
    Field payToCountry Code[10] Yes
    Field payToState Text[30] Yes
    Field payToPostCode Code[20] Yes
    Field shipToAddressLine1 Text[100]
    Field shipToAddressLine2 Text[50]
    Field shipToCity Text[30]
    Field shipToCountry Code[10]
    Field shipToState Text[30]
    Field shipToPostCode Code[20]
    Field shortcutDimension1Code Code[20]
    Field shortcutDimension2Code Code[20]
    Field currencyId Guid
    Field currencyCode Text
    Field pricesIncludeTax Boolean
    Field paymentTermsId Guid
    Field shipmentMethodId Guid
    Field purchaser Code[20]
    Field requestedReceiptDate Date
    Sub page purchaseOrderLines
    Field discountAmount Decimal
    Field discountAppliedBeforeTax Boolean Yes
    Field totalAmountExcludingTax Decimal Yes
    Field totalTaxAmount Decimal Yes
    Field totalAmountIncludingTax Decimal Yes
    Field fullyReceived Boolean
    Field status Enum "Purchase Order Entity Buffer Status" Yes
    Field lastModifiedDateTime DateTime 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 v25.2.234077.0

    Back to top Copyright © 2020 SmartApps
    Generated by DocFX