This feature in Carts API enables the cart to be transformed into a schema ready for submission to the Order Management System (OMS), representing the order draft stage before the order is officially created.

At this stage, the cart contains all necessary data, including items, fulfillment details, fees, taxes, and payment information. This transformation ensures that the cart aligns with OMS requirements, allowing for final review and confirmation of the order before proceeding to fulfillment.

Prerequisites

There are two types prerequisites, depending on your cart configurations.

One of the following prerequisites must be completed sequentially to configure an order draft.

Order Drafts Initialization

The order draft captures a snapshot of the cart, which can then be converted into an order. The ability to create an order draft is controlled by cart configurations. Cart offers users the flexibility to prevent order draft creation if:

  • Payments haven’t been added to the cart.
  • Taxes are missing for resources in the cart.
  • Items are invalid.
  • Items are out of stock.

The following code sample provides the structure of order draft settings that block creation in the response:

Cart configuration

Examples

Creating an order draft to send to an Order Management System (OMS)

Use the create an order draft endpoint to create an order draft and send it to OMS as in the following example: