younifyd
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

  1. Add a step and choose the Shopify Storefront connector.
  2. Pick the cart action (under Cart).
  3. 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.

graphql
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.

idstringrequired

The ID of the cart.

json
{
  "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}}.

appliedGiftCardsarray<object>
amountUsedobject
amountUsedV2object
balanceobject
balanceV2object
idobject
lastCharactersobject
presentmentAmountUsedobject
attributesarray<object>
keyobject
valueobject
buyerIdentityobject
countryCodestring

One ofAFAXALDZADAOAIAGARAMAWACAUATAZBSBHBDBBBYBEBZBJBMBTBOBABWBVBRIOBNBGBFBIKHCACVBQKY

customerobject14 fields
deliveryAddressPreferencesarray<object>
emailstring
phonestring
preferencesobject2 fields
purchasingCompanyobject3 fields
checkoutUrlstring
costobject
checkoutChargeAmountobject2 fields
subtotalAmountobject2 fields
subtotalAmountEstimatedboolean
totalAmountobject2 fields
totalAmountEstimatedboolean
totalDutyAmountobject2 fields
totalDutyAmountEstimatedboolean
totalTaxAmountobject2 fields
totalTaxAmountEstimatedboolean
createdAtstring
deliveryobject
discountAllocationsarray<object>
discountApplicationobject
discountedAmountobject
sourceDiscountApplicationobject
targetTypeobject
discountApplicationsarray<object>
allocationMethodobject
targetSelectionobject
targetTypeobject
totalAllocatedAmountobject
valueobject
discountCodesarray<object>
applicableobject
codeobject
estimatedCostobject
checkoutChargeAmountobject2 fields
subtotalAmountobject2 fields
totalAmountobject2 fields
totalDutyAmountobject2 fields
totalTaxAmountobject2 fields
idstring
notestring
totalQuantitynumber
updatedAtstring

Need more? See the Shopify Storefront guide for connection setup and behaviour shared by every action.

Was this page helpful?