Skip to main content

Actions

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

ClientPurpose
ClientProvides create, read, update, and delete access to Microsoft Dynamics 365 Finance and Operations tax master data and configuration entities via OData.

Client

Provides create, read, update, and delete access to Microsoft Dynamics 365 Finance and Operations tax master data and configuration 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.tax;

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

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

Operations

CFOP Codes

listCFOPCodes

Lists CFOP (Código Fiscal de Operações e Prestações) codes used for Brazilian fiscal document classification.

Parameters:

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

Returns: CFOPCodesCollection|error

Sample code:

tax:CFOPCodesCollection result = check fo->listCFOPCodes();
createCFOPCodes

Creates a CFOP code.

Parameters:

NameTypeRequiredDescription
payloadCFOPCodesYesThe CFOP code record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: CFOPCodes|error

Sample code:

tax:CFOPCodes result = check fo->createCFOPCodes({
dataAreaId: "BRMF",
cFOP: "5102",
name: "Sale of production - within state",
direction: "Outgoing",
purpose: "Shipment"
});
getCFOPCodes

Retrieves a CFOP code by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier, e.g. "BRMF".
cFOPstringYesThe CFOP key field, e.g. "5102".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetCFOPCodesQueriesNoOData query options: $expand, $select.

Returns: CFOPCodes|error

Sample code:

tax:CFOPCodes result = check fo->getCFOPCodes("BRMF", "5102");
deleteCFOPCodes

Deletes a CFOP code.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
cFOPstringYesThe CFOP key field.
headersDeleteCFOPCodesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteCFOPCodes("BRMF", "5102");
updateCFOPCodes

Updates a CFOP code.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
cFOPstringYesThe CFOP key field.
payloadCFOPCodesYesThe fields to update.
headersUpdateCFOPCodesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: CFOPCodes|error

Sample code:

tax:CFOPCodes result = check fo->updateCFOPCodes("BRMF", "5102", {
name: "Sale of production - within state (revised)"
});

CFOP Groups

listCFOPGroups

Lists CFOP groups used to bucket CFOP codes for Brazilian tax determination.

Parameters:

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

Returns: CFOPGroupsCollection|error

Sample code:

tax:CFOPGroupsCollection result = check fo->listCFOPGroups();
createCFOPGroups

Creates a CFOP group.

Parameters:

NameTypeRequiredDescription
payloadCFOPGroupYesThe CFOP group record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: CFOPGroup|error

Sample code:

tax:CFOPGroup result = check fo->createCFOPGroups({
dataAreaId: "BRMF",
groupId: "SALES",
description: "Domestic sales CFOP group"
});
getCFOPGroups

Retrieves a CFOP group by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
groupIdstringYesThe group ID key field, e.g. "SALES".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetCFOPGroupsQueriesNoOData query options: $expand, $select.

Returns: CFOPGroup|error

Sample code:

tax:CFOPGroup result = check fo->getCFOPGroups("BRMF", "SALES");
deleteCFOPGroups

Deletes a CFOP group.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
groupIdstringYesThe group ID key field.
headersDeleteCFOPGroupsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteCFOPGroups("BRMF", "SALES");
updateCFOPGroups

Updates a CFOP group.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
groupIdstringYesThe group ID key field.
payloadCFOPGroupYesThe fields to update.
headersUpdateCFOPGroupsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: CFOPGroup|error

Sample code:

tax:CFOPGroup result = check fo->updateCFOPGroups("BRMF", "SALES", {
description: "Domestic sales CFOP group - updated"
});

EL Parameters

listELParameters

Lists electronic ledger (EL) parameters used for multi-branch accounting configuration.

Parameters:

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

Returns: ELParametersCollection|error

Sample code:

tax:ELParametersCollection result = check fo->listELParameters();
createELParameters

Creates an EL parameters record.

Parameters:

NameTypeRequiredDescription
payloadELParameterYesThe EL parameters record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: ELParameter|error

Sample code:

