Skip to main content

Actions

The ballerinax/microsoft.dynamics365.finance.receivable package exposes the following clients:

ClientPurpose
ClientProvides create, read, update, and delete access to Microsoft Dynamics 365 Finance and Operations accounts receivable master data and transactional support entities via OData.

Client

Provides create, read, update, and delete access to Microsoft Dynamics 365 Finance and Operations accounts receivable master data and transactional support entities via OData.

Configuration

FieldTypeDefaultDescription
authOAuth2ClientCredentialsGrantConfigRequiredOAuth2 client credentials grant configuration used to authenticate with Microsoft Entra ID (tokenUrl, clientId, clientSecret, scopes).
httpVersionhttp:HttpVersionhttp:HTTP_2_0HTTP protocol version to use for outbound requests.
http1Settingshttp:ClientHttp1Settings{}Configurations related to the HTTP/1.x protocol.
secureSockethttp:ClientSecureSocket?()SSL/TLS configuration for secure connections.
proxyhttp:ProxyConfig?()HTTP proxy server configuration.

Initializing the client

import ballerinax/microsoft.dynamics365.finance.receivable;

configurable string tokenUrl = ?;
configurable string clientId = ?;
configurable string clientSecret = ?;
configurable string serviceUrl = ?;

receivable:Client fo = check new (
{
auth: {
tokenUrl,
clientId,
clientSecret
}
},
serviceUrl
);

Operations

Adv Lines

listAdvLines

Lists customer advance payment lines tied to advance reports.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoOptional HTTP headers.
queriesListAdvLinesQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, cross-company, $count, $select.

Returns: AdvLinesCollection|error

Sample code:

receivable:AdvLinesCollection result = check fo->listAdvLines();
createAdvLines

Creates an advance payment line.

Parameters:

NameTypeRequiredDescription
payloadAdvLineYesThe advance line record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: AdvLine|error

Sample code:

receivable:AdvLine result = check fo->createAdvLines({
dataAreaId: "USMF",
advanceId: "ADV-0012",
lineNum: 1,
currency: "USD",
amount: 500.00d,
mainAccount: "110110",
disbursementDate: "2026-08-01"
});
getAdvLines

Retrieves an advance payment line by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier, e.g. "USMF".
advanceIdstringYesThe advance ID key field, e.g. "ADV-0012".
lineNumdecimalYesThe line number key field, e.g. 1.
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetAdvLinesQueriesNoOData query options: $expand, $select.

Returns: AdvLine|error

Sample code:

receivable:AdvLine result = check fo->getAdvLines("USMF", "ADV-0012", 1);
deleteAdvLines

Deletes an advance payment line.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
advanceIdstringYesThe advance ID key field.
lineNumdecimalYesThe line number key field.
headersDeleteAdvLinesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteAdvLines("USMF", "ADV-0012", 1);
updateAdvLines

Updates an advance payment line.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
advanceIdstringYesThe advance ID key field.
lineNumdecimalYesThe line number key field.
payloadAdvLineYesThe fields to update.
headersUpdateAdvLinesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: AdvLine|error

Sample code:

receivable:AdvLine result = check fo->updateAdvLines("USMF", "ADV-0012", 1, {
amount: 550.00d
});

Cust Disputes

listCustDisputes

Lists customer dispute records used to track promise-to-pay and dispute resolution workflows.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoOptional HTTP headers.
queriesListCustDisputesQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, cross-company, $count, $select.

Returns: CustDisputesCollection|error

Sample code:

receivable:CustDisputesCollection result = check fo->listCustDisputes();
createCustDisputes

Creates a customer dispute record.

Parameters:

NameTypeRequiredDescription
payloadCustDisputeYesThe customer dispute record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: CustDispute|error

Sample code:

receivable:CustDispute result = check fo->createCustDisputes({
dataAreaId: "USMF",
custTrans: 100234,
status: "Disputed",
reasonCode: "QUALITY",
reasonComment: "Customer disputes invoice amount due to a quality issue",
followUpDate: "2026-09-01"
});
getCustDisputes

Retrieves a customer dispute record by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
sysRecIdintYesThe internal record ID key field, e.g. 5637144576.
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetCustDisputesQueriesNoOData query options: $expand, $select.

