---
title: Retrieve an accounts cart
slug: docs/demo/retrieve-an-accounts-cart
description: Learn how to use the curl command to make a GET request and retrieve data from a designated API endpoint effortlessly. This comprehensive code example showcases the inclusion of indispensable headers and request parameters for seamless authentication and 
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "ciakH1FOV2FTKYT4b_8KS",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/{accountReference}/carts/{cartReference}",
    "name": "Retrieve an accounts cart",
    "method": "GET",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string",
          "description": "Account reference identifier"
        },
        {
          "kind": "required",
          "name": "cartReference",
          "type": "string",
          "description": "The reference of the cart"
        }
      ],
      "queryParameters": [],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "schema": [
              {
                "kind": "optional",
                "name": "lineItemReference",
                "type": "string",
                "example": "",
                "description": "Line Item Reference"
              },
              {
                "kind": "optional",
                "name": "description",
                "type": "string",
                "example": "",
                "description": "Description of the Line Item"
              },
              {
                "kind": "optional",
                "name": "pricing",
                "type": "object",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "grossAmount",
                    "type": "number<double>",
                    "example": "",
                    "description": "Gross Amount"
                  },
                  {
                    "kind": "optional",
                    "name": "netAmount",
                    "type": "number<double>",
                    "example": "",
                    "description": "Net Amount"
                  },
                  {
                    "kind": "optional",
                    "name": "taxAmount",
                    "type": "number<double>",
                    "example": "",
                    "description": "Tax Amount"
                  },
                  {
                    "kind": "optional",
                    "name": "currency",
                    "type": "string",
                    "example": "",
                    "description": "Currency"
                  },
                  {
                    "kind": "optional",
                    "name": "priceReference",
                    "type": "string",
                    "example": "",
                    "description": "Product Price Reference"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.CartLineItems.PricePoint",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v3.CartLineItems.PricePoint",
                "description": "Pricing information about Line Item"
              },
              {
                "kind": "optional",
                "name": "quantity",
                "type": "integer<int32>",
                "example": 0,
                "description": "Quantity of items"
              },
              {
                "kind": "optional",
                "name": "productInfo",
                "type": "object",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "title",
                    "type": "string",
                    "example": "",
                    "description": "Product Title"
                  },
                  {
                    "kind": "optional",
                    "name": "productReference",
                    "type": "string",
                    "example": "",
                    "description": "Product Reference"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.Cart.LineItemProductInfo",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v3.Cart.LineItemProductInfo",
                "description": "Product"
              },
              {
                "kind": "optional",
                "name": "customLineItemParameters",
                "type": "object",
                "schema": [],
                "example": {},
                "description": "List of cart item detail parameters"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.Cart.CartItem",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v3.Cart.CartItem[]",
            "isExpanded": true
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "Content of the cart in respose body",
        "jsonExample": "{\n  \"contractReference\": \"ContractReference\",\n  \"accountReference\": \"AccountReference\",\n  \"lineItems\": [\n    {\n      \"lineItemReference\": \"LineItemReference\",\n      \"description\": \"Description\",\n      \"pricing\": {\n        \"grossAmount\": 12,\n        \"netAmount\": 10,\n        \"taxAmount\": 2,\n        \"currency\": \"GBP\"\n      },\n      \"quantity\": 2,\n      \"productInfo\": {\n        \"productReference\": \"ProductReference\"\n      },\n      \"customLineItemParameters\": {\n        \"size\": \"10\"\n      }\n    }\n  ]\n}"
      },
      {
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "schema": [
              {
                "kind": "optional",
                "name": "lineItemReference",
                "type": "string",
                "example": "",
                "description": "Line Item Reference"
              },
              {
                "kind": "optional",
                "name": "description",
                "type": "string",
                "example": "",
                "description": "Description of the Line Item"
              },
              {
                "kind": "optional",
                "name": "pricing",
                "type": "object",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "grossAmount",
                    "type": "number<double>",
                    "example": "",
                    "description": "Gross Amount"
                  },
                  {
                    "kind": "optional",
                    "name": "netAmount",
                    "type": "number<double>",
                    "example": "",
                    "description": "Net Amount"
                  },
                  {
                    "kind": "optional",
                    "name": "taxAmount",
                    "type": "number<double>",
                    "example": "",
                    "description": "Tax Amount"
                  },
                  {
                    "kind": "optional",
                    "name": "currency",
                    "type": "string",
                    "example": "",
                    "description": "Currency"
                  },
                  {
                    "kind": "optional",
                    "name": "priceReference",
                    "type": "string",
                    "example": "",
                    "description": "Product Price Reference"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.CartLineItems.PricePoint",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v3.CartLineItems.PricePoint",
                "description": "Pricing information about Line Item"
              },
              {
                "kind": "optional",
                "name": "quantity",
                "type": "integer<int32>",
                "example": 0,
                "description": "Quantity of items"
              },
              {
                "kind": "optional",
                "name": "productInfo",
                "type": "object",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "title",
                    "type": "string",
                    "example": "",
                    "description": "Product Title"
                  },
                  {
                    "kind": "optional",
                    "name": "productReference",
                    "type": "string",
                    "example": "",
                    "description": "Product Reference"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.Cart.LineItemProductInfo",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v3.Cart.LineItemProductInfo",
                "description": "Product"
              },
              {
                "kind": "optional",
                "name": "customLineItemParameters",
                "type": "object",
                "schema": [],
                "example": {},
                "description": "List of cart item detail parameters"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.Cart.CartItem",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v3.Cart.CartItem[]",
            "isExpanded": true
          }
        ],
        "isExpanded": true,
        "statusCode": "204",
        "description": "No content for cart empty",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Cart cannot be found",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will allow you to retrieve a cart (and associated line items) from the eSuite platform that have been bound to the specific account",
    "examples": {
      "languages": [
        {
          "id": "BMr6asVd124NQ2IzRAk2m",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.fictive.com/REST/api/accounts/{accountReference}/carts/{cartReference} \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "Om1gYmSHj_pxs02yqR5b5",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/{accountReference}/carts/{cartReference}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "lTZ2Hg2y3daUW1HgC0bxa",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/{accountReference}/carts/{cartReference}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "sb0IcNmksGNQ7rsB8lcZC",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/{accountReference}/carts/{cartReference}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "BMr6asVd124NQ2IzRAk2m"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "{\n  \"contractReference\": \"ContractReference\",\n  \"accountReference\": \"AccountReference\",\n  \"lineItems\": [\n    {\n      \"lineItemReference\": \"LineItemReference\",\n      \"description\": \"Description\",\n      \"pricing\": {\n        \"grossAmount\": 12,\n        \"netAmount\": 10,\n        \"taxAmount\": 2,\n        \"currency\": \"GBP\"\n      },\n      \"quantity\": 2,\n      \"productInfo\": {\n        \"productReference\": \"ProductReference\"\n      },\n      \"customLineItemParameters\": {\n        \"size\": \"10\"\n      }\n    }\n  ]\n}"
        },
        {
          "id": "response-1-204",
          "language": "204",
          "code": "// No content for cart empty\n[\n  {\n    \"lineItemReference\": \"\",\n    \"description\": \"\",\n    \"pricing\": {\n      \"grossAmount\": \"\",\n      \"netAmount\": \"\",\n      \"taxAmount\": \"\",\n      \"currency\": \"\",\n      \"priceReference\": \"\"\n    },\n    \"quantity\": \"\",\n    \"productInfo\": {\n      \"title\": \"\",\n      \"productReference\": \"\"\n    },\n    \"customLineItemParameters\": {}\n  }\n]"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// Cart cannot be found\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}