Vendure plugin to fulfill orders via QLS. This uses QLS as fulfillment center and does not support shipments only via QLS.
This plugin contains:
This plugin requires the default order process to be configured with checkFulfillmentStates: false, so that orders can be transitioned to Shipped and Delivered without the need of fulfillment. Fulfillment is the responsibility of Picqer, so we won't handle that in Vendure when using this plugin.
You should set up webhooks for the following events:
fulfillment_order.cancelledfulfillment_product.stockfulfillment_order.statusfulfillment_order.completedThe URL for all these events should be https://<YOUR_VENDURE_HOST>/qls/webhook/<CHANNEL_TOKEN>?secret=<PLUGIN_SECRET>. E.g. https://example.com/qls/webhook/your-channel-token?secret=121231.
<YOUR_VENDURE_HOST> is the URL of your Vendure instance.<CHANNEL_TOKEN> is the token of the channel you want to use.<PLUGIN_SECRET> is the webhook secret you've passed into the plugin's init() function.This plugin only uses Vendure's default stock location, that means you should either:
Vendure assumes the first created stock location is the default stock location.
You can use the query qlsServicePoints(postalCode: String!): [QlsServicePoint!]! to get the service points for a given postal code. You can use the setOrderCustomFields mutation to set the service point on an order.
Whenever an order fails to be pushed to QLS, an event is emitted. You can listen to this event to monitor failed orders.
Because a job can be retried, this event can be emitted multiple times for the same order. You can use the date field together with the order code to determine if you have already processed this event.
For product syncs, the same approach can be used, but with the QlsProductSyncFailedEvent instead.
This plugin adds a button push to QLS to the order detail page in the Admin UI. This will push the order to QLS again. If the order has been pushed before, you need to uncheck the checkbox synced to QLS in the order custom fields first.
Pushing an order to QLS again will not cancel the existing order in QLS. Cancel existing orders first via https://mijn.pakketdienstqls.nl/.
orderSync and productSync objects. This is a breaking change: all plugin options must now be organized under orderSync (for order-related hooks) and productSync (for product-related hooks).getAdditionalOrderFields to pushAdditionalOrderFields in orderSync options.pullAdditionalOrderFields hook in orderSync options, called after an order is successfully created in QLS. Errors in this hook are caught and logged, and will not fail the order push job.variant parameter to the saveAdditionalData hooksaveRawWarehouseStockData boolean with saveAdditionalData hook, allowing you to handle and persist any QLS product data yourselfsaveRawWarehouseStockData optionQlsVariantSyncFailedEvent instead of the error object.addAdditionalOrderItems() that will be added to the QLS order.qlsProductIdUiTab to be null to show QLS Product ID on the default Admin UI tab.sent → Delivered, partically_sent → PartiallyDelivered.syncedToQls custom field inside same transaction, to prevent Query runner already released. Cannot run queries anymore errors.syncedToQls to prevent race conditions.