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

# Get Discount

> Retrieve discount information for a given discount code. This endpoint is necessary to support discounts in the add product and reactivate endpoints. Zaymo calls this endpoint to validate discount codes and retrieve the discount type and amount before applying them to products or subscriptions.



## OpenAPI

````yaml /openapi.json get /zaymo/discounts/get-discount
openapi: 3.0.1
info:
  title: Zaymo Custom Integration API
  description: >-
    API for managing product upsells, customer interactions, and custom actions
    in email campaigns
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.your-domain.com/example/
security:
  - apiKeyAuth: []
tags:
  - name: Upsells
    description: Endpoints for managing product upsells in emails
  - name: Customer Portal
    description: Endpoints for customer subscription management portal
  - name: Swap Up
    description: Endpoints for swapping a customer's current subscription product
  - name: Reactivate
    description: Endpoints for reactivating cancelled subscriptions
  - name: Custom Actions
    description: Endpoints for executing custom actions from email buttons
  - name: Discounts
    description: Endpoints for retrieving discount information
paths:
  /zaymo/discounts/get-discount:
    get:
      tags:
        - Discounts
      summary: Get Discount
      description: >-
        Retrieve discount information for a given discount code. This endpoint
        is necessary to support discounts in the add product and reactivate
        endpoints. Zaymo calls this endpoint to validate discount codes and
        retrieve the discount type and amount before applying them to products
        or subscriptions.
      parameters:
        - name: discount_code
          in: query
          description: The discount code to retrieve information for
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response with discount details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscountResponse'
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Discount code not found or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    DiscountResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          example: true
          description: Indicates if the request was successful
        data:
          type: object
          required:
            - discount_type
          properties:
            discount_type:
              type: string
              enum:
                - percentage
                - amount
              description: >-
                The type of discount - either 'percentage' for a
                percentage-based discount or 'amount' for a fixed amount
                discount
              example: percentage
            discount_percentage:
              type: number
              format: float
              description: >-
                The percentage discount to apply (required when discount_type is
                'percentage'). Value should be between 0 and 100.
              example: 15
              minimum: 0
              maximum: 100
            discount_amount:
              type: number
              format: float
              description: >-
                The fixed amount discount to apply (required when discount_type
                is 'amount')
              example: 10
              minimum: 0
    Error:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Error code identifier
            message:
              type: string
              description: Human-readable error message
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Zaymo-API-Key
      description: Zaymo will authenticate requests using the API key you provide

````