Skip to main content

Actions

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

ClientPurpose
ClientProvides full CRUD access to Microsoft Dynamics 365 Finance document types and documents, agents and agent feeds, demo data posts, ED parameters, guides, media, message items/status/logs, and print layouts via the Dynamics 365 Finance and Operations OData API.

Client

Provides full CRUD access to Microsoft Dynamics 365 Finance document types and documents, agents and agent feeds, demo data posts, ED parameters, guides, media, message items/status/logs, and print layouts via the Dynamics 365 Finance and Operations OData API.

Configuration

FieldTypeDefaultDescription
authOAuth2ClientCredentialsGrantConfigRequiredOAuth2 client credentials grant configuration used to authenticate with Microsoft Entra ID (Azure AD): tokenUrl, clientId, clientSecret, and optional scopes.
httpVersionhttp:HttpVersion2.0HTTP protocol version to use for outbound requests.
http1Settingshttp:ClientHttp1Settings{}HTTP/1.x client settings including keep-alive, chunking, and proxy configuration.
secureSockethttp:ClientSecureSocket()SSL/TLS configuration for secure connections.
proxyhttp:ProxyConfig()Proxy server configuration.

Initializing the client

import ballerinax/microsoft.dynamics365.finance.document;

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

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

Operations

Agent Feeds

listAgentFeeds

Reads all agent feed items.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesListAgentFeedsQueriesNoOData query parameters: skip, top, filter, orderby, expand, crossCompany, count, 'select.

Returns: document:AgentFeedsCollection|error

Sample code:

document:AgentFeedsCollection feeds = check fo->listAgentFeeds(
queries = {
filter: "Status eq 'InProgress'",
top: 20
}
);
createAgentFeeds

Creates an agent feed item.

Parameters:

NameTypeRequiredDescription
payloadAgentFeedYesThe agent feed item to create.
headersmap<string|string[]>NoHeaders to be sent with the request.

Returns: document:AgentFeed|error

Sample code:

document:AgentFeed feed = check fo->createAgentFeeds({
feedItemId: "FI-0001",
correlationId: "CORR-0001",
title: "Invoice approval pending",
summary: "Vendor invoice VI-1002 is awaiting approval",
status: "NotStarted",
dueDate: "2026-08-10"
});
getAgentFeeds

Reads a specific agent feed item by key.

Parameters:

NameTypeRequiredDescription
feedItemIdstringYesThe feed item id key field.
correlationIdstringYesThe correlation id key field.
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesGetAgentFeedsQueriesNoOData query parameters: expand, 'select.

Returns: document:AgentFeed|error

Sample code:

document:AgentFeed feed = check fo->getAgentFeeds(
"FI-0001",
"CORR-0001"
);
deleteAgentFeeds

Deletes a specific agent feed item.

Parameters:

NameTypeRequiredDescription
feedItemIdstringYesThe feed item id key field.
correlationIdstringYesThe correlation id key field.
headersDeleteAgentFeedsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: error?

Sample code:

check fo->deleteAgentFeeds(
"FI-0001",
"CORR-0001",
headers = {ifMatch: eTag}
);
updateAgentFeeds

Updates a specific agent feed item.

Parameters:

NameTypeRequiredDescription
feedItemIdstringYesThe feed item id key field.
correlationIdstringYesThe correlation id key field.
payloadAgentFeedYesThe fields to update.
headersUpdateAgentFeedsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: document:AgentFeed|error

Sample code:

document:AgentFeed updated = check fo->updateAgentFeeds(
"FI-0001",
"CORR-0001",
{status: "Completed"},
headers = {ifMatch: eTag}
);

Agents

listAgents

Reads all agent master records.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesListAgentsQueriesNoOData query parameters: skip, top, filter, orderby, expand, crossCompany, count, 'select.

Returns: document:AgentsCollection|error

Sample code:

document:AgentsCollection agents = check fo->listAgents(
queries = {
filter: "TaxRegNum ne ''",
top: 20
}
);
createAgents

Creates an agent master record.

Parameters:

NameTypeRequiredDescription
payloadAgentYesThe agent to create.
headersmap<string|string[]>NoHeaders to be sent with the request.

Returns: document:Agent|error

Sample code:

document:Agent agent = check fo->createAgents({
dataAreaId: "USMF",
agentId: "AGT-001",
name: "Contoso Freight Agent",
partyNumber: "PARTY-2201",
taxRegNum: "12-3456789"
});
getAgents

