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

# List coupons



## OpenAPI

````yaml GET /coupons/
openapi: 3.0.3
info:
  title: Piriod API
  version: 1.0.0
  description: >
    Piriod API for billing, payments, procurement and collections.


    All requests require:

    - `Authorization: Token <api_token>` header.

    - `x-simple-workspace: <workspace_id>` header (the account/workspace
    identifier).

    - Optionally `x-piriod-test-mode: true` to operate against test-mode data.


    See the Documentation tab for getting started, integration flows,
    authentication,

    error handling and pagination/filtering guides.
servers:
  - url: https://api.piriod.com
    description: Production
security:
  - TokenAuth: []
paths:
  /coupons/:
    get:
      tags:
        - Billing
      summary: List coupons
      parameters:
        - $ref: '#/components/parameters/WorkspaceHeader'
        - $ref: '#/components/parameters/TestModeHeader'
        - $ref: '#/components/parameters/PageQuery'
        - $ref: '#/components/parameters/PageSizeQuery'
        - $ref: '#/components/parameters/OrderingQuery'
        - name: name
          in: query
          schema:
            type: string
        - name: apply_on
          in: query
          schema:
            type: string
            enum:
              - line
              - invoice
        - name: duration_scheme
          in: query
          schema:
            type: string
            enum:
              - one_time
              - forever
              - limited
        - name: amount
          in: query
          schema:
            type: number
        - name: currency
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Paginated coupon list.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Paginated'
                  - type: object
                    properties:
                      results:
                        type: array
                        items:
                          $ref: '#/components/schemas/Coupon'
components:
  parameters:
    WorkspaceHeader:
      name: x-simple-workspace
      in: header
      required: true
      schema:
        type: string
      description: Workspace (account) identifier. Required for every request.
      example: acc_01H8XYZ123ABC
    TestModeHeader:
      name: x-piriod-test-mode
      in: header
      required: false
      schema:
        type: boolean
        default: false
      description: Whether to operate against test-mode data. Defaults to `false`.
    PageQuery:
      name: page
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        default: 1
      description: Page number to retrieve (1-indexed).
    PageSizeQuery:
      name: page_size
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 20
      description: Number of items per page.
    OrderingQuery:
      name: ordering
      in: query
      required: false
      schema:
        type: string
      description: |
        Field to sort results by. Prefix with `-` for descending order
        (e.g. `-created`).
  schemas:
    Paginated:
      type: object
      required:
        - count
        - results
      properties:
        count:
          type: integer
          description: Total number of items matching the filter.
          example: 142
        next:
          type: string
          format: uri
          nullable: true
          description: URL of the next page, or `null` if last page.
        previous:
          type: string
          format: uri
          nullable: true
          description: URL of the previous page, or `null` if first page.
        results:
          type: array
          items: {}
          description: The items in the current page.
    Coupon:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        name:
          type: string
          maxLength: 56
        amount:
          type: number
        currency:
          type: string
        discount_scheme:
          type: string
          enum:
            - '%'
            - $
          default: '%'
        duration_scheme:
          type: string
          enum:
            - one_time
            - forever
            - limited
          default: one_time
        duration_times:
          type: integer
          nullable: true
          description: Required when `duration_scheme=limited`. Number of billing cycles.
        valid_until:
          type: string
          format: date
          nullable: true
        apply_on:
          type: string
          enum:
            - line
            - invoice
          default: invoice
        status:
          type: string
          enum:
            - active
            - archived
          default: active
        archived:
          type: string
          format: date-time
          nullable: true
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
        updated:
          type: string
          format: date-time
          readOnly: true
      required:
        - name
        - amount
        - currency
  securitySchemes:
    TokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: |
        Use header `Authorization: Token <api_token>`.
        API tokens are obtained from the Piriod dashboard.

````