---
title: Retrieve Bundles for the affiliate
slug: docs/demo/retrieve-bundles-for-the-affiliate
description: Learn how to use the curl command to perform a GET request on the API endpoint "https://api.fictive.com/REST/api/bundles". This code example showcases the inclusion of headers for specifying the response format and content type as JSON. Improve your API i
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "N2B95kwQt77Nb0TesVZYX",
  "data": {
    "url": "https://api.fictive.com/REST/api/bundles",
    "name": "Retrieve Bundles for the affiliate",
    "method": "GET",
    "request": {
      "pathParameters": [],
      "queryParameters": [
        {
          "kind": "optional",
          "name": "name",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "tag",
          "type": "string"
        },
        {
          "kind": "optional",
          "name": "status",
          "type": "array",
          "itemType": "string",
          "customType": "string[]"
        },
        {
          "kind": "optional",
          "name": "exactMatch",
          "type": "boolean"
        }
      ],
      "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": "bundleReference",
                "type": "string",
                "example": "",
                "description": "The bundle Id converted to a reference"
              },
              {
                "kind": "optional",
                "name": "carts",
                "type": "array",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "cartReference",
                    "type": "string",
                    "example": "",
                    "description": "Cart reference"
                  },
                  {
                    "kind": "optional",
                    "name": "active",
                    "type": "boolean",
                    "example": "",
                    "description": "The flag for displaying if the cart is active"
                  },
                  {
                    "kind": "optional",
                    "name": "trialInfo",
                    "type": "object",
                    "schema": [
                      {
                        "kind": "optional",
                        "name": "trialEnabled",
                        "type": "boolean",
                        "example": "",
                        "description": "Trial enabled"
                      },
                      {
                        "kind": "optional",
                        "name": "trialUnit",
                        "type": "string<Unspecified | None | Minute | Hour | Day | Month | Year>",
                        "example": "",
                        "description": "Trial unit"
                      },
                      {
                        "kind": "optional",
                        "name": "trialPeriod",
                        "type": "integer<int32>",
                        "example": 0,
                        "description": "Trial period"
                      },
                      {
                        "kind": "optional",
                        "name": "discountPercentage",
                        "type": "number<double>",
                        "example": "",
                        "description": "Discount percentage"
                      },
                      {
                        "kind": "optional",
                        "name": "nonPaymentTrial",
                        "type": "boolean",
                        "example": "",
                        "description": "Non payment trial"
                      },
                      {
                        "kind": "optional",
                        "name": "trialChargedAsSinglePeriod",
                        "type": "boolean",
                        "example": "",
                        "description": "Trial charged as single period"
                      }
                    ],
                    "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v2.TrialInfo",
                    "customType": "FictiveGlobal.Api.Rest.Dtos.v2.TrialInfo",
                    "description": "The trial info for the service in the cart"
                  },
                  {
                    "kind": "optional",
                    "name": "contractReference",
                    "type": "string",
                    "example": "",
                    "description": "Contract reference associated to the cart"
                  },
                  {
                    "kind": "optional",
                    "name": "accountReference",
                    "type": "string",
                    "example": "",
                    "description": "Account reference associated to the cart"
                  },
                  {
                    "kind": "optional",
                    "name": "lineItems",
                    "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[]",
                    "description": "Items within the cart"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.Bundle.BundleCart",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v1.Bundle.BundleCart[]",
                "description": "The carts attached to the bundle"
              },
              {
                "kind": "optional",
                "name": "name",
                "type": "string",
                "example": "",
                "description": "The bundle name"
              },
              {
                "kind": "optional",
                "name": "description",
                "type": "string",
                "example": "",
                "description": "The bundle description"
              },
              {
                "kind": "optional",
                "name": "tag",
                "type": "string",
                "example": "",
                "description": "The optional bundle tag"
              },
              {
                "kind": "optional",
                "name": "status",
                "type": "string<Active | Inactive | Archived>",
                "example": "",
                "description": "The bundle's status"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.Bundle.BundleContents",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.Bundle.BundleContents[]",
            "isExpanded": true,
            "description": "The Dto of a bundle contents"
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "Ok",
        "jsonExample": "[\n  {\n    \"bundleReference\": \"001PB4PI6KTEVRY8R2\",\n    \"name\": \"First Bundle (With Tag)\",\n    \"description\": \"The first bundle, featuring a tag\",\n    \"tag\": \"A001\",\n    \"status\": \"Active\"\n  },\n  {\n    \"bundleReference\": \"001PBUA2JKV9N8QIA3\",\n    \"name\": \"Second Bundle (Without Tag)\",\n    \"description\": \"The second bundle, without a tag\",\n    \"status\": \"Inactive\"\n  },\n  {\n    \"bundleReference\": \"001PB4PI6KTXCYR8R4\",\n    \"carts\": [\n      {\n        \"cartReference\": \"0010K4PI6KTXCYFT82\",\n        \"active\": true,\n        \"trialInfo\": {\n          \"trialEnabled\": true,\n          \"trialUnit\": \"Day\",\n          \"trialPeriod\": 7,\n          \"discountPercentage\": 100,\n          \"nonPaymentTrial\": false,\n          \"trialChargedAsSinglePeriod\": true\n        },\n        \"contractReference\": \"0010C4PI6KTXCYB8R9\",\n        \"lineItems\": [\n          {\n            \"lineItemReference\": \"0010I4PI6KTEVRY8R2\",\n            \"description\": \"The first line item in the cart\",\n            \"pricing\": {\n              \"grossAmount\": 2.5,\n              \"netAmount\": 2.08,\n              \"taxAmount\": 0.42,\n              \"currency\": \"GBP\"\n            },\n            \"quantity\": 1,\n            \"productInfo\": {\n              \"title\": \"Example Product\",\n              \"productReference\": \"0010B4PI6KTXCYR8R4\"\n            },\n            \"customLineItemParameters\": {}\n          }\n        ]\n      }\n    ],\n    \"name\": \"Third Bundle (With Tag & Cart & Active Trial)\",\n    \"description\": \"The third bundle, featuring a tag & single cart & trial\",\n    \"tag\": \"A002\",\n    \"status\": \"Active\"\n  }\n]"
      },
      {
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "schema": [
              {
                "kind": "optional",
                "name": "bundleReference",
                "type": "string",
                "example": "",
                "description": "The bundle Id converted to a reference"
              },
              {
                "kind": "optional",
                "name": "carts",
                "type": "array",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "cartReference",
                    "type": "string",
                    "example": "",
                    "description": "Cart reference"
                  },
                  {
                    "kind": "optional",
                    "name": "active",
                    "type": "boolean",
                    "example": "",
                    "description": "The flag for displaying if the cart is active"
                  },
                  {
                    "kind": "optional",
                    "name": "trialInfo",
                    "type": "object",
                    "schema": [
                      {
                        "kind": "optional",
                        "name": "trialEnabled",
                        "type": "boolean",
                        "example": "",
                        "description": "Trial enabled"
                      },
                      {
                        "kind": "optional",
                        "name": "trialUnit",
                        "type": "string<Unspecified | None | Minute | Hour | Day | Month | Year>",
                        "example": "",
                        "description": "Trial unit"
                      },
                      {
                        "kind": "optional",
                        "name": "trialPeriod",
                        "type": "integer<int32>",
                        "example": 0,
                        "description": "Trial period"
                      },
                      {
                        "kind": "optional",
                        "name": "discountPercentage",
                        "type": "number<double>",
                        "example": "",
                        "description": "Discount percentage"
                      },
                      {
                        "kind": "optional",
                        "name": "nonPaymentTrial",
                        "type": "boolean",
                        "example": "",
                        "description": "Non payment trial"
                      },
                      {
                        "kind": "optional",
                        "name": "trialChargedAsSinglePeriod",
                        "type": "boolean",
                        "example": "",
                        "description": "Trial charged as single period"
                      }
                    ],
                    "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v2.TrialInfo",
                    "customType": "FictiveGlobal.Api.Rest.Dtos.v2.TrialInfo",
                    "description": "The trial info for the service in the cart"
                  },
                  {
                    "kind": "optional",
                    "name": "contractReference",
                    "type": "string",
                    "example": "",
                    "description": "Contract reference associated to the cart"
                  },
                  {
                    "kind": "optional",
                    "name": "accountReference",
                    "type": "string",
                    "example": "",
                    "description": "Account reference associated to the cart"
                  },
                  {
                    "kind": "optional",
                    "name": "lineItems",
                    "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[]",
                    "description": "Items within the cart"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.Bundle.BundleCart",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v1.Bundle.BundleCart[]",
                "description": "The carts attached to the bundle"
              },
              {
                "kind": "optional",
                "name": "name",
                "type": "string",
                "example": "",
                "description": "The bundle name"
              },
              {
                "kind": "optional",
                "name": "description",
                "type": "string",
                "example": "",
                "description": "The bundle description"
              },
              {
                "kind": "optional",
                "name": "tag",
                "type": "string",
                "example": "",
                "description": "The optional bundle tag"
              },
              {
                "kind": "optional",
                "name": "status",
                "type": "string<Active | Inactive | Archived>",
                "example": "",
                "description": "The bundle's status"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.Bundle.BundleContents",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.Bundle.BundleContents[]",
            "isExpanded": true,
            "description": "The Dto of a bundle contents"
          }
        ],
        "isExpanded": true,
        "statusCode": "204",
        "description": "There are no bundles configured for the affiliate",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "The is no bundle matching the provided search parameters",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "412",
        "description": "Precondition Failed\r\n            <br />• The X-PageNumber header has not been supplied\r\n            <br />• The page number must be greater than zero.\r\n            <br />• The X-ResultsPerPage header has not been supplied\r\n            <br />• The number of items in the page must be greater than zero.",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint allows the ability to retrieve a list of bundles attached to the affiliate.\r\n            <br /><br />The following custom headers must be provided in the request\r\n            <br />• X-PageNumber\r\n            <br />• X-ResultsPerPage\r\n            <br /><br />The following custom headers will be provided in the response\r\n            <br />• X-TotalNumberOfRecords\r\n            <br />• X-PageNumber\r\n            <br />• X-ResultsPerPage",
    "examples": {
      "languages": [
        {
          "id": "IlgKP9skI1GQN1aHiZgU5",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.fictive.com/REST/api/bundles \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "_lbGKXRYWjp3LQqF6NbnC",
          "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/bundles\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "yesPpdbhrvVdZAKlkKpT5",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/bundles\")\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": "unyPHFgib6q_afAPG02Ys",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/bundles\"\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": "IlgKP9skI1GQN1aHiZgU5"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "[\n  {\n    \"bundleReference\": \"001PB4PI6KTEVRY8R2\",\n    \"name\": \"First Bundle (With Tag)\",\n    \"description\": \"The first bundle, featuring a tag\",\n    \"tag\": \"A001\",\n    \"status\": \"Active\"\n  },\n  {\n    \"bundleReference\": \"001PBUA2JKV9N8QIA3\",\n    \"name\": \"Second Bundle (Without Tag)\",\n    \"description\": \"The second bundle, without a tag\",\n    \"status\": \"Inactive\"\n  },\n  {\n    \"bundleReference\": \"001PB4PI6KTXCYR8R4\",\n    \"carts\": [\n      {\n        \"cartReference\": \"0010K4PI6KTXCYFT82\",\n        \"active\": true,\n        \"trialInfo\": {\n          \"trialEnabled\": true,\n          \"trialUnit\": \"Day\",\n          \"trialPeriod\": 7,\n          \"discountPercentage\": 100,\n          \"nonPaymentTrial\": false,\n          \"trialChargedAsSinglePeriod\": true\n        },\n        \"contractReference\": \"0010C4PI6KTXCYB8R9\",\n        \"lineItems\": [\n          {\n            \"lineItemReference\": \"0010I4PI6KTEVRY8R2\",\n            \"description\": \"The first line item in the cart\",\n            \"pricing\": {\n              \"grossAmount\": 2.5,\n              \"netAmount\": 2.08,\n              \"taxAmount\": 0.42,\n              \"currency\": \"GBP\"\n            },\n            \"quantity\": 1,\n            \"productInfo\": {\n              \"title\": \"Example Product\",\n              \"productReference\": \"0010B4PI6KTXCYR8R4\"\n            },\n            \"customLineItemParameters\": {}\n          }\n        ]\n      }\n    ],\n    \"name\": \"Third Bundle (With Tag & Cart & Active Trial)\",\n    \"description\": \"The third bundle, featuring a tag & single cart & trial\",\n    \"tag\": \"A002\",\n    \"status\": \"Active\"\n  }\n]"
        },
        {
          "id": "response-1-204",
          "language": "204",
          "code": "// There are no bundles configured for the affiliate\n[\n  {\n    \"bundleReference\": \"\",\n    \"carts\": [\n      {\n        \"cartReference\": \"\",\n        \"active\": false,\n        \"trialInfo\": {\n          \"trialEnabled\": false,\n          \"trialUnit\": \"\",\n          \"trialPeriod\": \"\",\n          \"discountPercentage\": \"\",\n          \"nonPaymentTrial\": false,\n          \"trialChargedAsSinglePeriod\": false\n        },\n        \"contractReference\": \"\",\n        \"accountReference\": \"\",\n        \"lineItems\": [\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        ]\n      }\n    ],\n    \"name\": \"\",\n    \"description\": \"\",\n    \"tag\": \"\",\n    \"status\": \"\"\n  }\n]"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// The is no bundle matching the provided search parameters\n"
        },
        {
          "id": "response-3-412",
          "language": "412",
          "code": "// Precondition Failed\r\n            • The X-PageNumber header has not been supplied\r\n            • The page number must be greater than zero.\r\n            • The X-ResultsPerPage header has not been supplied\r\n            • The number of items in the page must be greater than zero.\n"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}