Reads a specific agent by key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
agentIdstringYesThe agent id key field.
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesGetAgentsQueriesNoOData query parameters: expand, 'select.

Returns: document:Agent|error

Sample code:

document:Agent agent = check fo->getAgents(
"USMF",
"AGT-001"
);
deleteAgents

Deletes a specific agent.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
agentIdstringYesThe agent id key field.
headersDeleteAgentsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: error?

Sample code:

check fo->deleteAgents(
"USMF",
"AGT-001",
headers = {ifMatch: eTag}
);
updateAgents

Updates a specific agent.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
agentIdstringYesThe agent id key field.
payloadAgentYesThe fields to update.
headersUpdateAgentsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: document:Agent|error

Sample code:

document:Agent updated = check fo->updateAgents(
"USMF",
"AGT-001",
{taxRegNum: "98-7654321"},
headers = {ifMatch: eTag}
);

Demo Data Posts

listDemoDataPosts

Reads all demo data posting jobs.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesListDemoDataPostsQueriesNoOData query parameters: skip, top, filter, orderby, expand, crossCompany, count, 'select.

Returns: document:DemoDataPostsCollection|error

Sample code:

document:DemoDataPostsCollection posts = check fo->listDemoDataPosts(
queries = {
filter: "DemoDataJobStatus eq 'Ready'",
top: 20
}
);
createDemoDataPosts

Creates a demo data posting job.

Parameters:

NameTypeRequiredDescription
payloadDemoDataPostYesThe demo data post to create.
headersmap<string|string[]>NoHeaders to be sent with the request.

Returns: document:DemoDataPost|error

Sample code:

document:DemoDataPost post = check fo->createDemoDataPosts({
dataAreaId: "USMF",
demoDataJob: "JOB-100",
lineNum: 1,
document: "SalesOrder",
documentTarget: "Post",
demoDataJobStatus: "Open"
});
getDemoDataPosts

Reads a specific demo data posting job by key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
demoDataJobstringYesThe demo data job key field.
lineNumdecimalYesThe line num key field.
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesGetDemoDataPostsQueriesNoOData query parameters: expand, 'select.

Returns: document:DemoDataPost|error

Sample code:

document:DemoDataPost post = check fo->getDemoDataPosts(
"USMF",
"JOB-100",
1
);
deleteDemoDataPosts

Deletes a specific demo data posting job.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
demoDataJobstringYesThe demo data job key field.
lineNumdecimalYesThe line num key field.
headersDeleteDemoDataPostsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: error?

Sample code:

check fo->deleteDemoDataPosts(
"USMF",
"JOB-100",
1,
headers = {ifMatch: eTag}
);
updateDemoDataPosts

Updates a specific demo data posting job.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
demoDataJobstringYesThe demo data job key field.
lineNumdecimalYesThe line num key field.
payloadDemoDataPostYesThe fields to update.
headersUpdateDemoDataPostsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: document:DemoDataPost|error

Sample code:

document:DemoDataPost updated = check fo->updateDemoDataPosts(
"USMF",
"JOB-100",
1,
{demoDataJobStatus: "Successful"},
headers = {ifMatch: eTag}
);

Document Types

listDocumentTypes

Reads all document type definitions.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesListDocumentTypesQueriesNoOData query parameters: skip, top, filter, orderby, expand, crossCompany, count, 'select.

Returns: document:DocumentTypesCollection|error

Sample code:

document:DocumentTypesCollection types = check fo->listDocumentTypes(
queries = {
filter: "TypeGroup eq 'File'",
top: 20
}
);
createDocumentTypes

Creates a document type definition.

Parameters:

NameTypeRequiredDescription
payloadDocumentTypeYesThe document type to create.
headersmap<string|string[]>NoHeaders to be sent with the request.

Returns: document:DocumentType|error

Sample code:

document:DocumentType docType = check fo->createDocumentTypes({
dataAreaId: "USMF",
iD: "BOL",
name: "Bill of lading",
typeGroup: "File",
filePlace: "Database",
removeOption: "DocumentAndFile"
});
getDocumentTypes

Reads a specific document type by key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
iDstringYesThe i d key field.
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesGetDocumentTypesQueriesNoOData query parameters: expand, 'select.

Returns: document:DocumentType|error

Sample code:

document:DocumentType docType = check fo->getDocumentTypes(
"USMF",
"BOL"
);
deleteDocumentTypes

Deletes a specific document type.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
iDstringYesThe i d key field.
headersDeleteDocumentTypesHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: error?

Sample code:

