> ## 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.

# Créer une remise pour un établissement



## OpenAPI

````yaml /fr/api-reference/discounts-v1.json post /v1/locations/{location_id}/discounts
openapi: 3.0.0
info:
  title: API Remises Chataigne
  description: >-
    Gérez les remises des établissements, les modèles d’organisation et leurs
    affectations.
  version: '2026-05-01'
  contact: {}
servers:
  - url: https://server.chataigne.ai
security: []
tags: []
paths:
  /v1/locations/{location_id}/discounts:
    post:
      tags:
        - Remises
      summary: Créer une remise pour un établissement
      operationId: DiscountsV1Controller_create
      parameters:
        - name: location_id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocationDiscountCreateRequest'
      responses:
        '201':
          description: La remise d’établissement créée.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationDiscountResource'
        '400':
          description: La requête a échoué.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentification requise pour ce point de terminaison.
        '403':
          description: >-
            L’identité authentifiée n’est pas autorisée à utiliser ce point de
            terminaison.
        '404':
          description: La requête a échoué.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: La requête a échoué.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - organization-api-key: []
components:
  schemas:
    LocationDiscountCreateRequest:
      type: object
      additionalProperties: false
      required:
        - name
        - benefit
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 160
        description:
          type: string
          nullable: true
        code:
          type: string
          minLength: 1
          maxLength: 128
        image_url:
          type: string
          nullable: true
          format: uri
        enabled:
          type: boolean
          default: true
        visibility:
          type: string
          enum:
            - public
            - promoted
            - code_only
            - negotiated
          default: public
        negotiation_difficulty:
          type: string
          enum:
            - easy
            - medium
            - hard
          nullable: true
        combinable:
          type: boolean
          default: true
        once_per_customer:
          type: boolean
          default: true
        starts_on:
          type: string
          nullable: true
          format: date
        ends_on:
          type: string
          nullable: true
          format: date
        minimum_order:
          $ref: '#/components/schemas/DiscountMinimumOrder'
          nullable: true
        first_order_only:
          type: boolean
          default: false
        required_items:
          type: array
          items:
            $ref: '#/components/schemas/DiscountItemRef'
          default: []
        benefit:
          oneOf:
            - type: object
              additionalProperties: false
              required:
                - type
                - percentage
              properties:
                type:
                  type: string
                  enum:
                    - percentage
                percentage:
                  type: number
                  minimum: 0
                  exclusiveMinimum: true
                  maximum: 100
            - type: object
              additionalProperties: false
              required:
                - type
                - amount
              properties:
                type:
                  type: string
                  enum:
                    - fixed_amount
                amount:
                  $ref: '#/components/schemas/DiscountMoney'
            - type: object
              additionalProperties: false
              required:
                - type
                - reward_items
              properties:
                type:
                  type: string
                  enum:
                    - free_product
                reward_items:
                  type: array
                  items:
                    $ref: '#/components/schemas/DiscountProductRef'
                  default: []
                  minItems: 1
                  maxItems: 1
            - type: object
              additionalProperties: false
              required:
                - type
                - reward_items
              properties:
                type:
                  type: string
                  enum:
                    - buy_one_get_one
                reward_items:
                  type: array
                  items:
                    $ref: '#/components/schemas/DiscountItemRef'
                  default: []
                  minItems: 1
                include_modifiers:
                  type: boolean
                  default: false
            - type: object
              additionalProperties: false
              required:
                - type
                - buy_quantity
                - free_quantity
                - reward_items
              properties:
                type:
                  type: string
                  enum:
                    - buy_x_get_y
                buy_quantity:
                  type: integer
                  minimum: 1
                  maximum: 2147483647
                free_quantity:
                  type: integer
                  minimum: 1
                  maximum: 2147483647
                reward_items:
                  type: array
                  items:
                    $ref: '#/components/schemas/DiscountProductRef'
                  default: []
                  minItems: 1
                include_modifiers:
                  type: boolean
                  default: false
            - type: object
              additionalProperties: false
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - free_delivery
          discriminator:
            propertyName: type
    LocationDiscountResource:
      type: object
      required:
        - id
        - object
        - name
        - description
        - code
        - image_url
        - enabled
        - visibility
        - negotiation_difficulty
        - combinable
        - once_per_customer
        - starts_on
        - ends_on
        - minimum_order
        - first_order_only
        - benefit
        - created_at
        - updated_at
        - location_id
        - origin
        - required_items
        - mapping_status
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - discount
        name:
          type: string
        description:
          type: string
          nullable: true
        code:
          type: string
        image_url:
          type: string
          nullable: true
          format: uri
        enabled:
          type: boolean
        visibility:
          type: string
          enum:
            - public
            - promoted
            - code_only
            - negotiated
        negotiation_difficulty:
          type: string
          enum:
            - easy
            - medium
            - hard
          nullable: true
        combinable:
          type: boolean
        once_per_customer:
          type: boolean
        starts_on:
          type: string
          nullable: true
          format: date
        ends_on:
          type: string
          nullable: true
          format: date
        minimum_order:
          $ref: '#/components/schemas/DiscountMinimumOrderResource'
          nullable: true
        first_order_only:
          type: boolean
        benefit:
          $ref: '#/components/schemas/DiscountBenefitResource'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        location_id:
          type: string
        origin:
          oneOf:
            - type: object
              required:
                - type
              properties:
                type:
                  type: string
                  enum:
                    - location
            - type: object
              required:
                - type
                - organization_discount_id
              properties:
                type:
                  type: string
                  enum:
                    - organization
                organization_discount_id:
                  type: string
          discriminator:
            propertyName: type
        required_items:
          type: array
          items:
            $ref: '#/components/schemas/DiscountItemRef'
          default: []
        mapping_status:
          type: string
          enum:
            - ready
            - unresolved
            - ambiguous
    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
    DiscountMinimumOrder:
      type: object
      additionalProperties: false
      required:
        - amount
        - currency
      properties:
        amount:
          type: integer
          minimum: 1
          maximum: 2147483647
          description: Unités monétaires majeures entières.
        currency:
          type: string
          enum:
            - CHF
            - EUR
            - GBP
            - BRL
            - USD
            - MXN
    DiscountItemRef:
      type: object
      additionalProperties: false
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - product
            - bundle
        id:
          type: string
          maxLength: 128
          description: Identifiant public du produit ou bundle dans le catalogue actif.
    DiscountMoney:
      type: object
      additionalProperties: false
      required:
        - amount
        - currency
      properties:
        amount:
          type: number
          minimum: 0
          exclusiveMinimum: true
          multipleOf: 0.01
        currency:
          type: string
          enum:
            - CHF
            - EUR
            - GBP
            - BRL
            - USD
            - MXN
    DiscountProductRef:
      type: object
      additionalProperties: false
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - product
        id:
          type: string
          maxLength: 128
          description: Identifiant public du produit ou bundle dans le catalogue actif.
    DiscountMinimumOrderResource:
      type: object
      additionalProperties: false
      required:
        - amount
        - currency
      properties:
        amount:
          type: integer
          minimum: 1
          maximum: 2147483647
          description: Unités monétaires majeures entières.
        currency:
          type: string
          enum:
            - CHF
            - EUR
            - GBP
            - BRL
            - USD
            - MXN
          nullable: true
    DiscountBenefitResource:
      oneOf:
        - type: object
          additionalProperties: false
          required:
            - type
            - percentage
          properties:
            type:
              type: string
              enum:
                - percentage
            percentage:
              type: number
              minimum: 0
              exclusiveMinimum: true
              maximum: 100
        - type: object
          additionalProperties: false
          required:
            - type
            - amount
          properties:
            type:
              type: string
              enum:
                - fixed_amount
            amount:
              $ref: '#/components/schemas/DiscountMoneyResource'
        - type: object
          additionalProperties: false
          required:
            - type
            - reward_items
          properties:
            type:
              type: string
              enum:
                - free_product
            reward_items:
              type: array
              items:
                $ref: '#/components/schemas/DiscountProductRef'
              default: []
        - type: object
          additionalProperties: false
          required:
            - type
            - reward_items
            - include_modifiers
          properties:
            type:
              type: string
              enum:
                - buy_one_get_one
            reward_items:
              type: array
              items:
                $ref: '#/components/schemas/DiscountItemRef'
              default: []
            include_modifiers:
              type: boolean
              default: false
        - type: object
          additionalProperties: false
          required:
            - type
            - buy_quantity
            - free_quantity
            - reward_items
            - include_modifiers
          properties:
            type:
              type: string
              enum:
                - buy_x_get_y
            buy_quantity:
              type: integer
              minimum: 1
              maximum: 2147483647
            free_quantity:
              type: integer
              minimum: 1
              maximum: 2147483647
            reward_items:
              type: array
              items:
                $ref: '#/components/schemas/DiscountProductRef'
              default: []
            include_modifiers:
              type: boolean
              default: false
        - type: object
          additionalProperties: false
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - free_delivery
      discriminator:
        propertyName: type
    DiscountMoneyResource:
      type: object
      additionalProperties: false
      required:
        - amount
        - currency
      properties:
        amount:
          type: number
          minimum: 0
          exclusiveMinimum: true
          multipleOf: 0.01
        currency:
          type: string
          enum:
            - CHF
            - EUR
            - GBP
            - BRL
            - USD
            - MXN
          nullable: true
  securitySchemes:
    organization-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: Clé API d’établissement ou d’organisation.

````