# List all vouchers

- Operation ID: `ListVouchers`
- HTTP method: `GET`
- Path: `/v4/vouchers/item/list`
- [Human-readable API reference](https://hub.synerise.com/api-reference/loyalty-and-engagement#tag/Vouchers/operation/ListVouchers)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /v4/vouchers/item/list:
    get:
      tags:
        - Vouchers
      summary: List all vouchers
      description: |
        Retrieve all vouchers for a Workspace. You can customize the search.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>

        **API key permission required:** `VOUCHERS_ITEM_LIST_READ`

        **User role permission required:** `assets_code_pool: read`
      operationId: ListVouchers
      parameters:
        - name: Accept
          in: header
          required: true
          style: simple
          explode: false
          schema:
            type: string
            enum:
              - application/json
        - name: Content-Type
          in: header
          required: true
          style: simple
          explode: false
          schema:
            type: string
            enum:
              - application/json
        - name: Api-Version
          in: header
          required: true
          style: simple
          explode: false
          schema:
            type: string
            enum:
              - "4.4"
              - "4.2"
        - name: limit
          in: query
          description: The number of items to return per page
          required: false
          schema:
            type: integer
            format: int32
            example: 100
            default: 100
            maximum: 1000
        - name: page
          in: query
          description: Page number to return for pagination. The first page has the index `1`.
          required: false
          schema:
            type: integer
            format: int32
            example: 4
            default: 1
        - name: includeMeta
          in: query
          description: |
            
            When `true`, pagination metadata is included in the response body.

            When `false`, the data is included in the response headers:

            - Link: links to neighbors, first, and last pages in pagination.

            - X-Pagination-Total-Count: total number of items on all pages

            - X-Pagination-Total-Pages: total number of pages

            - X-Pagination-Page: current page

            - X-Pagination-Limit: maximum number of items on a page
          required: false
          schema:
            type: boolean
            example: false
            default: false
      responses:
        "200":
          description: An array of vouchers
          content:
            application/json:
              schema:
                required:
                  - data
                type: object
                properties:
                  data:
                    type: array
                    description: An array of vouchers
                    items:
                      required:
                        - poolUuid
                      type: object
                      properties:
                        poolUuid:
                          type: string
                          description: UUID of the voucher pool
                          example: faec32b0-c343-4362-ba32-c6148c649da4
                        clientUuid:
                          type: string
                          description: UUID of the Profile
                          example: 07243772-008a-42e1-ba37-c3807cebde8f
                        clientId:
                          type: integer
                          description: ID of the Profile
                        code:
                          type: string
                          description: |
                            Voucher code
                            Must match the pattern: `^.{0,36}$`
                          example: code123
                          nullable: true
                        expireIn:
                          type: string
                          format: date-time
                          description: Date when the voucher expires.
                          nullable: true
                        redeemAt:
                          type: string
                          format: date-time
                          description: Time when the voucher was redeemed. Defaults to current time when redeeming.
                          nullable: true
                        assignedAt:
                          type: string
                          format: date-time
                          description: Time when the voucher was assigned. Defaults to current time when assigning.
                          nullable: true
                        status:
                          type: string
                          description: Voucher status
                          enum:
                            - ASSIGNED
                            - UNASSIGNED
                            - REDEEMED
                            - CANCELED
                          example: ASSIGNED
                        createdAt:
                          type: string
                          format: date-time
                          description: Time when the voucher was created.
                        updatedAt:
                          type: string
                          format: date-time
                          description: Time when the voucher was last updated.
                  meta:
                    type: object
                    description: Optional metadata
                    properties:
                      link:
                        type: array
                        description: Links to other pages
                        items:
                          type: object
                          description: Link to another page on the list
                          properties:
                            rel:
                              type: string
                              enum:
                                - first
                                - last
                                - next
                                - prev
                              description: The type of relationship to the current page
                            url:
                              type: string
                              description: The URL of the page
                      totalCount:
                        type: integer
                        description: The total number of items on all pages
                      totalPages:
                        type: integer
                        description: The total number of pages
                      page:
                        type: integer
                        description: The current page
                      limit:
                        type: integer
                        description: The number of items per page
                      code:
                        type: integer
                        description: HTTP code
      deprecated: false
      security:
        - JWT: []
      x-snr-doc-urls:
        - /api-reference/loyalty-and-engagement#tag/Vouchers/operation/ListVouchers
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request GET \
              --url 'https://api.synerise.com/v4/vouchers/item/list?limit=100&page=4&includeMeta=false' \
              --header 'Accept: SOME_STRING_VALUE' \
              --header 'Api-Version: SOME_STRING_VALUE' \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'Content-Type: SOME_STRING_VALUE'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            headers = {
                'Accept': "SOME_STRING_VALUE",
                'Content-Type': "SOME_STRING_VALUE",
                'Api-Version': "SOME_STRING_VALUE",
                'Authorization': "Bearer REPLACE_BEARER_TOKEN"
                }

            conn.request("GET", "/v4/vouchers/item/list?limit=100&page=4&includeMeta=false", headers=headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = null;

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("GET", "https://api.synerise.com/v4/vouchers/item/list?limit=100&page=4&includeMeta=false");
            xhr.setRequestHeader("Accept", "SOME_STRING_VALUE");
            xhr.setRequestHeader("Content-Type", "SOME_STRING_VALUE");
            xhr.setRequestHeader("Api-Version", "SOME_STRING_VALUE");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "GET",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/v4/vouchers/item/list?limit=100&page=4&includeMeta=false",
              "headers": {
                "Accept": "SOME_STRING_VALUE",
                "Content-Type": "SOME_STRING_VALUE",
                "Api-Version": "SOME_STRING_VALUE",
                "Authorization": "Bearer REPLACE_BEARER_TOKEN"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/v4/vouchers/item/list');
            $request->setMethod(HTTP_METH_GET);

            $request->setQueryData([
              'limit' => '100',
              'page' => '4',
              'includeMeta' => 'false'
            ]);

            $request->setHeaders([
              'Accept' => 'SOME_STRING_VALUE',
              'Content-Type' => 'SOME_STRING_VALUE',
              'Api-Version' => 'SOME_STRING_VALUE',
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN'
            ]);

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.get("https://api.synerise.com/v4/vouchers/item/list?limit=100&page=4&includeMeta=false")
              .header("Accept", "SOME_STRING_VALUE")
              .header("Content-Type", "SOME_STRING_VALUE")
              .header("Api-Version", "SOME_STRING_VALUE")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .asString();
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: Vouchers
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      description: |-
        JWT Bearer token. The header looks like this: `Bearer {JWT}`

        Remember to include the space between 'Bearer' and the token.

        Generate a token via the **Authorization** endpoints.
```
