Skip to main content

checkout

Overview

Retrieve the shopper's cart with line items, pricing, coupon info, and checkout metadata. Use it to display a live summary during checkout steps.

  • Type: GraphQL Query
  • Endpoint: https://appssubdomain.com
  • Authentication: Authorization: Bearer <TOKEN> (session/account dependent)

Query

query getcheckout {
cart {
data {
_id
coupon
kind
couponApplied
couponDiscount
items {
productId
_id
variantId
productData {
price
slug
title
}
variantData {
compareAtPrice
price
}
quantity
price
compareAtPrice
totalPrice
totalCompareAtPrice
totalSavings
}
deviceId
sessionId
status
totalQuantity
totalPrice
totalCompareAtPrice
totalSavings
isFastOrder
createdAt
updatedAt
url
encryptionKey
}
success
message
}
}

Examples

curl -X POST \
https://appssubdomain.com\
-H "Content-Type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
--data-binary @- << 'EOF'
{ "query": "query getcheckout { cart { data { _id totalPrice totalQuantity items { _id quantity totalPrice } } success message } }" }
EOF

Notes

  • Replace <TOKEN> with the appropriate session/account credential.
  • Extend the selected fields (e.g., item productData) based on what you render on the checkout page.
  • Use success/message to handle empty or expired carts gracefully.