Table of Contents

API - Purchase Invoices

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

Object Definition

Object TypePage
Object ID70314188
Object NameQWESR API - Purchase Invoices
Source TablePurch. Inv. Entity Aggregate

API Definition

APIPublishersmartApps
APIGroupspider
APIVersionv1.0
EntitySetNamepurchaseInvoices
EntityNamepurchaseInvoice

Service Enabled Procedures

Name Description
Post(WebServiceActionContext) Posts the current Purchase Invoice.
Release(WebServiceActionContext) Releases the current Purchase Invoice.
Reopen(WebServiceActionContext) Reopens the current Purchase Invoice.

Events

Name Description
OnAfterInsert(Record "Purch. Inv. Entity Aggregate"; Record "Purchase Header"; Text; Text; Text; Text; Text; Text; Text; Text; Text; Text; List of [Integer]) Raised after a record is inserted.
OnAfterModify(Record "Purch. Inv. Entity Aggregate"; Record "Purchase Header"; Text; Text; Text; Text; Text; Text; Text; Text; Text; Text; List of [Integer]) Raised after a record is modified.
OnGetPostedPurchaseInvoiceExtraValues(Record "Purch. Inv. Entity Aggregate"; Record "Purch. Inv. Header"; Text; Text; Text; Text; Text; Text; Text; Text; Text; Text) Raised after a record is read from the database. This event is raised if the Purchase Invoice is posted. Makes it possible to set the ExtraValues 1..10, to be returned to the client.
OnGetPurchaseInvoiceExtraValues(Record "Purch. Inv. Entity Aggregate"; Record "Purchase Header"; Text; Text; Text; Text; Text; Text; Text; Text; Text; Text) Raised after a record is read from the database. This event is raised if the Purchase Invoice is not posted. Makes it possible to set the ExtraValues 1..10, to be returned to the client.

Example

Read

Get a list of Purchase Invoices.

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

Get a single Purchase Invoice and it's lines.

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

Create

Create a new Purchase Invoice and a Purchase Invoice Line.

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

Controls

Type Name Data Type Read-only
Field id Yes
Field number Yes
Field postingDate
Field invoiceDate
Field dueDate
Field vendorInvoiceNumber
Field vendorId
Field vendorNumber
Field vendorName Yes
Field payToName Yes
Field payToContact Yes
Field payToVendorId
Field payToVendorNumber
Field shipToName
Field shipToContact
Field buyFromAddressLine1
Field buyFromAddressLine2
Field buyFromCity
Field buyFromCountry
Field buyFromState
Field buyFromPostCode
Field shipToAddressLine1
Field shipToAddressLine2
Field shipToCity
Field shipToCountry
Field shipToState
Field shipToPostCode
Field payToAddressLine1 Yes
Field payToAddressLine2 Yes
Field payToCity Yes
Field payToCountry Yes
Field payToState Yes
Field payToPostCode Yes
Field shortcutDimension1Code
Field shortcutDimension2Code
Field currencyId
Field currencyCode Text
Field orderId Yes
Field orderNumber Yes
Field purchaser
Field pricesIncludeTax
Sub page dimensionSetLines
Sub page purchaseInvoiceLines
Sub page pdfDocument Yes
Field discountAmount
Field discountAppliedBeforeTax Yes
Field totalAmountExcludingTax Yes
Field totalTaxAmount Yes
Field totalAmountIncludingTax
Field status Yes
Field lastModifiedDateTime
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 documentAttachments

This documentation is generated from Spider v27.4