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

# Set an organization discount location



## OpenAPI

````yaml /api-reference/discounts-v1.json put /v1/organizations/{organization_id}/discounts/{discount_id}/locations/{location_id}
openapi: 3.0.0
info:
  title: Chataigne Discounts API
  description: Manage location discounts, organization templates, and location mappings.
  version: '2026-05-01'
  contact: {}
servers:
  - url: https://server.chataigne.ai
security: []
tags: []
paths:
  /v1/organizations/{organization_id}/discounts/{discount_id}/locations/{location_id}:
    put:
      tags:
        - Discounts
      summary: Set an organization discount location
      operationId: OrganizationDiscountLocationsV1Controller_put
      parameters:
        - name: organization_id
          required: true
          in: path
          schema:
            type: string
        - name: discount_id
          required: true
          in: path
          schema:
            type: string
        - name: location_id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DiscountTargetPutRequest'
      responses:
        '200':
          description: The created or replaced location mapping.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscountLocationResource'
        '400':
          description: The request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication required for this endpoint.
        '403':
          description: The authenticated principal is not allowed to use this endpoint.
        '404':
          description: The request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: The request failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - organization-api-key: []
components:
  schemas:
    DiscountTargetPutRequest:
      type: object
      additionalProperties: false
      properties:
        required_items:
          type: array
          items:
            $ref: '#/components/schemas/DiscountItemRef'
          default: []
        reward_items:
          type: array
          items:
            $ref: '#/components/schemas/DiscountItemRef'
          default: []
    DiscountLocationResource:
      type: object
      required:
        - id
        - object
        - discount_id
        - organization_id
        - location_id
        - status
        - mapping_status
        - required_items
        - reward_items
        - created_at
        - updated_at
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - discount_location
        discount_id:
          type: string
        organization_id:
          type: string
        location_id:
          type: string
        status:
          type: string
          enum:
            - active
            - retired
        mapping_status:
          type: string
          enum:
            - ready
            - unresolved
            - ambiguous
        required_items:
          type: array
          items:
            $ref: '#/components/schemas/DiscountItemRef'
          default: []
        reward_items:
          type: array
          items:
            $ref: '#/components/schemas/DiscountItemRef'
          default: []
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
            - request_id
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - authorization_error
                - not_found_error
                - conflict_error
                - rate_limit_error
                - idempotency_error
                - api_error
            code:
              type: string
              example: resource_missing
            message:
              type: string
            param:
              type: string
            request_id:
              type: string
              example: req_8f2c…
            details:
              type: object
              additionalProperties: true
    DiscountItemRef:
      type: object
      additionalProperties: false
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - product
            - bundle
        id:
          type: string
          maxLength: 128
          description: Public product or bundle id from the active Catalog API resource.
  securitySchemes:
    organization-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: Location/organization API key.

````