Skip to main content

Import Fulfilled Shopify Orders

Overview

Fulfillment import allows you to import already-fulfilled orders from Shopify directly as Sales Invoices in Business Central. This is useful when orders are fulfilled in Shopify first, and you want to record them in Business Central as completed shipments.

Key differences from Order import:

  • Orders = Import unfulfilled orders as Sales Orders

  • Fulfillments = Import fulfilled orders as Sales Invoices

Prerequisites

Before importing fulfillments:

  1. Complete basic Shopify Setup (API Url, API Token, Logging Mode)

  2. Configure Customer settings (Guest Customer or New Customer registration)

  3. Set Default Shopify Location

  4. Optionally configure Item Template Code and Default Item No. for automatic item creation

Configuration

Task 1: Enable Fulfillment Import

  1. Choose the 🔎 icon, enter Shopify Setup, and then choose the related link.

  2. On the Sales Order fastTab:

    1. Set Import Orders = Fulfillments

    2. Optionally set Import Orders From DT = date/time to start importing from (e.g., 2025-01-01 00:00:00 to ignore older fulfillments)

    3. Set Default Shopify Location = location code to use for imported invoices

      image-20251021-173908.png

  3. Press OK to save settings.

Task 2: Test Fulfillment Import

  1. Press Import New Documents button.

  2. Press Yes to confirm.

  3. System will:

    • Query Shopify for fulfilled orders

    • Skip orders already imported (checks JML Shopify Document ID field)

    • Create Sales Invoice for each new fulfillment

    • Import line items with quantities, prices, and discounts

    • Create or link customers

    • Create items if they don't exist (uses Item Template)

    • Optionally post invoices immediately

  4. Check imported invoices:

    • Choose the 🔎 icon, enter Sales Invoices, and filter by JML Shopify = Yes

How Fulfillment Import Works

Fulfillment Detection

System imports fulfillments where:

  • Order has fulfillment_status = fulfilled or partial

  • Fulfillment has status = success

  • Fulfillment was created after Import Orders From DT date

  • Fulfillment ID does not exist in Business Central

Document Creation

For each fulfillment:

  1. Sales Invoice Header created with:

    • Order Date and Posting Date = Fulfillment created date

    • External Document No. = Shopify Order Name (e.g., "#1001")

    • JML Shopify Document ID = Shopify Fulfillment GID

    • JML Shopify = Yes (marks as Shopify document)

    • Shipping Agent Code = Tracking company from fulfillment

    • Package Tracking No. = Tracking number from fulfillment

  2. Sales Invoice Lines created with:

    • Only items that were included in this specific fulfillment

    • Quantities from fulfillment_line_item.quantity

    • Prices and discounts from original order line items

  3. Customer created or linked:

    • Searches by email address

    • Creates new customer if Register New Customers = Yes

    • Uses Guest Customer No. if Register New Customers = No

  4. Items created or linked:

    • Searches by SKU (Item No. or Item Variant)

    • Searches Item Reference table

    • Creates new item using Item Template Code if not found

    • Uses Default Item No. as fallback

Manual Posting

After fulfillments are imported as Sales Invoices, you need to manually post them in Business Central:

  • Open the Sales Invoice

  • Review the lines and verify all information

  • Press Post to create Posted Sales Invoice

  • Any posting errors will be displayed for correction

Common Issues

Problem: Duplicate invoices created

Solution: Check that JML Shopify Document ID field is correctly populated on Sales Invoices. System uses this field to prevent duplicates. If field is empty, duplicates may occur.

Problem: Items not found, using Default Item

Solution:

  • Ensure Shopify product variants have SKU defined

  • Configure Item Template Code in Shopify Setup

  • Import items from Shopify first using Sync Items = From Shopify

Problem: Customer not found, using Guest Customer

Solution:

  • Enable Register New Customers in Shopify Setup

  • Configure Customer Template with default posting groups

  • Ensure Shopify order has valid email address

Problem: Posting Sales Invoice fails with error

Solution:

  • Review Sales Invoice for missing mandatory fields

  • Ensure Location Code has Inventory Posting Setup

  • Ensure Item Template has correct posting groups

  • Check if customer has correct posting group setup

Problem: Tracking information not imported

Solution:

  • Verify that Shopify fulfillment has tracking information

  • Create Shipping Agent Code in Business Central matching Shopify tracking company name

  • System imports tracking company and tracking number to Sales Invoice Header

Monitoring Fulfillment Imports

View Import History

  1. Choose the 🔎 icon, enter Shopify Log Entries, and then choose the related link.

  2. Filter by:

    • Request Type contains "fulfillment"

    • Type = Error (to see only errors)

    • Created = last 7 days

  3. Open a log entry to view:

    • Full GraphQL request sent to Shopify

    • Full JSON response received

    • Error details if any

Automatic Import Schedule

To set up automatic fulfillment import:

  1. Follow instructions in "Automatic data export - import" section

  2. Configure Orders Job Queue Entry

  3. Set schedule (e.g., every 15 minutes)

  4. System will automatically import new fulfillments based on schedule

Field Mapping

See "Fulfillments import – fields mapping" section for complete mapping of Shopify fulfillment fields to Business Central Sales Invoice fields.