Do you have a Vendure shop and want to connect it to the procurement systems of your key accounts via PunchOut? This guide will take you through the entire setup process - from the plugin installation in Vendure to the final configuration in the PunchCommerce dashboard. At the end, you can test the connection with the integrated PunchOut simulator without having to wait for your customer's IT. If you do not yet know what PunchOut is or how the Gateway Mode works: First read our [Vendure integration announcement](https://www.punchcommerce.de/de/journal/2026/neue-technologie-partnerschaft-punchout-anbindung-fur-vendure-shops) - there we explain the process at a glance.
Before you start, you need three things:
Install the official community plugin via the package manager of your choice:
npm install @vendure-community/punchout-gateway-plugin
Add the plugin to your vendure-config.ts:
import { PunchOutGatewayPlugin } from '@vendure-community/punchout-gateway-plugin';
export const config: VendureConfig = {
plugins: [
PunchOutGatewayPlugin.init({
// default values work immediately -
// optional customisations see below
}),
],
};
The plugin has everything the integration needs: a separate authentication strategy for PunchOut sessions, an active shopping basket assignment per session and a GraphQL mutation for the shopping basket transfer.
In most cases, the default values are sufficient. You can customise three options if required:
| Option | Default | When to customise? |
|---|---|---|
apiUrl |
https://www.punchcommerce.de |
Only for self-hosted or staging instances |
shippingCostMode |
'nonZero' |
If shipping costs should always ('all') or never ('none') be transferred |
productFieldMapping |
All products as pieces (PCE) |
If your catalogue contains products with different units (kg, litres, etc.) |
An example of product field mapping: Suppose you sell both individual parts and bulk goods. Then you can read the unit of measure per product from a Vendure custom field:
PunchOutGatewayPlugin.init({
productFieldMapping: {
unit: { customField: 'punchOutUnit', default: 'PCE' },
unit_name: { customField: 'punchOutUnitName', default: 'Piece' },
weight: { customField: 'productWeight', default: 0 },
},
})
If the custom field for a product is empty, the configured fallback value takes effect - a principle that you are also familiar with from field mapping in PunchCommerce.
The plugin adds a new field to the Vendure customer object: "PunchOut Customer ID (uID) ". Open the customer in the Vendure admin and enter the same identifier that you later assign as "Customer Identification" in the PunchCommerce dashboard.
The system uses this field to recognise which Vendure customer belongs to which PunchOut session.
Since Vendure works headless, your frontend needs three customisations. We describe the concept here - the complete code examples with GraphQL mutations can be found in the official plugin documentation.
It's even quicker with the finished demo storefront from the Vendure team: vendurehq/punchcommerce-storefront-demo. It contains all three customisations as a working reference implementation.
Create a route (e.g. /punchout) to which PunchCommerce will redirect the shopper. This page must do three things:
sID (session ID) and uID (customer identifier) from the URL.sID for the duration of the session - preferably in sessionStorage so that parallel browser tabs retain their own sessions.authenticate mutation with the PunchOut strategy and, if successful, redirect to the shop home page.All shopping basket operations - add item, change quantity, remove, display shopping basket - must include the parameter activeOrderInput with the current sID. This ensures that the shopping basket remains assigned to the correct PunchOut session.
This applies to the mutations addItemToOrder, adjustOrderLine, removeOrderLine and the query activeOrder. Without this parameter, items end up in the regular shopping basket instead of in the PunchOut session.
Replace the normal checkout flow with a "Transfer shopping basket" button. This calls the mutation transferPunchOutCart and transfers the sID. After a successful transfer, the order changes to "Transferred" status in Vendure - the shopping basket is archived and a new session starts with an empty shopping basket.
If the procurement system embeds your shop in an iFrame (instead of opening it in a new window), you must also set the session cookies to SameSite=None; Secure and remove the X-Frame-Options header during PunchOut sessions. Details can be found in the plugin documentation.
Create a new customer in the PunchCommerce dashboard. Assign a unique "Customer Identification " - this is the uID, which must also be stored in the Vendure Admin for the customer object.
Enter the URL of your PunchOut landing page, e.g. https://ihr-shop.de/punchout. PunchCommerce forwards the shopper to this address and automatically appends the parameters sID and uID.
Select the protocol that your customer expects:
You then assign the shop attributes (EAN, SKU, short description, price) to the PunchOut fields in the field mapping. This works via drag & drop. If a mandatory field in the shop is empty, a configurable fallback value takes effect - this ensures data quality without you having to adapt your source system.
Before you approach your customer: Use the integrated PunchOut simulator in PunchCommerce. It simulates a complete session - from forwarding via the shopping basket to the transfer back to the procurement system. You can see immediately whether the mapping, prices and product data arrive correctly.
Experience has shown that this saves at least one round of coordination with your customer's IT department.
| Task | Where | Effort |
|---|---|---|
| Install and configure plugin | Vendure | ~10 minutes |
| Customise storefront (3 places) | Your frontend code | Depending on project |
| Customer mapping (uID) | Vendure-Admin + PunchCommerce | ~5 minutes |
| Protocol and field mapping | PunchCommerce dashboard | ~15 minutes |
| Testing with simulator | PunchCommerce dashboard | ~5 minutes |
The configuration on the PunchCommerce site takes less than 30 minutes. The biggest variable factor is the storefront customisation - here the Demo-Storefront speeds up the start considerably.
Would you like to discuss the integration with your specific setup - or get started straight away? We will show you in a brief discussion what the setup looks like in practice.
If you have any questions or suggestions, just send us an email hallo@punchcommerce.de or call us at +49 6142 / 953 80 - 60. We appreciate your feedback!
Back to the journal