Next Commerce

cart

Query for cart

Arguments

id·ID!non-nullscalar

The ID of the object

Returns

CartNodeobject
abandoned·Boolean!non-nullscalar
attribution·AttributionNodeobject
dateCreated·DateTime!non-nullscalar
lines·[CartLineNode!]!non-nulllistobject
id·ID!non-nullscalar

The ID of the object

pk·Intscalar
user·UserNodeobject
checkoutUrl·Stringscalar
currency·Stringscalar
totalInclTax·Stringscalar
totalExclTax·Stringscalar
totalInclTaxExclDiscounts·Stringscalar
totalExclTaxExclDiscounts·Stringscalar
totalDiscount·Stringscalar
numItems·Intscalar
numLines·Intscalar
offerDiscounts·[OfferDiscountNode]listobject
voucherDiscounts·[VoucherDiscountNode]listobject
metadata·GenericScalarscalar
subscriptionPreview·SubscriptionPreviewNodeobject
Query Reference
query Cart($id: ID!) {
  cart(id: $id) {
    abandoned
    dateCreated
    id
    pk
    checkoutUrl
    currency
    totalInclTax
    totalExclTax
    totalInclTaxExclDiscounts
    totalExclTaxExclDiscounts
  }
}
Variables
{
  "id": "<id>"
}
JSON Response
{
  "data": {
    "cart": {
      "abandoned": true,
      "attribution": {
        "id": "<id>",
        "utmSource": "<your-value>",
        "utmMedium": "<your-value>",
        "utmCampaign": "<your-value>",
        "utmTerm": "<your-value>",
        "utmContent": "<your-value>",
        "gclid": "<your-value>",
        "campaign": "<your-value>",
        "metadata": {},
        "affiliate": "<your-value>",
        "subaffiliate1": "<your-value>",
        "subaffiliate2": "<your-value>",
        "subaffiliate3": "<your-value>",
        "subaffiliate4": "<your-value>",
        "subaffiliate5": "<your-value>"
      },
      "dateCreated": "2026-01-01T00:00:00Z",
      "lines": [
        {
          "product": {
            "isPublic": true,
            "parent": null,
            "slug": "<your-value>",
            "description": "<your-value>",
            "metaTitle": "<your-value>",
            "metaDescription": "<your-value>",
            "recommendedProducts": {
              "pageInfo": "...",
              "edges": "..."
            },
            "rating": 1,
            "dateCreated": "2026-01-01T00:00:00Z",
            "dateUpdated": "2026-01-01T00:00:00Z",
            "isDiscountable": true,
            "title": "<your-value>",
            "excerpt": "<your-value>",
            "upc": "<your-value>",
            "structure": "<your-value>",
            "ranking": 1,
            "attributes": [
              {
                "name": "...",
                "code": "...",
                "pk": "...",
                "type": "...",
                "values": "..."
              }
            ],
            "variantAttributes": [
              {
                "name": "...",
                "code": "...",
                "values": "..."
              }
            ],
            "images": [
              {
                "id": "...",
                "url": "..."
              }
            ],
            "children": [
              {
                "isPublic": "...",
                "parent": "...",
                "slug": "...",
                "description": "...",
                "metaTitle": "...",
                "metaDescription": "...",
                "recommendedProducts": "...",
                "rating": "...",
                "dateCreated": "...",
                "dateUpdated": "...",
                "isDiscountable": "...",
                "title": "...",
                "excerpt": "...",
                "upc": "...",
                "structure": "...",
                "ranking": "...",
                "id": "...",
                "pk": "...",
                "requiresShipping": "...",
                "purchaseInfo": "...",
                "images": "...",
                "primaryImage": "...",
                "subscriptionInfo": "...",
                "url": "...",
                "metadata": "...",
                "variantAttributeValues": "..."
              }
            ],
            "id": "<id>",
            "pk": 1,
            "requiresShipping": true,
            "purchaseInfo": {
              "availableForSale": "...",
              "availability": "...",
              "price": "...",
              "priceRetail": "...",
              "priceSubscription": "...",
              "sku": "..."
            },
            "primaryImage": {
              "id": "...",
              "url": "..."
            },
            "subscriptionInfo": {
              "interval": "...",
              "intervalCount": "..."
            },
            "url": "<your-value>",
            "metadata": {}
          },
          "quantity": 1,
          "priceCurrency": "<your-value>",
          "dateCreated": "2026-01-01T00:00:00Z",
          "dateUpdated": "2026-01-01T00:00:00Z",
          "isUpsell": true,
          "interval": "<your-value>",
          "intervalCount": 1,
          "attributes": [
            {
              "value": "<your-value>",
              "option": "<your-value>"
            }
          ],
          "pk": 1,
          "unitPriceExclTax": "<your-value>",
          "unitPriceInclTax": "<your-value>",
          "linePriceExclTax": "<your-value>",
          "linePriceInclTax": "<your-value>",
          "linePriceExclTaxInclDiscounts": "<your-value>",
          "linePriceInclTaxInclDiscounts": "<your-value>",
          "discountValue": "<your-value>"
        }
      ],
      "id": "<id>",
      "pk": 1,
      "user": {
        "id": "<id>",
        "lastLogin": "2026-01-01T00:00:00Z",
        "isActive": true,
        "email": "<your-value>",
        "phoneNumber": "<your-value>",
        "firstName": "<your-value>",
        "lastName": "<your-value>",
        "ip": "<your-value>",
        "language": "<your-value>",
        "isBlocked": true,
        "userType": "LEAD",
        "acceptsMarketing": true,
        "metadata": {},
        "userAgent": "<your-value>",
        "firstPurchaseDate": "2026-01-01T00:00:00Z",
        "lastPurchaseDate": "2026-01-01T00:00:00Z",
        "dateJoined": "2026-01-01T00:00:00Z",
        "agentMarketingAttributions": [
          {
            "id": "<id>",
            "utmSource": "<your-value>",
            "utmMedium": "<your-value>",
            "utmCampaign": "<your-value>",
            "utmTerm": "<your-value>",
            "utmContent": "<your-value>",
            "gclid": "<your-value>",
            "campaign": "<your-value>",
            "metadata": {},
            "affiliate": "<your-value>",
            "subaffiliate1": "<your-value>",
            "subaffiliate2": "<your-value>",
            "subaffiliate3": "<your-value>",
            "subaffiliate4": "<your-value>",
            "subaffiliate5": "<your-value>"
          }
        ],
        "pk": 1
      },
      "checkoutUrl": "<your-value>",
      "currency": "<your-value>",
      "totalInclTax": "<your-value>",
      "totalExclTax": "<your-value>",
      "totalInclTaxExclDiscounts": "<your-value>",
      "totalExclTaxExclDiscounts": "<your-value>",
      "totalDiscount": "<your-value>",
      "numItems": 1,
      "numLines": 1,
      "offerDiscounts": [
        {
          "name": "<your-value>",
          "description": "<your-value>",
          "amount": "<your-value>"
        }
      ],
      "voucherDiscounts": [
        {
          "name": "<your-value>",
          "description": "<your-value>",
          "amount": "<your-value>",
          "voucher": {
            "name": "<your-value>",
            "code": "<your-value>",
            "startDatetime": "2026-01-01T00:00:00Z",
            "endDatetime": "2026-01-01T00:00:00Z"
          }
        }
      ],
      "metadata": {},
      "subscriptionPreview": {
        "totalGroupsInclTax": "10.00",
        "totalGroupsExclTax": "10.00",
        "subscriptionRebills": [
          {
            "currency": "<your-value>",
            "displayTaxes": "<your-value>",
            "frequency": "<your-value>",
            "interval": "<your-value>",
            "intervalCount": 1,
            "lines": [
              {
                "product": "...",
                "quantity": "...",
                "priceCurrency": "...",
                "dateCreated": "...",
                "dateUpdated": "...",
                "isUpsell": "...",
                "attributes": "...",
                "pk": "...",
                "unitPriceExclTax": "...",
                "unitPriceInclTax": "...",
                "linePriceExclTax": "...",
                "linePriceInclTax": "...",
                "linePriceExclTaxInclDiscounts": "...",
                "linePriceInclTaxInclDiscounts": "...",
                "discountValue": "...",
                "discountPercentage": "..."
              }
            ],
            "totalExclTax": "10.00",
            "totalInclTax": "10.00",
            "totalTax": "10.00",
            "shippingPrice": "10.00"
          }
        ]
      }
    }
  }
}