Post-Purchase Upsell & Cross-Sell

ERP export reference for your ERP partner

Pass this page to your ERP partner. With the setting Wait until the order is ready before the ERP can import it turned on, the ERP's order queries return an order only when an offer can no longer change it. This page lists the requirements for the ERP, the credentials the wait applies to, the covered API queries and what happens when an order query fails. To learn when an order becomes ready and how long it waits, see How ERP export works. To learn where you turn on the setting and select the ERP's credentials, see Set up ERP export.

Requirements for the ERP

The setting Wait until the order is ready before the ERP can import it requires an ERP that:

  • queries all orders that it still needs to import, on every run
  • imports an order on the next run like any other order, even if it was missing from an earlier run
  • does not interpret a missing order as deleted or cancelled
  • uses credentials that only the ERP uses, either an integration or a separate user account in Shopware

An import that requests only orders newer than the last imported order, or only orders changed since its last run, can permanently miss waiting orders and is not compatible. When an order becomes ready, the extension does not change the order, not even its updatedAt field.

While an order is waiting, it does not appear in the query results. If an order is missing, the results alone do not tell you why.

Credentials

The wait applies only to the integration, the user account or both, whichever is selected for the order's sales channel. Any application that uses the same credentials receives the same filtered order view and waits too. Do not share the ERP's integration or user account with another system or a person.

Covered API queries

The wait applies to direct reads of the Admin API order entity:

  • list, detail, search and search IDs
  • aggregations
  • association routes whose final queried entity is order, such as GET /api/sales-channel/SALES_CHANNEL_ID/orders, where SALES_CHANNEL_ID is the ID of a sales channel

For the selected credentials, a waiting order is missing from every covered query. A search leaves it out of the results and the total count. A detail request for its ID returns 404 Not Found, the same response as for an order that does not exist.

The extension does not filter writes, not even for a waiting order.

In particular, the wait does not cover:

  • orders returned only as embedded data under another root entity, such as a customer together with their orders
  • the Store API, Flow Builder messages or webhook messages
  • exports through the Administration's Import/Export module, for example with the profile "Default orders"
  • custom endpoints, direct SQL queries or an export using different credentials

Verify the endpoint and the credentials that the ERP actually uses.

Failed order queries

The extension filters out waiting orders in the same database query that reads the orders. If that query fails because of a database, schema or query error, the API request also fails with 500 Internal Server Error. The extension does not repeat the request without this filter, and it does not fall back to a response that includes waiting orders.

The extension adds this filter to every covered order query, including queries with other credentials and queries made while the setting is off, where it excludes no order. Switching to other credentials or turning off the setting therefore does not get around the error. If the extension's cwk_ppu_export_gate table has a schema error, order queries in the Administration order module fail too.

Fix the cause and then let the ERP carry out its next normal run.