check fo->deleteDocumentTypes(
"USMF",
"BOL",
headers = {ifMatch: eTag}
);
updateDocumentTypes

Updates a specific document type.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
iDstringYesThe i d key field.
payloadDocumentTypeYesThe fields to update.
headersUpdateDocumentTypesHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: document:DocumentType|error

Sample code:

document:DocumentType updated = check fo->updateDocumentTypes(
"USMF",
"BOL",
{name: "Bill of lading (revised)"},
headers = {ifMatch: eTag}
);

Documents

listDocuments

Reads all transportation/shipping documents.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesListDocumentsQueriesNoOData query parameters: skip, top, filter, orderby, expand, crossCompany, count, 'select.

Returns: document:DocumentsCollection|error

Sample code:

document:DocumentsCollection docs = check fo->listDocuments(
queries = {
filter: "Carrier eq 'CARRIER-01'",
top: 20
}
);
createDocuments

Creates a transportation/shipping document.

Parameters:

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

Returns: document:Document|error

Sample code:

document:Document doc = check fo->createDocuments({
dataAreaId: "USMF",
lineId: "LINE-001",
carrier: "CARRIER-01",
carrierType: "Vendor",
registrationNumber: "TRK-4521",
driverName: "Alex Morgan",
loadingCity: "Chicago",
unloadingCity: "Dallas"
});
getDocuments

Reads a specific document by key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
lineIdstringYesThe line id key field.
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesGetDocumentsQueriesNoOData query parameters: expand, 'select.

Returns: document:Document|error

Sample code:

document:Document doc = check fo->getDocuments(
"USMF",
"LINE-001"
);
deleteDocuments

Deletes a specific document.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
lineIdstringYesThe line id key field.
headersDeleteDocumentsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: error?

Sample code:

check fo->deleteDocuments(
"USMF",
"LINE-001",
headers = {ifMatch: eTag}
);
updateDocuments

Updates a specific document.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
lineIdstringYesThe line id key field.
payloadDocumentYesThe fields to update.
headersUpdateDocumentsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: document:Document|error

Sample code:

document:Document updated = check fo->updateDocuments(
"USMF",
"LINE-001",
{unloadingCity: "Houston"},
headers = {ifMatch: eTag}
);

ED Parameters

listEDParameters

Reads all electronic document (ED) parameter records.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesListEDParametersQueriesNoOData query parameters: skip, top, filter, orderby, expand, crossCompany, count, 'select.

Returns: document:EDParametersCollection|error

Sample code:

document:EDParametersCollection params = check fo->listEDParameters(
queries = {
filter: "dataAreaId eq 'USMF'",
top: 20
}
);
createEDParameters

Creates an electronic document (ED) parameter record.

Parameters:

NameTypeRequiredDescription
payloadEDParameterYesThe ED parameter record to create.
headersmap<string|string[]>NoHeaders to be sent with the request.

Returns: document:EDParameter|error

Sample code:

document:EDParameter params = check fo->createEDParameters({
dataAreaId: "USMF",
key: 1,
custSingleInvoice: "Yes",
vendSingleInvoice: "Yes",
custFillInvoiceNum: "No"
});
getEDParameters

Reads a specific ED parameter record by key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
'keyintYesThe entity key value.
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesGetEDParametersQueriesNoOData query parameters: expand, 'select.

Returns: document:EDParameter|error

Sample code:

document:EDParameter params = check fo->getEDParameters(
"USMF",
1
);
deleteEDParameters

Deletes a specific ED parameter record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
'keyintYesThe entity key value.
headersDeleteEDParametersHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: error?

Sample code:

check fo->deleteEDParameters(
"USMF",
1,
headers = {ifMatch: eTag}
);
updateEDParameters

Updates a specific ED parameter record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
'keyintYesThe entity key value.
payloadEDParameterYesThe fields to update.
headersUpdateEDParametersHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: document:EDParameter|error

Sample code:

document:EDParameter updated = check fo->updateEDParameters(
"USMF",
1,
{custFillInvoiceNum: "Yes"},
headers = {ifMatch: eTag}
);

Guides

listGuides

Reads all task guide metadata records.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesListGuidesQueriesNoOData query parameters: skip, top, filter, orderby, expand, crossCompany, count, 'select.

Returns: document:GuidesCollection|error

Sample code:

document:GuidesCollection guides = check fo->listGuides(
queries = {
filter: "GuideID eq 'GDE-001'"
}
);
createGuides

Creates a task guide metadata record.

Parameters:

