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

# List Coupons

> Returns a list of your coupons. Optionally filter by `name`.



## OpenAPI

````yaml /openapi.json get /v1/coupons
openapi: 3.1.0
info:
  title: Flex API
  description: >-
    The Flex API powers HSA/FSA payment processing for healthcare commerce:
    checkout sessions, payment intents, subscriptions, customers, refunds,
    disputes, and eligibility. Authenticate with your partner API key as a
    Bearer token. All endpoints are scoped to your partner account, and test
    mode is fully supported via test API keys.
  version: 0.1.0
servers:
  - url: https://api.withflex.com
security:
  - BearerAuth: []
tags:
  - name: Balance Transactions
  - name: Captures
  - name: Checkout Sessions
  - name: Coupons
  - name: Customers
  - name: Disputes
  - name: Events
  - name: Exports
  - name: Files
  - name: Invoices
  - name: Letters
  - name: Orders
  - name: Payment Intents
  - name: Payment Links
  - name: Payouts
  - name: Prices
  - name: Products
  - name: Promo Codes
  - name: Receipts
  - name: Refunds
  - name: Setup Intents
  - name: Shipping Rates
  - name: Subscriptions
paths:
  /v1/coupons:
    get:
      tags:
        - Coupons
      summary: List Coupons
      description: Returns a list of your coupons. Optionally filter by `name`.
      operationId: v1.coupons.list
      parameters:
        - in: query
          name: name
          description: Filter coupons by name.
          schema:
            description: Filter coupons by name.
            examples:
              - Example
            type:
              - string
              - 'null'
          style: form
          example: Example
      responses:
        '200':
          description: An envelope wrapping a list of coupon objects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MultipleCouponsBody_for_V1Coupon'
              example:
                coupons:
                  - coupon_id: fcoup_1234567890
                    amount_off: 2500
                    duration: once
                    metadata:
                      order_id: '8842'
                      channel: shopify
                    name: Example
                    valid: false
                    created_at: '2026-06-15T14:30:00Z'
                    test_mode: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
              example:
                detail:
                  - loc:
                      - string
                    msg: string
                    type: string
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
      security:
        - BearerAuth:
            - coupons:read
