D365 Finance and Operations OData URL Builder
During an AX 2012 to Dynamics 365 move you will repeatedly read D365 entities to validate loads. This builder writes the token request and the OData calls for single legal entity reads, cross-company reads and row counts.
Fill in
Your F&O environment host name without https://.
Comma separated field names from the entity metadata.
1. Get an access token (client credentials)
POST https://login.microsoftonline.com/contoso.onmicrosoft.com/oauth2/v2.0/token Content-Type: application/x-www-form-urlencoded grant_type=client_credentials&client_id=00000000-0000-0000-0000-000000000000&client_secret=<YOUR_SECRET>&scope=https://contoso-test.operations.dynamics.com/.default
2. Read the entity for one legal entity
GET https://contoso-test.operations.dynamics.com/data/CustomersV3?$filter=dataAreaId eq 'usmf'&$select=CustomerAccount,OrganizationName,CustomerGroupId&$top=100 Authorization: Bearer <ACCESS_TOKEN> Accept: application/json
3. Read across all legal entities
GET https://contoso-test.operations.dynamics.com/data/CustomersV3?cross-company=true&$select=dataAreaId,CustomerAccount,OrganizationName,CustomerGroupId&$top=100 Authorization: Bearer <ACCESS_TOKEN> Accept: application/json
4. Count rows for a reconciliation
GET https://contoso-test.operations.dynamics.com/data/CustomersV3/$count?cross-company=true Authorization: Bearer <ACCESS_TOKEN>
The app registration must also be registered in D365 under System administration, Setup, Microsoft Entra ID applications, with a user mapped. Never paste a real client secret into shared documents. Space characters in URLs must be URL encoded by your client. Field names depend on your release; read /data/$metadata to confirm. OData is for small and medium reads, use the Data management framework or export to Azure for bulk.
Want migration validation automated?
An optional review of your D365 load validation and reconciliation approach.
Optional. The tool and every export work without this. No spam.
How to use the builder
Fill in your environment host, tenant, app registration client ID, the entity and the legal entity. Copy the blocks into Postman, an HTTP file in VS Code or your own script. Request a token first, then use the token in the Authorization header of the data requests. Replace the secret and token placeholders locally; never store them in the tool.
- Start with a small $top to confirm connectivity
- Use $select to limit columns and reduce payload size
- Use cross-company=true only when you need several legal entities
How the calls work
D365 F&O exposes data entities as OData v4 collections under /data. Authentication uses Microsoft Entra ID, and the client credentials flow is the usual pattern for services. The scope is the environment URL plus /.default. Data is scoped by legal entity through the dataAreaId field, and the cross-company query option removes the default scoping to the user's default company.
Using it for migration validation
After each import, count rows in D365 with $count and compare to your AX source count per legal entity. Then sample key fields with $select and a filter on a few known records. This catches truncated loads, wrong legal entity mapping and missed dependencies before business users find them.
Common mistakes
Users forget the cross-company option and see only their default company. Others exceed throttling by paging large reads through OData instead of using the Data management framework. A third frequent issue is a missing user mapping for the app registration, which returns an authorization error even with a valid token.
Frequently Asked Questions
Does this work for Business Central?
No. Business Central uses a different API base (api.businesscentral.dynamics.com) and its own v2.0 endpoints. This builder targets Dynamics 365 Finance and Operations data entities under the /data path.
Why do I get a 401 or 403 with a valid token?
The app registration must be added in D365 under Microsoft Entra ID applications and mapped to a user with the right security roles. A token alone is not enough. Also check the scope matches your environment host exactly.
Is OData fine for large migrations?
It suits validation and small reads. For bulk import or export use the Data management framework, package APIs or export to Azure Data Lake. OData reads of millions of rows are slow and subject to throttling.
How do I find field names?
Request https://your-host/data/$metadata or browse the entity in Data management. Field names are case sensitive in OData, and some labels in the UI differ from the stored names.
If you want automated validation between AX or GP and a new D365 environment, we can help build reconciliation jobs that run in your own tenant or on-prem.
Related Tools
AX 2012 Table to D365 Data Entity Reference
Look up the D365 F&O data entity and OData collection that corresponds to a Dynamics AX 2012 table when planning data migration.
Microsoft DynamicsDynamics GP Third-Party Add-On Dependency Assessment
Answer ten questions to score how much ISV add-ons, custom code and integrations will complicate a move off GP or AX.
Microsoft DynamicsDynamics GP Work, Open and History Table Map
A searchable list of Dynamics GP tables grouped by lifecycle: master, work, open and history, so you know where a transaction lives at each stage.
More Microsoft Dynamics tools
See all- D365 F&O Manufacturing Data Entities Reference
- D365 F&O OData URL Builder
- D365 Production Order Status Reference
- D365 Data Management Import Worksheet Template
- D365 Batch Job Checklist
- D365 Security Role Design Worksheet
- D365 Master Planning Setup Checklist
- D365 One Version Update Test Checklist
- D365 Finance and Supply Chain Functional Design Document Template