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

# Import promotions to the system



## OpenAPI

````yaml /openapi.yaml post /pos/{posSystemId}/company/{posCompanyId}/import/promotions
openapi: 3.0.1
info:
  title: ClearLine POS API
  description: >-
    Point of Sale integration API for ClearLine Marketing Platform. This API
    enables POS systems to send transaction data, manage customer interactions,
    and integrate with marketing campaigns.
  version: v1
servers:
  - url: https://public-api-demo.clearline.me
    description: ClearLine API Server
security: []
paths:
  /pos/{posSystemId}/company/{posCompanyId}/import/promotions:
    post:
      tags:
        - Import
      summary: Import promotions to the system
      operationId: PosCompanyImport_ImportPosCompanyPromotions
      parameters:
        - name: posSystemId
          in: path
          required: true
          schema:
            type: string
        - name: posCompanyId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/PosPromotionsPostDto'
            example:
              items:
                - id: '110'
                  name: Promotion 110
                  useForAllCategories: true
                  useForAllProducts: true
                  locationIds:
                    - '295'
                  categoryIds:
                    - '2'
                  promotionValidities:
                    - startDate: '2023-12-19T13:18:44.512Z'
                      endDate: '2023-12-19T13:18:44.512Z'
                      recurrence:
                        daysOfWeek:
                          - Sunday
                        startDate: '2023-12-19T13:18:44.512Z'
                        endDate: '2023-12-19T13:18:44.512Z'
                  productIds:
                    - '1'
                  promotionResults:
                    - promotionType: Amount
                      value: 10
          application/json:
            schema:
              $ref: '#/components/schemas/PosPromotionsPostDto'
            example:
              items:
                - id: '110'
                  name: Promotion 110
                  useForAllCategories: true
                  useForAllProducts: true
                  locationIds:
                    - '295'
                  categoryIds:
                    - '2'
                  promotionValidities:
                    - startDate: '2023-12-19T13:18:44.512Z'
                      endDate: '2023-12-19T13:18:44.512Z'
                      recurrence:
                        daysOfWeek:
                          - Sunday
                        startDate: '2023-12-19T13:18:44.512Z'
                        endDate: '2023-12-19T13:18:44.512Z'
                  productIds:
                    - '1'
                  promotionResults:
                    - promotionType: Amount
                      value: 10
          text/json:
            schema:
              $ref: '#/components/schemas/PosPromotionsPostDto'
            example:
              items:
                - id: '110'
                  name: Promotion 110
                  useForAllCategories: true
                  useForAllProducts: true
                  locationIds:
                    - '295'
                  categoryIds:
                    - '2'
                  promotionValidities:
                    - startDate: '2023-12-19T13:18:44.512Z'
                      endDate: '2023-12-19T13:18:44.512Z'
                      recurrence:
                        daysOfWeek:
                          - Sunday
                        startDate: '2023-12-19T13:18:44.512Z'
                        endDate: '2023-12-19T13:18:44.512Z'
                  productIds:
                    - '1'
                  promotionResults:
                    - promotionType: Amount
                      value: 10
          application/*+json:
            schema:
              $ref: '#/components/schemas/PosPromotionsPostDto'
            example:
              items:
                - id: '110'
                  name: Promotion 110
                  useForAllCategories: true
                  useForAllProducts: true
                  locationIds:
                    - '295'
                  categoryIds:
                    - '2'
                  promotionValidities:
                    - startDate: '2023-12-19T13:18:44.512Z'
                      endDate: '2023-12-19T13:18:44.512Z'
                      recurrence:
                        daysOfWeek:
                          - Sunday
                        startDate: '2023-12-19T13:18:44.512Z'
                        endDate: '2023-12-19T13:18:44.512Z'
                  productIds:
                    - '1'
                  promotionResults:
                    - promotionType: Amount
                      value: 10
          application/xml:
            schema:
              $ref: '#/components/schemas/PosPromotionsPostDto'
            example:
              items:
                - id: '110'
                  name: Promotion 110
                  useForAllCategories: true
                  useForAllProducts: true
                  locationIds:
                    - '295'
                  categoryIds:
                    - '2'
                  promotionValidities:
                    - startDate: '2023-12-19T13:18:44.512Z'
                      endDate: '2023-12-19T13:18:44.512Z'
                      recurrence:
                        daysOfWeek:
                          - Sunday
                        startDate: '2023-12-19T13:18:44.512Z'
                        endDate: '2023-12-19T13:18:44.512Z'
                  productIds:
                    - '1'
                  promotionResults:
                    - promotionType: Amount
                      value: 10
          text/xml:
            schema:
              $ref: '#/components/schemas/PosPromotionsPostDto'
            example:
              items:
                - id: '110'
                  name: Promotion 110
                  useForAllCategories: true
                  useForAllProducts: true
                  locationIds:
                    - '295'
                  categoryIds:
                    - '2'
                  promotionValidities:
                    - startDate: '2023-12-19T13:18:44.512Z'
                      endDate: '2023-12-19T13:18:44.512Z'
                      recurrence:
                        daysOfWeek:
                          - Sunday
                        startDate: '2023-12-19T13:18:44.512Z'
                        endDate: '2023-12-19T13:18:44.512Z'
                  productIds:
                    - '1'
                  promotionResults:
                    - promotionType: Amount
                      value: 10
          application/*+xml:
            schema:
              $ref: '#/components/schemas/PosPromotionsPostDto'
            example:
              items:
                - id: '110'
                  name: Promotion 110
                  useForAllCategories: true
                  useForAllProducts: true
                  locationIds:
                    - '295'
                  categoryIds:
                    - '2'
                  promotionValidities:
                    - startDate: '2023-12-19T13:18:44.512Z'
                      endDate: '2023-12-19T13:18:44.512Z'
                      recurrence:
                        daysOfWeek:
                          - Sunday
                        startDate: '2023-12-19T13:18:44.512Z'
                        endDate: '2023-12-19T13:18:44.512Z'
                  productIds:
                    - '1'
                  promotionResults:
                    - promotionType: Amount
                      value: 10
      responses:
        '200':
          description: Success
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ImportResultDtoApiResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ImportResultDtoApiResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ImportResultDtoApiResponse'
            application/xml:
              schema:
                $ref: '#/components/schemas/ImportResultDtoApiResponse'
            text/xml:
              schema:
                $ref: '#/components/schemas/ImportResultDtoApiResponse'
      security:
        - BearerAuth: []
        - ImplicitAuth: []
components:
  schemas:
    PosPromotionsPostDto:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/PosPromotionPostDto'
          description: Items to add
          nullable: true
      additionalProperties: false
      description: Represents promotions items import category request for POS
    ImportResultDtoApiResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ImportResultDto'
      additionalProperties: false
    PosPromotionPostDto:
      type: object
      properties:
        id:
          type: string
          description: Pos promotion Id
          nullable: true
        name:
          type: string
          description: Name
          nullable: true
        useForAllCategories:
          type: boolean
          description: Indicates if promotion used for all categories
        useForAllProducts:
          type: boolean
          description: Indicates if promotion used for all products
        locationIds:
          type: array
          items:
            type: string
          description: Product locations
          nullable: true
        categoryIds:
          type: array
          items:
            type: string
          description: Product categories
          nullable: true
        promotionValidities:
          type: array
          items:
            $ref: '#/components/schemas/PromotionValidityDto'
          description: Represents validity date conditions
          nullable: true
        productIds:
          type: array
          items:
            type: string
          description: Promotion products
          nullable: true
        promotionResults:
          type: array
          items:
            $ref: '#/components/schemas/PromotionResultPostDto'
          description: Promotion output
          nullable: true
      additionalProperties: false
      description: Represents promotion
    ImportResultDto:
      type: object
      properties:
        status:
          type: string
          description: Status message.
          nullable: true
        createdCount:
          type: integer
          description: Created new items count.
          format: int32
        updatedCount:
          type: integer
          description: Updated existing items count.
          format: int32
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ImportErrorDto'
          description: Import errors.
          nullable: true
        warnings:
          type: array
          items:
            $ref: '#/components/schemas/ImportWarningDto'
          description: Import warnings.
          nullable: true
      additionalProperties: false
      description: Results of import
    PromotionValidityDto:
      type: object
      properties:
        startDate:
          type: string
          description: Start Date of promotion if not null
          format: date-time
          nullable: true
        endDate:
          type: string
          description: End Date of promotion if not null
          format: date-time
          nullable: true
        recurrence:
          $ref: '#/components/schemas/PromotionValidityRecurrenceDto'
      additionalProperties: false
      description: Represents validity period condition
    PromotionResultPostDto:
      type: object
      properties:
        promotionType:
          $ref: '#/components/schemas/PromotionResultTypesDto'
        value:
          type: number
          description: Price or percentage
          format: double
      additionalProperties: false
      description: Result promotion execution
    ImportErrorDto:
      type: object
      properties:
        entityId:
          type: string
          description: Id of the imported entity
          nullable: true
        rowNumber:
          type: integer
          description: Row number in the source list
          format: int32
        errorMessage:
          type: string
          description: Error message
          nullable: true
        errorDetails:
          type: string
          description: Error details
          nullable: true
      additionalProperties: false
      description: Error in the import
    ImportWarningDto:
      type: object
      properties:
        entityId:
          type: string
          description: Id of the imported entity
          nullable: true
        rowNumber:
          type: integer
          description: Row number in the source list
          format: int32
        message:
          type: string
          description: Warning message
          nullable: true
        details:
          type: string
          description: Warning details
          nullable: true
      additionalProperties: false
      description: Warning in the import
    PromotionValidityRecurrenceDto:
      type: object
      properties:
        daysOfWeek:
          type: array
          items:
            $ref: '#/components/schemas/PromotionDayOfTheWeekDto'
          description: Days of week when promotion is valid
          nullable: true
        startTime:
          type: string
          description: Start time of validity period in hh:mm:ss format
          nullable: true
        endTime:
          type: string
          description: End time of validity period in hh:mm:ss format
          nullable: true
      additionalProperties: false
      description: Time period when promotion is valid
    PromotionResultTypesDto:
      enum:
        - Amount
        - Percentage
      type: string
      description: Type of promotion outcomes
    PromotionDayOfTheWeekDto:
      enum:
        - Sunday
        - Monday
        - Tuesday
        - Wednesday
        - Thursday
        - Friday
        - Saturday
      type: string
      description: Promotion Day of week
  securitySchemes:
    BearerAuth:
      type: http
      description: |-

        JWT Authorization header using the Bearer scheme.

        Enter **_JWT Bearer token only_** in the text input below.
      scheme: bearer
      bearerFormat: JWT
    ImplicitAuth:
      type: oauth2
      description: Implicit scheme
      flows:
        implicit:
          authorizationUrl: https://logindemo.clearline.me/connect/authorize
          scopes:
            clearline_api: Grants access to Clearline API endpoints.

````