components:
  schemas:
    MultipleCouponsBody_for_V1Coupon:
      description: An envelope wrapping a list of coupon objects.
      type: object
      required:
        - coupons
      properties:
        coupons:
          description: The list of coupons.
          type: array
          items:
            $ref: '#/components/schemas/V1Coupon'
      example:
        coupons:
          - coupon_id: fcoup_1234567890
            amount_off: 2500
            duration: once
            metadata:
              order_id: '8842'
              channel: shopify
            name: Example
            valid: false
            created_at: '2026-06-15T14:30:00Z'
            test_mode: false
    HttpErrorOut:
      title: HttpError
      description: The error response returned when a request cannot be completed.
      type: object
      required:
        - code
        - detail
      properties:
        code:
          description: A short machine-readable error code identifying the type of error.
          type: string
        detail:
          description: A human-readable explanation of what went wrong.
          type: string
      example:
        code: string
        detail: string
    HTTPValidationError:
      description: The error response returned when request validation fails (HTTP 422).
      type: object
      required:
        - detail
      properties:
        detail:
          description: The list of validation errors, one entry per invalid field.
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
      example:
        detail:
          - loc:
              - string
            msg: string
            type: string
    V1Coupon:
      description: >-
        A coupon contains information about a percent-off or amount-off discount
        you might want to apply to a customer. Coupons may be applied to
        subscriptions and checkout sessions.
      type: object
      required:
        - coupon_id
        - created_at
        - duration
        - name
        - test_mode
        - valid
      properties:
        coupon_id:
          description: Unique identifier for the object.
          type: string
          example: fcoup_1234567890
        amount_off:
          description: >-
            Amount that will be taken off the subtotal of any invoices for this
            customer.
          type:
            - integer
            - 'null'
          format: int32
          example: 2500
        applies_to:
          description: >-
            An object containing the ID of the product that the coupon can be
            applied to.
          anyOf:
            - $ref: '#/components/schemas/AppliesTo'
            - type: 'null'
        duration:
          $ref: '#/components/schemas/CouponDuration'
          description: >-
            One of forever, once, and repeating. Describes how long a customer
            who applies this coupon will get the discount.
        duration_in_months:
          description: >-
            If duration is repeating, the number of months the coupon applies.
            Null if coupon duration is forever or once.
          type:
            - integer
            - 'null'
          format: int32
        metadata:
          description: >-
            Set of key-value pairs that you can attach to an object. This can be
            useful for storing additional information about the object in a
            structured format.
          type:
            - object
            - 'null'
          example:
            order_id: '8842'
            channel: shopify
        name:
          description: Name of the coupon displayed to customers.
          type: string
          example: Example
        percent_off:
          description: >-
            Percent that will be taken off the subtotal of any invoices for this
            customer for the duration of the coupon.
          type:
            - number
            - 'null'
          format: double
        max_redemptions:
          description: >-
            Maximum number of times this coupon can be redeemed, in total,
            across all customers, before it is no longer valid.
          type:
            - integer
            - 'null'
          format: int32
        times_redeemed:
          description: Number of times this coupon has been applied to a customer.
          type:
            - integer
            - 'null'
          format: int32
        valid:
          description: >-
            Taking account of the above properties, whether this coupon can
            still be applied to a customer.
          type: boolean
          example: false
        created_at:
          $ref: '#/components/schemas/Timestamptz'
          description: Date when this coupon was created.
          example: '2026-06-15T14:30:00Z'
        test_mode:
          description: Whether the coupon is in test mode
          type: boolean
          example: false
      example:
        coupon_id: fcoup_1234567890
        amount_off: 2500
        applies_to:
          products: []
        duration: once
        metadata:
          order_id: '8842'
          channel: shopify
        name: Example
        valid: false
        created_at: '2026-06-15T14:30:00Z'
        test_mode: false
    ValidationErrorItem:
      description: >-
        Validation errors have their own schema to provide context for invalid
        requests eg. mismatched types and out of bounds values. There may be any
        number of these per 422 UNPROCESSABLE ENTITY error.
      type: object
      required:
        - loc
        - msg
        - type
      properties:
        loc:
          description: >-
            The location as a [`Vec`] of [`String`]s -- often in the form
            `["body", "field_name"]`, `["query", "field_name"]`, etc. They may,
            however, be arbitarily deep.
          type: array
          items:
            type: string
        msg:
          description: The message accompanying the validation error item.
          type: string
        type:
          description: >-
            The type of error, often "type_error" or "value_error", but
            sometimes with more context like as "value_error.number.not_ge"
          type: string
      example:
        loc:
          - string
        msg: string
        type: string
    AppliesTo:
      description: What a coupon's discount is restricted to.
      anyOf:
        - type: object
          required:
            - products
          properties:
            products:
              description: The product that this coupon applies to.
              type: array
              items:
                type: string
                example: fprod_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        - type: object
          required:
            - prices
          properties:
            prices:
              description: The price that this coupon applies to.
              type: array
              items:
                type: string
                example: fprice_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        - type: object
          required:
            - fee_types
          properties:
            fee_types:
              description: The fee types that this coupon applies to.
              type: array
              items:
                $ref: '#/components/schemas/FeeType'
        - $ref: '#/components/schemas/AppliesToShipping'
      example:
        products:
          - fprod_01J9XR8M3K7VZ8N2YB4WJ6T0RA
    CouponDuration:
      type: string
      enum:
        - once
        - repeating
        - forever
      x-ms-enum:
        name: CouponDuration
        modelAsString: false
        values:
          - value: once
            name: Once
            description: >-
              Applies to the first charge from a subscription with this coupon
              applied.
          - value: repeating
            name: Repeating
            description: >-
              Applies to charges in the first duration_in_months months from a
              subscription with this coupon applied.
          - value: forever
            name: Forever
            description: >-
              Applies to all charges from a subscription with this coupon
              applied.
      description: >-
        - `once`: Applies to the first charge from a subscription with this
        coupon applied.

        - `repeating`: Applies to charges in the first duration_in_months months
        from a subscription with this coupon applied.

        - `forever`: Applies to all charges from a subscription with this coupon
        applied.
      example: once
    Timestamptz:
      description: >-
        A timestamp encoded as an RFC 3339 / ISO 8601 string (e.g.
        `2026-06-15T14:30:00Z`).
      type: string
      example: string
    FeeType:
      description: >-
        The kind of fee applied to a checkout session: a Letter of Medical
        Necessity consultation fee, or a custom fee you define.
      type: string
      enum:
        - lmn_consultation
        - custom
      example: lmn_consultation
    AppliesToShipping:
      description: The coupon applies to shipping.
      type: string
      enum:
        - shipping
      example: shipping
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Use a Bearer token to access this API.

````