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
- Start with cart
GET
the link with rel: order- Render the response
Read Order Email
Reads email address associated with order.
Workflow
- Start with order
GET
the link with rel: emailinfoGET
the link with rel: email- Render the response
Response Fields
emails.email
Type: Name | Description | Type |
---|---|---|
email | The email address. | string |
Add Email From Order
Create an email address from the order.
Workflow
- Start with order
GET
the link with rel: emailinfoGET
the link with rel: emailform- Fill out the form
POST
the form using the link with rel: createemailaction
Request Fields
emails.email
Type: Name | Description | Type |
---|---|---|
email | The 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
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
- Start with order
GET
the link with rel: deliveriesGET
the link with rel: element- Refer to shipment details
Response Fields
orders.delivery
Type: Name | Description | Type |
---|---|---|
delivery-type | The delivery type for an order. | string |