Skip to main content
Version: 8.8.x

Orders

An order is a list of intentions Cortex API undertakes to complete a purchase. For example, an order can list the following information:

  • Cart containing the items to purchase
  • Billing and shipping address to use for the purchase
  • Shipping options, such as Canada Post, FedEx, etc.
  • Payment instrument to pay for the purchase
  • Taxes for the purchase

After the order is POSTed to a purchase, Cortex API executes the purchase based on the intentions in the order, and the cart and order are cleared.

Similar to the cart resource, an order is always available, persisted between sessions, and is updated automatically. For example, if a customer removes an item from their cart, the order is updated to remove the item.

The order contains NeedInfo links if the billing address, shipping address, shipping option, or payment instrument haven’t been selected.

Read Order​

Retrieves the cart’s order. An order may have Needinfos. Needinfos identify a condition that must be satisfied before a transaction can complete. Needinfos link to a selector where the customer can choose the missing condition. After the Needinfos are satisfied, the order can be submitted to a purchase. For a list of messages that can appear on the order, see needinfo-messages in the Structured Messages topic.

Workflow​

  1. Start with cart
  2. GET the link with rel: order
  3. Render the response

Read Order Email​

Reads email address associated with order.

Workflow​

  1. Start with order
  2. GET the link with rel: emailinfo
  3. GET the link with rel: email
  4. Render the response

Response Fields​

Type: emails.email​

NameDescriptionType
emailThe email address.string

Add Email From Order​

Create an email address from the order.

Workflow​

  1. Start with order
  2. GET the link with rel: emailinfo
  3. GET the link with rel: emailform
  4. Fill out the form
  5. POST the form using the link with rel: createemailaction

Request Fields​

Type: emails.email​

NameDescriptionType
emailThe email address.string

Read Billing Address Info​

Use a selector to select the billing address to use for the purchase. Follow the workflow to read the billing address info and then create a choice to select the billing address to use for the purchase.

Workflow​

  1. Start with order
  2. GET the link with rel: billingaddressinfo
  3. Refer to addresses

Read Order Delivery​

The deliveries resource returns the shipment details for the order. This includes details such as the delivery address and the shipping method. Out of the box, you cannot split orders into different shipments until the purchase is created. When you get the list of delivery elements for an order only one element appears in the list.

Workflow​

  1. Start with order
  2. GET the link with rel: deliveries
  3. GET the link with rel: element
  4. Refer to shipment details

Response Fields​

Type: orders.delivery​

NameDescriptionType
delivery-typeThe delivery type for an order.string