tax:ELParameter result = check fo->createELParameters({
dataAreaId: "RUMF",
key: 1,
branchId: "0001",
branchDescription: "Main branch",
isActiveMultiBranch: "Yes"
});
getELParameters

Retrieves an EL parameters record by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
keyintYesThe entity key value, e.g. 1.
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetELParametersQueriesNoOData query options: $expand, $select.

Returns: ELParameter|error

Sample code:

tax:ELParameter result = check fo->getELParameters("RUMF", 1);
deleteELParameters

Deletes an EL parameters record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
keyintYesThe entity key value.
headersDeleteELParametersHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteELParameters("RUMF", 1);
updateELParameters

Updates an EL parameters record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
keyintYesThe entity key value.
payloadELParameterYesThe fields to update.
headersUpdateELParametersHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: ELParameter|error

Sample code:

tax:ELParameter result = check fo->updateELParameters("RUMF", 1, {
branchDescription: "Main branch - updated"
});

GST Minor Codes

listGSTMinorCodes

Lists GST minor codes used for Indian GST component classification.

Parameters:

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

Returns: GSTMinorCodesCollection|error

Sample code:

tax:GSTMinorCodesCollection result = check fo->listGSTMinorCodes();
createGSTMinorCodes

Creates a GST minor code.

Parameters:

NameTypeRequiredDescription
payloadGSTMinorCodeYesThe GST minor code record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: GSTMinorCode|error

Sample code:

tax:GSTMinorCode result = check fo->createGSTMinorCodes({
dataAreaId: "INMF",
minorCode: "M001",
taxComponent: "CGST",
description: "Central GST minor code"
});
getGSTMinorCodes

Retrieves a GST minor code by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
minorCodestringYesThe minor code key field, e.g. "M001".
taxComponentstringYesThe tax component key field, e.g. "CGST".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetGSTMinorCodesQueriesNoOData query options: $expand, $select.

Returns: GSTMinorCode|error

Sample code:

tax:GSTMinorCode result = check fo->getGSTMinorCodes("INMF", "M001", "CGST");
deleteGSTMinorCodes

Deletes a GST minor code.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
minorCodestringYesThe minor code key field.
taxComponentstringYesThe tax component key field.
headersDeleteGSTMinorCodesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteGSTMinorCodes("INMF", "M001", "CGST");
updateGSTMinorCodes

Updates a GST minor code.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
minorCodestringYesThe minor code key field.
taxComponentstringYesThe tax component key field.
payloadGSTMinorCodeYesThe fields to update.
headersUpdateGSTMinorCodesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: GSTMinorCode|error

Sample code:

tax:GSTMinorCode result = check fo->updateGSTMinorCodes("INMF", "M001", "CGST", {
description: "Central GST minor code - updated"
});

HSN Codes

listHSNCodes

Lists Harmonized System of Nomenclature (HSN) codes used for Indian goods classification.

Parameters:

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

Returns: HSNCodesCollection|error

Sample code:

tax:HSNCodesCollection result = check fo->listHSNCodes();
createHSNCodes

Creates an HSN code.

Parameters:

NameTypeRequiredDescription
payloadHSNCodeYesThe HSN code record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: HSNCode|error

Sample code:

tax:HSNCode result = check fo->createHSNCodes({
dataAreaId: "INMF",
chapter: "84",
heading: "8471",
subheading: "8471.30",
countryExtension: "00",
statisticalSuffix: "00",
code: "84718030",
description: "Portable digital automatic data processing machines"
});
getHSNCodes

Retrieves an HSN code by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
chapterstringYesThe chapter key field, e.g. "84".
headingstringYesThe heading key field, e.g. "8471".
subheadingstringYesThe subheading key field, e.g. "8471.30".
countryExtensionstringYesThe country extension key field.
statisticalSuffixstringYesThe statistical suffix key field.
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetHSNCodesQueriesNoOData query options: $expand, $select.

Returns: HSNCode|error

Sample code:

tax:HSNCode result = check fo->getHSNCodes("INMF", "84", "8471", "8471.30", "00", "00");
deleteHSNCodes

Deletes an HSN code.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
chapterstringYesThe chapter key field.
headingstringYesThe heading key field.
subheadingstringYesThe subheading key field.
countryExtensionstringYesThe country extension key field.
statisticalSuffixstringYesThe statistical suffix key field.
headersDeleteHSNCodesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteHSNCodes("INMF", "84", "8471", "8471.30", "00", "00");
updateHSNCodes

Updates an HSN code.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
chapterstringYesThe chapter key field.
headingstringYesThe heading key field.
subheadingstringYesThe subheading key field.
countryExtensionstringYesThe country extension key field.
statisticalSuffixstringYesThe statistical suffix key field.
payloadHSNCodeYesThe fields to update.
headersUpdateHSNCodesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: HSNCode|error

Sample code:

tax:HSNCode result = check fo->updateHSNCodes("INMF", "84", "8471", "8471.30", "00", "00", {
description: "Portable digital automatic data processing machines - updated"
});

Tax Code Limits

listTaxCodeLimits

Lists minimum and maximum sales tax amount limits configured for tax codes.

Parameters:

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

Returns: TaxCodeLimitsCollection|error

Sample code:

tax:TaxCodeLimitsCollection result = check fo->listTaxCodeLimits();
createTaxCodeLimits

Creates a tax code limit.

Parameters:

NameTypeRequiredDescription
payloadTaxCodeLimitYesThe tax code limit record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: TaxCodeLimit|error

Sample code:

tax:TaxCodeLimit result = check fo->createTaxCodeLimits({
dataAreaId: "USMF",
taxCodeId: "VAT20",
fromDate: "2026-01-01",
toDate: "2026-12-31",
minimumSalesTax: 0d,
maximumSalesTax: 5000.00d
});
getTaxCodeLimits

Retrieves a tax code limit by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxCodeIdstringYesThe tax code ID key field, e.g. "VAT20".
fromDatestringYesThe from date key field, e.g. "2026-01-01".
toDatestringYesThe to date key field, e.g. "2026-12-31".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetTaxCodeLimitsQueriesNoOData query options: $expand, $select.

Returns: TaxCodeLimit|error

Sample code:

tax:TaxCodeLimit result = check fo->getTaxCodeLimits("USMF", "VAT20", "2026-01-01", "2026-12-31");
deleteTaxCodeLimits

Deletes a tax code limit.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxCodeIdstringYesThe tax code ID key field.
fromDatestringYesThe from date key field.
toDatestringYesThe to date key field.
headersDeleteTaxCodeLimitsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteTaxCodeLimits("USMF", "VAT20", "2026-01-01", "2026-12-31");
updateTaxCodeLimits

Updates a tax code limit.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxCodeIdstringYesThe tax code ID key field.
fromDatestringYesThe from date key field.
toDatestringYesThe to date key field.
payloadTaxCodeLimitYesThe fields to update.
headersUpdateTaxCodeLimitsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: TaxCodeLimit|error

Sample code:

tax:TaxCodeLimit result = check fo->updateTaxCodeLimits("USMF", "VAT20", "2026-01-01", "2026-12-31", {
maximumSalesTax: 6000.00d
});

Tax Codes

listTaxCodes

Lists tax codes used to calculate sales tax, VAT, and GST amounts.

Parameters:

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

Returns: TaxCodesCollection|error

Sample code:

tax:TaxCodesCollection result = check fo->listTaxCodes();
createTaxCodes

Creates a tax code.

Parameters:

NameTypeRequiredDescription
payloadTaxCodeYesThe tax code record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: TaxCode|error

Sample code:

tax:TaxCode result = check fo->createTaxCodes({
dataAreaId: "USMF",
taxCode: "VAT20",
taxName: "VAT 20%",
taxRoundOff: 0.01d,
taxRoundOffType: "Ordinary",
taxCalculationMethod: "FullAmounts"
});
getTaxCodes

Retrieves a tax code by its key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxCodestringYesThe tax code key field, e.g. "VAT20".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetTaxCodesQueriesNoOData query options: $expand, $select.

