# Dynamics 365 Finance and Supply Chain OData URL Builder

> Source: https://netray.co/tools/d365-fo-odata-url-builder
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Fill in your environment, entity and query options to get a correctly formed D365 F&O OData request and a sample OAuth token call.

## Category

microsoft-dynamics

## Erp

Microsoft Dynamics 365 Finance and Supply Chain

## Audience

- D365 F&O developer
- Integration developer
- Power BI developer

## Tool

**Kind:** template

**Output:** code

**Language:** http

**Fields:**

#### Environment host

**Key:** env

**Type:** text

**Default:** contoso-test.sandbox.operations.dynamics.com

**Help:** Host without https://

#### Entity collection name

**Key:** entity

**Type:** text

**Default:** ReleasedProductsV2

#### Legal entity (dataAreaId)

**Key:** company

**Type:** text

**Default:** usmf

#### Additional filter

**Key:** filter

**Type:** text

**Default:** ProductType eq Microsoft.Dynamics.DataEntities.EcoResProductType'Item'

#### Select fields

**Key:** select

**Type:** text

**Default:** ItemNumber,ProductName,ProductGroupId

#### Order by

**Key:** orderby

**Type:** text

**Default:** ItemNumber

#### Top (rows)

**Key:** top

**Type:** number

**Default:** 100

#### Cross-company

**Key:** xco

**Type:** select

**Options:**

- true
- false

**Default:** false

#### Entra tenant id

**Key:** tenant

**Type:** text

**Default:** 00000000-0000-0000-0000-000000000000

#### App registration client id

**Key:** client

**Type:** text

**Default:** 11111111-1111-1111-1111-111111111111

**Blocks:**

#### OData GET request

**Body:** GET https://{{env}}/data/{{entity}}?cross-company={{xco}}&$filter=dataAreaId eq '{{company}}' and {{filter}}&$select={{select}}&$orderby={{orderby}}&$top={{top}}
Authorization: Bearer <access token>
Accept: application/json
OData-MaxVersion: 4.0
OData-Version: 4.0

#### Same request, URL encoded for a browser or Power Query

**Body:** https://{{env}}/data/{{entity}}?cross-company={{xco}}&$filter=dataAreaId%20eq%20%27{{company}}%27&$select={{select}}&$orderby={{orderby}}&$top={{top}}

#### Token request (client credentials)

**Body:** POST https://login.microsoftonline.com/{{tenant}}/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&client_id={{client}}&client_secret=<secret>&scope=https://{{env}}/.default

#### Count and single record patterns

**Body:** Count: GET https://{{env}}/data/{{entity}}/$count?cross-company={{xco}}&$filter=dataAreaId eq '{{company}}'

Single record by key: GET https://{{env}}/data/{{entity}}(dataAreaId='{{company}}',ItemNumber='A0001')

**Notes:** Key fields and enum literal syntax differ by entity. Check the entity key in Data management > Data entities and test enum filters in a sandbox. Application registration must also be added to Microsoft Entra applications in System administration > Setup. Never paste real secrets into shared documents.

## Content

**Intro:** Dynamics 365 Finance and Supply Chain exposes public data entities as OData v4 collections under the /data path of your environment. Getting the URL syntax, cross-company flag and authentication right is where most first calls fail. Fill in the fields to generate both a readable and an encoded version.

**Sections:**

#### How to use the builder

**Body:** Enter your environment host, the public collection name of the entity, the legal entity and the query options. Copy the request into Postman, Insomnia, curl or Power Query. Replace the bearer token with one obtained from the token call shown, using an app registration that is registered in D365 under System administration > Setup > Microsoft Entra applications and mapped to a user.

**Bullets:**

- Use $select to limit columns, it matters for performance
- Use $top while testing and paginate with the next link in real runs
- Add cross-company=true only when you intend to read across legal entities
- Filter on dataAreaId for company-specific entities

#### Query options that matter

**Body:** OData v4 options in F&O include $filter, $select, $orderby, $top, $count and $expand where navigation properties exist. Enum values need the full namespace literal, such as Microsoft.Dynamics.DataEntities.NoYes'Yes', which surprises people used to plain strings. String literals use single quotes and spaces in a browser URL must be encoded. Server paging returns a next link, so loop until it is absent.

#### Authentication and limits

**Body:** Access uses Microsoft Entra ID tokens for the environment as the resource. Service protection limits and priority-based throttling apply, so a burst of calls can return HTTP 429 with a retry-after header. Build retry with back-off into integrations. For bulk movement, the Data management package API or recurring integrations usually beat paging OData.

#### Common mistakes

**Body:** Frequent problems are forgetting cross-company so only the default company returns rows, using the entity label instead of the public collection name, wrong enum literal syntax, and reading huge result sets without $select. Another is using the sandbox host in a production script, so keep the environment in a variable.

**Cta:** If your team needs these reads wrapped into a governed, read-only question-and-answer layer over D365, we can discuss how that is built on your own infrastructure.

**Faq:**

#### What is the base URL for D365 F&O OData?

**Answer:** It is https://your-environment-host/data followed by the public entity collection name, for example /data/CustomersV3. The host is the URL you use to sign in to the finance and operations client, not the Power Platform environment URL.

#### Why do I only see data for one company?

**Answer:** OData returns the default company of the calling user unless you pass cross-company=true. When you do, filter on dataAreaId if you only want certain legal entities, otherwise you may pull far more data than intended.

#### How do I filter on an enum field?

**Answer:** Use the full enum literal, for example $filter=SomeField eq Microsoft.Dynamics.DataEntities.NoYes'Yes'. The namespace and enum name come from the entity metadata, which you can read at /data/$metadata for your environment.

#### How do I page through large results?

**Answer:** Follow the @odata.nextLink value in each response until it is no longer returned. Do not rely on $skip for large sets. Use $select to shrink the payload and consider the data management package API for bulk extraction.

## Search terms

d365 odata url, d365 f&o odata filter example, dynamics 365 finance odata query, d365 cross-company odata, d365 odata postman, d365 data entity odata get, d365 f&o rest api example, d365 odata $filter dataAreaId

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
