> ## 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 Promo Code

> Retrieves a specific promo code.

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

<ResponseExample>
  ```json Get Promo Code theme={"system"}
  {
      "name": "swx1",
      "active": true,
      "maxRedemptions": 250,
      "createdAt": "2025-01-22T15:58:24.116Z",
      "updatedAt": "2025-01-25T08:44:26.668Z",
      "redemptions": 100,
  }
  ```

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

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

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

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

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


## OpenAPI

````yaml openapi-coupons.json get /coupons/coupon/{couponName}/promo-code/{promoCodeName}
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}/promo-code/{promoCodeName}:
    parameters:
      - in: path
        name: couponName
        required: true
        schema:
          type: string
          example: summer26
        description: Coupon name.
      - in: path
        name: promoCodeName
        required: true
        schema:
          type: string
          example: swx1
        description: Promo code name.
    get:
      tags:
        - Promo Codes
      description: Retrieves a specific promo code.
      responses:
        '200':
          description: Promo code retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PromoCodeResponse'
        '400':
          description: Bad request. Invalid input or validation failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalidCouponName:
                  summary: Invalid coupon name
                  value:
                    error: Invalid coupon name. Use only English letters and numbers.
                invalidPromoCodeName:
                  summary: Invalid promo code name
                  value:
                    error: >-
                      Invalid promo code name. Use only English letters and
                      numbers.
        '404':
          description: Promo code or coupon not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                couponNotFound:
                  summary: Coupon not found
                  value:
                    error: Coupon not found.
                promoCodeNotFound:
                  summary: Promo code not found
                  value:
                    error: Promo code 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:
    PromoCodeResponse:
      $ref: '#/components/schemas/PromoCode'
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error message describing what went wrong.
    PromoCode:
      type: object
      properties:
        name:
          type: string
          description: Promo code name.
          example: swx1
        active:
          type: boolean
          description: Whether the promo code is active.
          example: true
        maxRedemptions:
          type: integer
          description: Maximum number of times this promo code can be redeemed.
          example: 50
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the promo code was created.
          example: '2025-01-22T15:58:24.116Z'
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the promo code was last updated.
          example: '2025-01-25T08:44:26.668Z'
        redemptions:
          type: integer
          description: Number of times this promo code has been redeemed.
          example: 10
  securitySchemes:
    PublisherTokenAuth:
      type: apiKey
      in: header
      name: x-publisher-token
      description: Publisher token, as displayed in the Publisher Dashboard.

````