Skip to main content

Actions

The ballerinax/sap.businessone.purchasing package exposes the following clients:

Available clients:

ClientPurpose
ClientManages SAP Business One purchasing (A/P) documents — purchase requests & quotations, purchase orders & delivery notes, A/P invoices, credit notes & down payments, purchase returns & goods return requests, correction purchase invoices & reversals, landed costs & landed cost codes, and purchase tax invoices — over the session-authenticated Service Layer (OData V3).

Client

The Client provides access to the purchasing (A/P) documents exposed by the SAP Business One Service Layer — purchase requests, quotations, orders, delivery notes, invoices, credit notes, down payments, returns, goods return requests, correction invoices and their reversals, landed costs, landed cost codes, and purchase tax invoices.

Configuration

SessionConfig

SAP Business One Service Layer session credentials, passed as the first argument to the client initializer.

FieldTypeDefaultDescription
companyDbstringRequiredThe SAP Business One company database to log in to
usernamestringRequiredThe Service Layer user name
passwordstringRequiredThe Service Layer user password

ConnectionConfig

Provides a set of configurations for controlling the behaviours when communicating with the Service Layer HTTP endpoint. Passed as the optional second argument to the client initializer.

FieldTypeDefaultDescription
httpVersionhttp:HttpVersionhttp:HTTP_2_0The HTTP version understood by the client
http1Settingshttp:ClientHttp1SettingsConfigurations related to HTTP/1.x protocol
http2Settingshttp:ClientHttp2SettingsConfigurations related to HTTP/2 protocol
timeoutdecimal30The maximum time to wait (in seconds) for a response before closing the connection
forwardedstring"disable"The choice of setting forwarded/x-forwarded header
followRedirectshttp:FollowRedirectsOptionalConfigurations associated with redirection
poolConfighttp:PoolConfigurationOptionalConfigurations associated with request pooling
cachehttp:CacheConfigHTTP caching related configurations
compressionhttp:Compressionhttp:COMPRESSION_AUTOSpecifies the way of handling compression (accept-encoding) header
circuitBreakerhttp:CircuitBreakerConfigOptionalConfigurations associated with the behaviour of the Circuit Breaker
retryConfighttp:RetryConfigOptionalConfigurations associated with retrying
cookieConfighttp:CookieConfigOptionalConfigurations associated with cookies
responseLimitshttp:ResponseLimitConfigsConfigurations associated with inbound response size limits
secureSockethttp:ClientSecureSocketOptionalSSL/TLS-related options
proxyhttp:ProxyConfigOptionalProxy server related options
socketConfighttp:ClientSocketConfigProvides settings related to client socket configuration
validationbooleantrueEnables the inbound payload validation functionality provided by the constraint package
laxDataBindingbooleantrueEnables relaxed data binding on the client side, treating nil values and absent fields as optional

The client also accepts a serviceUrl string parameter — the base URL of the target Service Layer instance — which defaults to https://localhost:50000/b1s/v1.

Initializing the client

import ballerinax/sap.businessone;
import ballerinax/sap.businessone.purchasing;

businessone:SessionConfig session = {
companyDb: "SBODemoUS",
username: "manager",
password: "<password>"
};

purchasing:Client client = check new (session, serviceUrl = "https://<host>:50000/b1s/v1");

Operations

CorrectionPurchaseInvoiceReversal

listCorrectionPurchaseInvoiceReversal

Queries the CorrectionPurchaseInvoiceReversal collection and returns a page of documents, supporting OData query options for paging, filtering, sorting, and field selection.

Parameters:

NameTypeRequiredDescription
headersListCorrectionPurchaseInvoiceReversalHeadersNoHeaders to be sent with the request; supports the Prefer header for Service Layer paging control (e.g. odata.maxpagesize=100)
queriesListCorrectionPurchaseInvoiceReversalQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, and $select

Returns: CorrectionPurchaseInvoiceReversalCollectionResponse|error

Sample code:

CorrectionPurchaseInvoiceReversalCollectionResponse result = check client->listCorrectionPurchaseInvoiceReversal();

Sample response:

{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#CorrectionPurchaseInvoiceReversal",
"value": [
{
"DocEntry": 12,
"DocNum": 12,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
],
"odata.nextLink": "CorrectionPurchaseInvoiceReversal?$skip=20"
}
createCorrectionPurchaseInvoiceReversal

Creates a new correction purchase invoice reversal document and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadDocumentYesThe document entity to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->createCorrectionPurchaseInvoiceReversal(payload);

Sample response:

{
"DocEntry": 12,
"DocNum": 12,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
getCorrectionPurchaseInvoiceReversal

Retrieves a single correction purchase invoice reversal document by its DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetCorrectionPurchaseInvoiceReversalQueriesNoOData query options: $expand and $select

Returns: Document|error

Sample code:

Document result = check client->getCorrectionPurchaseInvoiceReversal(12);

Sample response:

{
"DocEntry": 12,
"DocNum": 12,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
deleteCorrectionPurchaseInvoiceReversal

Deletes the correction purchase invoice reversal document identified by the given DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteCorrectionPurchaseInvoiceReversal(12);
updateCorrectionPurchaseInvoiceReversal

Partially updates the correction purchase invoice reversal document identified by DocEntry using PATCH/MERGE semantics.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
payloadDocumentYesThe document fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateCorrectionPurchaseInvoiceReversal(12, payload);
correctionPurchaseInvoiceReversalCancel

Invokes the bound action 'Cancel' on the CorrectionPurchaseInvoiceReversal document identified by DocEntry.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceReversalCancel(12);
correctionPurchaseInvoiceReversalClose

Invokes the bound action 'Close' on the CorrectionPurchaseInvoiceReversal document identified by DocEntry.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceReversalClose(12);
correctionPurchaseInvoiceReversalCreateCancellationDocument

Invokes the bound action 'CreateCancellationDocument' on the CorrectionPurchaseInvoiceReversal document identified by DocEntry and returns the resulting cancellation document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->correctionPurchaseInvoiceReversalCreateCancellationDocument(12);

Sample response:

{
"DocEntry": 13,
"DocNum": 13,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
correctionPurchaseInvoiceReversalReopen

Invokes the bound action 'Reopen' on the CorrectionPurchaseInvoiceReversal document identified by DocEntry.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceReversalReopen(12);
correctionPurchaseInvoiceReversalServiceApproveAndAdd

Approves and adds a correction purchase invoice reversal document via the CorrectionPurchaseInvoiceReversalService_ApproveAndAdd service operation.

Parameters:

NameTypeRequiredDescription
payloadCorrectionPurchaseInvoiceReversalService_ApproveAndAdd_bodyYesRequest payload wrapping the Document to approve and add
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceReversalServiceApproveAndAdd(payload);
correctionPurchaseInvoiceReversalServiceApproveAndUpdate

Approves and updates a correction purchase invoice reversal document via the CorrectionPurchaseInvoiceReversalService_ApproveAndUpdate service operation.

Parameters:

NameTypeRequiredDescription
payloadCorrectionPurchaseInvoiceReversalService_ApproveAndUpdate_bodyYesRequest payload wrapping the Document to approve and update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceReversalServiceApproveAndUpdate(payload);
correctionPurchaseInvoiceReversalServiceCloseByDate

Closes a correction purchase invoice reversal document by date via the CorrectionPurchaseInvoiceReversalService_CloseByDate service operation.

Parameters:

NameTypeRequiredDescription
payloadCorrectionPurchaseInvoiceReversalService_CloseByDate_bodyYesRequest payload wrapping DocumentCloseParams (docEntry, specifiedClosingDate, closingOption)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceReversalServiceCloseByDate(payload);
correctionPurchaseInvoiceReversalServiceExportEWayBill

Exports an E-Way bill for a correction purchase invoice reversal document via the CorrectionPurchaseInvoiceReversalService_ExportEWayBill service operation.

Parameters:

NameTypeRequiredDescription
payloadCorrectionPurchaseInvoiceReversalService_ExportEWayBill_bodyYesRequest payload wrapping the Document for which to export the E-Way bill
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceReversalServiceExportEWayBill(payload);
correctionPurchaseInvoiceReversalServiceGetApprovalTemplates

Retrieves the approval templates applicable to a correction purchase invoice reversal document via the CorrectionPurchaseInvoiceReversalService_GetApprovalTemplates service operation.

Parameters:

NameTypeRequiredDescription
payloadCorrectionPurchaseInvoiceReversalService_GetApprovalTemplates_bodyYesRequest payload wrapping the Document to evaluate for approval templates
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->correctionPurchaseInvoiceReversalServiceGetApprovalTemplates(payload);

Sample response:

{
"DocEntry": 12,
"DocNum": 12,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
correctionPurchaseInvoiceReversalServiceHandleApprovalRequest

Handles an approval request for correction purchase invoice reversals via the CorrectionPurchaseInvoiceReversalService_HandleApprovalRequest service operation.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceReversalServiceHandleApprovalRequest();
correctionPurchaseInvoiceReversalServiceInitData

Initializes document data via the CorrectionPurchaseInvoiceReversalService_InitData service operation and returns the initialized document.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->correctionPurchaseInvoiceReversalServiceInitData();

Sample response:

{
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}

PurchaseDownPayments

listPurchaseDownPayments

Queries the PurchaseDownPayments collection and returns a page of documents, supporting OData query options for paging, filtering, sorting, and field selection.

Parameters:

NameTypeRequiredDescription
headersListPurchaseDownPaymentsHeadersNoHeaders to be sent with the request; supports the Prefer header for Service Layer paging control (e.g. odata.maxpagesize=100)
queriesListPurchaseDownPaymentsQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, and $select

Returns: PurchaseDownPaymentsCollectionResponse|error

Sample code:

PurchaseDownPaymentsCollectionResponse result = check client->listPurchaseDownPayments();

Sample response:

{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#PurchaseDownPayments",
"value": [
{
"DocEntry": 8,
"DocNum": 8,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
],
"odata.nextLink": "PurchaseDownPayments?$skip=20"
}
createPurchaseDownPayments

Creates a new purchase down payment document and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadDocumentYesThe document entity to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->createPurchaseDownPayments(payload);

Sample response:

{
"DocEntry": 8,
"DocNum": 8,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
getPurchaseDownPayments

Retrieves a single purchase down payment document by its DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetPurchaseDownPaymentsQueriesNoOData query options: $expand and $select

Returns: Document|error

Sample code:

Document result = check client->getPurchaseDownPayments(8);

Sample response:

{
"DocEntry": 8,
"DocNum": 8,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
deletePurchaseDownPayments

Deletes the purchase down payment document identified by the given DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deletePurchaseDownPayments(8);
updatePurchaseDownPayments

Partially updates the purchase down payment document identified by DocEntry using PATCH/MERGE semantics.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
payloadDocumentYesThe document fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updatePurchaseDownPayments(8, payload);
purchaseDownPaymentsCancel

Invokes the bound action 'Cancel' on the PurchaseDownPayments document identified by DocEntry.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDownPaymentsCancel(8);
purchaseDownPaymentsClose

Invokes the bound action 'Close' on the PurchaseDownPayments document identified by DocEntry.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDownPaymentsClose(8);
purchaseDownPaymentsCreateCancellationDocument

Invokes the bound action 'CreateCancellationDocument' on the PurchaseDownPayments document identified by DocEntry and returns the resulting cancellation document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseDownPaymentsCreateCancellationDocument(8);

Sample response:

{
"DocEntry": 9,
"DocNum": 9,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
purchaseDownPaymentsReopen

Invokes the bound action 'Reopen' on the PurchaseDownPayments document identified by DocEntry.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDownPaymentsReopen(8);
purchaseDownPaymentsServiceApproveAndAdd

Approves and adds a purchase down payment document via the PurchaseDownPaymentsService_ApproveAndAdd service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseDownPaymentsService_ApproveAndAdd_bodyYesRequest payload wrapping the Document to approve and add
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDownPaymentsServiceApproveAndAdd(payload);
purchaseDownPaymentsServiceApproveAndUpdate

Approves and updates a purchase down payment document via the PurchaseDownPaymentsService_ApproveAndUpdate service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseDownPaymentsService_ApproveAndUpdate_bodyYesRequest payload wrapping the Document to approve and update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDownPaymentsServiceApproveAndUpdate(payload);
purchaseDownPaymentsServiceCloseByDate

Closes a purchase down payment document by date via the PurchaseDownPaymentsService_CloseByDate service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseDownPaymentsService_CloseByDate_bodyYesRequest payload wrapping DocumentCloseParams (docEntry, specifiedClosingDate, closingOption)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDownPaymentsServiceCloseByDate(payload);
purchaseDownPaymentsServiceExportEWayBill

Exports an E-Way bill for a purchase down payment document via the PurchaseDownPaymentsService_ExportEWayBill service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseDownPaymentsService_ExportEWayBill_bodyYesRequest payload wrapping the Document for which to export the E-Way bill
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDownPaymentsServiceExportEWayBill(payload);
purchaseDownPaymentsServiceGetApprovalTemplates

Retrieves the approval templates applicable to a purchase down payment document via the PurchaseDownPaymentsService_GetApprovalTemplates service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseDownPaymentsService_GetApprovalTemplates_bodyYesRequest payload wrapping the Document to evaluate for approval templates
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseDownPaymentsServiceGetApprovalTemplates(payload);

Sample response:

{
"DocEntry": 8,
"DocNum": 8,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
purchaseDownPaymentsServiceHandleApprovalRequest

Handles an approval request for purchase down payments via the PurchaseDownPaymentsService_HandleApprovalRequest service operation.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDownPaymentsServiceHandleApprovalRequest();
purchaseDownPaymentsServiceInitData

Initializes document data via the PurchaseDownPaymentsService_InitData service operation and returns the initialized document.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseDownPaymentsServiceInitData();

Sample response:

{
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}

PurchaseInvoices

listPurchaseInvoices

Queries the PurchaseInvoices collection and returns a page of documents, supporting OData query options for paging, filtering, sorting, and field selection.

Parameters:

NameTypeRequiredDescription
headersListPurchaseInvoicesHeadersNoHeaders to be sent with the request; supports the Prefer header for Service Layer paging control (e.g. odata.maxpagesize=100)
queriesListPurchaseInvoicesQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, and $select

Returns: PurchaseInvoicesCollectionResponse|error

Sample code:

PurchaseInvoicesCollectionResponse result = check client->listPurchaseInvoices();

Sample response:

{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#PurchaseInvoices",
"value": [
{
"DocEntry": 17,
"DocNum": 17,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
],
"odata.nextLink": "PurchaseInvoices?$skip=20"
}
createPurchaseInvoices

Creates a new purchase invoice document and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadDocumentYesThe document entity to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->createPurchaseInvoices(payload);

Sample response:

{
"DocEntry": 17,
"DocNum": 17,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
getPurchaseInvoices

Retrieves a single purchase invoice document by its DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetPurchaseInvoicesQueriesNoOData query options: $expand and $select

Returns: Document|error

Sample code:

Document result = check client->getPurchaseInvoices(17);

Sample response:

{
"DocEntry": 17,
"DocNum": 17,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
deletePurchaseInvoices

Deletes the purchase invoice document identified by the given DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deletePurchaseInvoices(17);
updatePurchaseInvoices

Partially updates the purchase invoice document identified by DocEntry using PATCH/MERGE semantics.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
payloadDocumentYesThe document fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updatePurchaseInvoices(17, payload);
purchaseInvoicesCancel

Invokes the bound action 'Cancel' on the PurchaseInvoices document identified by DocEntry.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseInvoicesCancel(17);
purchaseInvoicesClose

Invokes the bound action 'Close' on the PurchaseInvoices document identified by DocEntry.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseInvoicesClose(17);
purchaseInvoicesCreateCancellationDocument

Invokes the bound action 'CreateCancellationDocument' on the PurchaseInvoices document identified by DocEntry and returns the resulting cancellation document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseInvoicesCreateCancellationDocument(17);

Sample response:

{
"DocEntry": 18,
"DocNum": 18,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
purchaseInvoicesReopen

Invokes the bound action 'Reopen' on the PurchaseInvoices document identified by DocEntry.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseInvoicesReopen(17);
purchaseInvoicesServiceApproveAndAdd

Approves and adds a purchase invoice document via the PurchaseInvoicesService_ApproveAndAdd service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseInvoicesService_ApproveAndAdd_bodyYesRequest payload wrapping the Document to approve and add
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseInvoicesServiceApproveAndAdd(payload);
purchaseInvoicesServiceApproveAndUpdate

Approves and updates a purchase invoice document via the PurchaseInvoicesService_ApproveAndUpdate service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseInvoicesService_ApproveAndUpdate_bodyYesRequest payload wrapping the Document to approve and update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseInvoicesServiceApproveAndUpdate(payload);
purchaseInvoicesServiceCancel2

Cancels a purchase invoice via the PurchaseInvoicesService_Cancel2 service operation, passing the document in the request payload.

Parameters:

NameTypeRequiredDescription
payloadPurchaseInvoicesService_Cancel2_bodyYesRequest payload wrapping the Document to cancel
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseInvoicesServiceCancel2(payload);
purchaseInvoicesServiceCloseByDate

Closes a purchase invoice document by date via the PurchaseInvoicesService_CloseByDate service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseInvoicesService_CloseByDate_bodyYesRequest payload wrapping DocumentCloseParams (docEntry, specifiedClosingDate, closingOption)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseInvoicesServiceCloseByDate(payload);
purchaseInvoicesServiceExportEWayBill

Exports an E-Way bill for a purchase invoice document via the PurchaseInvoicesService_ExportEWayBill service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseInvoicesService_ExportEWayBill_bodyYesRequest payload wrapping the Document for which to export the E-Way bill
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseInvoicesServiceExportEWayBill(payload);
purchaseInvoicesServiceGetApprovalTemplates

Retrieves the approval templates applicable to a purchase invoice document via the PurchaseInvoicesService_GetApprovalTemplates service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseInvoicesService_GetApprovalTemplates_bodyYesRequest payload wrapping the Document to evaluate for approval templates
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseInvoicesServiceGetApprovalTemplates(payload);

Sample response:

{
"DocEntry": 17,
"DocNum": 17,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
purchaseInvoicesServiceHandleApprovalRequest

Handles an approval request for purchase invoices via the PurchaseInvoicesService_HandleApprovalRequest service operation.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseInvoicesServiceHandleApprovalRequest();
purchaseInvoicesServiceInitData

Initializes document data via the PurchaseInvoicesService_InitData service operation and returns the initialized document.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseInvoicesServiceInitData();

Sample response:

{
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}

PurchaseRequests

purchaseRequestServiceApproveAndAdd

Approves and adds a purchase request document via the PurchaseRequestService_ApproveAndAdd service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseRequestService_ApproveAndAdd_bodyYesRequest payload wrapping the Document to approve and add
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseRequestServiceApproveAndAdd(payload);
purchaseRequestServiceApproveAndUpdate

Approves and updates a purchase request document via the PurchaseRequestService_ApproveAndUpdate service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseRequestService_ApproveAndUpdate_bodyYesRequest payload wrapping the Document to approve and update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseRequestServiceApproveAndUpdate(payload);
purchaseRequestServiceCloseByDate

Closes a purchase request document by date via the PurchaseRequestService_CloseByDate service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseRequestService_CloseByDate_bodyYesRequest payload wrapping DocumentCloseParams (docEntry, specifiedClosingDate, closingOption)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseRequestServiceCloseByDate(payload);
purchaseRequestServiceExportEWayBill

Exports an E-Way bill for a purchase request document via the PurchaseRequestService_ExportEWayBill service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseRequestService_ExportEWayBill_bodyYesRequest payload wrapping the Document for which to export the E-Way bill
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseRequestServiceExportEWayBill(payload);
purchaseRequestServiceGetApprovalTemplates

Retrieves the approval templates applicable to a purchase request document via the PurchaseRequestService_GetApprovalTemplates service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseRequestService_GetApprovalTemplates_bodyYesRequest payload wrapping the Document to evaluate for approval templates
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseRequestServiceGetApprovalTemplates(payload);

Sample response:

{
"DocEntry": 5,
"DocNum": 5,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
purchaseRequestServiceHandleApprovalRequest

Handles an approval request for purchase requests via the PurchaseRequestService_HandleApprovalRequest service operation.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseRequestServiceHandleApprovalRequest();
purchaseRequestServiceInitData

Initializes document data via the PurchaseRequestService_InitData service operation and returns the initialized document.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseRequestServiceInitData();

Sample response:

{
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
listPurchaseRequests

Queries the PurchaseRequests collection and returns a page of documents, supporting OData query options for paging, filtering, sorting, and field selection.

Parameters:

NameTypeRequiredDescription
headersListPurchaseRequestsHeadersNoHeaders to be sent with the request; supports the Prefer header for Service Layer paging control (e.g. odata.maxpagesize=100)
queriesListPurchaseRequestsQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, and $select

Returns: PurchaseRequestsCollectionResponse|error

Sample code:

PurchaseRequestsCollectionResponse result = check client->listPurchaseRequests();

Sample response:

{
"odata.metadata": "https://localhost:50000/b1s/v1/$metadata#PurchaseRequests",
"value": [
{
"DocEntry": 5,
"DocNum": 5,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
],
"odata.nextLink": "PurchaseRequests?$skip=20"
}
createPurchaseRequests

Creates a new purchase request document and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadDocumentYesThe document entity to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->createPurchaseRequests(payload);

Sample response:

{
"DocEntry": 5,
"DocNum": 5,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
getPurchaseRequests

Retrieves a single purchase request document by its DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetPurchaseRequestsQueriesNoOData query options: $expand and $select

Returns: Document|error

Sample code:

Document result = check client->getPurchaseRequests(5);

Sample response:

{
"DocEntry": 5,
"DocNum": 5,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
deletePurchaseRequests

Deletes the purchase request document identified by the given DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deletePurchaseRequests(5);
updatePurchaseRequests

Partially updates the purchase request document identified by DocEntry using PATCH/MERGE semantics.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
payloadDocumentYesThe document fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updatePurchaseRequests(5, payload);
purchaseRequestsCancel

Invokes the bound action 'Cancel' on the PurchaseRequests document identified by DocEntry.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseRequestsCancel(5);
purchaseRequestsClose

Invokes the bound action 'Close' on the PurchaseRequests document identified by DocEntry.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseRequestsClose(5);
purchaseRequestsCreateCancellationDocument

Invokes the bound action 'CreateCancellationDocument' on the PurchaseRequests document identified by DocEntry and returns the resulting cancellation document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseRequestsCreateCancellationDocument(5);

Sample response:

{
"DocEntry": 6,
"DocNum": 6,
"DocType": "dDocument_Items",
"DocDate": "2026-07-01"
}
purchaseRequestsReopen

Invokes the bound action 'Reopen' on the PurchaseRequests document identified by DocEntry.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseRequestsReopen(5);

LandedCosts

listLandedCosts

Queries the LandedCosts collection and returns a page of landed cost entities, with optional OData query parameters for filtering, sorting, paging, and field selection.

Parameters:

NameTypeRequiredDescription
headersListLandedCostsHeadersNoHeaders to be sent with the request, e.g. the Prefer header for Service Layer paging control
queriesListLandedCostsQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select

Returns: LandedCostsCollectionResponse|error

Sample code:

LandedCostsCollectionResponse response = check client->listLandedCosts(dollarTop = 10);

Sample response:

{
"odata.metadata": "https://server:50000/b1s/v2/$metadata#LandedCosts",
"value": [
{
"DocEntry": 1,
"LandedCostNumber": 1,
"PostingDate": "2026-07-01",
"VendorCode": "V10000",
"VendorName": "Acme Associates",
"ClosedDocument": "lcOpen",
"DocumentCurrency": "USD"
}
],
"odata.nextLink": "LandedCosts?$skip=20"
}
createLandedCosts

Creates a new LandedCost entity in SAP Business One and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadLandedCostYesRequest payload representing the landed cost to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: LandedCost|error

Sample code:

LandedCost created = check client->createLandedCosts({VendorCode: "V10000", PostingDate: "2026-07-01"});

Sample response:

{
"DocEntry": 5,
"LandedCostNumber": 5,
"PostingDate": "2026-07-01",
"VendorCode": "V10000",
"VendorName": "Acme Associates",
"ClosedDocument": "lcOpen",
"DocumentCurrency": "USD"
}
getLandedCosts

Retrieves a single LandedCost entity by its DocEntry key, with optional $expand and $select query options.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetLandedCostsQueriesNoOData query options: $expand, $select

Returns: LandedCost|error

Sample code:

LandedCost landedCost = check client->getLandedCosts(5);

Sample response:

{
"DocEntry": 5,
"LandedCostNumber": 5,
"PostingDate": "2026-07-01",
"VendorCode": "V10000",
"VendorName": "Acme Associates",
"ClosedDocument": "lcOpen",
"DocumentCurrency": "USD"
}
deleteLandedCosts

Deletes a LandedCost entity identified by its DocEntry key; no content is returned on success.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteLandedCosts(5);
updateLandedCosts

Partially updates a LandedCost entity (PATCH/MERGE semantics) identified by its DocEntry key; no content is returned on success.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
payloadLandedCostYesRequest payload containing the fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateLandedCosts(5, {Remarks: "Updated remarks"});
landedCostsCancelLandedCost

Invokes the bound action 'CancelLandedCost' on a LandedCost entity identified by its DocEntry key to cancel the landed cost document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->landedCostsCancelLandedCost(5);
landedCostsCloseLandedCost

Invokes the bound action 'CloseLandedCost' on a LandedCost entity identified by its DocEntry key to close the landed cost document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->landedCostsCloseLandedCost(5);
landedCostsServiceGetLandedCostList

Retrieves the landed cost list via the LandedCostsService_GetLandedCostList service operation.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: inline_response_200|error

Sample code:

inline_response_200 result = check client->landedCostsServiceGetLandedCostList();

Sample response:

{
"odata.metadata": "https://server:50000/b1s/v2/$metadata#Collection(SAPB1.LandedCostParams)",
"value": [
{
"DocEntry": 1
},
{
"DocEntry": 2
}
]
}

PurchaseOrders

listPurchaseOrders

Queries the PurchaseOrders collection and returns a page of purchase order documents, with optional OData query parameters for filtering, sorting, paging, and field selection.

Parameters:

NameTypeRequiredDescription
headersListPurchaseOrdersHeadersNoHeaders to be sent with the request, e.g. the Prefer header for Service Layer paging control
queriesListPurchaseOrdersQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select

Returns: PurchaseOrdersCollectionResponse|error

Sample code:

PurchaseOrdersCollectionResponse response = check client->listPurchaseOrders(dollarTop = 10);

Sample response:

{
"odata.metadata": "https://server:50000/b1s/v2/$metadata#PurchaseOrders",
"value": [
{
"DocEntry": 11,
"DocNum": 11,
"DocDate": "2026-07-01",
"DocDueDate": "2026-07-31",
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 1500.0,
"DocCurrency": "USD"
}
],
"odata.nextLink": "PurchaseOrders?$skip=20"
}
createPurchaseOrders

Creates a new purchase order Document and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadDocumentYesRequest payload representing the purchase order document to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document created = check client->createPurchaseOrders({CardCode: "V10000", DocDueDate: "2026-07-31"});

Sample response:

{
"DocEntry": 11,
"DocNum": 11,
"DocDate": "2026-07-01",
"DocDueDate": "2026-07-31",
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 1500.0,
"DocCurrency": "USD"
}
getPurchaseOrders

Retrieves a single purchase order Document by its DocEntry key, with optional $expand and $select query options.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetPurchaseOrdersQueriesNoOData query options: $expand, $select

Returns: Document|error

Sample code:

Document purchaseOrder = check client->getPurchaseOrders(11);

Sample response:

{
"DocEntry": 11,
"DocNum": 11,
"DocDate": "2026-07-01",
"DocDueDate": "2026-07-31",
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 1500.0,
"DocCurrency": "USD"
}
deletePurchaseOrders

Deletes a purchase order Document identified by its DocEntry key; no content is returned on success.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deletePurchaseOrders(11);
updatePurchaseOrders

Partially updates a purchase order Document (PATCH/MERGE semantics) identified by its DocEntry key; no content is returned on success.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
payloadDocumentYesRequest payload containing the fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updatePurchaseOrders(11, {Comments: "Updated comments"});
purchaseOrdersCancel

Invokes the bound action 'Cancel' on a purchase order Document identified by its DocEntry key to cancel the document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseOrdersCancel(11);
purchaseOrdersClose

Invokes the bound action 'Close' on a purchase order Document identified by its DocEntry key to close the document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseOrdersClose(11);
purchaseOrdersCreateCancellationDocument

Invokes the bound action 'CreateCancellationDocument' on a purchase order identified by its DocEntry key and returns the resulting cancellation Document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document cancellationDoc = check client->purchaseOrdersCreateCancellationDocument(11);

Sample response:

{
"DocEntry": 12,
"DocNum": 12,
"DocDate": "2026-07-02",
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 1500.0
}
purchaseOrdersReopen

Invokes the bound action 'Reopen' on a purchase order Document identified by its DocEntry key to reopen the document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseOrdersReopen(11);
purchaseOrdersServiceApproveAndAdd

Approves and adds a purchase order via the PurchaseOrdersService_ApproveAndAdd service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseOrdersService_ApproveAndAdd_bodyYesRequest payload wrapping the purchase order document to approve and add
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseOrdersServiceApproveAndAdd({document: {CardCode: "V10000", DocDueDate: "2026-07-31"}});
purchaseOrdersServiceApproveAndUpdate

Approves and updates a purchase order via the PurchaseOrdersService_ApproveAndUpdate service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseOrdersService_ApproveAndUpdate_bodyYesRequest payload wrapping the purchase order document to approve and update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseOrdersServiceApproveAndUpdate({document: {DocEntry: 11, Comments: "Approved"}});
purchaseOrdersServiceCloseByDate

Closes purchase orders by date via the PurchaseOrdersService_CloseByDate service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseOrdersService_CloseByDate_bodyYesRequest payload wrapping the document close parameters
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseOrdersServiceCloseByDate({documentCloseParams: {docEntry: 11, specifiedClosingDate: "2026-07-31"}});
purchaseOrdersServiceExportEWayBill

Exports an e-way bill for a purchase order via the PurchaseOrdersService_ExportEWayBill service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseOrdersService_ExportEWayBill_bodyYesRequest payload wrapping the purchase order document
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseOrdersServiceExportEWayBill({document: {DocEntry: 11}});
purchaseOrdersServiceGetApprovalTemplates

Gets the approval templates for a purchase order via the PurchaseOrdersService_GetApprovalTemplates service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseOrdersService_GetApprovalTemplates_bodyYesRequest payload wrapping the purchase order document to evaluate
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseOrdersServiceGetApprovalTemplates({document: {CardCode: "V10000"}});

Sample response:

{
"DocEntry": 11,
"DocNum": 11,
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 1500.0
}
purchaseOrdersServiceHandleApprovalRequest

Handles an approval request for purchase orders via the PurchaseOrdersService_HandleApprovalRequest service operation.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseOrdersServiceHandleApprovalRequest();
purchaseOrdersServiceInitData

Initializes purchase order data via the PurchaseOrdersService_InitData service operation and returns the initialized Document.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document initData = check client->purchaseOrdersServiceInitData();

Sample response:

{
"DocDate": "2026-07-14",
"DocDueDate": "2026-07-14",
"DocCurrency": "USD",
"DocRate": 1.0
}

PurchaseQuotations

listPurchaseQuotations

Queries the PurchaseQuotations collection and returns a page of purchase quotation documents, with optional OData query parameters for filtering, sorting, paging, and field selection.

Parameters:

NameTypeRequiredDescription
headersListPurchaseQuotationsHeadersNoHeaders to be sent with the request, e.g. the Prefer header for Service Layer paging control
queriesListPurchaseQuotationsQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select

Returns: PurchaseQuotationsCollectionResponse|error

Sample code:

PurchaseQuotationsCollectionResponse response = check client->listPurchaseQuotations(dollarTop = 10);

Sample response:

{
"odata.metadata": "https://server:50000/b1s/v2/$metadata#PurchaseQuotations",
"value": [
{
"DocEntry": 7,
"DocNum": 7,
"DocDate": "2026-07-01",
"DocDueDate": "2026-07-31",
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 850.0,
"DocCurrency": "USD"
}
],
"odata.nextLink": "PurchaseQuotations?$skip=20"
}
createPurchaseQuotations

Creates a new purchase quotation Document and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadDocumentYesRequest payload representing the purchase quotation document to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document created = check client->createPurchaseQuotations({CardCode: "V10000", DocDueDate: "2026-07-31"});

Sample response:

{
"DocEntry": 7,
"DocNum": 7,
"DocDate": "2026-07-01",
"DocDueDate": "2026-07-31",
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 850.0,
"DocCurrency": "USD"
}
getPurchaseQuotations

Retrieves a single purchase quotation Document by its DocEntry key, with optional $expand and $select query options.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetPurchaseQuotationsQueriesNoOData query options: $expand, $select

Returns: Document|error

Sample code:

Document quotation = check client->getPurchaseQuotations(7);

Sample response:

{
"DocEntry": 7,
"DocNum": 7,
"DocDate": "2026-07-01",
"DocDueDate": "2026-07-31",
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 850.0,
"DocCurrency": "USD"
}
deletePurchaseQuotations

Deletes a purchase quotation Document identified by its DocEntry key; no content is returned on success.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deletePurchaseQuotations(7);
updatePurchaseQuotations

Partially updates a purchase quotation Document (PATCH/MERGE semantics) identified by its DocEntry key; no content is returned on success.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
payloadDocumentYesRequest payload containing the fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updatePurchaseQuotations(7, {Comments: "Updated comments"});
purchaseQuotationsCancel

Invokes the bound action 'Cancel' on a purchase quotation Document identified by its DocEntry key to cancel the document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseQuotationsCancel(7);
purchaseQuotationsClose

Invokes the bound action 'Close' on a purchase quotation Document identified by its DocEntry key to close the document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseQuotationsClose(7);
purchaseQuotationsCreateCancellationDocument

Invokes the bound action 'CreateCancellationDocument' on a purchase quotation identified by its DocEntry key and returns the resulting cancellation Document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document cancellationDoc = check client->purchaseQuotationsCreateCancellationDocument(7);

Sample response:

{
"DocEntry": 8,
"DocNum": 8,
"DocDate": "2026-07-02",
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 850.0
}
purchaseQuotationsReopen

Invokes the bound action 'Reopen' on a purchase quotation Document identified by its DocEntry key to reopen the document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseQuotationsReopen(7);
purchaseQuotationsServiceApproveAndAdd

Approves and adds a purchase quotation via the PurchaseQuotationsService_ApproveAndAdd service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseQuotationsService_ApproveAndAdd_bodyYesRequest payload wrapping the purchase quotation document to approve and add
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseQuotationsServiceApproveAndAdd({document: {CardCode: "V10000", DocDueDate: "2026-07-31"}});
purchaseQuotationsServiceApproveAndUpdate

Approves and updates a purchase quotation via the PurchaseQuotationsService_ApproveAndUpdate service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseQuotationsService_ApproveAndUpdate_bodyYesRequest payload wrapping the purchase quotation document to approve and update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseQuotationsServiceApproveAndUpdate({document: {DocEntry: 7, Comments: "Approved"}});
purchaseQuotationsServiceCloseByDate

Closes purchase quotations by date via the PurchaseQuotationsService_CloseByDate service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseQuotationsService_CloseByDate_bodyYesRequest payload wrapping the document close parameters
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseQuotationsServiceCloseByDate({documentCloseParams: {docEntry: 7, specifiedClosingDate: "2026-07-31"}});
purchaseQuotationsServiceExportEWayBill

Exports an e-way bill for a purchase quotation via the PurchaseQuotationsService_ExportEWayBill service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseQuotationsService_ExportEWayBill_bodyYesRequest payload wrapping the purchase quotation document
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseQuotationsServiceExportEWayBill({document: {DocEntry: 7}});
purchaseQuotationsServiceGetApprovalTemplates

Gets the approval templates for a purchase quotation via the PurchaseQuotationsService_GetApprovalTemplates service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseQuotationsService_GetApprovalTemplates_bodyYesRequest payload wrapping the purchase quotation document to evaluate
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseQuotationsServiceGetApprovalTemplates({document: {CardCode: "V10000"}});

Sample response:

{
"DocEntry": 7,
"DocNum": 7,
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 850.0
}
purchaseQuotationsServiceHandleApprovalRequest

Handles an approval request for purchase quotations via the PurchaseQuotationsService_HandleApprovalRequest service operation.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseQuotationsServiceHandleApprovalRequest();
purchaseQuotationsServiceInitData

Initializes purchase quotation data via the PurchaseQuotationsService_InitData service operation and returns the initialized Document.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document initData = check client->purchaseQuotationsServiceInitData();

Sample response:

{
"DocDate": "2026-07-14",
"DocDueDate": "2026-07-14",
"DocCurrency": "USD",
"DocRate": 1.0
}

PurchaseReturns

listPurchaseReturns

Queries the PurchaseReturns collection and returns a page of purchase return documents, with optional OData query parameters for filtering, sorting, paging, and field selection.

Parameters:

NameTypeRequiredDescription
headersListPurchaseReturnsHeadersNoHeaders to be sent with the request, e.g. the Prefer header for Service Layer paging control
queriesListPurchaseReturnsQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select

Returns: PurchaseReturnsCollectionResponse|error

Sample code:

PurchaseReturnsCollectionResponse response = check client->listPurchaseReturns(dollarTop = 10);

Sample response:

{
"odata.metadata": "https://server:50000/b1s/v2/$metadata#PurchaseReturns",
"value": [
{
"DocEntry": 3,
"DocNum": 3,
"DocDate": "2026-07-01",
"DocDueDate": "2026-07-31",
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 320.0,
"DocCurrency": "USD"
}
],
"odata.nextLink": "PurchaseReturns?$skip=20"
}
createPurchaseReturns

Creates a new purchase return Document and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadDocumentYesRequest payload representing the purchase return document to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document created = check client->createPurchaseReturns({CardCode: "V10000", DocDueDate: "2026-07-31"});

Sample response:

{
"DocEntry": 3,
"DocNum": 3,
"DocDate": "2026-07-01",
"DocDueDate": "2026-07-31",
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 320.0,
"DocCurrency": "USD"
}
getPurchaseReturns

Retrieves a single purchase return Document by its DocEntry key, with optional $expand and $select query options.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetPurchaseReturnsQueriesNoOData query options: $expand, $select

Returns: Document|error

Sample code:

Document purchaseReturn = check client->getPurchaseReturns(3);

Sample response:

{
"DocEntry": 3,
"DocNum": 3,
"DocDate": "2026-07-01",
"DocDueDate": "2026-07-31",
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 320.0,
"DocCurrency": "USD"
}
deletePurchaseReturns

Deletes a purchase return Document identified by its DocEntry key; no content is returned on success.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deletePurchaseReturns(3);
updatePurchaseReturns

Partially updates a purchase return Document (PATCH/MERGE semantics) identified by its DocEntry key; no content is returned on success.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
payloadDocumentYesRequest payload containing the fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updatePurchaseReturns(3, {Comments: "Updated comments"});
purchaseReturnsCancel

Invokes the bound action 'Cancel' on a purchase return Document identified by its DocEntry key to cancel the document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseReturnsCancel(3);
purchaseReturnsClose

Invokes the bound action 'Close' on a purchase return Document identified by its DocEntry key to close the document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseReturnsClose(3);
purchaseReturnsCreateCancellationDocument

Invokes the bound action 'CreateCancellationDocument' on a purchase return identified by its DocEntry key and returns the resulting cancellation Document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document cancellationDoc = check client->purchaseReturnsCreateCancellationDocument(3);

Sample response:

{
"DocEntry": 4,
"DocNum": 4,
"DocDate": "2026-07-02",
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 320.0
}
purchaseReturnsReopen

Invokes the bound action 'Reopen' on a purchase return Document identified by its DocEntry key to reopen the document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseReturnsReopen(3);
purchaseReturnsServiceApproveAndAdd

Approves and adds a purchase return via the PurchaseReturnsService_ApproveAndAdd service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseReturnsService_ApproveAndAdd_bodyYesRequest payload wrapping the purchase return document to approve and add
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseReturnsServiceApproveAndAdd({document: {CardCode: "V10000", DocDueDate: "2026-07-31"}});
purchaseReturnsServiceApproveAndUpdate

Approves and updates a purchase return via the PurchaseReturnsService_ApproveAndUpdate service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseReturnsService_ApproveAndUpdate_bodyYesRequest payload wrapping the purchase return document to approve and update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseReturnsServiceApproveAndUpdate({document: {DocEntry: 3, Comments: "Approved"}});
purchaseReturnsServiceCancel2

Cancels a purchase return via the PurchaseReturnsService_Cancel2 service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseReturnsService_Cancel2_bodyYesRequest payload wrapping the purchase return document to cancel
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseReturnsServiceCancel2({document: {DocEntry: 3}});
purchaseReturnsServiceCloseByDate

Closes purchase returns by date via the PurchaseReturnsService_CloseByDate service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseReturnsService_CloseByDate_bodyYesRequest payload wrapping the document close parameters
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseReturnsServiceCloseByDate({documentCloseParams: {docEntry: 3, specifiedClosingDate: "2026-07-31"}});
purchaseReturnsServiceExportEWayBill

Exports an e-way bill for a purchase return via the PurchaseReturnsService_ExportEWayBill service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseReturnsService_ExportEWayBill_bodyYesRequest payload wrapping the purchase return document
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseReturnsServiceExportEWayBill({document: {DocEntry: 3}});
purchaseReturnsServiceGetApprovalTemplates

Gets the approval templates for a purchase return via the PurchaseReturnsService_GetApprovalTemplates service operation.

Parameters:

NameTypeRequiredDescription
payloadPurchaseReturnsService_GetApprovalTemplates_bodyYesRequest payload wrapping the purchase return document to evaluate
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseReturnsServiceGetApprovalTemplates({document: {CardCode: "V10000"}});

Sample response:

{
"DocEntry": 3,
"DocNum": 3,
"CardCode": "V10000",
"CardName": "Acme Associates",
"DocTotal": 320.0
}
purchaseReturnsServiceHandleApprovalRequest

Handles an approval request for purchase returns via the PurchaseReturnsService_HandleApprovalRequest service operation.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseReturnsServiceHandleApprovalRequest();
purchaseReturnsServiceInitData

Initializes purchase return data via the PurchaseReturnsService_InitData service operation and returns the initialized Document.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document initData = check client->purchaseReturnsServiceInitData();

Sample response:

{
"DocDate": "2026-07-14",
"DocDueDate": "2026-07-14",
"DocCurrency": "USD",
"DocRate": 1.0
}

PurchaseTaxInvoices

listPurchaseTaxInvoices

Queries the PurchaseTaxInvoices collection and returns a page of purchase tax invoice entities, with optional OData query parameters for filtering, sorting, paging, and field selection.

Parameters:

NameTypeRequiredDescription
headersListPurchaseTaxInvoicesHeadersNoHeaders to be sent with the request, e.g. the Prefer header for Service Layer paging control
queriesListPurchaseTaxInvoicesQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, $inlinecount, $select

Returns: PurchaseTaxInvoicesCollectionResponse|error

Sample code:

PurchaseTaxInvoicesCollectionResponse response = check client->listPurchaseTaxInvoices(dollarTop = 10);

Sample response:

{
"odata.metadata": "https://server:50000/b1s/v2/$metadata#PurchaseTaxInvoices",
"value": [
{
"DocEntry": 2,
"DocNum": 2,
"DocDate": "2026-07-01",
"DocDueDate": "2026-07-31",
"CardCode": "V10000",
"TaxDate": "2026-07-01",
"Comments": "Q3 tax invoice"
}
],
"odata.nextLink": "PurchaseTaxInvoices?$skip=20"
}
createPurchaseTaxInvoices

Creates a new PurchaseTaxInvoice entity and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadPurchaseTaxInvoiceYesRequest payload representing the purchase tax invoice to create
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: PurchaseTaxInvoice|error

Sample code:

PurchaseTaxInvoice created = check client->createPurchaseTaxInvoices({CardCode: "V10000", DocDate: "2026-07-01"});

Sample response:

{
"DocEntry": 2,
"DocNum": 2,
"DocDate": "2026-07-01",
"DocDueDate": "2026-07-31",
"CardCode": "V10000",
"TaxDate": "2026-07-01",
"Comments": "Q3 tax invoice"
}
getPurchaseTaxInvoices

Retrieves a single PurchaseTaxInvoice entity by its DocEntry key, with optional $expand and $select query options.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetPurchaseTaxInvoicesQueriesNoOData query options: $expand, $select

Returns: PurchaseTaxInvoice|error

Sample code:

PurchaseTaxInvoice taxInvoice = check client->getPurchaseTaxInvoices(2);

Sample response:

{
"DocEntry": 2,
"DocNum": 2,
"DocDate": "2026-07-01",
"DocDueDate": "2026-07-31",
"CardCode": "V10000",
"TaxDate": "2026-07-01",
"Comments": "Q3 tax invoice"
}
deletePurchaseTaxInvoices

Deletes a PurchaseTaxInvoice entity identified by its DocEntry key; no content is returned on success.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deletePurchaseTaxInvoices(2);
updatePurchaseTaxInvoices

Partially updates a PurchaseTaxInvoice entity (PATCH/MERGE semantics) identified by its DocEntry key; no content is returned on success.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
payloadPurchaseTaxInvoiceYesRequest payload containing the fields to update
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updatePurchaseTaxInvoices(2, {Comments: "Updated comments"});

PurchaseCreditNotes

listPurchaseCreditNotes

Retrieves a paged collection of PurchaseCreditNotes entities from the SAP Business One Service Layer, supporting OData query options for filtering, sorting, and paging.

Parameters:

NameTypeRequiredDescription
headersListPurchaseCreditNotesHeadersNoHeaders to be sent with the request
queriesListPurchaseCreditNotesQueriesNoQuery parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) to be sent with the request

Returns: PurchaseCreditNotesCollectionResponse|error

Sample code:

PurchaseCreditNotesCollectionResponse result = check client->listPurchaseCreditNotes();

Sample response:

{
"odata.metadata": "$metadata#PurchaseCreditNotes",
"value": [
{
"DocEntry": 181,
"DocNum": 181,
"CardCode": "V10000",
"CardName": "Example Vendor",
"DocDate": "2026-07-01",
"DocTotal": 1250.00
}
],
"odata.nextLink": "PurchaseCreditNotes?$skip=20"
}
createPurchaseCreditNotes

Creates a new PurchaseCreditNotes document in SAP Business One from the given payload and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadDocumentYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->createPurchaseCreditNotes(payload);

Sample response:

{
"DocEntry": 181,
"DocNum": 181,
"CardCode": "V10000",
"CardName": "Example Vendor",
"DocDate": "2026-07-01",
"DocTotal": 1250.00
}
getPurchaseCreditNotes

Retrieves a single PurchaseCreditNotes document identified by its DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetPurchaseCreditNotesQueriesNoQuery parameters ($expand, $select) to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->getPurchaseCreditNotes(181);

Sample response:

{
"DocEntry": 181,
"DocNum": 181,
"CardCode": "V10000",
"CardName": "Example Vendor",
"DocDate": "2026-07-01",
"DocTotal": 1250.00
}
deletePurchaseCreditNotes

Deletes the PurchaseCreditNotes document identified by the given DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deletePurchaseCreditNotes(181);
updatePurchaseCreditNotes

Partially updates the PurchaseCreditNotes document identified by DocEntry using PATCH/MERGE semantics.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
payloadDocumentYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updatePurchaseCreditNotes(181, payload);
purchaseCreditNotesCancel

Invokes the bound Cancel action on the PurchaseCreditNotes document, cancelling the posted document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseCreditNotesCancel(181);
purchaseCreditNotesClose

Invokes the bound Close action on the PurchaseCreditNotes document, closing the open document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseCreditNotesClose(181);
purchaseCreditNotesCreateCancellationDocument

Invokes the bound CreateCancellationDocument action, generating a cancellation document for the given PurchaseCreditNotes document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseCreditNotesCreateCancellationDocument(181);

Sample response:

{
"DocEntry": 205,
"DocNum": 205,
"CardCode": "V10000",
"DocDate": "2026-07-10",
"DocTotal": 1250.00
}
purchaseCreditNotesReopen

Invokes the bound Reopen action, reopening a previously closed PurchaseCreditNotes document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseCreditNotesReopen(181);
purchaseCreditNotesServiceApproveAndAdd

Approves a pending PurchaseCreditNotes document and adds it, completing an approval workflow that creates the underlying document.

Parameters:

NameTypeRequiredDescription
payloadPurchaseCreditNotesService_ApproveAndAdd_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseCreditNotesServiceApproveAndAdd(payload);
purchaseCreditNotesServiceApproveAndUpdate

Approves a pending change and updates the existing PurchaseCreditNotes document as part of the approval workflow.

Parameters:

NameTypeRequiredDescription
payloadPurchaseCreditNotesService_ApproveAndUpdate_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseCreditNotesServiceApproveAndUpdate(payload);
purchaseCreditNotesServiceCancel2

Cancels a posted PurchaseCreditNotes document via the alternate Cancel2 service action using the supplied document payload.

Parameters:

NameTypeRequiredDescription
payloadPurchaseCreditNotesService_Cancel2_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseCreditNotesServiceCancel2(payload);
purchaseCreditNotesServiceCloseByDate

Closes one or more PurchaseCreditNotes documents as of a specified closing date via DocumentCloseParams.

Parameters:

NameTypeRequiredDescription
payloadPurchaseCreditNotesService_CloseByDate_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseCreditNotesServiceCloseByDate(payload);
purchaseCreditNotesServiceExportEWayBill

Exports the E-Way Bill details for the given PurchaseCreditNotes document (India localization).

Parameters:

NameTypeRequiredDescription
payloadPurchaseCreditNotesService_ExportEWayBill_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseCreditNotesServiceExportEWayBill(payload);
purchaseCreditNotesServiceGetApprovalTemplates

Retrieves the approval templates applicable to the given PurchaseCreditNotes document payload.

Parameters:

NameTypeRequiredDescription
payloadPurchaseCreditNotesService_GetApprovalTemplates_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseCreditNotesServiceGetApprovalTemplates(payload);

Sample response:

{
"DocEntry": 181,
"DocNum": 181,
"CardCode": "V10000",
"DocDate": "2026-07-01"
}
purchaseCreditNotesServiceHandleApprovalRequest

Handles an incoming approval request notification for the PurchaseCreditNotes approval workflow.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseCreditNotesServiceHandleApprovalRequest();
purchaseCreditNotesServiceInitData

Initializes and returns default data used when creating a new PurchaseCreditNotes document.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseCreditNotesServiceInitData();

Sample response:

{
"DocEntry": 0,
"DocDate": "2026-07-10",
"CardCode": "",
"DocCurrency": "USD"
}

PurchaseDeliveryNotes

listPurchaseDeliveryNotes

Retrieves a paged collection of PurchaseDeliveryNotes entities from the SAP Business One Service Layer, supporting OData query options for filtering, sorting, and paging.

Parameters:

NameTypeRequiredDescription
headersListPurchaseDeliveryNotesHeadersNoHeaders to be sent with the request
queriesListPurchaseDeliveryNotesQueriesNoQuery parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) to be sent with the request

Returns: PurchaseDeliveryNotesCollectionResponse|error

Sample code:

PurchaseDeliveryNotesCollectionResponse result = check client->listPurchaseDeliveryNotes();

Sample response:

{
"odata.metadata": "$metadata#PurchaseDeliveryNotes",
"value": [
{
"DocEntry": 302,
"DocNum": 302,
"CardCode": "V20000",
"CardName": "Example Supplier",
"DocDate": "2026-07-05",
"DocTotal": 4300.50
}
],
"odata.nextLink": "PurchaseDeliveryNotes?$skip=20"
}
createPurchaseDeliveryNotes

Creates a new PurchaseDeliveryNotes document in SAP Business One from the given payload and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadDocumentYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->createPurchaseDeliveryNotes(payload);

Sample response:

{
"DocEntry": 302,
"DocNum": 302,
"CardCode": "V20000",
"CardName": "Example Supplier",
"DocDate": "2026-07-05",
"DocTotal": 4300.50
}
getPurchaseDeliveryNotes

Retrieves a single PurchaseDeliveryNotes document identified by its DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetPurchaseDeliveryNotesQueriesNoQuery parameters ($expand, $select) to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->getPurchaseDeliveryNotes(302);

Sample response:

{
"DocEntry": 302,
"DocNum": 302,
"CardCode": "V20000",
"CardName": "Example Supplier",
"DocDate": "2026-07-05",
"DocTotal": 4300.50
}
deletePurchaseDeliveryNotes

Deletes the PurchaseDeliveryNotes document identified by the given DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deletePurchaseDeliveryNotes(302);
updatePurchaseDeliveryNotes

Partially updates the PurchaseDeliveryNotes document identified by DocEntry using PATCH/MERGE semantics.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
payloadDocumentYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updatePurchaseDeliveryNotes(302, payload);
purchaseDeliveryNotesCancel

Invokes the bound Cancel action on the PurchaseDeliveryNotes document, cancelling the posted document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDeliveryNotesCancel(302);
purchaseDeliveryNotesClose

Invokes the bound Close action on the PurchaseDeliveryNotes document, closing the open document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDeliveryNotesClose(302);
purchaseDeliveryNotesCreateCancellationDocument

Invokes the bound CreateCancellationDocument action, generating a cancellation document for the given PurchaseDeliveryNotes document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseDeliveryNotesCreateCancellationDocument(302);

Sample response:

{
"DocEntry": 340,
"DocNum": 340,
"CardCode": "V20000",
"DocDate": "2026-07-10",
"DocTotal": 4300.50
}
purchaseDeliveryNotesReopen

Invokes the bound Reopen action, reopening a previously closed PurchaseDeliveryNotes document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDeliveryNotesReopen(302);
purchaseDeliveryNotesServiceApproveAndAdd

Approves a pending PurchaseDeliveryNotes document and adds it, completing an approval workflow that creates the underlying document.

Parameters:

NameTypeRequiredDescription
payloadPurchaseDeliveryNotesService_ApproveAndAdd_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDeliveryNotesServiceApproveAndAdd(payload);
purchaseDeliveryNotesServiceApproveAndUpdate

Approves a pending change and updates the existing PurchaseDeliveryNotes document as part of the approval workflow.

Parameters:

NameTypeRequiredDescription
payloadPurchaseDeliveryNotesService_ApproveAndUpdate_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDeliveryNotesServiceApproveAndUpdate(payload);
purchaseDeliveryNotesServiceCancel2

Cancels a posted PurchaseDeliveryNotes document via the alternate Cancel2 service action using the supplied document payload.

Parameters:

NameTypeRequiredDescription
payloadPurchaseDeliveryNotesService_Cancel2_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDeliveryNotesServiceCancel2(payload);
purchaseDeliveryNotesServiceCloseByDate

Closes one or more PurchaseDeliveryNotes documents as of a specified closing date via DocumentCloseParams.

Parameters:

NameTypeRequiredDescription
payloadPurchaseDeliveryNotesService_CloseByDate_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDeliveryNotesServiceCloseByDate(payload);
purchaseDeliveryNotesServiceExportEWayBill

Exports the E-Way Bill details for the given PurchaseDeliveryNotes document (India localization).

Parameters:

NameTypeRequiredDescription
payloadPurchaseDeliveryNotesService_ExportEWayBill_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDeliveryNotesServiceExportEWayBill(payload);
purchaseDeliveryNotesServiceGetApprovalTemplates

Retrieves the approval templates applicable to the given PurchaseDeliveryNotes document payload.

Parameters:

NameTypeRequiredDescription
payloadPurchaseDeliveryNotesService_GetApprovalTemplates_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseDeliveryNotesServiceGetApprovalTemplates(payload);

Sample response:

{
"DocEntry": 302,
"DocNum": 302,
"CardCode": "V20000",
"DocDate": "2026-07-05"
}
purchaseDeliveryNotesServiceHandleApprovalRequest

Handles an incoming approval request notification for the PurchaseDeliveryNotes approval workflow.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->purchaseDeliveryNotesServiceHandleApprovalRequest();
purchaseDeliveryNotesServiceInitData

Initializes and returns default data used when creating a new PurchaseDeliveryNotes document.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->purchaseDeliveryNotesServiceInitData();

Sample response:

{
"DocEntry": 0,
"DocDate": "2026-07-10",
"CardCode": "",
"DocCurrency": "USD"
}

GoodsReturnRequest

listGoodsReturnRequest

Retrieves a paged collection of GoodsReturnRequest entities from the SAP Business One Service Layer, supporting OData query options for filtering, sorting, and paging.

Parameters:

NameTypeRequiredDescription
headersListGoodsReturnRequestHeadersNoHeaders to be sent with the request
queriesListGoodsReturnRequestQueriesNoQuery parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) to be sent with the request

Returns: GoodsReturnRequestCollectionResponse|error

Sample code:

GoodsReturnRequestCollectionResponse result = check client->listGoodsReturnRequest();

Sample response:

{
"odata.metadata": "$metadata#GoodsReturnRequest",
"value": [
{
"DocEntry": 55,
"DocNum": 55,
"CardCode": "V30000",
"CardName": "Example Vendor",
"DocDate": "2026-07-02",
"DocTotal": 620.00
}
],
"odata.nextLink": "GoodsReturnRequest?$skip=20"
}
createGoodsReturnRequest

Creates a new GoodsReturnRequest document in SAP Business One from the given payload and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadDocumentYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->createGoodsReturnRequest(payload);

Sample response:

{
"DocEntry": 55,
"DocNum": 55,
"CardCode": "V30000",
"CardName": "Example Vendor",
"DocDate": "2026-07-02",
"DocTotal": 620.00
}
getGoodsReturnRequest

Retrieves a single GoodsReturnRequest document identified by its DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetGoodsReturnRequestQueriesNoQuery parameters ($expand, $select) to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->getGoodsReturnRequest(55);

Sample response:

{
"DocEntry": 55,
"DocNum": 55,
"CardCode": "V30000",
"CardName": "Example Vendor",
"DocDate": "2026-07-02",
"DocTotal": 620.00
}
deleteGoodsReturnRequest

Deletes the GoodsReturnRequest document identified by the given DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteGoodsReturnRequest(55);
updateGoodsReturnRequest

Partially updates the GoodsReturnRequest document identified by DocEntry using PATCH/MERGE semantics.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
payloadDocumentYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateGoodsReturnRequest(55, payload);
goodsReturnRequestCancel

Invokes the bound Cancel action on the GoodsReturnRequest document, cancelling the posted document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->goodsReturnRequestCancel(55);
goodsReturnRequestClose

Invokes the bound Close action on the GoodsReturnRequest document, closing the open document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->goodsReturnRequestClose(55);
goodsReturnRequestCreateCancellationDocument

Invokes the bound CreateCancellationDocument action, generating a cancellation document for the given GoodsReturnRequest document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->goodsReturnRequestCreateCancellationDocument(55);

Sample response:

{
"DocEntry": 61,
"DocNum": 61,
"CardCode": "V30000",
"DocDate": "2026-07-10",
"DocTotal": 620.00
}
goodsReturnRequestReopen

Invokes the bound Reopen action, reopening a previously closed GoodsReturnRequest document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->goodsReturnRequestReopen(55);
goodsReturnRequestServiceApproveAndAdd

Approves a pending GoodsReturnRequest document and adds it, completing an approval workflow that creates the underlying document.

Parameters:

NameTypeRequiredDescription
payloadGoodsReturnRequestService_ApproveAndAdd_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->goodsReturnRequestServiceApproveAndAdd(payload);
goodsReturnRequestServiceApproveAndUpdate

Approves a pending change and updates the existing GoodsReturnRequest document as part of the approval workflow.

Parameters:

NameTypeRequiredDescription
payloadGoodsReturnRequestService_ApproveAndUpdate_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->goodsReturnRequestServiceApproveAndUpdate(payload);
goodsReturnRequestServiceCloseByDate

Closes one or more GoodsReturnRequest documents as of a specified closing date via DocumentCloseParams.

Parameters:

NameTypeRequiredDescription
payloadGoodsReturnRequestService_CloseByDate_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->goodsReturnRequestServiceCloseByDate(payload);
goodsReturnRequestServiceExportEWayBill

Exports the E-Way Bill details for the given GoodsReturnRequest document (India localization).

Parameters:

NameTypeRequiredDescription
payloadGoodsReturnRequestService_ExportEWayBill_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->goodsReturnRequestServiceExportEWayBill(payload);
goodsReturnRequestServiceGetApprovalTemplates

Retrieves the approval templates applicable to the given GoodsReturnRequest document payload.

Parameters:

NameTypeRequiredDescription
payloadGoodsReturnRequestService_GetApprovalTemplates_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->goodsReturnRequestServiceGetApprovalTemplates(payload);

Sample response:

{
"DocEntry": 55,
"DocNum": 55,
"CardCode": "V30000",
"DocDate": "2026-07-02"
}
goodsReturnRequestServiceHandleApprovalRequest

Handles an incoming approval request notification for the GoodsReturnRequest approval workflow.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->goodsReturnRequestServiceHandleApprovalRequest();
goodsReturnRequestServiceInitData

Initializes and returns default data used when creating a new GoodsReturnRequest document.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->goodsReturnRequestServiceInitData();

Sample response:

{
"DocEntry": 0,
"DocDate": "2026-07-10",
"CardCode": "",
"DocCurrency": "USD"
}

CorrectionPurchaseInvoice

listCorrectionPurchaseInvoice

Retrieves a paged collection of CorrectionPurchaseInvoice entities from the SAP Business One Service Layer, supporting OData query options for filtering, sorting, and paging.

Parameters:

NameTypeRequiredDescription
headersListCorrectionPurchaseInvoiceHeadersNoHeaders to be sent with the request
queriesListCorrectionPurchaseInvoiceQueriesNoQuery parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) to be sent with the request

Returns: CorrectionPurchaseInvoiceCollectionResponse|error

Sample code:

CorrectionPurchaseInvoiceCollectionResponse result = check client->listCorrectionPurchaseInvoice();

Sample response:

{
"odata.metadata": "$metadata#CorrectionPurchaseInvoice",
"value": [
{
"DocEntry": 12,
"DocNum": 12,
"CardCode": "V40000",
"CardName": "Example Vendor",
"DocDate": "2026-07-03",
"DocTotal": 980.25
}
],
"odata.nextLink": "CorrectionPurchaseInvoice?$skip=20"
}
createCorrectionPurchaseInvoice

Creates a new CorrectionPurchaseInvoice document in SAP Business One from the given payload and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadDocumentYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->createCorrectionPurchaseInvoice(payload);

Sample response:

{
"DocEntry": 12,
"DocNum": 12,
"CardCode": "V40000",
"CardName": "Example Vendor",
"DocDate": "2026-07-03",
"DocTotal": 980.25
}
getCorrectionPurchaseInvoice

Retrieves a single CorrectionPurchaseInvoice document identified by its DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetCorrectionPurchaseInvoiceQueriesNoQuery parameters ($expand, $select) to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->getCorrectionPurchaseInvoice(12);

Sample response:

{
"DocEntry": 12,
"DocNum": 12,
"CardCode": "V40000",
"CardName": "Example Vendor",
"DocDate": "2026-07-03",
"DocTotal": 980.25
}
deleteCorrectionPurchaseInvoice

Deletes the CorrectionPurchaseInvoice document identified by the given DocEntry key.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteCorrectionPurchaseInvoice(12);
updateCorrectionPurchaseInvoice

Partially updates the CorrectionPurchaseInvoice document identified by DocEntry using PATCH/MERGE semantics.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
payloadDocumentYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateCorrectionPurchaseInvoice(12, payload);
correctionPurchaseInvoiceCancel

Invokes the bound Cancel action on the CorrectionPurchaseInvoice document, cancelling the posted document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceCancel(12);
correctionPurchaseInvoiceClose

Invokes the bound Close action on the CorrectionPurchaseInvoice document, closing the open document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceClose(12);
correctionPurchaseInvoiceCreateCancellationDocument

Invokes the bound CreateCancellationDocument action, generating a cancellation document for the given CorrectionPurchaseInvoice document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->correctionPurchaseInvoiceCreateCancellationDocument(12);

Sample response:

{
"DocEntry": 18,
"DocNum": 18,
"CardCode": "V40000",
"DocDate": "2026-07-10",
"DocTotal": 980.25
}
correctionPurchaseInvoiceReopen

Invokes the bound Reopen action, reopening a previously closed CorrectionPurchaseInvoice document.

Parameters:

NameTypeRequiredDescription
docEntryint:Signed32YesKey property 'DocEntry' (Edm.Int32)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceReopen(12);
correctionPurchaseInvoiceServiceApproveAndAdd

Approves a pending CorrectionPurchaseInvoice document and adds it, completing an approval workflow that creates the underlying document.

Parameters:

NameTypeRequiredDescription
payloadCorrectionPurchaseInvoiceService_ApproveAndAdd_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceServiceApproveAndAdd(payload);
correctionPurchaseInvoiceServiceApproveAndUpdate

Approves a pending change and updates the existing CorrectionPurchaseInvoice document as part of the approval workflow.

Parameters:

NameTypeRequiredDescription
payloadCorrectionPurchaseInvoiceService_ApproveAndUpdate_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceServiceApproveAndUpdate(payload);
correctionPurchaseInvoiceServiceCloseByDate

Closes one or more CorrectionPurchaseInvoice documents as of a specified closing date via DocumentCloseParams.

Parameters:

NameTypeRequiredDescription
payloadCorrectionPurchaseInvoiceService_CloseByDate_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceServiceCloseByDate(payload);
correctionPurchaseInvoiceServiceExportEWayBill

Exports the E-Way Bill details for the given CorrectionPurchaseInvoice document (India localization).

Parameters:

NameTypeRequiredDescription
payloadCorrectionPurchaseInvoiceService_ExportEWayBill_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceServiceExportEWayBill(payload);
correctionPurchaseInvoiceServiceGetApprovalTemplates

Retrieves the approval templates applicable to the given CorrectionPurchaseInvoice document payload.

Parameters:

NameTypeRequiredDescription
payloadCorrectionPurchaseInvoiceService_GetApprovalTemplates_bodyYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->correctionPurchaseInvoiceServiceGetApprovalTemplates(payload);

Sample response:

{
"DocEntry": 12,
"DocNum": 12,
"CardCode": "V40000",
"DocDate": "2026-07-03"
}
correctionPurchaseInvoiceServiceHandleApprovalRequest

Handles an incoming approval request notification for the CorrectionPurchaseInvoice approval workflow.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->correctionPurchaseInvoiceServiceHandleApprovalRequest();
correctionPurchaseInvoiceServiceInitData

Initializes and returns default data used when creating a new CorrectionPurchaseInvoice document.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: Document|error

Sample code:

Document result = check client->correctionPurchaseInvoiceServiceInitData();

Sample response:

{
"DocEntry": 0,
"DocDate": "2026-07-10",
"CardCode": "",
"DocCurrency": "USD"
}

LandedCostsCodes

listLandedCostsCodes

Retrieves a paged collection of LandedCostsCodes entities from the SAP Business One Service Layer, supporting OData query options for filtering, sorting, and paging.

Parameters:

NameTypeRequiredDescription
headersListLandedCostsCodesHeadersNoHeaders to be sent with the request
queriesListLandedCostsCodesQueriesNoQuery parameters ($skip, $top, $filter, $orderby, $expand, $inlinecount, $select) to be sent with the request

Returns: LandedCostsCodesCollectionResponse|error

Sample code:

LandedCostsCodesCollectionResponse result = check client->listLandedCostsCodes();

Sample response:

{
"odata.metadata": "$metadata#LandedCostsCodes",
"value": [
{
"Code": "01",
"Name": "Freight",
"AllocationBy": "asCashValueBeforeCustoms",
"LandedCostsAllocationAccount": "_SYS00000001234"
}
],
"odata.nextLink": "LandedCostsCodes?$skip=20"
}
createLandedCostsCodes

Creates a new LandedCostsCode in SAP Business One from the given payload and returns the created entity.

Parameters:

NameTypeRequiredDescription
payloadLandedCostsCodeYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: LandedCostsCode|error

Sample code:

LandedCostsCode result = check client->createLandedCostsCodes(payload);

Sample response:

{
"Code": "01",
"Name": "Freight",
"AllocationBy": "asCashValueBeforeCustoms",
"LandedCostsAllocationAccount": "_SYS00000001234"
}
getLandedCostsCodes

Retrieves a single LandedCostsCode identified by its Code key.

Parameters:

NameTypeRequiredDescription
codestringYesKey property 'Code' (Edm.String)
headersmap<string|string[]>NoHeaders to be sent with the request
queriesGetLandedCostsCodesQueriesNoQuery parameters ($expand, $select) to be sent with the request

Returns: LandedCostsCode|error

Sample code:

LandedCostsCode result = check client->getLandedCostsCodes("01");

Sample response:

{
"Code": "01",
"Name": "Freight",
"AllocationBy": "asCashValueBeforeCustoms",
"LandedCostsAllocationAccount": "_SYS00000001234"
}
deleteLandedCostsCodes

Deletes the LandedCostsCode identified by the given Code key.

Parameters:

NameTypeRequiredDescription
codestringYesKey property 'Code' (Edm.String)
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->deleteLandedCostsCodes("01");
updateLandedCostsCodes

Partially updates the LandedCostsCode identified by Code using PATCH/MERGE semantics.

Parameters:

NameTypeRequiredDescription
codestringYesKey property 'Code' (Edm.String)
payloadLandedCostsCodeYesRequest payload
headersmap<string|string[]>NoHeaders to be sent with the request

Returns: error?

Sample code:

check client->updateLandedCostsCodes("01", payload);