Returns: CustDispute|error

Sample code:

receivable:CustDispute result = check fo->getCustDisputes("USMF", 5637144576);
deleteCustDisputes

Deletes a customer dispute record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
sysRecIdintYesThe internal record ID key field.
headersDeleteCustDisputesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteCustDisputes("USMF", 5637144576);
updateCustDisputes

Updates a customer dispute record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
sysRecIdintYesThe internal record ID key field.
payloadCustDisputeYesThe fields to update.
headersUpdateCustDisputesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: CustDispute|error

Sample code:

receivable:CustDispute result = check fo->updateCustDisputes("USMF", 5637144576, {
status: "Resolved"
});

Custom APIs

listCustomApis

Lists custom API extensibility entities registered in the environment.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoOptional HTTP headers.
queriesListCustomApisQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, cross-company, $count, $select.

Returns: CustomApisCollection|error

Sample code:

receivable:CustomApisCollection result = check fo->listCustomApis();
createCustomApis

Registers a custom API entity.

Parameters:

NameTypeRequiredDescription
payloadCustomApiYesThe custom API record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: CustomApi|error

Sample code:

receivable:CustomApi result = check fo->createCustomApis({
entityTable: "CustTable",
entityName: "CustomersV2"
});
getCustomApis

Retrieves a custom API entity by its key.

Parameters:

NameTypeRequiredDescription
entityNamestringYesThe entity name key field, e.g. "CustomersV2".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetCustomApisQueriesNoOData query options: $expand, $select.

Returns: CustomApi|error

Sample code:

receivable:CustomApi result = check fo->getCustomApis("CustomersV2");
deleteCustomApis

Deletes a custom API entity.

Parameters:

NameTypeRequiredDescription
entityNamestringYesThe entity name key field.
headersDeleteCustomApisHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteCustomApis("CustomersV2");
updateCustomApis

Updates a custom API entity.

Parameters:

NameTypeRequiredDescription
entityNamestringYesThe entity name key field.
payloadCustomApiYesThe fields to update.
headersUpdateCustomApisHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: CustomApi|error

Sample code:

receivable:CustomApi result = check fo->updateCustomApis("CustomersV2", {
entityTable: "CustTableExtended"
});

Custom Fields

listCustomFields

Lists custom field extensibility entities registered in the environment.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoOptional HTTP headers.
queriesListCustomFieldsQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, cross-company, $count, $select.

Returns: CustomFieldsCollection|error

Sample code:

receivable:CustomFieldsCollection result = check fo->listCustomFields();
createCustomFields

Creates a custom field entity.

Parameters:

NameTypeRequiredDescription
payloadCustomFieldYesThe custom field record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: CustomField|error

Sample code:

receivable:CustomField result = check fo->createCustomFields({
dataAreaId: "USMF",
customField: "LOYALTYTIER",
dataType: "Text",
description: "Customer loyalty tier",
defaultText: "Standard"
});
getCustomFields

Retrieves a custom field entity by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
customFieldstringYesThe custom field key field, e.g. "LOYALTYTIER".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetCustomFieldsQueriesNoOData query options: $expand, $select.

Returns: CustomField|error

Sample code:

receivable:CustomField result = check fo->getCustomFields("USMF", "LOYALTYTIER");
deleteCustomFields

Deletes a custom field entity.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
customFieldstringYesThe custom field key field.
headersDeleteCustomFieldsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteCustomFields("USMF", "LOYALTYTIER");
updateCustomFields

Updates a custom field entity.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
customFieldstringYesThe custom field key field.
payloadCustomFieldYesThe fields to update.
headersUpdateCustomFieldsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: CustomField|error

Sample code:

receivable:CustomField result = check fo->updateCustomFields("USMF", "LOYALTYTIER", {
description: "Customer loyalty tier (revised)"
});

Custom Offices

listCustomOffices

Lists custom office extensibility entities that associate agents with office codes.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoOptional HTTP headers.
queriesListCustomOfficesQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, cross-company, $count, $select.

Returns: CustomOfficesCollection|error

Sample code:

receivable:CustomOfficesCollection result = check fo->listCustomOffices();
createCustomOffices

Creates a custom office entity.