Returns: TaxCode|error

Sample code:

tax:TaxCode result = check fo->getTaxCodes("USMF", "VAT20");
deleteTaxCodes

Deletes a tax code.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxCodestringYesThe tax code key field.
headersDeleteTaxCodesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteTaxCodes("USMF", "VAT20");
updateTaxCodes

Updates a tax code.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxCodestringYesThe tax code key field.
payloadTaxCodeYesThe fields to update.
headersUpdateTaxCodesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: TaxCode|error

Sample code:

tax:TaxCode result = check fo->updateTaxCodes("USMF", "VAT20", {
taxName: "VAT 20% (standard rate)"
});

Tax Group Data

listTaxGroupDatas

Lists the tax code assignments that make up each tax group.

Parameters:

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

Returns: TaxGroupDatasCollection|error

Sample code:

tax:TaxGroupDatasCollection result = check fo->listTaxGroupDatas();
createTaxGroupDatas

Assigns a tax code to a tax group.

Parameters:

NameTypeRequiredDescription
payloadTaxGroupDataYesThe tax group data record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: TaxGroupData|error

Sample code:

tax:TaxGroupData result = check fo->createTaxGroupDatas({
dataAreaId: "USMF",
taxGroupId: "TAXABLE",
taxCodeId: "VAT20",
exemptTax: "No",
useTax: "No"
});
getTaxGroupDatas

Retrieves a tax group data record by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxGroupIdstringYesThe tax group ID key field, e.g. "TAXABLE".
taxCodeIdstringYesThe tax code ID key field, e.g. "VAT20".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetTaxGroupDatasQueriesNoOData query options: $expand, $select.

Returns: TaxGroupData|error

Sample code:

tax:TaxGroupData result = check fo->getTaxGroupDatas("USMF", "TAXABLE", "VAT20");
deleteTaxGroupDatas

Removes a tax code assignment from a tax group.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxGroupIdstringYesThe tax group ID key field.
taxCodeIdstringYesThe tax code ID key field.
headersDeleteTaxGroupDatasHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteTaxGroupDatas("USMF", "TAXABLE", "VAT20");
updateTaxGroupDatas

Updates a tax group data record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxGroupIdstringYesThe tax group ID key field.
taxCodeIdstringYesThe tax code ID key field.
payloadTaxGroupDataYesThe fields to update.
headersUpdateTaxGroupDatasHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: TaxGroupData|error

Sample code:

tax:TaxGroupData result = check fo->updateTaxGroupDatas("USMF", "TAXABLE", "VAT20", {
exemptTax: "Yes"
});

Tax Groups

listTaxGroups

Lists sales tax groups used to determine which tax codes apply to a customer, vendor, or transaction.

Parameters:

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

Returns: TaxGroupsCollection|error

Sample code:

tax:TaxGroupsCollection result = check fo->listTaxGroups();
createTaxGroups

Creates a sales tax group.

Parameters:

NameTypeRequiredDescription
payloadTaxGroupYesThe tax group record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: TaxGroup|error

Sample code:

tax:TaxGroup result = check fo->createTaxGroups({
dataAreaId: "USMF",
taxGroupCode: "TAXABLE",
description: "Fully taxable sales",
roundingBy: "TaxCode"
});
getTaxGroups

Retrieves a sales tax group by its key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxGroupCodestringYesThe tax group code key field, e.g. "TAXABLE".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetTaxGroupsQueriesNoOData query options: $expand, $select.

Returns: TaxGroup|error

Sample code:

tax:TaxGroup result = check fo->getTaxGroups("USMF", "TAXABLE");
deleteTaxGroups

Deletes a sales tax group.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxGroupCodestringYesThe tax group code key field.
headersDeleteTaxGroupsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteTaxGroups("USMF", "TAXABLE");
updateTaxGroups

Updates a sales tax group.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxGroupCodestringYesThe tax group code key field.
payloadTaxGroupYesThe fields to update.
headersUpdateTaxGroupsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: TaxGroup|error

Sample code:

tax:TaxGroup result = check fo->updateTaxGroups("USMF", "TAXABLE", {
description: "Fully taxable sales - updated"
});

Tax Item Groups

listTaxItemGroups

Lists item-level tax groups used to determine which tax codes apply to a product or service.

Parameters:

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

Returns: TaxItemGroupsCollection|error

Sample code:

tax:TaxItemGroupsCollection result = check fo->listTaxItemGroups();
createTaxItemGroups

Creates a tax item group.

Parameters:

NameTypeRequiredDescription
payloadTaxItemGroupYesThe tax item group record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: TaxItemGroup|error

Sample code:

tax:TaxItemGroup result = check fo->createTaxItemGroups({
dataAreaId: "USMF",
taxItemGroupCode: "GOODS",
taxCodeId: "VAT20",
description: "Standard-rated goods",
exemptTax: "No"
});
getTaxItemGroups

Retrieves a tax item group by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxItemGroupCodestringYesThe tax item group code key field, e.g. "GOODS".
taxCodeIdstringYesThe tax code ID key field, e.g. "VAT20".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetTaxItemGroupsQueriesNoOData query options: $expand, $select.

Returns: TaxItemGroup|error

Sample code:

tax:TaxItemGroup result = check fo->getTaxItemGroups("USMF", "GOODS", "VAT20");
deleteTaxItemGroups

Deletes a tax item group.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxItemGroupCodestringYesThe tax item group code key field.
taxCodeIdstringYesThe tax code ID key field.
headersDeleteTaxItemGroupsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteTaxItemGroups("USMF", "GOODS", "VAT20");
updateTaxItemGroups

Updates a tax item group.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxItemGroupCodestringYesThe tax item group code key field.
taxCodeIdstringYesThe tax code ID key field.
payloadTaxItemGroupYesThe fields to update.
headersUpdateTaxItemGroupsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: TaxItemGroup|error

Sample code:

tax:TaxItemGroup result = check fo->updateTaxItemGroups("USMF", "GOODS", "VAT20", {
description: "Standard-rated goods - updated"
});

Tax Parameters

listTaxParameters

Lists the company-level tax parameters that control tax calculation and posting behavior.

Parameters:

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

Returns: TaxParametersCollection|error

Sample code:

tax:TaxParametersCollection result = check fo->listTaxParameters();
createTaxParameters

Creates the tax parameters record for a company.

Parameters:

NameTypeRequiredDescription
payloadTaxParametersYesThe tax parameters record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: TaxParameters|error

Sample code:

tax:TaxParameters result = check fo->createTaxParameters({
dataAreaId: "USMF",
calculationPrinciple: "Total",
taxCalculationDate: "InvoiceDate"
});
getTaxParameters

Retrieves the tax parameters record for a company.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier, e.g. "USMF".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetTaxParametersQueriesNoOData query options: $expand, $select.

Returns: TaxParameters|error

Sample code:

tax:TaxParameters result = check fo->getTaxParameters("USMF");
deleteTaxParameters

Deletes the tax parameters record for a company.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
headersDeleteTaxParametersHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteTaxParameters("USMF");
updateTaxParameters

Updates the tax parameters record for a company.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
payloadTaxParametersYesThe fields to update.
headersUpdateTaxParametersHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: TaxParameters|error

Sample code:

tax:TaxParameters result = check fo->updateTaxParameters("USMF", {
taxCalculationDate: "DeliveryDate"
});

Tax Periods

listTaxPeriods

Lists tax periods used for tax reporting and settlement cycles.

Parameters:

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

Returns: TaxPeriodsCollection|error

Sample code:

tax:TaxPeriodsCollection result = check fo->listTaxPeriods();
createTaxPeriods

Creates a tax period.

Parameters:

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

Returns: TaxPeriod|error

Sample code:

