Skip to main content
Version: 8.0.x

Orders

An order is a list of intentions Cortex API will undertake to complete a purchase. For example, an order lists the billing and shipping address to use for the purchase, shipping options (Canada Post, FedEx, etc), paymentmethods to use for the purchase, the cart containing the items to purchase, and the taxes to pay for the purchase. Once the order is POSTed to a purchase, Cortex API executes the purchase based on the intentions in the order.

Just like the cart, 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. Once the order is POSTed to a purchase, the order is cleared and a new order is created for the customer.

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

Billing Address Info:

The Billing address info resource provides the customer with a selector to select the billing address to use for the purchase and an addressform to create a billing address to use for the purchase. The billing address is the address that is related to the payment means, which in some cases is the address your credit card uses.

Deliveries:

The deliveries resource groups the shipment details, which are the how and where your goods are being shipped, for your orders. Out of the box, you can’t split orders into different shipments, so when you get the list of delivery elements for an order only one element appears in the list. The order’s shipment details are specified through the shipmentdetails resource.

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 select 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​

Read 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

Billingaddress Info Selector​

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 billingaddress-info
  2. GET the link with rel: selector
  3. GET the link with rel: choice
  4. GET the link with rel: chosen
  5. GET the link with rel: description
  6. POST the choice using the link with rel: selectaction

Read Billing Address​

Read the currently selected billingaddress for the order.

Workflow​

  1. Start with order
  2. GET the link with rel: billingaddressinfo
  3. GET the link with rel: billingaddress
  4. Render the response

Response Fields​

Type: addresses.address​

NameDescriptionType
nameThe customer name.object
  given-nameThe person’s given name.string
  family-nameThe person’s family name.string
addressThe customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card.object
  street-addressThe street address.string
  extended-addressExtra field for address information. This field is optional.string
  localityThe city name.string
  regionThe region name. A region typically corresponds to a province or a state of a country.string
  postal-codePostal code or zip code.string
  country-nameThe country name.string
phone-numberPhone numberstring
organizationThe organizationstring

Add Billing Address From Order​

Create a billing address from the order.

Workflow​

  1. Start with order
  2. GET the link with rel: billingaddressinfo
  3. GET the link with rel: addressform
  4. Fill out the form
  5. POST the form using the link with rel: createaddressaction

Request Fields​

Type: addresses.address​

NameDescriptionType
nameThe customer name.object
  given-nameThe person’s given name.string
  family-nameThe person’s family name.string
addressThe customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card.object
  street-addressThe street address.string
  extended-addressExtra field for address information. This field is optional.string
  localityThe city name.string
  regionThe region name. A region typically corresponds to a province or a state of a country.string
  postal-codePostal code or zip code.string
  country-nameThe country name.string
phone-numberPhone numberstring
organizationThe organizationstring

Read Order Delivery​

Read a delivery from a list of deliveries

Workflow​

  1. Start with order
  2. GET the link with rel: deliveries
  3. GET the link with rel: element
  4. Render the response

Response Fields​

Type: orders.delivery​

NameDescriptionType
delivery-typeThe delivery type for an order.string