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 Guid Yes
Field number Code[20] Yes
Field postingDate Date
Field invoiceDate Date
Field dueDate Date
Field vendorInvoiceNumber Code[35]
Field vendorId Guid
Field vendorNumber Code[20]
Field vendorName Text[100] Yes
Field payToName Text[100] Yes
Field payToContact 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 shipToAddressLine1 Text[100]
Field shipToAddressLine2 Text[50]
Field shipToCity Text[30]
Field shipToCountry Code[10]
Field shipToState Text[30]
Field shipToPostCode 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 shortcutDimension1Code Code[20]
Field shortcutDimension2Code Code[20]
Field currencyId Guid
Field currencyCode Text
Field orderId Guid Yes
Field orderNumber Code[20] Yes
Field purchaser Code[20]
Field pricesIncludeTax Boolean
Sub page dimensionSetLines
Sub page purchaseInvoiceLines
Sub page pdfDocument Yes
Field discountAmount Decimal
Field discountAppliedBeforeTax Boolean Yes
Field totalAmountExcludingTax Decimal Yes
Field totalTaxAmount Decimal Yes
Field totalAmountIncludingTax Decimal
Field status Enum "Invoice Entity Aggregate 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 documentAttachments

This documentation is generated from Spider v27.2