Engineering

Dynamics 365 Finance & Operations integration and API development

We connect Dynamics 365 Finance & Operations to the systems around it with integrations that are designed for volume, failure and change — and that someone can monitor at three in the morning.

Integration & API Development
Dynamics 365 Finance & Ops Business events Service Bus CRM Web shop Bank Retry · dead-letter

Integration in action

Connecting Business Systems. Powering Seamless Operations.

Discover how Codefine connects Dynamics 365 Finance & Operations with external platforms through secure APIs, Azure integration services and reliable event-driven architectures.

  1. One Order. Multiple Connected Systems.

    example-store.testFictional storefront

    Office Chair

    Item CHAIR-001 · quantity 2

    Added to cart Checkout Order confirmed

    Order
    WEB-10045
    Customer
    Example Customer
    Status
    Submitted

    Scene 1 of 8

    The customer places an order

    A customer orders 2 × Office Chair in an online store. The storefront records order WEB-10045 as Submitted and expects the business to fulfil it.

  2. POST /orders · application/json

    {
      "externalOrderId": "WEB-10045",
      "customerAccount": "CUST-DEMO",
      "currency": "EUR",
      "items": [
        {
          "itemId": "CHAIR-001",
          "quantity": 2
        }
      ]
    }

    Authorization: Bearer ‹token issued by Microsoft Entra ID — never shown or logged›

    1. Serialised Order converted to the agreed JSON contract
    2. Authenticated Token validated at the gateway
    3. Authorised Caller allowed to create orders for this store
    4. Validated Schema and required fields checked
    5. Correlated Correlation ID corr-7f3a-10045 assigned

    202 Accepted Received for asynchronous processing — the sales order does not exist yet.

    Scene 2 of 8

    The API request begins

    The storefront serialises the order to JSON and posts it to the integration endpoint. The caller is authenticated and authorised, the payload is validated and a correlation ID is assigned. The answer is 202 Accepted — received for processing, not yet a sales order.

    1. Gateway

      Azure API Management

      Authentication, throttling, one public contract

    2. Intake

      Azure Function

      Validate, map, assign correlation ID

    3. Buffer

      Azure Service Bus

      Durable queue; redelivery and dead-letter

    4. Consumer

      Azure Function

      Reads the message and calls F&O

    5. ERP

      Microsoft Dynamics 365

      Custom X++ service → business logic

    ReceivedValidatedQueuedProcessing

    Microsoft Azure Service Bus stores the message; the consumer calls F&O. Not every integration needs every component — the right mix depends on volume, latency, ownership and cost.

    Scene 3 of 8

    Azure integration orchestration

    The gateway hands the request to an intake function, which maps it and puts a message on a Service Bus queue. A consumer function picks the message up and calls Dynamics 365. The queue only stores the message — the consumer does the work. Logic Apps, data management packages or OData are equally valid for other requirements.

  3. Storefront JSON

    F&O custom service contract (Codefine-built, fictional names)

    externalOrderId ExternalOrderRefIdempotency key customerAccount CustomerAccountMust exist in the legal entity items[].itemId ItemNumberMust be a released product items[].quantity SalesQuantityDecimal > 0 currency CurrencyCodeISO 4217 (configuration) CompanyLegal entity context
    • Required fields present
    • Data types and decimals valid
    • Customer CUST-DEMO exists in the legal entity
    • Item CHAIR-001 released
    • External order not seen before
    • Company context: DEMO (demo)

    Scene 4 of 8

    Data mapping and transformation

    Storefront fields are mapped to the data contract of a custom X++ service. Required fields, data types, customer and item references, duplicates and the legal entity are checked before anything reaches the ERP.

  4. From External Request to Validated ERP Transaction.

    1. Request received by custom service
    2. Business validation
    3. Sales order created
    4. Line added
    5. Status confirmed

    Microsoft Dynamics 365 Sales order · illustrative view

    Sales order
    SO-DEMO-1045
    Customer account
    CUST-DEMO
    External reference
    WEB-10045
    Status
    Open order
    Item numberProduct nameQuantityCurrency
    CHAIR-001Office Chair2EUR

    Later stages — reservation, picking, shipping, invoicing, posting — follow normal F&O processes.

    Scene 5 of 8

    Dynamics 365 processes the order

    The custom service runs standard F&O business logic: the customer and item are validated and a sales order with its line is created. Reservation, picking, invoicing and posting are later business steps — not automatic results of the API call.

    1. Gateway

      Azure API Management

      Authentication, throttling, one public contract

    2. Intake

      Azure Function

      Validate, map, assign correlation ID

    3. Buffer

      Azure Service Bus

      Durable queue; redelivery and dead-letter

    4. Consumer

      Azure Function

      Reads the message and calls F&O

    5. ERP

      Microsoft Dynamics 365

      Custom X++ service → business logic

    Timeout Consumer → F&O custom service

    Correlation ID
    corr-7f3a-10045
    Attempt
    1 of 5
    Error
    No response within 30 s — outcome unknown
    Message
    Retry Pending kept in queue, redelivery after back-off
    • Alert Monitoring flags the failure with the correlation ID.
    • Idempotency first Before retrying, check whether WEB-10045 already reached F&O.
    • Dead-letter After the retry limit, or for non-transient errors such as invalid data, the message moves to the dead-letter queue for investigation.
    • Not everything retries A missing customer is fixed at the source; resending it would fail again.

    Scene 6 of 8

    Something goes wrong

    The call to F&O times out. A timeout does not say whether the order was created, so the message is not lost and not blindly resent: it stays in the queue, an alert is raised and a retry is scheduled with back-off. Messages that keep failing, or fail validation, go to the dead-letter queue for investigation.

    1. Retry after back-off Attempt 2 of 5
    2. Duplicate check Look up ExternalOrderRef WEB-10045
    3. Already created SO-DEMO-1045 found — no second order
    4. Reference recorded WEB-10045 ↔ SO-DEMO-1045
    5. Completed Message removed from the queue

    Later · outbound status notification

    1. Business event “Order status changed” — carries keys (SO-DEMO-1045), not the whole order
    2. Event handler Reads the current status from F&O (OData)
    3. Storefront updated Customer sees: “Your order is being prepared”

    Connected Systems. Reliable Business Processes.

    Scene 7 of 8

    Recovery and synchronisation

    On retry the consumer first looks up the external reference. SO-DEMO-1045 already exists — the first call committed — so no duplicate is created; the reference is recorded and the message completed. Later, a business event announces a status change and a handler reads the current status back to the storefront.

  5. Integration health · what we monitor

    • Completed Orders created in F&O
    • Recovered Transient failures handled by retry
    • Dead-letter Messages waiting for investigation
    • Events Status updates returned to the storefront
    • D365 F&O integration architecture
    • OData and data entities
    • Custom X++ services
    • Azure Integration Services
    • Business events
    • API development
    • Error handling and monitoring
    • Data transformation
    • Integration performance
    • Support and maintenance

    Your Systems. Connected by Codefine.

    Codefine designs secure, maintainable and scalable integrations that connect Dynamics 365 Finance & Operations with the applications your business depends on.

    Scene 8 of 8

    Codefine integration expertise

    Reliable integrations are designed, not just connected: contracts, idempotency, retries, monitoring and ownership agreed up front.

