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.
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
- Start with billingaddress-info
GET
the link with rel: selectorGET
the link with rel: choiceGET
the link with rel: chosenGET
the link with rel: descriptionPOST
the choice using the link with rel: selectaction
Read Billing Address
Read the currently selected billingaddress for the order.
Workflow
- Start with order
GET
the link with rel: billingaddressinfoGET
the link with rel: billingaddress- Render the response
Response Fields
Type: addresses.address
Name | Description | Type |
---|---|---|
name | The customer name. | object |
given-name | The person’s given name. | string |
family-name | The person’s family name. | string |
address | The customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card. | object |
street-address | The street address. | string |
extended-address | Extra field for address information. This field is optional. | string |
locality | The city name. | string |
region | Valid region codes for this field can be retrieved using the Geographies Resource. | string |
postal-code | Postal code or zip code. | string |
country-name | Valid country codes for this field can be retrieved using the Geographies Resource. | string |
phone-number | Phone number | string |
organization | The organization | string |
Add Billing Address From Order
Create a billing address from the order.
Workflow
- Start with order
GET
the link with rel: billingaddressinfoGET
the link with rel: addressform- Fill out the form
POST
the form using the link with rel: createaddressaction
Request Fields
addresses.address
Type: Name | Description | Type |
---|---|---|
name | The customer name. | object |
given-name | The person’s given name. | string |
family-name | The person’s family name. | string |
address | The customer address. Address field names are based on the v.card specification. For more information on this specification, see v.card. | object |
street-address | The street address. | string |
extended-address | Extra field for address information. This field is optional. | string |
locality | The city name. | string |
region | Valid region codes for this field can be retrieved using the Geographies Resource. | string |
postal-code | Postal code or zip code. | string |
country-name | Valid country codes for this field can be retrieved using the Geographies Resource. | string |
phone-number | Phone number | string |
organization | The organization | string |
Read Billingaddress Needinfo From Order
When a billingaddress needinfo appears on the order, it means the billingaddress has not been selected for the purchase. Follow the workflow to read the billingaddress needinfo.
Workflow
- Start with order
GET
the link with rel: needinfo- Render the response
Response Fields
Type: elasticpath.controls.info
Name | Description | Type |
---|---|---|
name | The info object’s name. | string |
Read Billingaddress Needinfo From Purchaseform
Read billingaddress needinfo.
Workflow
- Start with create-purchase-form
GET
the link with rel: needinfo- Render the response
Response Fields
Type: elasticpath.controls.info
Name | Description | Type |
---|---|---|
name | The info object’s name. | string |
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. Once the Needinfos are satisfied the order can be submitted to a purchase.
Workflow
- Start with cart
GET
the link with rel: order- Render the response
Read Order Email
Read 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
Type: emails.email
Name | Description | Type |
---|---|---|
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 Email Needinfo From Order
Read the order’s email needinfo. When an email needinfo appears on the order, it means the customer’s email has not been selected for the purchase. Likely, this customer does not have an account. Follow the workflow to read the email needinfo.
Workflow
- Start with order
GET
the link with rel: needinfo- Render the response
Response Fields
Type: elasticpath.controls.info
Name | Description | Type |
---|---|---|
name | The info object’s name. | string |
Read Email Needinfo From Purchaseform
Read order email needinfo. When an email needinfo appears on the purchase form, it means the customer’s email has not been selected for the purchase. Likely, this customer does not have an account. Follow the workflow to read the email needinfo.
Workflow
- Start with create-purchase-form
GET
the link with rel: needinfo- Render the response
Response Fields
Type: elasticpath.controls.info
Name | Description | Type |
---|---|---|
name | The info object’s name. | string |
Read Order Delivery
Read a delivery from a list of deliveries
Workflow
- Start with order
GET
the link with rel: deliveriesGET
the link with rel: element- Render the response
Response Fields
Type: orders.delivery
Name | Description | Type |
---|---|---|
delivery-type | The delivery type for an order. | string |