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

# Retrieve a discount

> Fetches a single discount by ID.

<Info>Click the base URL in the API playground and select the **Sandbox** host for test data or the **Production** host for live data. Use credentials from the same environment.</Info>


## OpenAPI

````yaml /api-reference/openapi.json get /discount/{pk}/
openapi: 3.0.0
info:
  title: kelviq API
  version: 1.0.0
  description: >-
    API for interacting with kelviq services, derived from Python SDK
    documentation.
servers:
  - url: https://sandboxapi.kelviq.com/api/v1
    description: Sandbox — Test payments
  - url: https://api.kelviq.com/api/v1
    description: Production — Live payments
security:
  - bearerAuth: []
tags:
  - name: Products
    description: Catalog products.
  - name: Product Settings
    description: Per-product settings (currency, VPN/Tor/proxy, product URL).
  - name: Product Files
    description: Product images and downloadable assets.
  - name: Features
    description: Catalog features that can be granted as plan entitlements.
  - name: Plans
    description: Catalog plans (CRUD, publish, versions, prices).
  - name: Plan Entitlements
    description: Feature entitlements attached to a plan.
  - name: Plan Files
    description: Files attached to plans, and signed download links.
  - name: Media
    description: Generate presigned S3 upload URLs for product/plan images and files.
  - name: Partner
    description: Partner integration APIs (organization provisioning, lookup).
  - name: Charges
    description: >-
      One-time payments charged immediately against a customer's default payment
      method.
  - name: Refunds
    description: Full and partial refunds for paid orders.
  - name: Transactions
    description: >-
      Charges, refunds, disputes, and other financial movements for the
      authenticated organization.
  - name: Payment Methods
    description: Saved customer payment methods (cards, etc.).
  - name: Orders
    description: Completed and resolved orders for the authenticated organization.
  - name: Order Events
    description: Timeline events for a specific order.
  - name: Invoices
    description: Invoices generated for orders and subscription billing cycles.
  - name: Discounts
    description: >-
      Discount codes (coupons) that can be applied to products and plans at
      checkout.
  - name: Webhook Endpoints
    description: >-
      Configure the destination URLs and event subscriptions that receive
      webhook deliveries.
  - name: Webhooks
    description: Delivery logs for webhook events sent to your configured endpoints.
  - name: Checkout Sessions
    description: Merchant-side view of checkout sessions created by customers.
  - name: Checkout Session Events
    description: Timeline events for a specific checkout session.
paths:
  /discount/{pk}/:
    parameters:
      - name: pk
        in: path
        required: true
        description: Discount UUID.
        example: b3f1a2c4-5d6e-4f7a-8b9c-0d1e2f3a4b5c
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Discounts
      summary: Retrieve a discount
      description: Fetches a single discount by ID.
      operationId: retrieveDiscount
      responses:
        '200':
          description: Discount details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discount'
        '401':
          description: Unauthorized — missing or invalid API key.
        '404':
          description: Discount not found.
components:
  schemas:
    Discount:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: b3f1a2c4-5d6e-4f7a-8b9c-0d1e2f3a4b5c
        discountType:
          type: string
          enum:
            - PERCENTAGE
            - FIXED_AMOUNT
          description: >-
            PERCENTAGE discounts a percentage off the price. FIXED_AMOUNT
            discounts a flat amount off the total.
        amountOff:
          type: string
          nullable: true
          description: >-
            Amount to discount, in currency units (e.g. "10.00"). Set when
            `discountType` is FIXED_AMOUNT.
          example: '10.00'
        percentageOff:
          type: integer
          nullable: true
          description: Percentage to discount. Set when `discountType` is PERCENTAGE.
          example: 20
        currency:
          type: string
          nullable: true
          description: >-
            3-letter ISO currency code. Required when `discountType` is
            FIXED_AMOUNT.
          example: usd
        currencySymbol:
          type: string
          example: $
        name:
          type: string
          description: Displayed on the customer's invoice.
          example: Summer Sale
        code:
          type: string
          description: Checkout discount code. Uppercase letters and numbers only.
          example: SUMMER20
        duration:
          type: string
          enum:
            - ONCE
            - REPEATING
            - FOREVER
          description: How many billing cycles the discount applies for.
        durationInMonths:
          type: integer
          nullable: true
          description: >-
            Number of billing periods the discount applies for. Despite the
            field name, this counts billing cycles, not calendar months — e.g. 3
            on a yearly plan means 3 years. Set when `duration` is REPEATING.
        redeemBy:
          type: string
          format: date-time
          nullable: true
          description: UTC time after which this discount can no longer be redeemed.
        maxRedemptions:
          type: integer
          nullable: true
          description: >-
            Total number of times this code can be redeemed across all
            customers.
        timesRedeemed:
          type: integer
          description: Number of times this code has been redeemed so far.
        appliesTo:
          type: array
          description: >-
            Products/plans this discount is restricted to. Empty means the
            discount applies to all products.
          items:
            $ref: '#/components/schemas/DiscountAppliesTo'
        isActive:
          type: boolean
    DiscountAppliesTo:
      type: object
      description: >-
        One product (and optionally specific plans of that product) this
        discount is restricted to.
      properties:
        product:
          $ref: '#/components/schemas/DiscountAppliesToProduct'
        plans:
          type: array
          items:
            $ref: '#/components/schemas/DiscountAppliesToPlan'
    DiscountAppliesToProduct:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
    DiscountAppliesToPlan:
      type: object
      properties:
        identifier:
          type: string
        name:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        The Server API Key obtained from the kelviq application. Pass as a
        Bearer token in the Authorization header. Example: 'Authorization:
        Bearer __YOUR_API_KEY__'

````