This concept is valid for ICM version 7.10.31 and higher.
cXML Order Injection is a B2B feature that describes the receiving and processing of a cXML order request, generally sent from a procurement system. After receiving a cXML file, it is parsed, a basket is created with certain values from the cXML file, and an order is created.
cXML is a standard for Punchout similar to OCI. Besides the Punchout to an external B2B store, it also supports order injection with basket data.
This feature is very flexible and will most likely be implemented differently in every project. Therefore, one of the main goals for this implementation was the exchangeability and extensibility of the provided functionality. To achieve this, the handler chain framework has been chosen. This allows projects to easily extend, replace, or remove standard functionality.
Before the handler chain is executed, the cXML content is received through the REST API endpoint for order injection. The API passes the request data directly to the handler chain. All incoming requests are processed using the single configured handler chain, CXMLOrderInjectionChainV2. The handler chain then manages all further processing, such as unmarshalling the cXML, validating the user, creating and preparing the basket, applying any required mappings, and finally creating the order. After processing, the API returns a response containing either a success message or information about any issues that occurred, based on the cXML Standard.
There are two main chains implemented in the standard implementation and several handlers. Some of the handlers are version-independent, and some work with version-specific classes. This can be differentiated by the package name. Version‑independent handlers can easily be reused when adjusting the chain for a new cXML version.
The first chain is PreCXMLOrderInjectionChainV2. It handles all kinds of preparation to place the order later. Available handlers are:
Name of Handler | Description | Version-independent |
|---|---|---|
ParseCXMLOrderInjectionHandler | Handler that parses the input stream to an object | no |
CheckBasketCXMLOrderInjectionHandler | Handler that checks if the basket provided via cXML is valid | no |
CheckUserCXMLOrderInjectionHandler | Handler that checks if the user data sent in the cXML Header are valid | no |
MapBasketCXMLOrderInjectionHandler | Handler that maps the cXML OrderRequest to a basket | yes |
MapLineItemsCXMLOrderInjectionHandler | Handler that adds items from a cXML order request to a basket | no |
MapShippingMethodCXMLOrderInjectionHandler | Handler that adds a shipping method to the basket from cXML | no |
MapOrderAddressesCXMLOrderInjectionHandler | Handler that adds an invoice address and shipping address for the whole order if specified in the cXML | no |
MapPaymentCXMLOrderInjectionHandler | Handler that sets the configured payment method at the basket | yes |
PrepareBasketForOrderCreationCXMLOrderInjectionHandler | Handler that prepares a basket for the order creation by validating and calculating | yes |
The second chain CreateOrderCXMLOrderInjectionChainV2 creates the actual order and has only one handler:
Name of Handler | Description | Version-independent |
|---|---|---|
CreateOrderCXMLOrderInjectionHandler | Handler that creates an order from a basket, which was created from a cXML order request | yes |
In a development environment, the actual loaded handlers can be checked via a pipeline call to InspectHandlerChains-Start, like https://<yourServer>/INTERSHOP/web/WFS/inSPIRED-inTRONICS_Business-Site/en_US/-/USD/InspectHandlerChains-Start.
If there is a failure in any of the handlers, the chain will be rolled back. In standard implementation, that means the reverseInvoke() from MapBasketCXMLOrderInjectionHandler will be called, which moves the basket into the basket history.
The cXML order injection feature released with 7.10.31 is based and tested on cXML Version 1.2.049. In ICM, the implemented cXML feature is referred to as V2.
Other minor cXML versions will most likely work with V2 as well, but that has not been tested.
If support for additional cXML variations is required, the adjustments should be implemented within the existing handler chain. Version‑independent handlers can continue to be reused for this purpose. Please refer to Cookbook - cXML Order Injection | Recipe: How To Support Another Version of cXML.
https://punchoutcommerce.com/tools/cxml-order-tester offers a testing tool for your environment.
The REST API endpoint for order injection can be tested directly using standard tools such as Swagger UI or Postman. No additional framework-specific setup is necessary.
See Concept - cXML Punchout | cXML Punchout Configuration, which is also valid for cXML Order Injection.
The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Website, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.