Menu
cart
Fetch a cart by its ID — line items, cost, buyer identity, discount/gift-card codes, delivery groups, and the `checkoutUrl`.
Use it in a workflow
- Add a step and choose the Shopify Storefront connector.
- Pick the cart action (under Cart).
- Fill in the fields below, then reference the result from later steps as
{{cart.response.data}}.
Query
This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.
query Cart($id: ID!) {
cart(id: $id) {
appliedGiftCards {
amountUsed {
amount
currencyCode
}
amountUsedV2 {
amount
currencyCode
}
balance {
amount
currencyCode
}
balanceV2 {
amount
currencyCode
}
id
lastCharacters
presentmentAmountUsed {
amount
currencyCode
}
}
attributes {
key
value
}
buyerIdentity {
countryCode
customer {
acceptsMarketing
avatarUrl
createdAt
defaultAddress
displayName
email
firstName
id
lastName
numberOfOrders
phone
socialLoginProvider
tags
updatedAt
}
deliveryAddressPreferences
email
phone
preferences {
delivery
wallet
}
purchasingCompany {
company
contact
location
}
}
checkoutUrl
cost {
checkoutChargeAmount {
amount
currencyCode
}
subtotalAmount {
amount
currencyCode
}
subtotalAmountEstimated
totalAmount {
amount
currencyCode
}
totalAmountEstimated
totalDutyAmount {
amount
currencyCode
}
totalDutyAmountEstimated
totalTaxAmount {
amount
currencyCode
}
totalTaxAmountEstimated
}
createdAt
delivery
discountAllocations {
discountApplication {
allocationMethod
targetSelection
targetType
value
}
discountedAmount {
amount
currencyCode
}
sourceDiscountApplication {
allocationMethod
targetSelection
targetType
totalAllocatedAmount
value
}
targetType
}
discountApplications {
allocationMethod
targetSelection
targetType
totalAllocatedAmount {
amount
currencyCode
}
value
}
discountCodes {
applicable
code
}
estimatedCost {
checkoutChargeAmount {
amount
currencyCode
}
subtotalAmount {
amount
currencyCode
}
totalAmount {
amount
currencyCode
}
totalDutyAmount {
amount
currencyCode
}
totalTaxAmount {
amount
currencyCode
}
}
id
note
totalQuantity
updatedAt
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"id": "string"
}
Response
Read the result with {{cart.response.data.data.cart}}. If the API returns errors, the step fails and they are at {{cart.response.data.errors}}.
Need more? See the Shopify Storefront guide for connection setup and behaviour shared by every action.
Was this page helpful?