Experience an Integration in Action

Illustrative Integration Simulation — No Live Systems Connected

  1. 01 Storefront Updated
  2. 02 API gateway Done
  3. 03 Service Bus queue Done
  4. 04 Integration consumer Done
  5. 05 Dynamics 365 F&O Done

Completed

Sales order SO-DEMO-1045 created and verified.

  1. Received
  2. Validated
  3. Queued
  4. Processing
  5. Completed
Developer view · payload, response and status history

Request payload

{
  "externalOrderId": "WEB-10045",
  "customerAccount": "CUST-DEMO",
  "currency": "EUR",
  "items": [
    {
      "itemId": "CHAIR-001",
      "quantity": 2
    }
  ]
}
Correlation ID
corr-7f3a-10045
Last HTTP / API result
200 OK
Processing attempt
1
ERP reference
SO-DEMO-1045

Validation

  • ✓ JSON schema
  • ✓ Required field customerAccount
  • ✓ Item CHAIR-001 exists
  • ✓ Duplicate external order

Status history

t + msStatusAttemptDetail
0Received0POST /orders → 202 Accepted
40Validated0202 Accepted
65Queued0202 Accepted
900Processing1POST CFWebOrderService.createSalesOrder
2300Completed1200 OK

The challenge

Integrations fail at the edges nobody designed

