Compartir a través de


Export posted sales invoices to Shopify

Enabled for Public preview General availability
Users, automatically - Oct 1, 2024

Business value

Buyers can sign in to Shopify and access all their invoices, whether Business Central or Shopify created the invoices.

Feature details

When you use a new report (batch job), you can export posted sales invoices to Shopify as orders. You can find the report on the Shopify Shop Card page, or you can use Tell Me search to find it. You can also run the report by using the job queue.

To enable this feature for a specific shop, go to the Shopify Shop Card page and turn on the Posted Invoice Sync toggle.

The sync process includes invoices that meet the following conditions:

  • The Shopify Order ID field contains 0.
  • The bill-to customer has a mapping in the Shopify Customers or Shopify Companies tables.
  • The bill-to customer isn't the Default Customer on the Shopify Shop Card or Shopify Customer Template.
  • The posted invoice has at least one non-comment line where the No. field has a value.

When you run the report, Business Central and Shopify take the following actions.

Business Central

The report updates the Shopify Order ID field based on the sync results:

  • Successful export – the field updates with the ID of the order in Shopify.
  • Export failed – the field sets to -1.
  • Invoice excluded from sync – the field sets to -2 for invoices excluded from sync because of specific conditions.

This pattern applies to the Posted Sales Shipment. The Update Document page lets you replace -1, -2, or 0 values to retry the export.

Shopify

The connector uses GraphQL to create a draft order with a header and item lines. Then, it completes the draft order and converts it to an order.

Headers and lines

The connector exports the following fields on the order header:

  • It uses the mapped bill-to customer or company.
  • The Fulfilment Status field shows Fulfilled. Tracking Details don't synchronize.
  • The Paid Status field shows Paid or Partially Paid status, based on the customer ledger entry linked to the sales invoice. For partially paid status, it shows the Remaining Amount field.

The app exports the following fields on the order lines:

  • Items and item variants that you map export as products.
  • Items that you don't map and lines of other types, such as G/L Account or Item Charge lines, export as custom products in Shopify.
  • You don't create shipping charges in Shopify. The app registers the shipping cost as a custom product in Shopify.
  • The new setting on the Shopify Shop Card page lets you avoid exporting invoices with unmapped items. Turn on the Items must be mapped to Products toggle to exclude posted invoices from sync if there's at least one line of type Item where the selected item isn't mapped to a product or variant in Shopify.
  • Tax amounts. Because the Graph API doesn't currently support the TaxLine object, the calculated tax amount is added as a custom product. Tax information from Business Central isn't available in the tax report in Shopify Admin. To prevent Shopify from recalculating taxes, mark orders as Tax Exempt.
  • Quantity, in whole numbers. Shopify doesn't support fractions.

Impact on the process of synchronizing orders

Synchronization imports the order and checks whether the order was exported earlier. If the order was exported earlier:

  • It marks the order as processed.
  • It adds a link to the posted sales invoice (related documents, which happens automatically because the system already populates the Shopify Order ID). Shopify might automatically archive fully paid and fulfilled orders, and the synchronization doesn't process them.

Handle updates

In Shopify, because the order is already fulfilled, the only meaningful changes are notes, payment status, and payment transactions. If you process payments in Shopify, you also process refunds and returns.

In Business Central, you don't track changes. Currently, to mark the order as paid, use the Mark as Paid action on the Shopify Order Card page.

Tell us what you think

Help us improve Dynamics 365 Business Central by discussing ideas, providing suggestions, and giving feedback. Use the forum at https://aka.ms/bcideas.

Additional resources

Export posted sales invoices to Shopify (docs)