Business Central (Apps step)

Updated Nov 23, 2026
DataMagik Automate

Business Central

Lists companies, customers, items and sales orders, reads a customer, and creates sales orders in Dynamics 365 Business Central (online) through its API v2.0.

Use it to keep Business Central in step with the plant: create a sales order when a customer PO arrives, look up a customer's details for a document, or list items and open sales orders for a report.

Beta. This step has not yet been checked against a live Business Central account, so treat its first runs as a test, and tell us if an operation does not answer as described.

Find it in the workflow editor's palette under Apps. See Apps steps for what every Apps step has in common.

Set it up

  1. In the Microsoft Entra admin center, open App registrations › New registration, register an app for this organization only, and note its Application (client) ID and Directory (tenant) ID.
  2. Under API permissions › Add a permission › Dynamics 365 Business Central › Application permissions, add API.ReadWrite.All, then click Grant admin consent.
  3. Under Certificates & secrets › Client secrets, create a secret and copy its Value (it is shown once).
  4. In Business Central, search for the Microsoft Entra Applications page, add a new line with the app's Client ID, set State to Enabled, and give it permission sets that cover what the workflow reads and writes (customers, items, sales documents). Click Grant Consent on that page.
  5. Add api.businesscentral.dynamics.com to Allowed Domains in the workflow's Script settings.

Credential: An OAuth 2.0 client credentials credential for a Microsoft Entra app: its Application (client) ID, a client secret, and the token URL with your Directory (tenant) ID in it.

Signing in with OAuth 2.0

Grant typeClient credentials
Token URLhttps://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
Scopehttps://api.businesscentral.dynamics.com/.default

Replace <tenant-id> in the token URL with your Directory (tenant) ID from the app's Overview page. Register the app in Microsoft Entra ID with the Dynamics 365 Business Central application permission API.ReadWrite.All, grant admin consent and create a client secret. Then add the app on Business Central's Microsoft Entra Applications page, enabled, with the permission sets it needs; the app signs in as itself, so no one clicks Connect.

Hosts it calls: api.businesscentral.dynamics.com

Connection

FieldRequiredWhat to put
Tenant IDYesYour Microsoft Entra Directory (tenant) ID, a GUID from the app registration's Overview page, or your tenant's domain such as acme.onmicrosoft.com. For example 8c1f2a3b-4d5e-6f70-8192-a3b4c5d6e7f8.
EnvironmentYesThe Business Central environment's name as the admin center shows it: Production, or a sandbox's name such as Sandbox. For example Production.

Operations

OperationWhat it does
Company › ListLists the companies in the environment, so you can see their ids.
Customer › ListLists a company's customers, optionally filtered, following every page up to the step's page limit.
Customer › GetReads one customer by its id.
Item › ListLists a company's items, optionally filtered, following every page up to the step's page limit.
Sales order › ListLists a company's sales orders, optionally filtered, following every page up to the step's page limit.
Sales order › CreateCreates a sales order, with its lines if you give them in salesOrderLines.

Company › List

Lists the companies in the environment, so you can see their ids.

Calls GET /companies.

What comes out: One item per company: {{ $json.id }} (what the Company field takes), {{ $json.name }}, {{ $json.displayName }} and {{ $json.systemVersion }}.

Example: Run it once to find the id of CRONUS USA, Inc. and use it as the Company in the other operations.

Customer › List

Lists a company's customers, optionally filtered, following every page up to the step's page limit.

Calls GET /companies({companyId})/customers. Follows the pages, up to Most pages (10 unless you change it).

FieldRequiredWhat to put
CompanyYesThe company's id, a GUID; List companies gives it as {{ $json.id }}. For example 1d9b6a4e-…. Choose from list beside the field fetches the choices from your account.
FilterNoAn OData filter on the API's field names, such as number eq '10000' or lastModifiedDateTime gt 2026-01-01T00:00:00Z; leave empty for all. For example number eq '10000'.
Most resultsNoReturn at most this many; leave empty for all of them.

What comes out: One item per customer: {{ $json.id }}, {{ $json.number }}, {{ $json.displayName }}, {{ $json.email }}, {{ $json.phoneNumber }}, {{ $json.balanceDue }}, {{ $json.blocked }} and {{ $json.lastModifiedDateTime }}.

Example: Filter balanceDue gt 0 to list the customers who owe money for the credit team's Monday email.

Customer › Get

Reads one customer by its id.

Calls GET /companies({companyId})/customers({customerId}).

FieldRequiredWhat to put
CompanyYesThe company's id, a GUID; List companies gives it as {{ $json.id }}. For example 1d9b6a4e-…. Choose from list beside the field fetches the choices from your account.
Customer IDYesThe customer's id, a GUID (not its number such as 10000); List customers gives it as {{ $json.id }}. For example 5d115c9c-….

What comes out: One item: the customer, with {{ $json.id }}, {{ $json.number }}, {{ $json.displayName }}, {{ $json.addressLine1 }}, {{ $json.city }}, {{ $json.email }}, {{ $json.currencyCode }} and {{ $json.balanceDue }}.

Example: Read customer {{ $json.customerId }} to put its address on a generated packing list.

Item › List

Lists a company's items, optionally filtered, following every page up to the step's page limit.

