Skip to main content
Related API: This extension modifies the Create Order operation.
This action occurs after an order is created from the cart. Changes made to the order or order items in this action persist in Kibo.
Action TypeEmbedded
Full Action IDembedded.commerce.orders.createFromCart.after
Runs multiple custom functions?No

JavaScript File Structure

Action files share the following basic structure:
When you code the custom function for an action, you have access to two arguments: callback—This argument follows the established JavaScript callback pattern: it takes an error as the first argument (or null if there is no error) and a result as the second argument (if required). For how callback interacts with async functions, see Signaling Function Completion. context—This argument provides the function access to relevant objects and methods that interface with Kibo.

Context: Order

The methods and objects documented here are available to this action through the use of the context argument. Microservice Operation
This action corresponds to the microservice that creates orders from the cart.

Get

get.order

Obtains a response that includes information about the current order. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

Exec

exec.setItemAllocation

Sets soft allocation information on an order item. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

exec.setAttribute

Sets an attribute from the order. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

exec.removeAttribute

Removes an attribute from the order. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

exec.setData

Sets custom key/value data on the current order. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

exec.removeData

Removes custom key/value data from the current order. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

exec.setItemData

Sets custom key/value data on an order item. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

exec.removeItemData

Removes custom key/value data from an order item. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

exec.setDutyAmount

Sets the duty amount applied to an order. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

exec.setShipmentCreationOffset

Sets the shipment creation offset on the order: the number of minutes after the order is submitted before its shipments are created. This overrides the site’s shipment release setting for this order only, the same way the top-level shipmentCreationOffset field does on the Create Order and Update Order APIs. For details on how the delay works, see Configure Shipment Creation. The method throws an error if the value is not an integer. The allowed range (-1 or 1 to 7200) is validated when the order is saved, not when the method is called. Set the offset before the order is submitted; changing it after shipments have been created has no effect on those shipments. Example:
Response: Returns the updated order object, in the same shape as the exec.setDutyAmount response.

exec.setHandlingAmount

Sets the handling amount applied to an order. This method is only available for the embedded.commerce.orders.price.before action. In addition, do not use both the setHandlingAmount and the setItemHandlingAmount methods within the same function, as this forces ambiguous adjustments on the handling amount. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

exec.setItemHandlingAmount

Sets the handling amount applied to an order item. This method is only available for the embedded.commerce.orders.price.before action. In addition, do not use both the setHandlingAmount and the setItemHandlingAmount methods within the same function, as this forces ambiguous adjustments on the handling amount. Example:
Response:
For information about the properties in the response, refer to the REST API Help.

Context Objects Available to All Actions

apiContext

Accesses tenant information. Example:

configuration

Receives a JSON response that contains information about the configuration data set in the Action Management JSON editor. Example: