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

# Add Discount Customers

> Idempotently attach customers to a discount's allowlist, which backs a customer_eligibility of specific.



## OpenAPI

````yaml post /discounts/{discount_id}/customers
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.111.2
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
  - name: Payment Connector Webhooks
paths:
  /discounts/{discount_id}/customers:
    post:
      tags:
        - Discounts
      summary: POST /discounts/{discount_id}/customers
      description: |-
        Idempotently attaches customers to a discount's allowlist (backs
        `customer_eligibility = 'specific'`). All `customer_ids` must already
        exist in the caller's business; unknown/foreign ids reject the whole
        request with 422.
      operationId: add_discount_customers_handler
      parameters:
        - name: discount_id
          in: path
          description: Discount Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddDiscountCustomersRequest'
        required: true
      responses:
        '200':
          description: >-
            Customers attached (idempotent). Echoes only the customer IDs
            submitted in THIS request, not the full allowlist — use GET
            /discounts/{discount_id}/customers to retrieve all attached
            customers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscountCustomersListResponse'
        '404':
          description: Discount not found
        '422':
          description: One or more customer IDs do not exist in this business
        '500':
          description: Something went wrong :(
      security:
        - API_KEY: []
components:
  schemas:
    AddDiscountCustomersRequest:
      type: object
      description: Request body for `POST /discounts/{discount_id}/customers`.
      required:
        - customer_ids
      properties:
        customer_ids:
          type: array
          items:
            type: string
          description: >-
            Customer IDs to attach (1..=1000). All must exist in the caller's
            business.
    DiscountCustomersListResponse:
      type: object
      required:
        - items
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DiscountCustomerItem'
    DiscountCustomerItem:
      type: object
      required:
        - customer_id
      properties:
        customer_id:
          type: string
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````