Get Checkout
Retrieves a checkout with its cart and up-to-date totals.
A checkout is created when a shopper moves from the cart to checkout on the storefront. It holds the cart, the shopper (customer, company or guest email) and the choices made during checkout: addresses, shipping method and cost, payment method or payment term, tax, extra charges, store credit and notes. When the order is placed, the checkout gets the order number.
HTTP Request
- URL:
/checkout/{id} - Method:
GET - Headers:
accessToken: Required. Your API access token.
- Required scope:
READ_ORDERorREAD_WRITE_ORDER
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | Required. The ID of the checkout. |
cURL Example
curl --location '<BASE_URL>/checkout/6650f1a2d5775459152d7300' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The checkout was returned successfully.
- 400 Bad Request: The access token is missing or invalid, or no checkout exists with this ID.
Sample JSON Response
{
"success": true,
"data": {
"id": "6650f1a2d5775459152d7300",
"cart": {
"id": "6650f190d5775459152d72f0",
"customer": "664dec6cd5775459152d4926",
"company": "664dec6cd5775459152d4922",
"lineItems": [
{
"id": "6650f190d5775459152d72f1",
"productId": "663a0cbe516313e5bc94ab30",
"quantity": 12,
"price": 45,
"extendedPrice": 540,
"discountAmount": 0,
"isFreeGift": false
}
],
"baseAmount": 540,
"totalAmount": 540,
"lineDiscountAmount": 0,
"discountAmount": 0
},
"guestCheckout": false,
"company": "664dec6cd5775459152d4922",
"customer": "664dec6cd5775459152d4926",
"shippingAddress": {
"id": "6650f1a2d5775459152d7301",
"shippingAddressId": "664dec6cd5775459152d4924",
"firstName": "Maria",
"lastName": "Lopez",
"address1": "4100 Industrial Blvd",
"city": "Austin",
"state": { "name": "Texas", "code": "TX" },
"country": { "name": "United States", "code": "US" },
"zipcode": "78744"
},
"billingAddress": null,
"shippingMethod": "663a0afe4587085935a4fa0d",
"paymentMethod": "663a0afe4587085935a4fa11",
"paymentType": "online",
"paymentTerm": null,
"taxType": "percentage",
"tax": 44.55,
"shippingCost": 12,
"shippingDiscountAmount": 0,
"additionalCosts": [{ "name": "Handling fee", "amount": 5 }],
"storeCredit": null,
"customerNotes": "Deliver to dock 3.",
"metaFields": [],
"subTotal": 540,
"lineDiscountAmount": 0,
"discountAmount": 0,
"total": 601.55,
"amountToPay": 601.55,
"selectedCurrencyAmount": null,
"createdAt": "2024-05-24T08:12:18.120Z",
"updatedAt": "2024-05-24T08:15:02.441Z"
}
}
Response Details
Checkout Data
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier of the checkout. |
cart | Object | The cart being checked out. See Cart Object. |
guestCheckout | Boolean | Whether the shopper is checking out as a guest. |
guest | Object | Guest email, for guest checkouts. |
customer | String | ID of the customer. |
company | String | ID of the customer's company, for B2B shoppers. |
orderNumber | String | Order number, once the order has been placed. |
shippingAddress | Object | Selected shipping address. |
billingAddress | Object | Selected billing address. |
shippingMethod | String | ID of the selected shipping method. |
paymentMethod | String | ID of the selected payment method. |
paymentType | String | Type of the selected payment method, for example online or offline. |
paymentTerm | Object | Selected payment term, with paymentDueDays, dueType, depositRequired and depositPercentage. |
taxType | String | amount for a fixed tax amount, or percentage for a tax rate. |
tax | Number | Tax amount for this checkout. |
shippingCost | Number | Shipping charge. |
shippingDiscountAmount | Number | Discount on shipping. |
additionalCosts | Array | Extra charges, each with name and amount. |
storeCredit | Object | Store credit used (applied, amount, label). |
customerNotes | String | Notes entered by the shopper. |
metaFields | Array | Custom field values. |
subTotal | Number | Cart subtotal before discounts. |
lineDiscountAmount | Number | Total line-level discount. |
discountAmount | Number | Total order-level discount. |
total | Number | Cart total plus tax, shipping and extra charges, minus shipping discount. |
amountToPay | Number | Amount due now, after store credit and any required deposit. |
selectedCurrencyAmount | Object | Amounts in the shopper's selected currency, if different from the store currency. |
createdAt | String | Date and time the checkout was created (ISO 8601). |
updatedAt | String | Date and time the checkout was last updated (ISO 8601). |
Cart Object
| Field | Type | Description |
|---|---|---|
id | String | Cart ID. |
customer | String | ID of the customer. |
company | String | ID of the company. |
lineItems | Array | Items in the cart, with productId, variantId, quantity, price, extendedPrice and discountAmount. |
baseAmount | Number | Cart subtotal before discounts. |
totalAmount | Number | Cart total after discounts. |
lineDiscountAmount | Number | Total line-level discount. |
discountAmount | Number | Total order-level discount. |
Notes
- Totals are calculated with the latest product prices and promotions each time you get the checkout.
- To set tax or extra charges on a checkout, use Update Checkout.