Calls GET /companies({companyId})/items. Follows the pages, up to Most pages (10 unless you change it).

FieldRequiredWhat to put
CompanyYesThe company's id, a GUID; List companies gives it as {{ $json.id }}. For example 1d9b6a4e-…. Choose from list beside the field fetches the choices from your account.
FilterNoAn OData filter on the API's field names, such as number eq '1896-S' or inventory lt 10; leave empty for all. For example number eq '1896-S'.
Most resultsNoReturn at most this many; leave empty for all of them.

What comes out: One item per item: {{ $json.id }}, {{ $json.number }}, {{ $json.displayName }}, {{ $json.type }}, {{ $json.baseUnitOfMeasureCode }}, {{ $json.unitPrice }}, {{ $json.unitCost }}, {{ $json.inventory }} and {{ $json.blocked }}.

Example: Filter inventory lt 10 each morning and email purchasing the items running low.

Sales order › List

Lists a company's sales orders, optionally filtered, following every page up to the step's page limit.

Calls GET /companies({companyId})/salesOrders. Follows the pages, up to Most pages (10 unless you change it).

FieldRequiredWhat to put
CompanyYesThe company's id, a GUID; List companies gives it as {{ $json.id }}. For example 1d9b6a4e-…. Choose from list beside the field fetches the choices from your account.
FilterNoAn OData filter on the API's field names, such as status eq 'Open' or customerNumber eq '10000'; leave empty for all. For example status eq 'Open'.
Most resultsNoReturn at most this many; leave empty for all of them.

What comes out: One item per sales order: {{ $json.id }}, {{ $json.number }}, {{ $json.orderDate }}, {{ $json.customerNumber }}, {{ $json.customerName }}, {{ $json.externalDocumentNumber }}, {{ $json.status }}, {{ $json.requestedDeliveryDate }} and {{ $json.totalAmountIncludingTax }}.

Example: Filter status eq 'Open' to list the open orders for the shipping lead's morning report.

Sales order › Create

Creates a sales order, with its lines if you give them in salesOrderLines.

Calls POST /companies({companyId})/salesOrders.

FieldRequiredWhat to put
CompanyYesThe company's id, a GUID; List companies gives it as {{ $json.id }}. For example 1d9b6a4e-…. Choose from list beside the field fetches the choices from your account.
Order fieldsYesA JSON object of the order's fields by their API names: customerNumber (or customerId) is required; externalDocumentNumber, orderDate and requestedDeliveryDate are common, and salesOrderLines adds the lines in the same call. For example {"customerNumber": "10000", "externalDocumentNumber": "{{ $json.po }}", "salesOrderLines": [{"lineType": "Item", "lineObjectNumber": "1896-S", "quantity": 5}]}.

What comes out: One item: the new sales order as Business Central saved it, with {{ $json.id }}, {{ $json.number }}, {{ $json.status }} (Draft), {{ $json.customerName }} and {{ $json.totalAmountIncludingTax }}. The lines are not included.

Example: For each PO from the customer portal, create {"customerNumber": "{{ $json.customer }}", "externalDocumentNumber": "{{ $json.po }}", "salesOrderLines": {{ $json.lines }}} and save {{ $json.number }} with the PO.

Trigger: Business Central: New Items

Under Triggers in the palette. It looks at Business Central on a schedule (every 15 minutes unless you change Look every) with one of these operations: Customer › List; Item › List; Sales order › List, and starts the workflow with the items it has not seen on an earlier look, one item each. Saving the workflow sets up the schedule.

  • New means: not seen before, by the item's id (or the field you name in Item field), or newer than the newest one last time, by a date or increasing number.
  • On the first run it only remembers what is there, unless you choose Start with everything.
  • Test runs show what would be new without remembering it. It remembers the last 5000 ids, so filter the list to keep it shorter than that.

Example

When an EDI 850 purchase order arrives, Business Central › Create sales order makes the order for customer {{ $json.customer_number }} with one line per PO line, then Send Email tells the planner its number {{ $json.number }}.

Tips

  • Every call except List companies needs the company's id, a GUID: run List companies once and pick it in the Company field, or copy {{ $json.id }}.
  • Filters use OData syntax with the API's field names: number eq '10000', displayName eq 'Adatum', lastModifiedDateTime gt 2026-01-01T00:00:00Z. Text values go in single quotes; dates do not.
  • A sales order can be created with its lines in one call: put them in salesOrderLines, each with lineType Item, lineObjectNumber (the item number) and quantity.
  • The Environment name is case-sensitive in the address; a sandbox's name is shown in the Business Central admin center.
  • It reads and writes the real company on test runs too, so point it at a sandbox environment while building.

Settings every Apps step has

  • More query parameters: any query parameter the fields do not offer, sent as is.
  • More body fields: a JSON object merged into the request body; nested objects merge, other values replace.
  • Most requests per second: spaces the calls out for rate limits. A "too many requests" (429) answer is retried after the wait the API asks for.
  • Most pages: for operations that follow pages, the most pages to fetch (10 unless you change it, up to 100). The run warns when it stops with more to get.
  • Fail on a non-2xx response: on by default. Turn it off to handle errors yourself.

Business Central's own API documentation: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/api-reference/v2.0/

Was this page helpful?