tax:TaxPeriod result = check fo->createTaxPeriods({
dataAreaId: "USMF",
taxPeriodId: "Q1-2026",
fromDate: "2026-01-01",
toDate: "2026-03-31",
description: "Q1 2026 VAT period",
periodInterval: "Month",
numberOfUnit: 3
});
getTaxPeriods

Retrieves a tax period by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxPeriodIdstringYesThe tax period ID key field, e.g. "Q1-2026".
fromDatestringYesThe from date key field, e.g. "2026-01-01".
toDatestringYesThe to date key field, e.g. "2026-03-31".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetTaxPeriodsQueriesNoOData query options: $expand, $select.

Returns: TaxPeriod|error

Sample code:

tax:TaxPeriod result = check fo->getTaxPeriods("USMF", "Q1-2026", "2026-01-01", "2026-03-31");
deleteTaxPeriods

Deletes a tax period.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxPeriodIdstringYesThe tax period ID key field.
fromDatestringYesThe from date key field.
toDatestringYesThe to date key field.
headersDeleteTaxPeriodsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteTaxPeriods("USMF", "Q1-2026", "2026-01-01", "2026-03-31");
updateTaxPeriods

Updates a tax period.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxPeriodIdstringYesThe tax period ID key field.
fromDatestringYesThe from date key field.
toDatestringYesThe to date key field.
payloadTaxPeriodYesThe fields to update.
headersUpdateTaxPeriodsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: TaxPeriod|error

Sample code:

tax:TaxPeriod result = check fo->updateTaxPeriods("USMF", "Q1-2026", "2026-01-01", "2026-03-31", {
description: "Q1 2026 VAT period - updated"
});

Tax Posting Groups

listTaxPostingGroups

Lists tax posting groups used to determine the ledger accounts to which tax amounts are posted.

Parameters:

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

Returns: TaxPostingGroupsCollection|error

Sample code:

tax:TaxPostingGroupsCollection result = check fo->listTaxPostingGroups();
createTaxPostingGroups

Creates a tax posting group.

Parameters:

NameTypeRequiredDescription
payloadTaxPostingGroupYesThe tax posting group record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: TaxPostingGroup|error

Sample code:

tax:TaxPostingGroup result = check fo->createTaxPostingGroups({
dataAreaId: "USMF",
taxPostingGroupCode: "VATPOST",
description: "Standard VAT posting group"
});
getTaxPostingGroups

Retrieves a tax posting group by its key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxPostingGroupCodestringYesThe tax posting group code key field, e.g. "VATPOST".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetTaxPostingGroupsQueriesNoOData query options: $expand, $select.

Returns: TaxPostingGroup|error

Sample code:

tax:TaxPostingGroup result = check fo->getTaxPostingGroups("USMF", "VATPOST");
deleteTaxPostingGroups

Deletes a tax posting group.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxPostingGroupCodestringYesThe tax posting group code key field.
headersDeleteTaxPostingGroupsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteTaxPostingGroups("USMF", "VATPOST");
updateTaxPostingGroups

Updates a tax posting group.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxPostingGroupCodestringYesThe tax posting group code key field.
payloadTaxPostingGroupYesThe fields to update.
headersUpdateTaxPostingGroupsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: TaxPostingGroup|error

Sample code:

tax:TaxPostingGroup result = check fo->updateTaxPostingGroups("USMF", "VATPOST", {
description: "Standard VAT posting group - updated"
});

Tax Regions

listTaxRegions

Lists tax regions used for jurisdiction-based tax determination.

Parameters:

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

Returns: TaxRegionsCollection|error

Sample code:

tax:TaxRegionsCollection result = check fo->listTaxRegions();
createTaxRegions

Creates a tax region.

Parameters:

NameTypeRequiredDescription
payloadTaxRegionYesThe tax region record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: TaxRegion|error

Sample code:

tax:TaxRegion result = check fo->createTaxRegions({
locationId: "US-CA-94105",
validFrom: "2026-01-01",
taxRegionName: "California",
state: "CA",
countryRegionId: "USA"
});
getTaxRegions

Retrieves a tax region by its composite key. Unlike most tax entities, tax regions are not keyed by dataAreaId.