Most ERP integrations work on day one. The trouble comes later — when volumes grow, an external API changes, a message arrives twice, a master record is missing or an endpoint is unavailable for an hour. Without retries, idempotency and monitoring, those cases turn into manual corrections and lost trust in the data.

Codefine designs each interface from its requirements — direction, frequency, volume, latency, ownership and failure behaviour — and picks the D365 F&O and Azure capabilities that fit, rather than forcing every flow through one tool.

Capabilities

What we cover in Integration & API Development

  • 01

    OData & data entities

    Standard and custom entities exposed through OData for transactional reads and writes at moderate volumes.

  • 02

    Custom services

    JSON services in X++ for operations that need business logic, validation or multiple tables in one transaction.

  • 03

    Business events

    Outbound events to Service Bus, Event Grid or Power Automate so other systems react without polling the ERP.

  • 04

    High-volume data jobs

    Recurring integrations and the data management package API for bulk imports and exports with staging and validation.

  • 05

    Azure middleware

    Logic Apps and Functions for orchestration and transformation, Service Bus for decoupling and API Management for exposure and security.

  • 06

    Dual-write & Dataverse

    Near-real-time synchronisation with Dataverse and customer engagement apps where shared master data justifies it.

How the engagement works

A clear sequence, agreed up front

  1. Inventory & design

    List every interface, its data, volume and timing, then choose a pattern and define failure behaviour.

  2. Build

    Develop D365 F&O endpoints and middleware components with test harnesses for each message type.

  3. Test under load

    Test with realistic volumes, malformed messages and unavailable endpoints — not only the happy path.

  4. Operate

    Hand over monitoring dashboards, runbooks and alert routing, or operate the integrations for you.

Technical approach

Our approach to Integration & API Development

Choose the pattern per flow

NeedTypical pattern
Look up or create a record from another appOData on a data entity
Call business logic with validationCustom X++ service
Tell other systems something happenedBusiness event
Import or export thousands of recordsRecurring integration / data package API
Keep shared master data aligned with DataverseDual-write

The table is a starting point, not a rule. Volume, latency and who owns the data decide the final choice.

Design for failure

Every interface has an answer to four questions: what happens when the target is down, when a message arrives twice, when referenced data is missing, and who is told. Queues with dead-letter handling, retries with back-off, message identifiers and reconciliation reports are how those answers become code.

Keep the ERP responsive

Synchronous calls from posting logic to external systems make user transactions as slow as the slowest API. Where possible, D365 F&O publishes a business event or writes to a queue and lets the integration layer do the waiting.

Benefits

What changes for your organisation

  • Data you can trust

    Idempotent processing and reconciliation stop duplicates and silent gaps.

  • Less manual correction

    Failures retry automatically or surface with enough context to fix quickly.

  • Room for volume

    Patterns are chosen for the throughput you expect, including peaks.

  • Systems that change independently

    Decoupled integrations let you replace or upgrade one system without breaking the rest.

FAQ

Questions about Integration & API Development

Which integration options does D365 F&O offer?

The main options are OData endpoints on data entities, custom X++ services, business events, recurring integrations and the data management package API, dual-write with Dataverse and virtual tables. Each fits different volumes, latencies and directions.

Do we need middleware such as Azure Logic Apps?

Not always. Simple point-to-point flows can call D365 F&O directly. Middleware becomes valuable when you need transformation, orchestration across systems, decoupling with queues, central monitoring or secure exposure of APIs to partners.

How do you prevent duplicate or lost messages?

By designing idempotent processing with message identifiers, using queues with dead-letter handling, retrying transient failures and reconciling counts or totals between systems on a schedule.

Can you take over existing integrations?

Yes. We document what exists, find the fragile points and stabilise or redesign the flows that cause most incidents.

Related services

Discuss Integration & API Development with Codefine

Describe the situation in a few lines — what you run, what is not working and what has to happen next. We reply with concrete questions and a suggested first step.