Understand punchout

The Commerce punchout features let you integrate an account-based store with a procurement system.

This integration allows a shopper who is logged into a procurement system to access your storefront, view items from the assigned catalog, add items to the cart, and return to the procurement system.

Once the procurement system approves the purchase, it sends Commerce a purchase order, which is used to create the Commerce order.

Commerce punchout functionality is provided through server-side extensions. Commerce identifies incoming punchout orders that come through the server side extension (as cXML-based orders) by setting the originOfOrder property to punchout for incomplete orders and purchaseOrder once the order has been approved by the procurement system.

The following are some key terms that you need to be familiar with before you implement a punchout integration:

  • The procurement system is an external system where the buyer starts the shopping process, and where the buyer’s proposed purchases are approved.
  • The supplier/seller is the Commerce merchant.
  • A purchase order is a message sent from the procurement system to Commerce. The purchase order includes details about the cart the punchout shopper created. Commerce requires the purchase order so it can create an order.
  • After a shopper has submitted cart data to the procurement system, they may need to alter the order. This is known as re-punchout. The only difference between the punchout and re-punchout process is that after the process has returned the security token, re-punchout creates or updates incomplete orders and returns the order information in JSON format. The procurement system passes the cart information in cXML format for re-punchout; no cart information is passed during punchout.

During re-punchout, if the cart contains an invalid product or SKU, Commerce automatically removes it. If the cart contains a product or SKU that is out of stock, it remains in the cart and storefront displays a message that notifies the shopper of its inventory status.

Punchout functionality can be implemented only for a Commerce store that is configured for account-based commerce. (See Configure Business Accounts for more information.)

Punchout is implemented using cXML (commerce eXtensible Markup Language) 1.2, which is an open-standard XML-based data-exchange format. Before configuring punchout, you should be familiar with cXML. For information about cXML 1.2, see http://cxml.org/.

Understand Commerce punchout limitations

Commerce does not support level 2 punchout, which implements CIF (Content Interchange Format) catalogs to allow shoppers to view your Commerce catalog on the procurement system’s site before punching out to your Commerce site to see real-time data, like prices, and add items to the cart.

Commerce does not support punchout marketplaces or networks, where buyers can connect to a number of different suppliers. Commerce supports only direct punchout.

Punchout can be used with most Commerce features that can be configured for account-based stores. However, punchout cannot be used with scheduled orders or quoting.

Configure CORS support

To access Commerce endpoints from the procurement system, you must configure CORS (cross-origin resource sharing) support in Commerce by explicitly specifying the procurement system’s domain as one that is permitted to make requests to the punchout site. You specify the domains and methods permitted to access the Commerce punchout site by using the PUT /ccadmin/v1/sites/{siteID} endpoint to set the value of the allowedOriginMethods property on the corresponding site object. See CORS support for more information.

Additionally, the punchoutSetupResponse Commerce sends to the procurement system (in response to the punchoutSetupRequest request) must include Access-Control-Expose-Headers to allow the procurement system to access to the oAuthtoken, BuyerCookie, BrowserFormPost and OrderId in the response headers.

The punchoutSetUpResponse contains the Commerce storefront URL, which the procurement system should redirect the shopper to. Other information (such as oAuthToken and BuyerCookie) is part of the HTTP response headers.