web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

Recommended way to create Sales Order header + lines via OData in Dynamics 365 F&O

(0) ShareShare
ReportReport
Posted on by 3

We are integrating an external OMS with Dynamics 365 Finance & Operations and creating Sales Orders using the standard OData entities:

  • SalesOrderHeadersV4
  • SalesOrderLinesV3

Our current flow is:

  1. Create Sales Order Header via OData (POST /data/SalesOrderHeadersV4)
  2. Retrieve the generated SalesOrderNumber
  3. Create lines via POST /data/SalesOrderLinesV3

This works, but because header and lines are separate calls we must handle several edge cases in our integration layer:

  • Header succeeds but line creation fails
  • Some lines succeed and some fail
  • Retry logic may create duplicate headers
  • Need to implement idempotency and reconciliation logic

We explored OData batch (/data/$batch) with a single changeset to make the operation atomic. The goal was to create header and lines in the same batch request.

However, referencing the created header inside the batch (for example using $1/... patterns similar to the OData documentation examples) results in URI errors in D365, suggesting that SalesOrderLinesV3 may not be exposed as a navigation path from SalesOrderHeadersV4.

Because of this, we are trying to understand the recommended integration pattern for this scenario.

Questions:

  1. Is there a supported way to create a Sales Order header and lines atomically via OData in D365 F&O?
  2. Is OData batch intended to work for this scenario with these entities?
  3. If not, is the recommended approach to create the header first and then create lines while handling idempotency and retries in the integration layer?
  4. Alternatively, should Data Management / composite entities be used for this type of document-style import even for near-real-time integrations?

Any guidance on the recommended approach for creating Sales Orders from external systems would be greatly appreciated.

Thanks!

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 1,072

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 227 Super User 2026 Season 1

#3
SoumitraforD365 Profile Picture

SoumitraforD365 130

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans