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

# Fetch All Coupon Lists

> This API fetches all created coupon lists in a specific workspace. By default, this API returns the coupon lists marked with an *ACTIVE* status. In return, it offers detailed specifications of the active coupon lists, respective configurations, statuses, expiry dates, and alert conditions, including on-time data on the total coupons added and those that are currently available.


<Note>
  **Information**

  There is no request body or content to send for this request except for the headers and parameters.
</Note>

#### Rate Limit

You can fetch 10,000 coupon lists per day.


## OpenAPI

````yaml /api/coupons/coupons.yaml get /coupon-list
openapi: 3.0.3
info:
  title: Coupon List API 🏷️
  description: >
    API for managing coupon lists within the MoEngage system. This includes
    creating, fetching, updating, activating, archiving lists, uploading coupon
    files, managing files, and generating usage reports.

    Authentication is via Basic Auth using your **Workspace ID** as username and
    an **API Key** as password.
  version: '1.0'
servers:
  - url: https://api-{dc}.moengage.com/v1
    description: >-
      The MoEngage Coupon Management API endpoint. The **X** in the URL is
      replaced by the data center number (e.g., 01, 02, 03).
    variables:
      dc:
        default: '01'
        description: >-
          The ‘dc’ in the API Endpoint URL refers to the MoEngage Data Center
          (DC). MoEngage hosts each customer in a different DC. You can find
          your DC number and replace the value of ‘dc’ in the URL by referring
          to the DC and API endpoint mapping
          [here](/api/introduction#data-centers). Your MoEngage Data Center (DC)
          can be 01, 02, 03, 04, 05, 06, or 101.
security:
  - basicAuth: []
tags:
  - name: Coupon Lists
    description: >-
      Operations related to defining, managing status (active/archive), and
      modifying coupon list metadata.
  - name: Coupon Files
    description: >-
      Operations related to uploading coupon codes via files and
      checking/managing file processing status.
  - name: Reports
    description: Operations related to generating usage reports for coupon lists.
paths:
  /coupon-list:
    get:
      tags:
        - Coupon Lists
      summary: Fetch All Coupon Lists
      description: >
        This API fetches all created coupon lists in a specific workspace. By
        default, this API returns the coupon lists marked with an *ACTIVE*
        status. In return, it offers detailed specifications of the active
        coupon lists, respective configurations, statuses, expiry dates, and
        alert conditions, including on-time data on the total coupons added and
        those that are currently available.
      operationId: fetchAllCouponLists
      parameters:
        - $ref: '#/components/parameters/AppKeyHeader'
        - name: status
          in: query
          required: false
          description: >
            This field contains an array of all the coupons with their
            respective attributes based on the following statuses you provide in
            the request parameter:


            * ACTIVE - to view only active coupon lists

            * ARCHIVED - to view only archived coupon lists

            * EXPIRED - to view only expired coupon lists


            **Note**: Not specifying any status will display all the existing
            coupon lists together.
          schema:
            type: string
            enum:
              - ACTIVE
              - ARCHIVED
              - EXPIRED
      responses:
        '200':
          description: >
            Success

            Indicates that the request is successful and all the active and/or
            archived coupon lists are fetched.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: >-
                            This field consists of the unique name of the coupon
                            list.
                        label:
                          type: string
                          description: >-
                            This field consists of the label name for the
                            fetched coupon list.
                        expires_at:
                          type: string
                          description: >-
                            This field consists of the expiry date of the coupon
                            list in yyyy-mm-dd format.
                        status:
                          type: string
                          description: >
                            This field shows one of the following statuses of
                            the fetched coupon list:

                            * ACTIVE

                            * EXPIRED

                            * ARCHIVED
                        total_coupons:
                          type: integer
                          description: >-
                            This field consists of the total number of coupons
                            in the coupon list.
                        created_at:
                          type: string
                          description: >-
                            This field consists of the date and time the coupon
                            list was created.
                        updated_at:
                          type: string
                          description: >-
                            This field consists of the date and time of the most
                            recent update to the coupon list.
                        email_alert_subscribers:
                          type: string
                          description: >-
                            This field consists of the email address of the
                            coupon list subscriber.
                        alert_conditions:
                          type: object
                          description: >-
                            This field consists of the alert conditions and
                            their statuses specified while creating the coupon
                            list.
                        available_coupons:
                          type: integer
                          description: >-
                            This field consists of the available number of
                            coupons in coupon list.
                        personalization_snippet:
                          type: string
                          description: >-
                            This field consists of the personalization snippet
                            of the coupon list.
                        created_by:
                          type: string
                          description: >-
                            This field consists of the user name who created the
                            fetched coupon list.
                        _id:
                          type: string
                          description: >-
                            This field contains the unique ID corresponding to a
                            successful coupon list fetch request. This ID is
                            also used to update and archive coupon lists.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: bad-request
                  message: >-
                    Possible issues include duplicates, such as coupon list
                    names, invalid data types, or missing mandatory attributes.
        '401':
          description: Unauthenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: request-unauthenticated
                  message: >-
                    Your request is unauthorized. Verify your credentials and
                    try again.
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: request-forbidden
                  message: >-
                    Your account does not have access to the Coupon Management
                    features. Contact the MoEngage team for further assistance.
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: unexpected-error
                  message: >-
                    Something went wrong with your request. Please contact the
                    MoEngage team for further assistance.
components:
  parameters:
    AppKeyHeader:
      name: MOE-APPKEY
      in: header
      required: true
      description: >
        This is the Workspace ID of your MoEngage account that must be passed
        with the request. You can find it in the MoEngage dashboard at
        **Settings** > **Account** > **APIs** > **Workspace ID (earlier app
        id)**.
      schema:
        type: string
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Error'
    Error:
      type: object
      properties:
        code:
          type: string
          description: >-
            Each error codes are unique and serve as a shorthand representation
            for the type of error, providing a quick reference that can be used
            to diagnose, troubleshoot, and address the problem based on a
            predefined set of error conditions.
        message:
          type: string
          description: >-
            Along with the error code, a detailed message is also provided in
            the response, describing the specifics of the request failure and
            the nature of the error.
  responses:
    TooManyRequests:
      description: >
        The following headers are returned in case of rate-limit breach:

        * `x-ratelimit-limit` (integer) - The maximum number of requests that
        the consumer is permitted to make in a given time window.

        * `x-ratelimit-remaining` (integer) - The number of requests remaining
        in the current rate limit window.

        * `x-ratelimit-reset` (integer) - The time at which the current rate
        limit window resets in UTC epoch seconds.
      headers:
        x-ratelimit-limit:
          schema:
            type: integer
          description: >-
            The maximum number of requests that the consumer is permitted to
            make in a given time window.
        x-ratelimit-remaining:
          schema:
            type: integer
          description: The number of requests remaining in the current rate limit window.
        x-ratelimit-reset:
          schema:
            type: integer
          description: >-
            The time at which the current rate limit window resets in UTC epoch
            seconds.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >
        Authentication is done via Basic Auth. This requires a base64-encoded
        string of your credentials in the format 'username:password'.


        - **Username**: Use your MoEngage workspace ID (also known as the App
        ID). You can find it in the MoEngage dashboard at **Settings** >
        **Account** > **APIs** > **Workspace ID (earlier app id)**.

        - **Password**: Use your API Key, which you can find within the
        **Campaign report/Business events/Custom templates/Catalog API/Inform
        Report** tile.


        For more information on authentication and getting your credentials,
        refer
        [here](https://www.moengage.com/docs/api/introduction#getting-your-credentials).

````