NameTypeRequiredDescription
payloadGuideYesThe guide to create.
headersmap<string|string[]>NoHeaders to be sent with the request.

Returns: document:Guide|error

Sample code:

document:Guide guide = check fo->createGuides({
integrationKey: "GDE-001-KEY",
guideID: "GDE-001",
name: "Create a sales order",
schemaVersion: 1
});
getGuides

Reads a specific guide by key.

Parameters:

NameTypeRequiredDescription
integrationKeystringYesThe integration key key field.
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesGetGuidesQueriesNoOData query parameters: expand, 'select.

Returns: document:Guide|error

Sample code:

document:Guide guide = check fo->getGuides("GDE-001-KEY");
deleteGuides

Deletes a specific guide.

Parameters:

NameTypeRequiredDescription
integrationKeystringYesThe integration key key field.
headersDeleteGuidesHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: error?

Sample code:

check fo->deleteGuides(
"GDE-001-KEY",
headers = {ifMatch: eTag}
);
updateGuides

Updates a specific guide.

Parameters:

NameTypeRequiredDescription
integrationKeystringYesThe integration key key field.
payloadGuideYesThe fields to update.
headersUpdateGuidesHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: document:Guide|error

Sample code:

document:Guide updated = check fo->updateGuides(
"GDE-001-KEY",
{name: "Create and confirm a sales order"},
headers = {ifMatch: eTag}
);

Media

listMedia

Reads all contact media records.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesListMediaQueriesNoOData query parameters: skip, top, filter, orderby, expand, crossCompany, count, 'select.

Returns: document:MediaCollection|error

Sample code:

document:MediaCollection media = check fo->listMedia(
queries = {
filter: "vendAccount eq 'VEND-1001'",
top: 20
}
);
createMedia

Creates a contact media record.

Parameters:

NameTypeRequiredDescription
payloadMediaYesThe media record to create.
headersmap<string|string[]>NoHeaders to be sent with the request.

Returns: document:Media|error

Sample code:

document:Media media = check fo->createMedia({
dataAreaId: "USMF",
media: "MED-001",
mediaType: "Email",
vendAccount: "VEND-1001",
email: "[email protected]"
});
getMedia

Reads a specific media record by key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
mediastringYesThe media key field.
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesGetMediaQueriesNoOData query parameters: expand, 'select.

Returns: document:Media|error

Sample code:

document:Media media = check fo->getMedia(
"USMF",
"MED-001"
);
deleteMedia

Deletes a specific media record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
mediastringYesThe media key field.
headersDeleteMediaHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: error?

Sample code:

check fo->deleteMedia(
"USMF",
"MED-001",
headers = {ifMatch: eTag}
);
updateMedia

Updates a specific media record.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
mediastringYesThe media key field.
payloadMediaYesThe fields to update.
headersUpdateMediaHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: document:Media|error

Sample code:

document:Media updated = check fo->updateMedia(
"USMF",
"MED-001",
{email: "[email protected]"},
headers = {ifMatch: eTag}
);

Media Types

listMediaTypes

Reads all media type definitions.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesListMediaTypesQueriesNoOData query parameters: skip, top, filter, orderby, expand, crossCompany, count, 'select.

Returns: document:MediaTypesCollection|error

Sample code:

document:MediaTypesCollection types = check fo->listMediaTypes(
queries = {
top: 20
}
);
createMediaTypes

Creates a media type definition.

Parameters:

NameTypeRequiredDescription
payloadMediaTypeYesThe media type to create.
headersmap<string|string[]>NoHeaders to be sent with the request.

Returns: document:MediaType|error

Sample code:

document:MediaType mediaType = check fo->createMediaTypes({
dataAreaId: "USMF",
mediaTypeId: "EMAIL",
description: "Email address"
});
getMediaTypes

Reads a specific media type by key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
mediaTypeIdstringYesThe media type id key field.
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesGetMediaTypesQueriesNoOData query parameters: expand, 'select.

Returns: document:MediaType|error

Sample code:

document:MediaType mediaType = check fo->getMediaTypes(
"USMF",
"EMAIL"
);
deleteMediaTypes

Deletes a specific media type.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
mediaTypeIdstringYesThe media type id key field.
headersDeleteMediaTypesHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: error?

Sample code:

check fo->deleteMediaTypes(
"USMF",
"EMAIL",
headers = {ifMatch: eTag}
);
updateMediaTypes

Updates a specific media type.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
mediaTypeIdstringYesThe media type id key field.
payloadMediaTypeYesThe fields to update.
headersUpdateMediaTypesHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: document:MediaType|error