Parameters:

NameTypeRequiredDescription
locationIdstringYesThe location ID key field, e.g. "US-CA-94105".
validFromstringYesThe valid-from date key field, e.g. "2026-01-01".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetTaxRegionsQueriesNoOData query options: $expand, $select.

Returns: TaxRegion|error

Sample code:

tax:TaxRegion result = check fo->getTaxRegions("US-CA-94105", "2026-01-01");
deleteTaxRegions

Deletes a tax region.

Parameters:

NameTypeRequiredDescription
locationIdstringYesThe location ID key field.
validFromstringYesThe valid-from date key field.
headersDeleteTaxRegionsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteTaxRegions("US-CA-94105", "2026-01-01");
updateTaxRegions

Updates a tax region.

Parameters:

NameTypeRequiredDescription
locationIdstringYesThe location ID key field.
validFromstringYesThe valid-from date key field.
payloadTaxRegionYesThe fields to update.
headersUpdateTaxRegionsHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: TaxRegion|error

Sample code:

tax:TaxRegion result = check fo->updateTaxRegions("US-CA-94105", "2026-01-01", {
taxRegionName: "California (revised)"
});

Tax Tables

listTaxTables

Lists tax tables that link tax types and modules to their ledger main accounts.

Parameters:

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

Returns: TaxTablesCollection|error

Sample code:

tax:TaxTablesCollection result = check fo->listTaxTables();
createTaxTables

Creates a tax table entry.

Parameters:

NameTypeRequiredDescription
payloadTaxTableYesThe tax table record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: TaxTable|error

Sample code:

tax:TaxTable result = check fo->createTaxTables({
dataAreaId: "RUMF",
'module: "Tax",
code: "VAT-STD",
typeOfTax: "VAT",
expenseCode: "TAXEXP"
});
getTaxTables

Retrieves a tax table entry by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
modulestringYesThe module key field, e.g. "Tax".
codestringYesThe code key field, e.g. "VAT-STD".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetTaxTablesQueriesNoOData query options: $expand, $select.

Returns: TaxTable|error

Sample code:

tax:TaxTable result = check fo->getTaxTables("RUMF", "Tax", "VAT-STD");
deleteTaxTables

Deletes a tax table entry.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
modulestringYesThe module key field.
codestringYesThe code key field.
headersDeleteTaxTablesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteTaxTables("RUMF", "Tax", "VAT-STD");
updateTaxTables

Updates a tax table entry.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
modulestringYesThe module key field.
codestringYesThe code key field.
payloadTaxTableYesThe fields to update.
headersUpdateTaxTablesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: TaxTable|error

Sample code:

tax:TaxTable result = check fo->updateTaxTables("RUMF", "Tax", "VAT-STD", {
expenseCode: "TAXEXP2"
});

Taxation Code

listTaxationCode

Lists Brazilian taxation codes used to classify ICMS, IPI, PIS, and COFINS tax handling.

Parameters:

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

Returns: TaxationCodeCollection|error

Sample code:

tax:TaxationCodeCollection result = check fo->listTaxationCode();
createTaxationCode

Creates a taxation code.

Parameters:

NameTypeRequiredDescription
payloadTaxationCodeYesThe taxation code record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: TaxationCode|error

Sample code:

tax:TaxationCode result = check fo->createTaxationCode({
dataAreaId: "BRMF",
taxType: "ICMS",
taxationCode: "060",
fiscalValue: "WithCreditDebit",
outputCode: "5405",
description: "ICMS with credit"
});
getTaxationCode

Retrieves a taxation code by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxTypestringYesThe tax type key field, e.g. "ICMS".
taxationCodestringYesThe taxation code key field, e.g. "060".
fiscalValuestringYesThe fiscal value key field, e.g. "WithCreditDebit".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetTaxationCodeQueriesNoOData query options: $expand, $select.

Returns: TaxationCode|error

Sample code:

tax:TaxationCode result = check fo->getTaxationCode("BRMF", "ICMS", "060", "WithCreditDebit");
deleteTaxationCode

