---
title: Retrieve all vouchers
slug: docs/demo/retrieve-all-vouchers
description: Learn how to make a successful GET request to a fictive API endpoint with this detailed code example. Retrieve vouchers linked to a particular offer reference effortlessly using the powerful curl command. This example also ensures the smooth acceptance an
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "NiXMVZPsli9qgq-kk6xnT",
  "data": {
    "url": "https://api.fictive.com/REST/api/offers/{offerReference}/vouchers",
    "name": "Retrieve all vouchers",
    "method": "GET",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "offerReference",
          "type": "string",
          "description": ""
        }
      ],
      "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": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "voucherCode",
                "type": "string",
                "example": "",
                "description": "Voucher Code"
              },
              {
                "kind": "optional",
                "name": "createdDate",
                "type": "string<date-time>",
                "example": "2021-09-21T05:33:19.6510512",
                "description": "Created date"
              },
              {
                "kind": "optional",
                "name": "lastUpdatedDate",
                "type": "string<date-time>",
                "example": "",
                "description": "Last updated date"
              },
              {
                "kind": "optional",
                "name": "status",
                "type": "string",
                "example": "",
                "description": "Status"
              },
              {
                "kind": "optional",
                "name": "redemptionCount",
                "type": "integer<int32>",
                "example": 0,
                "description": "Redemption count"
              },
              {
                "kind": "optional",
                "name": "redemptionsDetails",
                "type": "array",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "orderReference",
                    "type": "string",
                    "example": "",
                    "description": "Order reference"
                  },
                  {
                    "kind": "optional",
                    "name": "accountReference",
                    "type": "string",
                    "example": "",
                    "description": "Account reference"
                  },
                  {
                    "kind": "optional",
                    "name": "subscriptionReference",
                    "type": "string",
                    "example": "",
                    "description": "Subscription reference"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.Offers.RedemptionDetailsDTO",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v1.Offers.RedemptionDetailsDTO[]",
                "description": "Redemption details"
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v1.Offers.OfferVoucherDataDTO",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v1.Offers.OfferVoucherDataDTO",
            "isExpanded": true,
            "description": "Voucher data"
          }
        ],
        "isExpanded": true,
        "statusCode": "200",
        "description": "OK",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will provide the ability to return all available voucher codes for a specific offer",
    "examples": {
      "languages": [
        {
          "id": "og16VkqDMc_TaBXgKfYM2",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.fictive.com/REST/api/offers/{offerReference}/vouchers \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "xkjP5UlNro_tcMkWWWLAO",
          "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/offers/{offerReference}/vouchers\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "aEpkl8SxL3qoFTuWCBV4J",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/offers/{offerReference}/vouchers\")\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": "wmLmbmiHxD-zgw9g8R_Tz",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/offers/{offerReference}/vouchers\"\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": "og16VkqDMc_TaBXgKfYM2"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n{\n  \"voucherCode\": \"\",\n  \"createdDate\": \"2021-09-21T05:33:19.6510512\",\n  \"lastUpdatedDate\": \"\",\n  \"status\": \"\",\n  \"redemptionCount\": \"\",\n  \"redemptionsDetails\": [\n    {\n      \"orderReference\": \"\",\n      \"accountReference\": \"\",\n      \"subscriptionReference\": \"\"\n    }\n  ]\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}