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

# Get a list of vouchers

> This endpoint allows you to get a paginated list of vouchers. It is possible to set query parameters to filter the results.

A Voucher belongs to a Voucher Group and is uniquely identified by a code.
It can be linked to multiple tokens (idtags) and appUsers.

When a driver starts a session at a location, the system checks:

If the driver’s token is linked to a voucher, or

If the driver’s appUser (linked to that token) is linked to a voucher.

If either is true and the voucher’s group is associated with the location, the voucher is applied — potentially affecting pricing or granting access.



## OpenAPI

````yaml /openapi/integration-api-v2/openapi.yaml get /v2/vouchers
openapi: 3.0.0
info:
  title: Spirii API
  description: Spirii API
  version: 2.10.0
  contact: {}
servers:
  - url: https://api.spirii.com
security: []
tags: []
paths:
  /v2/vouchers:
    get:
      tags:
        - Vouchers
      summary: Get a list of vouchers
      description: >-
        This endpoint allows you to get a paginated list of vouchers. It is
        possible to set query parameters to filter the results.


        A Voucher belongs to a Voucher Group and is uniquely identified by a
        code.

        It can be linked to multiple tokens (idtags) and appUsers.


        When a driver starts a session at a location, the system checks:


        If the driver’s token is linked to a voucher, or


        If the driver’s appUser (linked to that token) is linked to a voucher.


        If either is true and the voucher’s group is associated with the
        location, the voucher is applied — potentially affecting pricing or
        granting access.
      operationId: findAll
      parameters:
        - name: createdAt
          required: false
          in: query
          description: Creation date.
          schema:
            type: string
            format: date-time
        - name: createdAtFrom
          required: false
          in: query
          description: >-
            Start date for filtering by creation date. When set, filter
            `sort_by` defaults to `createdAt`.
          schema:
            type: string
            format: date-time
        - name: createdAtTo
          required: false
          in: query
          description: >-
            End date for filtering by creation date. When set, filter `sort_by`
            defaults to `createdAt`.
          schema:
            type: string
            format: date-time
        - name: updatedAt
          required: false
          in: query
          description: Last update date.
          schema:
            type: string
            format: date-time
        - name: updatedAtFrom
          required: false
          in: query
          description: >-
            Start date for filtering by last update date. When set, filter
            `sort_by` defaults to `updatedAt`.
          schema:
            type: string
            format: date-time
        - name: updatedAtTo
          required: false
          in: query
          description: >-
            End date for filtering by last update date. When set, filter
            `sort_by` defaults to `updatedAt`.
          schema:
            type: string
            format: date-time
        - name: limit
          required: false
          in: query
          description: Filter the total amount of items returned.
          schema:
            minimum: 1
            default: 50
            type: integer
        - name: after
          required: false
          in: query
          description: The cursor to start fetching records after (forward pagination).
          schema:
            example: My0xMDAw
            type: string
        - name: before
          required: false
          in: query
          description: The cursor to start fetching records before (backward pagination).
          schema:
            example: Ny0xMDAw
            type: string
        - name: sort_by
          required: false
          in: query
          description: >-
            Which property to sort by. When used with `createdAt*` default is
            `createdAt`. When used with `updatedAt*` default is `updatedAt`.
          schema:
            default: id
            enum:
              - id
              - name
              - createdAt
              - updatedAt
            type: string
        - name: sort_direction
          required: false
          in: query
          description: Sort direction. Defaults to `asc`.
          schema:
            default: asc
            enum:
              - desc
              - asc
            type: string
        - name: search
          required: false
          in: query
          description: Search across item names and IDs.
          schema:
            type: string
      responses:
        '200':
          description: The returned list of vouchers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoucherListResponseDto'
components:
  schemas:
    VoucherListResponseDto:
      type: object
      properties:
        data:
          description: A list of Vouchers.
          type: array
          items:
            $ref: '#/components/schemas/VoucherResponseDto'
        pagination:
          $ref: '#/components/schemas/PaginationResponseDto'
      required:
        - data
        - pagination
    VoucherResponseDto:
      type: object
      properties:
        id:
          type: number
          format: integer
          description: Used to identify the voucher throughout the Spirii system.
          example: 67890
        code:
          type: string
          format: string
          description: Unique code used to redeem the voucher.
          example: TT-67890
        voucherGroupId:
          type: number
          format: integer
          description: Id belonging to a voucher group this voucher is associated with.
          example: 67890
        maxUsers:
          type: number
          nullable: true
          maximum: 65535
          format: integer
          description: Maximum number of users allowed to redeem this voucher.
          example: 100
        expiresAt:
          format: date-time
          type: string
          nullable: true
          description: Date after which the voucher is unusable.
          example: '2025-06-03T12:00:00.000Z'
        createdAt:
          format: date-time
          type: string
          description: The date and time when the voucher was created.
          example: '2025-06-03T12:00:00.000Z'
        updatedAt:
          format: date-time
          type: string
          description: The date and time when the voucher was last updated.
          example: '2025-06-03T12:00:00.000Z'
        deletedAt:
          format: date-time
          type: string
          nullable: true
          description: The date and time when the voucher was deleted.
          example: '2025-06-03T12:00:00.000Z'
      required:
        - id
        - code
        - voucherGroupId
        - maxUsers
        - expiresAt
        - createdAt
        - updatedAt
        - deletedAt
    PaginationResponseDto:
      type: object
      properties:
        endCursor:
          type: string
          nullable: true
          description: Cursor for the end of the current page.
        previousEndCursor:
          type: string
          nullable: true
          description: Cursor for the end of the previous page.
        hasNext:
          type: boolean
          description: Indicates if there are more records to fetch.
        hasPrevious:
          type: boolean
          description: Indicates if there are previous records to fetch.
        count:
          type: number
          description: Total number of records.
          example: 10
      required:
        - endCursor
        - hasNext
        - hasPrevious
        - count

````