---
title: "Searches vouchers by parameters"
url: "https://developer.retailexpress.com.au/apis/retail-express-api-21-v2/versions/210b509a-613e-44ac-a87b-ef6c22c23a2c/operations/get-vouchers"
---

> Full API specification: https://developer.retailexpress.com.au/apis/retail-express-api-21-v2/versions/210b509a-613e-44ac-a87b-ef6c22c23a2c.md

# Searches vouchers by parameters

`GET` `/vouchers`

Operation ID: `get-vouchers`

Searches vouchers by parameters

## Query parameters

- `order_by` (string, optional) - Order by. Available field name values: id, code, voucher_type, balance, created_on, expires_on, initial_value Available direction values: asc, desc. Example: id asc, voucher_type desc
- `filter_by` (string, optional) - Filter by. Available field name values: code, voucher_type_id, initial_value, balance, created_on, expires_on, order_id, order_number, customer_id, customer_number, customer_email In string values: '|' and ',' characters have to be escaped with slash, i.e. '\\,' '\\|' For operators that support multiple values (in, notin): multiple values are delimited using '|' character Available operators: eq - Equal neq - Not equals lt - Less lte - Less or equal gt - Greater gte - Greater or equal in - In notin - Not In contains - Contains isnull - Is Null isnullorempty - Is Null Or Empty isnotnull - Is Not Null startswith - Starts with endswith - Ends with doesnotcontain - Does not contain For non-nullable fields operators isnull and isnotnull are unavailable For dates operators: contains, startswith, endswith, doesnotcontain, isnullorempty are unavailable For strings operators: lt, lte, gt, gte are unavailable Example: created_on:gte:2021-06-03T05:48:09+10:00,order_number:in:order_number1|order_number2
- `page_number` (integer, int32, optional)
- `page_size` (integer, int32, optional)

## Header parameters

- `x-api-key` (string, required) - Api subscription key
- `Cache-Control` (string, optional)
- `Authorization` (string, required) - Bearer token for authorization (e.g., Bearer <token>)

## Responses

- `200` - Returns vouchers
- `400` - Bad request
- `401` - Unauthorized
- `403` - Forbidden

## OpenAPI definition

