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

# List Promotion Codes

> Lists promotion codes for your configuration, optionally filtered by coupon, active status, and/or code (exact-match lookup by code).



## OpenAPI

````yaml /openapi.json get /promotion-codes
openapi: 3.1.0
info:
  title: OpenLoop API
  version: 0.1.0
  description: >-
    Unified reference for the OpenLoop Patient (clinical) and Payments & Revenue
    APIs.
servers:
  - url: https://api.openloophealth.com/v0.1
    description: Production partner edge
  - url: https://api-staging.openloophealth.com/v0.1
    description: Staging partner edge (sandbox credentials)
security: []
paths:
  /promotion-codes:
    get:
      tags:
        - Promotion Codes
      summary: List Promotion Codes
      description: >-
        Lists promotion codes for your configuration, optionally filtered by
        coupon, active status, and/or code (exact-match lookup by code).
      parameters:
        - in: query
          name: provider_coupon_id
          required: false
          schema:
            type: string
          description: >-
            Filter to promotion codes for a single coupon (provider coupon id).
            Omit to list all for the config.
          example: 20OFF
        - in: query
          name: active
          required: false
          schema:
            type: boolean
          description: Filter by active status (`true` / `false`).
          example: 'true'
        - in: query
          name: code
          required: false
          schema:
            type: string
          description: >-
            Exact-match lookup by the promotion code value. Each returned item
            embeds the full `coupon` it belongs to. Combinable with
            `provider_coupon_id` / `active`.
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      promotion_codes:
                        type: array
                        items:
                          $ref: '#/components/schemas/PromotionCodeWithCoupon'
                        description: >-
                          Array of promotion codes; each has `code`, `active`,
                          `provider_promotion_code_id`, and the embedded
                          `coupon` it belongs to (incl. `duration` /
                          `duration_in_months`). Not paginated — provider
                          results are auto-paged into the full array.
                required:
                  - data
              example:
                data:
                  promotion_codes:
                    - code: SUMMER20
                      active: true
                      provider_promotion_code_id: test_promotion_code_id_2
                      coupon:
                        id: 20OFF
                        name: 20% Off
                        amount_off: null
                        currency: USD
                        percent_off: 20
                        applies_to_products:
                          - test_product_id
                        duration: repeating
                        duration_in_months: 3
        '401':
          description: Missing or invalid bearer token.
        '403':
          description: >-
            No configuration exists for your account, or provider access has
            been disabled for it.
        '500':
          description: Payment provider integration error.
      security:
        - serviceToken: []
        - userToken: []
components:
  schemas:
    PromotionCodeWithCoupon:
      type: object
      properties:
        code:
          type: string
          description: Promotion code value.
        active:
          type: boolean
          description: Active status.
        provider_promotion_code_id:
          type: string
          description: Provider promotion code id (the payment provider `promo_...`).
        coupon:
          $ref: '#/components/schemas/Coupon'
          description: The embedded coupon this promotion code belongs to.
    Coupon:
      type: object
      properties:
        provider_coupon_id:
          type: string
          description: Provider coupon ID.
        name:
          type: string
          description: Coupon name.
        amount_off:
          type:
            - number
            - 'null'
          description: Fixed discount amount or null if percent-based.
        currency:
          type: string
          description: Currency code (e.g. `"USD"`).
        percent_off:
          type:
            - number
            - 'null'
          description: Percentage discount or null if amount-based.
        applies_to_products:
          type: array
          items:
            type: string
          description: Provider (the payment provider) product ids this coupon applies to.
        duration:
          type: string
          description: >-
            How long the discount applies: `"forever"`, `"once"`, or
            `"repeating"`.
        duration_in_months:
          type:
            - number
            - 'null'
          description: >-
            Number of months the discount applies when `duration` is
            `"repeating"`; `null` otherwise.
        max_redemptions:
          type:
            - number
            - 'null'
          description: Max total redemptions (`null` if unset).
        metadata:
          type: object
          additionalProperties:
            type: string
          description: String key/value pairs (`{}` if none).
  securitySchemes:
    serviceToken:
      type: oauth2
      description: >-
        Service (M2M) access token issued by POST /auth/token using the
        client_credentials grant. Required scopes, where known, are listed on
        each operation below.
      flows:
        clientCredentials:
          tokenUrl: https://api.openloophealth.com/v0.1/auth/token
          scopes: {}
    userToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        User access token issued by POST /auth/token via the verification-code
        grant (after Verify a one-time code) or the refresh_token grant.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.