Parameters:

NameTypeRequiredDescription
payloadCustomOfficesYesThe custom office record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: CustomOffices|error

Sample code:

receivable:CustomOffices result = check fo->createCustomOffices({
dataAreaId: "USMF",
agentAccountNumber: "AG-1001",
officeCode: "NYC01"
});
getCustomOffices

Retrieves a custom office entity by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
agentAccountNumberstringYesThe agent account number key field, e.g. "AG-1001".
officeCodestringYesThe office code key field, e.g. "NYC01".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetCustomOfficesQueriesNoOData query options: $expand, $select.

Returns: CustomOffices|error

Sample code:

receivable:CustomOffices result = check fo->getCustomOffices("USMF", "AG-1001", "NYC01");
deleteCustomOffices

Deletes a custom office entity.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
agentAccountNumberstringYesThe agent account number key field.
officeCodestringYesThe office code key field.
headersDeleteCustomOfficesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteCustomOffices("USMF", "AG-1001", "NYC01");
updateCustomOffices

Updates a custom office entity.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
agentAccountNumberstringYesThe agent account number key field.
officeCodestringYesThe office code key field.
payloadCustomOfficesYesThe fields to update.
headersUpdateCustomOfficesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: CustomOffices|error

Sample code:

receivable:CustomOffices result = check fo->updateCustomOffices("USMF", "AG-1001", "NYC01", {
officeCode: "NYC01"
});

Debt Periods

listDebtPeriods

Lists debt collection aging periods used for aging analysis.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoOptional HTTP headers.
queriesListDebtPeriodsQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, cross-company, $count, $select.

Returns: DebtPeriodsCollection|error

Sample code:

receivable:DebtPeriodsCollection result = check fo->listDebtPeriods();
createDebtPeriods

Creates a debt collection aging period.

Parameters:

NameTypeRequiredDescription
payloadDebtPeriodYesThe debt period record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: DebtPeriod|error

Sample code:

receivable:DebtPeriod result = check fo->createDebtPeriods({
dataAreaId: "USMF",
description: "0-30 days overdue",
debtType: "Debit",
periodDebtType: "Bad",
percent: 5.0d,
registerField: "CustTrans",
'by: 30,
'from: 0
});
getDebtPeriods

Retrieves a debt collection aging period by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
debtTypestringYesThe debt type key field, e.g. "Debit".
periodDebtTypestringYesThe period debt type key field, e.g. "Bad".
'fromintYesThe lower bound of the aging range, e.g. 0.
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetDebtPeriodsQueriesNoOData query options: $expand, $select.

Returns: DebtPeriod|error

Sample code:

receivable:DebtPeriod result = check fo->getDebtPeriods("USMF", "Debit", "Bad", 0);
deleteDebtPeriods

Deletes a debt collection aging period.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
debtTypestringYesThe debt type key field.
periodDebtTypestringYesThe period debt type key field.
'fromintYesThe lower bound of the aging range.
headersDeleteDebtPeriodsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteDebtPeriods("USMF", "Debit", "Bad", 0);
updateDebtPeriods

Updates a debt collection aging period.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
debtTypestringYesThe debt type key field.
periodDebtTypestringYesThe period debt type key field.
'fromintYesThe lower bound of the aging range.
payloadDebtPeriodYesThe fields to update.
headersUpdateDebtPeriodsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: DebtPeriod|error

Sample code:

receivable:DebtPeriod result = check fo->updateDebtPeriods("USMF", "Debit", "Bad", 0, {
percent: 6.0d
});

Due Date Limits

listDueDateLimits

Lists due date limits used to determine invoice payment terms.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoOptional HTTP headers.
queriesListDueDateLimitsQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, cross-company, $count, $select.

Returns: DueDateLimitsCollection|error

Sample code:

receivable:DueDateLimitsCollection result = check fo->listDueDateLimits();
createDueDateLimits

Creates a due date limit.

Parameters:

NameTypeRequiredDescription
payloadDueDateLimitYesThe due date limit record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: DueDateLimit|error

Sample code:

receivable:DueDateLimit result = check fo->createDueDateLimits({
dataAreaId: "USMF",
dueDateLimit: "NET30",
startDate: "2026-01-01",
periodInterval: "Day",
numberOfUnits: 30,
description: "Net 30 days"
});
getDueDateLimits

