# Dynamics 365 Supply Chain Management API: OData, Custom Services and Data Packages

> Source: https://netray.co/erp-help/dynamics-365-supply-chain-management-api-odata-custom-services
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: ERP Help

## Short answer

Dynamics 365 Supply Chain Management exposes three main integration routes: OData endpoints over data entities for record-level reads and writes, JSON custom services for X++ logic you expose as operations, and the data management package API for bulk import and export. All use OAuth 2.0 with a Microsoft Entra ID app registration.

## Kind

advanced

## System

dynamics

## Erp

Microsoft Dynamics 365 Supply Chain Management / Finance and Operations

## Module

Integration / APIs

## Query

dynamics 365 supply chain management api

## Alternate Queries

- web api dynamics 365
- d365 finance and operations odata api
- d365 custom service json api
- d365 data entity api authentication

## Applies To

Dynamics 365 Supply Chain Management and Finance (finance and operations apps), cloud-hosted. Endpoint details can change, so verify against Microsoft Learn.

## Steps

### Call the API for the first time

**Items:**

- Register an application in Microsoft Entra ID and create a client secret or certificate.
- In D365, register the application ID under System administration > Setup > Microsoft Entra ID applications and map it to a user with the needed security roles.
- Request a token with the client credentials flow, using your environment URL as the resource or scope.
- Call the OData endpoint at your environment URL under /data/, for example /data/Customers or the entity's public collection name.
- Pass the bearer token in the Authorization header, and use cross-company=true when needed since reads are scoped to the user's default company.
- For a custom operation, call POST /api/services/{ServiceGroup}/{Service}/{Operation} with a JSON body of the parameters.
- For bulk loads use the data management package API, or recurring integration for file-based queues.

## Sections

### Which route for which job

**Body:**

Use OData data entities for interactive and moderate volume record work: reading a sales order, creating a customer, updating a field. Entities enforce validation and defaults, so they are safe, but each call is relatively expensive and the service throttles heavy callers.

Use custom services when a business operation spans several tables or needs X++ logic, such as releasing and confirming an order. Use the data management framework package API for thousands of records, because it stages and processes in batches.

**Code:**

- GET https://<environment>.operations.dynamics.com/data/Customers?$top=5&cross-company=true
- POST https://<environment>.operations.dynamics.com/api/services/MyServiceGroup/MyService/myOperation
- Authorization: Bearer <access token>

### Authentication and security

**Body:**

The Entra application is mapped to a D365 user, and that user's security roles define what the API can do. Give integrations a dedicated user with least privilege and avoid reusing an administrator.

Business events and Dataverse virtual entities or dual write offer outbound and cross-app patterns when polling is the wrong shape. For event-driven designs, prefer business events to polling OData on a timer.

### Reliability and throttling

**Body:**

Resource-based throttling returns HTTP 429 with a retry hint when an integration overloads the environment. Handle it with exponential backoff, smaller batches and off-hours scheduling. Our page on OData 429 covers it in detail.

## Pitfalls

- Forgetting to register the Entra application inside D365, which returns authorization errors even with a valid token.
- Using OData for large migrations instead of the data management package API.
- Giving the integration user administrator rights.
- Ignoring 429 responses and retrying immediately.

## Ai Angle

Teams building integrations often spend time discovering entity names and fields. An assistant grounded in your metadata can point to the right entity and draft the request, and a read-only analytics layer can avoid hitting transactional endpoints for reporting. Netray's ERPray provides read-only access for questions, with human approval on any write-back.

## Faq

### What is the D365 Supply Chain Management API?

**Answer:** It is a set of web interfaces: OData over data entities, JSON custom services and the data management framework package API. They let external systems read and write data under Entra ID authentication.

### How do I authenticate to the D365 OData endpoint?

**Answer:** Register an app in Microsoft Entra ID, register its ID inside D365 with a mapped user, then request an OAuth 2.0 token and send it as a bearer token to the environment's /data/ endpoint.

### Is there a REST API for D365 beyond OData?

**Answer:** Yes. Custom services exposed as JSON at /api/services, plus the data management package REST API for bulk import and export.

### Why do I get 429 errors?

**Answer:** The platform throttles callers that consume too many resources. Reduce batch sizes, add backoff on the Retry-After value and spread jobs over time.

## Search terms

dynamics 365 supply chain management api, web api dynamics 365, d365 odata api, d365 finance and operations api, d365 custom service json, d365 data entity, d365 entra id app registration, d365 data management package api

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