Sales Order Import

Prev Next

Feature Overview

Sales Order Import is the core capability of Commerce Manager. It allows external systems — e-commerce platforms, customer portals, field sales apps, consignment systems, and shop replenishment tools — to push sales orders and sales quotes directly into Business Central via a standardised API. Rather than having each channel use a different integration pattern, Commerce Manager provides a single, consistent entry point that normalises all inbound order traffic into Business Central's standard sales document structure.

When an order arrives from an external source, Commerce Manager routes it through a pre-processing step that classifies the incoming data, maps it to the correct table structures (header and item lines), and prepares an order buffer ready for Business Central to act on. Once the buffer is processed, a Sales Order or Sales Quote is created in Business Central. After the document is created, post-processing rules can trigger additional actions automatically — for example, releasing the sales order or retrieving payment information from the source system — without requiring any manual steps from a user.

Order Origins allow each inbound channel to be identified and configured individually. An Order Origin Code travels with every imported document, making it possible to track where each order came from, apply channel-specific behaviour (such as special freight handling), and trigger a payment retrieval webhook at the point of posting.

Key fact Detail
Supported document types Sales Order, Sales Quote
Setup page Order Origins (New Order Origin Codes)
Classification tables Sales Order Types, Sales Order Statuses
Post-processing actions Release Sales Order, Retrieve Sales Order Payment
Integration point Data Contract Manager Core (required dependency)
Monitoring Order Buffer Conversions (accessible from Customer Card)

Getting Started

  1. Activate Commerce Manager via the Assisted Setup wizard — search for Assisted Setup and run the Commerce Manager setup to register the app.
  2. Search for New Order Origin Codes and create at least one Order Origin Code representing your first external channel (e.g. WEBSHOP, FIELD, CONSIGNMENT).
  3. For each Order Origin Code, decide whether it requires Use Special Freight — enable this if the channel uses a freight handling approach that differs from standard sales orders.
  4. If payment information should be retrieved automatically when a sales order is posted, set the Retrieve Payment field on the Order Origin Code to the relevant webhook code configured in Data Contract Manager.
  5. Configure the API function in Data Contract Manager for commerceCreateSalesOrderBuffer (for orders) and/or commerceCreateSalesQuoteBuffer (for quotes). These are the functions the external system calls to push orders in.
  6. Test the integration by sending a sample order payload from your external system and verifying that a sales order or quote is created in Business Central.
  7. Open the Customer Card for a relevant customer and use the Order Buffer Conversions action to review the history of incoming orders and their conversion status.

Related Features

Sales Order Import works together with several other Commerce Manager features. Sales Order Types and Statuses can be assigned to incoming orders to classify and route them, and each type or status can carry a Trigger Action that fires a webhook when that classification is applied. Credit Limit Check monitors the customer's credit position on every imported sales order; orders that exceed the credit limit are flagged automatically so the order management team can review them before processing. Document Export can be used to push confirmation data back to the originating channel once the order has been processed in Business Central.


User Stories

US-01: Import a sales order from an external system

As a Sales Order Processor
I want to receive a sales order from an external channel (e-commerce, field sales, customer portal) directly into Business Central
So that the order is processed without manual re-entry and the customer receives their goods faster

Setup:

  1. Ensure the external system is configured to call the commerceCreateSalesOrderBuffer API function in Data Contract Manager.
  2. The payload must include a header record (table 36, document type ORDER) and one or more item lines (table 37, type Item).
  3. Commerce Manager's pre-processing step classifies the incoming data, sets the Order Buffer Action Message to Create new Document, and marks the header as ready to carry out.
  4. When Data Contract Manager processes the batch, a Sales Order is created in Business Central.
  5. Verify the result by opening Sales Orders and finding the newly created order.

Note: The external system must pass a valid Sell-to Customer No. that exists in Business Central. Orders with an unrecognised customer number will fail at the carry-out step.

US-02: Import a sales quote from an external system

As a Sales Order Processor
I want to receive a sales quote from an external channel into Business Central
So that the quote can be reviewed and converted to an order through the standard BC workflow

Setup:

  1. Configure the external system to call commerceCreateSalesQuoteBuffer instead of the order buffer function.
  2. The pre-processing step maps the data to document type QUOTE and marks it ready for carry-out.
  3. After processing, a Sales Quote is created in Business Central.
  4. Open Sales Quotes to find and review the imported quote.
  5. When the customer confirms, use the standard BC action to convert the quote to a sales order.
US-03: Update an existing sales order line from an external system

As a Sales Order Processor
I want to allow the external system to update quantity or other fields on an existing sales order line
So that changes made by the customer in their portal are reflected immediately in Business Central without manual intervention

Setup:

  1. Configure the external system to call commerceUpdateSalesOrderLineBuffer with the document number and line number of the existing order.
  2. Commerce Manager's pre-processing sets the Order Buffer Action Message to Update Document Fields on the line, leaving the header untouched (No Action).
  3. Data Contract Manager carries out the update and modifies the relevant fields on the existing sales order line.

Note: The same pattern applies to sales quotes using commerceUpdateSalesQuoteLineBuffer.

US-04: Automatically release a sales order after import

As a Sales Order Processor
I want to have imported sales orders released automatically after they are created
So that downstream warehouse and shipping processes can start without requiring a user to manually release each order

Setup:

  1. In Data Contract Manager, configure the API function 961_ReleaseSalesOrder as a post-processing step for the order import flow.
  2. After the sales order is created, Commerce Manager's post-processing subscribes to the ProcessAfterCarryOut event and calls Release Sales Document on the new order.
  3. If the release succeeds, the order status is set to Released automatically.
  4. The Data Import Record's Action Message is updated to Handling Success to confirm the post-processing completed.

Note: If the release fails (e.g. due to a blocked customer or missing mandatory fields), the order remains in Open status and the failure is logged in the Data Import Record.

US-05: Retrieve payment information when a sales order is posted

As a Sales Order Processor
I want to trigger a payment retrieval webhook automatically when a sales order is posted
So that payment status from the originating e-commerce platform is pulled into Business Central without any manual step

Setup:

  1. Open New Order Origin Codes and find the relevant Order Origin Code (e.g. WEBSHOP).
  2. Set the Retrieve Payment field to the webhook code that calls the payment retrieval endpoint in your integration platform.
  3. Commerce Manager subscribes to the OnAfterConfirmPost event on the sales posting codeunit. When a sales order is posted, the webhook is invoked automatically.
  4. The payment information is retrieved and stored according to your integration platform's response handling.

Note: This feature requires the Detailed App Feature Setup for Retrieve Sales Order Payment to be enabled. It fires on every posting of a sales order associated with an Order Origin Code that has a Retrieve Payment webhook configured.

US-06: Track order conversions per customer

As a Sales Manager
I want to review the history of order buffer conversions for a specific customer
So that I can see which orders were imported, whether they succeeded, and identify any that failed to convert

Setup:

  1. Open the Customer Card for the relevant customer.
  2. In the Commerce Manager action group, choose Order Buffer Conversions.
  3. The list shows all data import records associated with this customer, including their status and action messages.
  4. Filter or sort by status to identify failed conversions that need attention.
US-07: Configure a channel with special freight handling

As a Sales Order Processor
I want to mark a specific order origin as requiring special freight handling
So that orders from that channel are processed with the correct freight rules without requiring the external system to specify freight details

Setup:

  1. Open New Order Origin Codes.
  2. Find or create the relevant Order Origin Code (e.g. CONSIGNMENT).
  3. Enable the Use Special Freight toggle.
  4. Configure your freight handling logic in Data Contract Manager to check for this flag when processing orders with this origin code.
US-08: Support multiple channels with a single integration endpoint

As a IT Manager
I want to onboard multiple external sales channels (webshop, field app, B2B portal) using the same API endpoint with different Order Origin Codes
So that I only need to maintain one integration pattern regardless of how many channels we add

Setup:

  1. Create one Order Origin Code for each channel in New Order Origin Codes (e.g. WEBSHOP, FIELD, B2BPORTAL).
  2. Configure the external system for each channel to pass the relevant Order Origin Code in the import payload.
  3. Commerce Manager uses the Order Origin Code to apply channel-specific behaviour (special freight, payment retrieval) without requiring separate API functions per channel.
  4. In reporting and monitoring, filter by Order Origin Code to see volume and conversion results per channel.

Field Reference

Field Where to find it What it does Default
Order Origin Code New Order Origin Codes Unique code identifying the source channel of an imported order
Use Special Freight New Order Origin Codes Flags orders from this channel as requiring special freight handling Disabled
Retrieve Payment New Order Origin Codes Webhook code to call when a sales order from this channel is posted, to retrieve payment data Blank
Order Type Sales Order (header) Free-text classification field for the type of order (e.g. Preorder, Stock Order). Integrated with Master Data Information if installed Blank
Credit Limit Status Sales Order (header) Automatically populated credit limit check result: blank, Ok, Approved by user, or Blocked Blank