Retrieves a due date limit by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
dueDateLimitstringYesThe due date limit key field, e.g. "NET30".
startDatestringYesThe start date key field, e.g. "2026-01-01".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetDueDateLimitsQueriesNoOData query options: $expand, $select.

Returns: DueDateLimit|error

Sample code:

receivable:DueDateLimit result = check fo->getDueDateLimits("USMF", "NET30", "2026-01-01");
deleteDueDateLimits

Deletes a due date limit.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
dueDateLimitstringYesThe due date limit key field.
startDatestringYesThe start date key field.
headersDeleteDueDateLimitsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteDueDateLimits("USMF", "NET30", "2026-01-01");
updateDueDateLimits

Updates a due date limit.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
dueDateLimitstringYesThe due date limit key field.
startDatestringYesThe start date key field.
payloadDueDateLimitYesThe fields to update.
headersUpdateDueDateLimitsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: DueDateLimit|error

Sample code:

receivable:DueDateLimit result = check fo->updateDueDateLimits("USMF", "NET30", "2026-01-01", {
numberOfUnits: 45
});

Plafonds

listPlafonds

Lists Italian VAT export plafond (tax exemption ceiling) records.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoOptional HTTP headers.
queriesListPlafondsQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, cross-company, $count, $select.

Returns: PlafondsCollection|error

Sample code:

receivable:PlafondsCollection result = check fo->listPlafonds();
createPlafonds

Creates a VAT export plafond record.

Parameters:

NameTypeRequiredDescription
payloadPlafondYesThe plafond record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: Plafond|error

Sample code:

receivable:Plafond result = check fo->createPlafonds({
dataAreaId: "ITMF",
plafondId: "PLF-2026",
description: "2026 export VAT plafond",
plafondType: "Fixed",
limitType: "Amount",
limitAmount: 100000.00d,
fromDate: "2026-01-01",
toDate: "2026-12-31"
});
getPlafonds

Retrieves a VAT export plafond record by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier, e.g. "ITMF".
plafondIdstringYesThe plafond ID key field, e.g. "PLF-2026".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetPlafondsQueriesNoOData query options: $expand, $select.

Returns: Plafond|error

Sample code:

receivable:Plafond result = check fo->getPlafonds("ITMF", "PLF-2026");
deletePlafonds

Deletes a VAT export plafond record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
plafondIdstringYesThe plafond ID key field.
headersDeletePlafondsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deletePlafonds("ITMF", "PLF-2026");
updatePlafonds

Updates a VAT export plafond record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
plafondIdstringYesThe plafond ID key field.
payloadPlafondYesThe fields to update.
headersUpdatePlafondsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: Plafond|error

Sample code:

receivable:Plafond result = check fo->updatePlafonds("ITMF", "PLF-2026", {
limitAmount: 120000.00d
});

Return Details

listReturnDetails

Lists sales return details used in return merchandise authorization processing.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoOptional HTTP headers.
queriesListReturnDetailsQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, cross-company, $count, $select.

Returns: ReturnDetailsCollection|error

Sample code:

receivable:ReturnDetailsCollection result = check fo->listReturnDetails();
createReturnDetails

Creates a sales return detail record.

Parameters:

NameTypeRequiredDescription
payloadReturnDetailYesThe return detail record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: ReturnDetail|error

Sample code:

receivable:ReturnDetail result = check fo->createReturnDetails({
dataAreaId: "USMF",
returnID: "RMA-1045",
orderNumber: "SO-58821",
orderType: "SalesOrder",
accountNum: "CUST-3021",
returnAddressName: "Returns Center",
carrierCode: "FEDEX"
});
getReturnDetails

Retrieves a sales return detail record by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
returnIDstringYesThe return ID key field, e.g. "RMA-1045".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetReturnDetailsQueriesNoOData query options: $expand, $select.

Returns: ReturnDetail|error

Sample code:

receivable:ReturnDetail result = check fo->getReturnDetails("USMF", "RMA-1045");
deleteReturnDetails