```yaml
openapi: 3.0.1
info:
  title: Retail Express API
  version: v2.1
servers:
  - url: https://api.retailexpress.com.au/v2.1
paths:
  /vouchers:
    get:
      tags:
        - vouchers
      summary: Searches vouchers by parameters
      description: Searches vouchers by parameters
      operationId: get-vouchers
      parameters:
        - name: order_by
          in: query
          description: "Order by. \r

            \r

            Available field name values: id, code, voucher_type, balance,
            created_on, expires_on, initial_value\r

            \r

            Available direction values: asc, desc. \r

            \r

            Example: id asc, voucher_type desc"
          schema:
            type: string
            description: "Order by. \r

              \r

              Available field name values: id, code, voucher_type, balance,
              created_on, expires_on, initial_value\r

              \r

              Available direction values: asc, desc. \r

              \r

              Example: id asc, voucher_type desc"
            nullable: true
        - name: filter_by
          in: query
          description: "Filter by. \r

            \r

            Available field name values: code, voucher_type_id, initial_value,
            balance, created_on, expires_on, order_id, order_number,
            customer_id, customer_number, customer_email\r

            \            \r

            In string values: '|' and ',' characters have to be escaped with
            slash, i.e. '\\\\,' '\\\\|'\r

            \            \r

            For operators that support multiple values (in, notin): multiple
            values are delimited using '|' character\r

            \r

            Available operators:\r

            \r

            eq -  Equal\r

            \r

            neq - Not equals\r

            \r

            lt  - Less\r

            \r

            lte - Less or equal\r

            \r

            gt -  Greater\r

            \r

            gte - Greater or equal\r

            \r

            in  - In\r

            \r

            notin - Not In\r

            \            \r

            contains - Contains\r

            \r

            isnull - Is Null\r

            \            \r

            isnullorempty - Is Null Or Empty\r

            \r

            isnotnull - Is Not Null\r

            \r

            startswith - Starts with\r

            \r

            endswith - Ends with\r

            \r

            doesnotcontain - Does not contain\r

            \            \r

            For non-nullable fields operators isnull and isnotnull are
            unavailable\r

            \r

            For dates operators: contains, startswith, endswith, doesnotcontain,
            isnullorempty are unavailable\r

            \            \r

            For strings operators: lt, lte, gt, gte are unavailable\r

            \            \r

            Example:
            created_on:gte:2021-06-03T05:48:09+10:00,order_number:in:order_numb\
            er1|order_number2"
          schema:
            type: string
            description: "Filter by. \r

              \r

              Available field name values: code, voucher_type_id, initial_value,
              balance, created_on, expires_on, order_id, order_number,
              customer_id, customer_number, customer_email\r

              \            \r

              In string values: '|' and ',' characters have to be escaped with
              slash, i.e. '\\\\,' '\\\\|'\r

              \            \r

              For operators that support multiple values (in, notin): multiple
              values are delimited using '|' character\r

              \r

              Available operators:\r

              \r

              eq -  Equal\r

              \r

              neq - Not equals\r

              \r

              lt  - Less\r

              \r

              lte - Less or equal\r

              \r

              gt -  Greater\r

              \r

              gte - Greater or equal\r

              \r

              in  - In\r

              \r

              notin - Not In\r

              \            \r

              contains - Contains\r

              \r

              isnull - Is Null\r

              \            \r

              isnullorempty - Is Null Or Empty\r

              \r

              isnotnull - Is Not Null\r

              \r

              startswith - Starts with\r

              \r

              endswith - Ends with\r

              \r

              doesnotcontain - Does not contain\r

              \            \r

              For non-nullable fields operators isnull and isnotnull are
              unavailable\r

              \r

              For dates operators: contains, startswith, endswith,
              doesnotcontain, isnullorempty are unavailable\r

              \            \r

              For strings operators: lt, lte, gt, gte are unavailable\r

              \            \r

              Example:
              created_on:gte:2021-06-03T05:48:09+10:00,order_number:in:order_nu\
              mber1|order_number2"
            nullable: true
        - name: page_number
          in: query
          schema:
            maximum: 100000
            minimum: 1
            type: integer
            format: int32
        - name: page_size
          in: query
          schema:
            maximum: 2147483647
            minimum: 1
            type: integer
            format: int32
        - name: x-api-key
          in: header
          description: Api subscription key
          required: true
          schema:
            type: string
        - name: Cache-Control
          in: header
          required: false
          schema:
            type: string
            default: no-cache
        - name: Authorization
          in: header
          required: true
          description: Bearer token for authorization (e.g., Bearer <token>)
          schema:
            type: string
      responses:
        "200":
          description: Returns vouchers
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Voucher.PagingResponse"
              example:
                data:
                  - id: 0
                    code: string
                    type:
                      id: 0
                      name: string
                    initial_value: 0
                    balance: 0
                    created_on: string
                    expires_on: string
                    order:
                      id: 0
                      customer:
                        customer_number: string
                        email: string
                        first_name: string
                        id: 0
                        last_name: string
                        custom_reference: string
                      order_number: string
                      original_order_id: 0
                      created_on: string
                      vouchers:
                        - id: 0
                          code: string
                          type:
                            id: 0
                            name: string
                          initial_value: 0
                          balance: 0
                          created_on: string
                          expires_on: string
                page_number: 0
                page_size: 0
                total_records: 0
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
              example:
                type: string
                title: string
                status: 0
                detail: string
                instance: string
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
              example:
                type: string
                title: string
                status: 0
                detail: string
                instance: string
        "403":
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProblemDetails"
              example:
                type: string
                title: string
                status: 0
                detail: string
                instance: string
security: []
components:
  schemas:
    Voucher.PagingResponse:
      title: ""
      type: object
      properties:
        data:
          type: array
          items:
            $ref: "#/components/schemas/Voucher"
          nullable: true
        page_number:
          type: integer
          format: int32
        page_size:
          type: integer
          format: int32
        total_records:
          type: integer
          format: int32
      additionalProperties: false
    ProblemDetails:
      title: ""
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    Voucher:
      title: ""
      type: object
      properties:
        id:
          type: integer
          description: Voucher Id.
          format: int32
          nullable: true
        code:
          type: string
          description: Voucher code
          nullable: true
        type:
          $ref: "#/components/schemas/VoucherTypeLimited"
        initial_value:
          type: number
          description: Initial value
          format: double
          nullable: true
        balance:
          type: number
          description: Balance
          format: double
          nullable: true
        created_on:
          type: string
          description: Created on
          format: date-time
        expires_on:
          type: string
          description: Modified on
          format: date-time
          nullable: true
        order:
          $ref: "#/components/schemas/OrderLimited"
      additionalProperties: false
    VoucherTypeLimited:
      title: ""
      type: object
      properties:
        id:
          type: integer
          description: Voucher type Id.
          format: int32
          nullable: true
        name:
          type: string
          description: Voucher name
          nullable: true
      additionalProperties: false
    OrderLimited:
      title: ""
      type: object
      properties:
        id:
          type: integer
          description: Order Id.
          format: int32
          nullable: true
        customer:
          $ref: "#/components/schemas/CustomerLimited"
        order_number:
          type: string
          description: The Order identifier in Retail Express.
          nullable: true
        original_order_id:
          type: integer
          description: Original Order Id.
          format: int32
          nullable: true
        created_on:
          type: string
          description: Created on
          format: date-time
        vouchers:
          type: array
          items:
            $ref: "#/components/schemas/OrderVoucher"
          description: Vouchers.
          nullable: true
      additionalProperties: false
    CustomerLimited:
      title: ""
      type: object
      properties:
        customer_number:
          type: string
          description: Customer number
          nullable: true
        email:
          type: string
          description: Email
          nullable: true
        first_name:
          type: string
          description: First name
          nullable: true
        id:
          type: integer
          description: Identifier
          format: int32
        last_name:
          type: string
          description: Last name
          nullable: true
        custom_reference:
          type: string
          description: Custom reference
          nullable: true
      additionalProperties: false
    OrderVoucher:
      title: ""
      type: object
      properties:
        id:
          type: integer
          description: Voucher Id.
          format: int32
          nullable: true
        code:
          type: string
          description: Voucher code
          nullable: true
        type:
          $ref: "#/components/schemas/VoucherVoucherType"
        initial_value:
          type: number
          description: Initial value
          format: double
          nullable: true
        balance:
          type: number
          description: Balance
          format: double
          nullable: true
        created_on:
          type: string
          description: Created on
          format: date-time
        expires_on:
          type: string
          description: Modified on
          format: date-time
          nullable: true
      additionalProperties: false
    VoucherVoucherType:
      title: ""
      type: object
      properties:
        id:
          type: integer
          description: Voucher type Id.
          format: int32
          nullable: true
        name:
          type: string
          description: Voucher type code
          nullable: true
      additionalProperties: false
```
