younifyd
Menu

site_cart

Fetch the current shopper's cart, or a cart by its ID — line items, amounts, discounts and version.

Use it in a workflow

  1. Add a step and choose the BigCommerce Storefront connector.
  2. Pick the site_cart action (under Cart).
  3. Fill in the fields below, then reference the result from later steps as {{siteCart.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 SiteCart($entityId: String) {
  site {
    cart(entityId: $entityId) {
      id
      entityId
      currencyCode
      displayCurrencyCode
      isTaxIncluded
      baseAmount {
        currencyCode
        value
        formatted
        formattedV2
      }
      baseAmountInDisplayCurrency {
        currencyCode
        value
        formatted
        formattedV2
      }
      discountedAmount {
        currencyCode
        value
        formatted
        formattedV2
      }
      discountedAmountInDisplayCurrency {
        currencyCode
        value
        formatted
        formattedV2
      }
      amount {
        currencyCode
        value
        formatted
        formattedV2
      }
      amountInDisplayCurrency {
        currencyCode
        value
        formatted
        formattedV2
      }
      discounts {
        entityId
        discountedAmount {
          currencyCode
          value
          formatted
          formattedV2
        }
        discountedAmountInDisplayCurrency {
          currencyCode
          value
          formatted
          formattedV2
        }
        displayName
      }
      lineItems {
        physicalItems {
          entityId
          parentEntityId
          productEntityId
          variantEntityId
          sku
          allowGiftWrapping
          name
          url
          imageUrl
          brand
          quantity
          isTaxable
          isMutable
          isShippingRequired
          addedByAttributeId
          path
        }
        digitalItems {
          entityId
          parentEntityId
          productEntityId
          variantEntityId
          sku
          name
          url
          imageUrl
          isMutable
          brand
          quantity
          isTaxable
          addedByAttributeId
          path
        }
        giftCertificates {
          entityId
          name
          theme
          isTaxable
          message
        }
        customItems {
          entityId
          sku
          name
          quantity
        }
        totalQuantity
      }
      createdAt {
        utc
      }
      updatedAt {
        utc
      }
      locale
      version
      externalSource
      source
      companyId
    }
  }
}

Variables

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

entityIdstring

Cart ID.

json
{
  "entityId": "string"
}

Response

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

idstring
entityIdstring
currencyCodestring
displayCurrencyCodestring
isTaxIncludedboolean
baseAmountobject
currencyCodestring
valuestring
formattedstring
formattedV2string
baseAmountInDisplayCurrencyobject
currencyCodestring
valuestring
formattedstring
formattedV2string
discountedAmountobject
currencyCodestring
valuestring
formattedstring
formattedV2string
discountedAmountInDisplayCurrencyobject
currencyCodestring
valuestring
formattedstring
formattedV2string
amountobject
currencyCodestring
valuestring
formattedstring
formattedV2string
amountInDisplayCurrencyobject
currencyCodestring
valuestring
formattedstring
formattedV2string
discountsarray<object>
entityIdobject
discountedAmountobject
discountedAmountInDisplayCurrencyobject
displayNameobject
lineItemsobject
physicalItemsarray<object>
digitalItemsarray<object>
giftCertificatesarray<object>
customItemsarray<object>
totalQuantitynumber
createdAtobject
utcstring
updatedAtobject
utcstring
localestring
versionnumber
externalSourcestring
sourcestring

One ofB2BB2B_INVOICEB2B_QUOTEBUY_NOW

companyIdnumber

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

Was this page helpful?