Deletes a sales return detail record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
returnIDstringYesThe return ID key field.
headersDeleteReturnDetailsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteReturnDetails("USMF", "RMA-1045");
updateReturnDetails

Updates a sales return detail record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
returnIDstringYesThe return ID key field.
payloadReturnDetailYesThe fields to update.
headersUpdateReturnDetailsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: ReturnDetail|error

Sample code:

receivable:ReturnDetail result = check fo->updateReturnDetails("USMF", "RMA-1045", {
carrierServiceCode: "GROUND"
});

Sales Carriers

listSalesCarriers

Lists sales carriers used for shipment and return processing.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoOptional HTTP headers.
queriesListSalesCarriersQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, cross-company, $count, $select.

Returns: SalesCarriersCollection|error

Sample code:

receivable:SalesCarriersCollection result = check fo->listSalesCarriers();
createSalesCarriers

Creates a sales carrier.

Parameters:

NameTypeRequiredDescription
payloadSalesCarrierYesThe sales carrier record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: SalesCarrier|error

Sample code:

receivable:SalesCarrier result = check fo->createSalesCarriers({
dataAreaId: "USMF",
carrierName: "Global Freight Co",
vendor: "VEND-4021",
addressCity: "New York",
addressCountryRegionId: "USA"
});
getSalesCarriers

Retrieves a sales carrier by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
carrierNamestringYesThe carrier name key field, e.g. "Global Freight Co".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetSalesCarriersQueriesNoOData query options: $expand, $select.

Returns: SalesCarrier|error

Sample code:

receivable:SalesCarrier result = check fo->getSalesCarriers("USMF", "Global Freight Co");
deleteSalesCarriers

Deletes a sales carrier.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
carrierNamestringYesThe carrier name key field.
headersDeleteSalesCarriersHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteSalesCarriers("USMF", "Global Freight Co");
updateSalesCarriers

Updates a sales carrier.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
carrierNamestringYesThe carrier name key field.
payloadSalesCarrierYesThe fields to update.
headersUpdateSalesCarriersHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: SalesCarrier|error

Sample code:

receivable:SalesCarrier result = check fo->updateSalesCarriers("USMF", "Global Freight Co", {
addressCity: "Newark"
});

Sales Lists

listSalesLists

Lists EU sales lists used for cross-border VAT reporting.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoOptional HTTP headers.
queriesListSalesListsQueriesNoOData query options: $skip, $top, $filter, $orderby, $expand, cross-company, $count, $select.

Returns: SalesListsCollection|error

Sample code:

receivable:SalesListsCollection result = check fo->listSalesLists();
createSalesLists

Creates an EU sales list record.

Parameters:

NameTypeRequiredDescription
payloadSalesListYesThe sales list record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: SalesList|error

Sample code:

receivable:SalesList result = check fo->createSalesLists({
dataAreaId: "ESMF",
dispatchId: "DISP-2026-Q1",
status: "Include",
number: 1,
direction: "Sales",
year: 2026,
quarter: "Q1",
companyTaxID: "ESB12345678"
});
getSalesLists

Retrieves an EU sales list record by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier, e.g. "ESMF".
statusstringYesThe status key field, e.g. "Include".
dispatchIdstringYesThe dispatch ID key field, e.g. "DISP-2026-Q1".
numberintYesThe sales list number key field, e.g. 1.
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetSalesListsQueriesNoOData query options: $expand, $select.

Returns: SalesList|error

Sample code:

receivable:SalesList result = check fo->getSalesLists("ESMF", "Include", "DISP-2026-Q1", 1);
deleteSalesLists

Deletes an EU sales list record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
statusstringYesThe status key field.
dispatchIdstringYesThe dispatch ID key field.
numberintYesThe sales list number key field.
headersDeleteSalesListsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteSalesLists("ESMF", "Include", "DISP-2026-Q1", 1);
updateSalesLists

Updates an EU sales list record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
statusstringYesThe status key field.
dispatchIdstringYesThe dispatch ID key field.
numberintYesThe sales list number key field.
payloadSalesListYesThe fields to update.
headersUpdateSalesListsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: SalesList|error

Sample code:

receivable:SalesList result = check fo->updateSalesLists("ESMF", "Include", "DISP-2026-Q1", 1, {
status: "Reported"
});