younifyd
Menu

carts

Query carts — supports a `where` predicate, `sort`, and `limit`/`offset` paging.

Use it in a workflow

  1. Add a step and choose the Commercetools connector.
  2. Pick the carts action (under Carts).
  3. Fill in the fields below, then reference the result from later steps as {{carts.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 Carts($where: String, $sort: [String!], $limit: Int, $offset: Int) {
  carts(where: $where, sort: $sort, limit: $limit, offset: $offset) {
    offset
    count
    total
    exists
    results {
      customerId
      customer {
        id
        customerNumber
        email
        addresses
        defaultShippingAddressId
        defaultBillingAddressId
        shippingAddressIds
        billingAddressIds
        isEmailVerified
        customerGroupRef
        externalId
        key
        authenticationMode
        firstName
        lastName
        middleName
        title
        locale
        salutation
        dateOfBirth
        companyName
        vatId
        password
        customerGroup
        defaultShippingAddress
        defaultBillingAddress
        shippingAddresses
        billingAddresses
        storesRef
        stores
        customerGroupAssignments
        custom
        version
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
      customerEmail
      anonymousId
      customLineItems {
        id
        key
        nameAllLocales
        money
        totalPrice
        slug
        quantity
        state
        taxCategory
        taxCategoryRef
        taxRate
        taxedPrice
        taxedPricePortions
        perMethodTaxRate
        discountedPricePerQuantity
        custom
        shippingDetails
        priceMode
        recurrenceInfo
      }
      totalPrice {
        type
        currencyCode
        centAmount
        fractionDigits
      }
      taxedPrice {
        totalNet
        totalGross
        taxPortions
        totalTax
      }
      discountOnTotalPrice {
        discountedAmount
        includedDiscounts
        discountedNetAmount
        discountedGrossAmount
      }
      shippingAddress {
        id
        streetName
        streetNumber
        additionalStreetInfo
        postalCode
        city
        region
        state
        country
        company
        department
        building
        apartment
        pOBox
        additionalAddressInfo
        externalId
        key
        phone
        mobile
        email
        fax
        title
        salutation
        firstName
        lastName
        custom
      }
      billingAddress {
        id
        streetName
        streetNumber
        additionalStreetInfo
        postalCode
        city
        region
        state
        country
        company
        department
        building
        apartment
        pOBox
        additionalAddressInfo
        externalId
        key
        phone
        mobile
        email
        fax
        title
        salutation
        firstName
        lastName
        custom
      }
      inventoryMode
      taxMode
      priceRoundingMode
      taxRoundingMode
      taxCalculationMode
      customerGroup {
        id
        version
        name
        key
        createdAt
        lastModifiedAt
        custom
        createdBy
        lastModifiedBy
      }
      customerGroupRef {
        typeId
        id
      }
      country
      shippingKey
      shippingInfo {
        shippingMethodName
        price
        shippingRate
        taxRate
        deliveries
        discountedPrice
        shippingMethodState
        estimatedDelivery
        shippingMethod
        shippingMethodRef
        taxCategory
        taxCategoryRef
        taxedPrice
      }
      discountCodes {
        discountCodeRef
        state
        discountCode
      }
      directDiscounts {
        id
        value
        target
      }
      refusedGifts {
        cartPredicate
        stackingMode
        isActive
        requiresDiscountCode
        key
        discountGroupRef
        nameAllLocales
        descriptionAllLocales
        referenceRefs
        custom
        validFrom
        validUntil
        storesRef
        stores
        discountGroup
        value
        target
        sortOrder
        recurringOrderScope
        id
        version
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
      refusedGiftsRefs {
        typeId
        id
      }
      paymentInfo {
        payments
        paymentRefs
      }
      locale
      shippingRateInput {
        type
      }
      origin
      storeRef {
        typeId
        key
      }
      store {
        id
        version
        key
        nameAllLocales
        languages
        countries
        productSelections
        distributionChannelsRef
        distributionChannels
        supplyChannelsRef
        supplyChannels
        storefront
        createdAt
        lastModifiedAt
        custom
        createdBy
        lastModifiedBy
      }
      itemShippingAddresses {
        id
        streetName
        streetNumber
        additionalStreetInfo
        postalCode
        city
        region
        state
        country
        company
        department
        building
        apartment
        pOBox
        additionalAddressInfo
        externalId
        key
        phone
        mobile
        email
        fax
        title
        salutation
        firstName
        lastName
        custom
      }
      businessUnit {
        id
        key
        name
        contactEmail
        addresses
        defaultShippingAddress
        defaultBillingAddress
        defaultShippingAddressId
        defaultBillingAddressId
        shippingAddresses
        billingAddresses
        shippingAddressIds
        billingAddressIds
        status
        storesRef
        stores
        storeMode
        unitType
        associates
        associateMode
        inheritedAssociates
        custom
        parentUnitRef
        parentUnit
        ancestors
        inheritedStores
        topLevelUnitRef
        topLevelUnit
        approvalRuleMode
        customerGroupAssignments
        version
        createdAt
        lastModifiedAt
        createdBy
        lastModifiedBy
      }
      businessUnitRef {
        typeId
        key
      }
      shipping {
        shippingKey
        shippingInfo
        shippingAddress
        shippingRateInput
        shippingCustomFields
      }
      taxedShippingPrice {
        totalNet
        totalGross
        taxPortions
        totalTax
      }
      shippingMode
      shippingCustomFields {
        typeRef
        type
      }
      placement
      discountTypeCombination {
        type
      }
      cartState
      key
      purchaseOrderNumber
      lock {
        createdAt
        clientId
      }
      custom {
        typeRef
        type
      }
      deleteDaysAfterLastModification
      totalLineItemQuantity
      recurringPaymentConfiguration {
        paymentStrategy
        paymentAllocations
      }
      freezeStrategy
      warnings {
        code
        message
      }
      id
      version
      createdAt
      lastModifiedAt
      createdBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
      lastModifiedBy {
        isPlatformClient
        clientId
        externalUserId
        anonymousId
        customerRef
        userRef
        associateRef
        attributedTo
      }
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

wherestring
sortarray<string>
limitnumber
offsetnumber
json
{
  "where": "string",
  "sort": [
    "string"
  ],
  "limit": 0,
  "offset": 0
}

Response

Read the result with {{carts.response.data.data.carts}}. If the API returns errors, the step fails and they are at {{carts.response.data.errors}}.

offsetnumber
countnumber
totalstring
existsboolean
resultsarray<object>
customerIdobject
customerobject
customerEmailobject
anonymousIdobject
customLineItemsobject
totalPriceobject
taxedPriceobject
discountOnTotalPriceobject
shippingAddressobject
billingAddressobject
inventoryModeobject
taxModeobject
priceRoundingModeobject
taxRoundingModeobject
taxCalculationModeobject
customerGroupobject
customerGroupRefobject
countryobject
shippingKeyobject
shippingInfoobject
discountCodesobject
directDiscountsobject
refusedGiftsobject
refusedGiftsRefsobject
paymentInfoobject
localeobject
shippingRateInputobject
originobject
storeRefobject
storeobject
itemShippingAddressesobject
businessUnitobject
businessUnitRefobject
shippingobject
taxedShippingPriceobject
shippingModeobject
shippingCustomFieldsobject
placementobject
discountTypeCombinationobject
cartStateobject

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

Was this page helpful?
carts — Commercetools — Documentation