Deletes a taxation code.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxTypestringYesThe tax type key field.
taxationCodestringYesThe taxation code key field.
fiscalValuestringYesThe fiscal value key field.
headersDeleteTaxationCodeHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteTaxationCode("BRMF", "ICMS", "060", "WithCreditDebit");
updateTaxationCode

Updates a taxation code.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
taxTypestringYesThe tax type key field.
taxationCodestringYesThe taxation code key field.
fiscalValuestringYesThe fiscal value key field.
payloadTaxationCodeYesThe fields to update.
headersUpdateTaxationCodeHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: TaxationCode|error

Sample code:

tax:TaxationCode result = check fo->updateTaxationCode("BRMF", "ICMS", "060", "WithCreditDebit", {
description: "ICMS with credit - updated"
});

Taxes Matrices

listTaxesMatrices

Lists Brazilian tax matrices that map fiscal establishment groups and CFOP groups to sales tax groups.

Parameters:

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

Returns: TaxesMatricesCollection|error

Sample code:

tax:TaxesMatricesCollection result = check fo->listTaxesMatrices();
createTaxesMatrices

Creates a tax matrix entry.

Parameters:

NameTypeRequiredDescription
payloadTaxesMatrixYesThe tax matrix record to create.
headersmap<string|string[]>NoOptional HTTP headers.

Returns: TaxesMatrix|error

Sample code:

tax:TaxesMatrix result = check fo->createTaxesMatrices({
dataAreaId: "BRMF",
fiscalEstablishmentGroupId: "FEG01",
cFOPGroupId: "SALES",
'type: "Customer",
accountRelation: "CUST-001",
itemRelation: "ITEM-001",
salesTaxGroup: "TAXABLE",
itemSalesTaxGroup: "GOODS"
});
getTaxesMatrices

Retrieves a tax matrix entry by its composite key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
fiscalEstablishmentGroupIdstringYesThe fiscal establishment group ID key field, e.g. "FEG01".
cFOPGroupIdstringYesThe CFOP group ID key field, e.g. "SALES".
typestringYesThe entity type identifier key field, e.g. "Customer".
accountRelationstringYesThe account relation key field, e.g. "CUST-001".
itemRelationstringYesThe item relation key field, e.g. "ITEM-001".
headersmap<string|string[]>NoOptional HTTP headers.
queriesGetTaxesMatricesQueriesNoOData query options: $expand, $select.

Returns: TaxesMatrix|error

Sample code:

tax:TaxesMatrix result = check fo->getTaxesMatrices("BRMF", "FEG01", "SALES", "Customer", "CUST-001", "ITEM-001");
deleteTaxesMatrices

Deletes a tax matrix entry.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
fiscalEstablishmentGroupIdstringYesThe fiscal establishment group ID key field.
cFOPGroupIdstringYesThe CFOP group ID key field.
typestringYesThe entity type identifier key field.
accountRelationstringYesThe account relation key field.
itemRelationstringYesThe item relation key field.
headersDeleteTaxesMatricesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: error?

Sample code:

error? result = fo->deleteTaxesMatrices("BRMF", "FEG01", "SALES", "Customer", "CUST-001", "ITEM-001");
updateTaxesMatrices

Updates a tax matrix entry.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
fiscalEstablishmentGroupIdstringYesThe fiscal establishment group ID key field.
cFOPGroupIdstringYesThe CFOP group ID key field.
typestringYesThe entity type identifier key field.
accountRelationstringYesThe account relation key field.
itemRelationstringYesThe item relation key field.
payloadTaxesMatrixYesThe fields to update.
headersUpdateTaxesMatricesHeadersNoOptional ifMatch ETag for optimistic concurrency.

Returns: TaxesMatrix|error

Sample code:

tax:TaxesMatrix result = check fo->updateTaxesMatrices("BRMF", "FEG01", "SALES", "Customer", "CUST-001", "ITEM-001", {
salesTaxGroup: "TAXABLE2"
});