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

# Get Coupon By Name

> Retrieves a specific coupon by name.

<RequestExample>
  ```bash Get Coupon By Name theme={"system"}
  curl -X GET \
    'https://api.appcharge.com/coupons/coupon/summer26' \
    -H 'x-publisher-token: <x-publisher-token>'
  ```
</RequestExample>

<ResponseExample>
  ```json Get Coupon By Name theme={"system"}
  {
      "name": "summer26",
      "active": true,
      "discountPercentage": 10,
      "maxRedemptionsPerCustomer": 2,
      "expiredBy": "2025-04-02T06:54:51.670Z",
      "startsAt": "2025-02-02T06:54:51.670Z",
      "supportedOfferExternalIds": ["bundle1", "rollingoffer3"],
      "firstTimePurchase": false,
      "allowedPlayers": ["player123", "player456", "player789"]
  }
  ```

  ```json 400 theme={"system"}
  {
      "error": "Invalid coupon name. Use only English letters and numbers."
  }
  ```

  ```json 404 theme={"system"}
  {
      "error": "Coupon not found."
  }
  ```

  ```json 500 theme={"system"}
  {
      "error": "Unexpected error. Please contact support."
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi-coupons.json get /coupons/coupon/{couponName}
openapi: 3.0.3
info:
  title: Coupons API
  version: 1.0.0
servers:
  - url: https://api.appcharge.com
security:
  - PublisherTokenAuth: []
tags:
  - name: Coupons
  - name: Promo Codes
paths:
  /coupons/coupon/{couponName}:
    parameters:
      - in: path
        name: couponName
        required: true
        schema:
          type: string
          example: summer26
        description: Coupon name.
    get:
      tags:
        - Coupons
      description: Retrieves a specific coupon by name.
      responses:
        '200':
          description: Coupon retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CouponResponse'
        '400':
          description: Invalid coupon name.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                couponNotFound:
                  summary: Invalid coupon name.
                  value:
                    error: Invalid coupon name. Use only English letters and numbers.
        '404':
          description: Coupon not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                couponNotFound:
                  summary: Coupon not found.
                  value:
                    error: Coupon not found.
        '500':
          description: Unexpected error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                unexpectedError:
                  summary: Unexpected error.
                  value:
                    error: Unexpected error. Please contact support.
components:
  schemas:
    CouponResponse:
      $ref: '#/components/schemas/Coupon'
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message describing what went wrong.
    Coupon:
      type: object
      properties:
        name:
          type: string
          description: Coupon name.
          example: summer26
        active:
          type: boolean
          description: Whether the coupon is active.
          example: true
        discountPercentage:
          type: number
          description: Discount percentage applied by the coupon.
          example: 1
        maxRedemptionsPerCustomer:
          type: integer
          description: Maximum number of times a customer can redeem this coupon.
          example: 2
        expiredBy:
          type: string
          format: date-time
          description: Expiration date of the coupon.
          example: '2025-04-02T06:54:51.670Z'
        startsAt:
          type: string
          format: date-time
          description: Start date of the coupon validity.
          example: '2025-02-02T06:54:51.670Z'
        supportedOfferExternalIds:
          type: array
          items:
            type: string
          description: >-
            List of offer external IDs that support this coupon. Empty array
            means all offers are supported.
          example:
            - bundle1
            - rollingoffer3
        firstTimePurchase:
          type: boolean
          description: Whether the coupon is only valid for first-time purchases.
          example: false
        allowedPlayers:
          type: array
          items:
            type: string
          description: >-
            List of player IDs allowed to use this coupon. Empty array means all
            players are allowed.
          example:
            - player123
            - player456
            - player789
  securitySchemes:
    PublisherTokenAuth:
      type: apiKey
      in: header
      name: x-publisher-token
      description: Publisher token, as displayed in the Publisher Dashboard.

````