Sample code:

document:MediaType updated = check fo->updateMediaTypes(
"USMF",
"EMAIL",
{description: "Primary email address"},
headers = {ifMatch: eTag}
);

Message Items

listMessageItems

Reads all message processing items.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesListMessageItemsQueriesNoOData query parameters: skip, top, filter, orderby, expand, crossCompany, count, 'select.

Returns: document:MessageItemsCollection|error

Sample code:

document:MessageItemsCollection items = check fo->listMessageItems(
queries = {
filter: "ItemStatus eq 'Error'",
top: 20
}
);
createMessageItems

Creates a message processing item.

Parameters:

NameTypeRequiredDescription
payloadMessageItemsYesThe message item to create.
headersmap<string|string[]>NoHeaders to be sent with the request.

Returns: document:MessageItems|error

Sample code:

document:MessageItems item = check fo->createMessageItems({
dataAreaId: "USMF",
messageId: "MSG-001",
itemId: "ITEM-001",
itemType: "Invoice",
processingId: "PROC-001",
itemStatus: "Pending"
});
getMessageItems

Reads a specific message item by key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
itemIdstringYesThe item id key field.
itemTypestringYesThe item type key field.
processingIdstringYesThe processing id key field.
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesGetMessageItemsQueriesNoOData query parameters: expand, 'select.

Returns: document:MessageItems|error

Sample code:

document:MessageItems item = check fo->getMessageItems(
"USMF",
"ITEM-001",
"Invoice",
"PROC-001"
);
deleteMessageItems

Deletes a specific message item.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
itemIdstringYesThe item id key field.
itemTypestringYesThe item type key field.
processingIdstringYesThe processing id key field.
headersDeleteMessageItemsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: error?

Sample code:

check fo->deleteMessageItems(
"USMF",
"ITEM-001",
"Invoice",
"PROC-001",
headers = {ifMatch: eTag}
);
updateMessageItems

Updates a specific message item.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
itemIdstringYesThe item id key field.
itemTypestringYesThe item type key field.
processingIdstringYesThe processing id key field.
payloadMessageItemsYesThe fields to update.
headersUpdateMessageItemsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: document:MessageItems|error

Sample code:

document:MessageItems updated = check fo->updateMessageItems(
"USMF",
"ITEM-001",
"Invoice",
"PROC-001",
{itemStatus: "Processed"},
headers = {ifMatch: eTag}
);

Message Status

listMessageStatus

Reads all message status definitions.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesListMessageStatusQueriesNoOData query parameters: skip, top, filter, orderby, expand, crossCompany, count, 'select.

Returns: document:MessageStatusCollection|error

Sample code:

document:MessageStatusCollection statuses = check fo->listMessageStatus(
queries = {
top: 20
}
);
createMessageStatus

Creates a message status definition.

Parameters:

NameTypeRequiredDescription
payloadMessageStatusYesThe message status to create.
headersmap<string|string[]>NoHeaders to be sent with the request.

Returns: document:MessageStatus|error

Sample code:

document:MessageStatus status = check fo->createMessageStatus({
dataAreaId: "USMF",
messageStatus: "PENDING",
description: "Pending processing",
allowDelete: "No",
responseType: "None"
});
getMessageStatus

Reads a specific message status by key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
messageStatusstringYesThe message status key field.
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesGetMessageStatusQueriesNoOData query parameters: expand, 'select.

Returns: document:MessageStatus|error

Sample code:

document:MessageStatus status = check fo->getMessageStatus(
"USMF",
"PENDING"
);
deleteMessageStatus

Deletes a specific message status.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
messageStatusstringYesThe message status key field.
headersDeleteMessageStatusHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: error?

Sample code:

check fo->deleteMessageStatus(
"USMF",
"PENDING",
headers = {ifMatch: eTag}
);
updateMessageStatus

Updates a specific message status.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
messageStatusstringYesThe message status key field.
payloadMessageStatusYesThe fields to update.
headersUpdateMessageStatusHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: document:MessageStatus|error

Sample code:

document:MessageStatus updated = check fo->updateMessageStatus(
"USMF",
"PENDING",
{description: "Awaiting downstream processing"},
headers = {ifMatch: eTag}
);

Messages Logs

listMessagesLogs

Reads all message processing log entries.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesListMessagesLogsQueriesNoOData query parameters: skip, top, filter, orderby, expand, crossCompany, count, 'select.

Returns: document:MessagesLogsCollection|error

Sample code:

document:MessagesLogsCollection logs = check fo->listMessagesLogs(
queries = {
filter: "MessageId eq 'MSG-001'",
top: 20
}
);
createMessagesLogs

Creates a message processing log entry.

Parameters:

NameTypeRequiredDescription
payloadMessagesLogYesThe log entry to create.
headersmap<string|string[]>NoHeaders to be sent with the request.

Returns: document:MessagesLog|error

Sample code:

document:MessagesLog log = check fo->createMessagesLogs({
dataAreaId: "USMF",
messageId: "MSG-001",
actionId: "ACT-001",
messageStatusIdFrom: "PENDING",
messageStatusIdTo: "PROCESSED",
processingDescription: "Processed successfully"
});
getMessagesLogs

Reads a specific message log entry by key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
messageIdstringYesThe message id key field.
actionIdstringYesThe action id key field.
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesGetMessagesLogsQueriesNoOData query parameters: expand, 'select.

Returns: document:MessagesLog|error

Sample code:

document:MessagesLog log = check fo->getMessagesLogs(
"USMF",
"MSG-001",
"ACT-001"
);
deleteMessagesLogs

Deletes a specific message log entry.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
messageIdstringYesThe message id key field.
actionIdstringYesThe action id key field.
headersDeleteMessagesLogsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: error?

Sample code:

check fo->deleteMessagesLogs(
"USMF",
"MSG-001",
"ACT-001",
headers = {ifMatch: eTag}
);
updateMessagesLogs

Updates a specific message log entry.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
messageIdstringYesThe message id key field.
actionIdstringYesThe action id key field.
payloadMessagesLogYesThe fields to update.
headersUpdateMessagesLogsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: document:MessagesLog|error

Sample code:

document:MessagesLog updated = check fo->updateMessagesLogs(
"USMF",
"MSG-001",
"ACT-001",
{processingDescription: "Reprocessed after retry"},
headers = {ifMatch: eTag}
);
listPrintLayouts

Reads all print layout definitions.

Parameters:

NameTypeRequiredDescription
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesListPrintLayoutsQueriesNoOData query parameters: skip, top, filter, orderby, expand, crossCompany, count, 'select.

Returns: document:PrintLayoutsCollection|error

Sample code:

document:PrintLayoutsCollection layouts = check fo->listPrintLayouts(
queries = {
top: 20
}
);
createPrintLayouts

Creates a print layout definition.

Parameters:

NameTypeRequiredDescription
payloadPrintLayoutYesThe print layout to create.
headersmap<string|string[]>NoHeaders to be sent with the request.

Returns: document:PrintLayout|error

Sample code:

document:PrintLayout layout = check fo->createPrintLayouts({
dataAreaId: "USMF",
printLayoutGroup: "VOUCHERS",
printLayoutCode: "TR101",
groupDescription: "General ledger vouchers",
codeDescription: "Transfer voucher layout"
});
getPrintLayouts

Reads a specific print layout by key.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
printLayoutGroupstringYesThe print layout group key field.
printLayoutCodestringYesThe print layout code key field.
headersmap<string|string[]>NoHeaders to be sent with the request.
queriesGetPrintLayoutsQueriesNoOData query parameters: expand, 'select.

Returns: document:PrintLayout|error

Sample code:

document:PrintLayout layout = check fo->getPrintLayouts(
"USMF",
"VOUCHERS",
"TR101"
);
deletePrintLayouts

Deletes a specific print layout.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
printLayoutGroupstringYesThe print layout group key field.
printLayoutCodestringYesThe print layout code key field.
headersDeletePrintLayoutsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: error?

Sample code:

check fo->deletePrintLayouts(
"USMF",
"VOUCHERS",
"TR101",
headers = {ifMatch: eTag}
);
updatePrintLayouts

Updates a specific print layout.

Parameters:

NameTypeRequiredDescription
dataAreaIdstringYesThe company data area identifier.
printLayoutGroupstringYesThe print layout group key field.
printLayoutCodestringYesThe print layout code key field.
payloadPrintLayoutYesThe fields to update.
headersUpdatePrintLayoutsHeadersNoOptional ifMatch ETag header for optimistic concurrency; mapped to If-Match.

Returns: document:PrintLayout|error

Sample code:

document:PrintLayout updated = check fo->updatePrintLayouts(
"USMF",
"VOUCHERS",
"TR101",
{codeDescription: "Updated transfer voucher layout"},
headers = {ifMatch: eTag}
);