> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cocartapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Cart

> Gets the cart items added by the customer.



## OpenAPI

````yaml api-reference/v1/openapi-cart-v1.yaml get /get-cart
openapi: 3.0.3
info:
  title: CoCart - Cart API v1
  version: 4.6.0
  description: API for managing shopping carts
  termsOfService: http://cocartapi.com/terms-of-conditions-polar/
  contact:
    email: support@cocartapi.com
  license:
    name: GNU General Public License v3.0
    url: http://www.gnu.org/licenses/gpl-3.0.html
servers:
  - url: '{protocol}://{host}/wp-json/cocart/v1'
    description: API v1
    variables:
      protocol:
        enum:
          - http
          - https
        default: https
      host:
        default: example-store.com
        description: Your store domain
security: []
tags:
  - name: cart
    description: Operations for managing the shopping cart
  - name: items
    description: Operations for managing cart items
  - name: coupons
    description: Operations for managing cart coupons
  - name: fees
    description: Operations for managing cart fees
  - name: shipping
    description: Operations for managing shipping methods and rates
  - name: calculate
    description: Operations for calculating cart totals
  - name: products
    description: Operations for managing products
externalDocs:
  description: Find out more about CoCart API
  url: https://docs.cocartapi.com
paths:
  /get-cart:
    get:
      tags:
        - cart
      summary: Get cart contents
      description: Gets the cart items added by the customer.
      parameters:
        - name: cart_key
          in: query
          description: Unique identifier for the cart/customer.
          schema:
            type: string
          required: false
        - name: thumb
          in: query
          description: Returns the URL of the product image thumbnail.
          schema:
            type: boolean
            default: false
          required: false
      responses:
        '200':
          description: List of cart items.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
              example:
                1c383cd30b7c298ab50293adfecb7b18:
                  key: 1c383cd30b7c298ab50293adfecb7b18
                  product_id: 35
                  variation_id: 0
                  variation: []
                  quantity: 6
                  data_hash: b5c1d5ca8bae6d4896cf1807cdf763f0
                  line_tax_data:
                    subtotal: []
                    total: []
                  line_subtotal: 108
                  line_subtotal_tax: 0
                  line_total: 108
                  line_tax: 0
                  data: {}
                  product_name: T-Shirt with Logo
                  product_title: T-Shirt with Logo
                  product_price: £18.00
                70efdf2ec9b086079795c442636b55fb:
                  key: 70efdf2ec9b086079795c442636b55fb
                  product_id: 17
                  variation_id: 0
                  variation: []
                  quantity: 5
                  data_hash: b5c1d5ca8bae6d4896cf1807cdf763f0
                  line_tax_data:
                    subtotal: []
                    total: []
                  line_subtotal: 225
                  line_subtotal_tax: 0
                  line_total: 225
                  line_tax: 0
                  data: {}
                  product_name: Hoodie with Logo
                  product_title: Hoodie with Logo
                  product_price: £45.00
components:
  schemas:
    Cart:
      type: object
      description: >-
        A map of cart item keys to cart item objects. Each property key is a
        unique cart item key.
      additionalProperties:
        $ref: '#/components/schemas/CartItem'
    CartItem:
      type: object
      properties:
        key:
          type: string
          description: Unique identifier for the item within the cart.
        product_id:
          type: integer
          description: Unique identifier for the product.
        variation_id:
          type: integer
          description: Unique identifier for the variation.
        variation:
          description: Chosen attributes (for variations).
          oneOf:
            - type: object
              additionalProperties:
                type: string
            - type: array
              items:
                type: string
        quantity:
          type: integer
          description: Quantity of this item in the cart.
        data_hash:
          type: string
          description: Hash of cart item data.
        line_tax_data:
          type: object
          description: Line tax data.
          properties:
            subtotal:
              description: Line subtotal tax data.
              type: array
              items:
                type: number
            total:
              description: Line total tax data.
              type: array
              items:
                type: number
        line_subtotal:
          type: number
          description: >-
            Line subtotal (the price of the product before coupon discounts have
            been applied).
        line_subtotal_tax:
          type: number
          description: Line subtotal tax.
        line_total:
          type: number
          description: >-
            Line total (the price of the product after coupon discounts have
            been applied).
        line_tax:
          type: number
          description: Line total tax.
        product_name:
          type: string
          description: Product name.
        product_title:
          type: string
          description: Product title.
        product_price:
          type: string
          description: Current product price.
        product_image:
          type: string
          description: Product image URL. (Returns if thumb is true)
      additionalProperties: false

````