Order xC extension points
You can customize how Commerce+ handles cart and order capture operations and integrations with an external order management system.
- Suppose that a condition occurs that prevents shoppers from purchasing more than 10 copies of a book. To resolve this issue with the cart, you can configure an extension point to run code that validates the quantity in the cart before the cart is updated.
- Consider an order that is submitted by a shopper who does not live in the Geographical Area (GEO) served by the store. You can configure an extension point that only submits orders if they come from within a valid GEO.
The following table identifies the classes for order-related commands that you can
customize through an externalized customization extension.
| Sample CSV input files | ||||
|---|---|---|---|---|
| order-item-add-pre | The add order item operation (POST cart) calls the order_item_add_pre extension point to perform custom actions (for example, validate the command inputs) before adding the order items to the cart. | OrderPreUERequest, OrderPreUEResponse | The orderItemAddPre method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | order_item_add_pre |
| order-item-add-post | The add order item operation (POST cart) calls the order-item-add-post extension point to perform custom actions (for example, update the order item attributes) after adding the order items to the cart. | OrderPostUERequest, OrderPostUEResponse | The orderItemAddPost method in
workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java The validateQuantity method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java |
order_item_add_post |
| order-item-update-pre | The update order item operation (PUT cart/@self/update-order-item) calls the order-item-update-pre extension point to perform custom actions (for example, validate the command inputs) before updating the order items. | OrderPreUERequest, OrderPreUEResponse | The orderItemUpdatePre method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | order_item_update_pre |
| order-item-update-post | The update order item operation (PUT cart/@self/update-order-item) calls the order-item-update-post extension point to perform custom actions (for example, update the order item attributes) after updating the order items. | OrderPostUERequest, OrderPostUEResponse | The orderItemUpdatePost method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | order_item_update_post |
| order-item-delete-pre | The delete order item operation (PUT cart/@self/delete-order-item) calls the order-item-delete-pre extension point to perform custom actions (for example, validate the command inputs) before deleting the order items. | OrderPreUERequest, OrderPreUEResponse | The orderItemDeletePre method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | order_item_delete_pre |
| order-item-delete-post | The delete order item operation (PUT cart/@self/delete-order-item) calls the order-item-delete-post extension point to perform custom actions after deleting the order items. | OrderPostUERequest, OrderPostUEResponse | The orderItemDeletePost method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | order_item_delete_post |
| order-calculate-pre | The calculate cart operations (POST cart/calculate and POST cart/{cartId}/calculate) call the order-calculate-pre extension point to perform custom actions (for example, validate the command inputs) before calculating the cart's adjustments and charges. | OrderPreUERequest, OrderPreUEResponse | The OrderCalculatePre method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | order_calculate_pre |
| order-calculate-post | The calculate cart operations (POST cart/calculate and POST cart/{cartId}/calculate) call the order-calculate-post extension point to perform custom actions (for example, update the cart attributes) after calculating the cart's adjustments and charges. | OrderPreUERequest, OrderPreUEResponse | The OrderCalculatePost method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | order_calculate_post |
| order-prepare-pre | The prepare cart operation (POST cart/@self/precheckout) calls the
order-prepare-pre extension point to perform custom actions (for
example, validate the command inputs) before preparing the cart
for checkout. |
OrderPreUERequest, OrderPreUEResponse | The OrderPreparePre method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | order_prepare_pre |
| order-prepare-post | The prepare cart operation (POST cart/@self/precheckout) calls the
order-prepare-post extension point to perform custom actions
(for example, update the cart attributes) after preparing the
cart for checkout. |
OrderPostUERequest, OrderPostUEResponse | The OrderPreparePost method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | order_prepare_post |
| order-process-pre | The checkout cart operation (POST cart/@self/checkout) calls the order-process-pre extension point to perform custom actions (for example, validate the command inputs) before processing the order. | OrderPreUERequest, OrderPreUEResponse | The OrderProcessPre method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | order_process_pre |
| order-process-post | The checkout cart operation (POST cart/@self/checkout) calls the order-process-post extension point to perform custom actions (for example, update the order attributes) after processing the order. | OrderPostUERequest, OrderPostUEResponse | The OrderProcessPost method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | order_process_post |
| update-shipping-address-pre | The order item operations (POST cart, PUT cart/@self/update-order-item and PUT cart/@self/delete-order-item) call the update-shipping-address-pre extension point to perform custom actions (for example, validate the shipping addresses) before updating the shipping addresses of the order items. | UpdateShippingAddressCmdUEInput, UpdateShippingAddressCmdUEOutput | The updateShippingAddressCus method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | update_shipping_address_pre |
| update-shipping-address-post | The order item operations (POST cart, PUT cart/@self/update-order-item and PUT cart/@self/delete-order-item) call the update-shipping-address-post extension point to perform custom actions (for example, update the order item attributes) after updating the shipping addresses of the order items. | UpdateShippingAddressCmdUEInput, UpdateShippingAddressCmdUEOutput | The updateShippingAddressCus method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | update_shipping_address_post |
| order-notify-pre | The checkout cart operation (POST cart/@self/checkout) calls the order-notify-pre extension point to perform custom actions before sending the order notification message. | OrderNotifyCmdUEInput, OrderNotifyCmdUEOutput | The orderNotifyCus method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | order_notify_pre |
| order-notify-post | The checkout cart operation (POST cart/@self/checkout) calls the order-notify-post extension point to perform custom actions after sending the order notification message. | OrderNotifyCmdUEInput, OrderNotifyCmdUEOutput | The orderNotifyCus method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | order_notify_post |
| compensate-transaction | Digital Commerce calls the compensate-transaction extension point to perform custom actions when a transaction is rolled back. | CompensateForTxRollbackCmdUEInput, CompensateForTxRollbackCmdUEOutput | The compensateForTxTransanction method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java | compensate_transaction |
| promotion-code-add-remove-pre | The promotion code operations (POST cart/@self/assigned-promotion-code and DELETE cart/@self/assigned-promotion-code/{promotionCode}) call the promotion-code-add-remove-pre extension point to perform custom actions before adding or removing promotion codes to or from the cart. | OrderPreUERequest, OrderPreUEResponse | The promotionCodeAddRemovePre method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/OrderResource.java |
Sample input files for registering and assigning order xC extension points
| Extension point | Registering extension code with UEConfig.csv | Assigning extension code to extension points with CmdReg.csv |
|---|---|---|
| order-item-add-pre |
|
|
| order-item-add-post |
|
|
| order-item-update-pre |
|
|
| order-item-update-post |
|
|
| order-item-delete-pre |
|
|
| order-item-delete-post |
|
|
| order-calculate-pre |
|
|
| order-calculate-post |
|
|
| order-prepare-pre |
|
|
| order-prepare-post |
|
|
| order-process-pre |
|
|
| order-process-post |
|
|
| update-shipping-address-pre |
|
|
| update-shipping-address-post |
|
|
| order-notify-pre |
|
|
| order-notify-post |
|
|
| compensate-transaction |
|
|
| promotion-code-add-remove-pre |
|
|
| promotion-code-add-remove-post |
|
|