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

# Create product exclusion list

> Create a product exclusion list with target products that will be exempted from being discounted.



## OpenAPI

````yaml product-exclusion-lists.openapi post /product-exclusion-lists
openapi: 3.0.0
info:
  title: Offers - Product exclusion lists
  description: >-
    fabric Product exclusion lists let you protect SKUs from being discounted by
    active promotions. These endpoints let you create and manage such product
    exclusion lists.
  version: 3.0.0
  x-audience: external-public
  termsOfService: https://fabric.inc/terms-of-use
  contact:
    name: Offers support
    email: support@fabric.inc
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
servers:
  - url: https://api.fabric.inc/v3
    description: Production environment
security: []
externalDocs:
  description: Find out more about Offers
  url: https://developer.fabric.inc/docs/offers-overview
paths:
  /product-exclusion-lists:
    post:
      tags:
        - Product Exclusion Lists
      summary: Create product exclusion list
      description: >-
        Create a product exclusion list with target products that will be
        exempted from being discounted.
      operationId: createProductExclusionList
      parameters:
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xClientId'
        - $ref: '#/components/parameters/xFabricRequestId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createProductExclusionListRequest'
      responses:
        '201':
          description: Created
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createProductExclusionListResponse'
        '400':
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/productExclusionListNameError'
                  - $ref: '#/components/schemas/productExclusionListDateError'
                  - $ref: '#/components/schemas/missingTenantHeader'
                  - $ref: '#/components/schemas/error400'
        '401':
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error401'
        '500':
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
      security:
        - AuthorizationToken: []
components:
  parameters:
    xFabricTenantId:
      in: header
      name: x-fabric-tenant-id
      schema:
        type: string
        minLength: 24
        maxLength: 24
      required: true
      example: 5f328bf0b5f328bf0b5f328b
      description: >-
        A header used by fabric to identify the tenant making the request. You
        must include tenant id in the authentication header for an API request
        to access any of fabric’s endpoints. You can retrieve the tenant id ,
        which is also called account id, from
        [Copilot](/v3/platform/settings/account-details/getting-the-account-id).
        This header is required.
    xFabricChannelId:
      in: header
      name: x-fabric-channel-id
      schema:
        type: string
        example: '12'
      description: >-
        x-fabric-channel-id identifies the sales channel where the API request
        is being made; primarily for multichannel use cases. The channel ids are
        12 corresponding to US and 13 corresponding to Canada. The default
        channel id is 12. This field is required.
    xClientId:
      in: header
      name: x-client-id
      schema:
        type: string
      required: false
      example: copilot
      description: >-
        A unique identifier obtained from
        [Copilot](/v3/platform/settings/api-apps/getting-system-app-credentials)
        for the System app in the fabric ecosystem, essential for OpenID Connect
        authentication flows.
    xFabricRequestId:
      in: header
      name: x-fabric-request-id
      description: A unique request ID.
      required: false
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
  schemas:
    createProductExclusionListRequest:
      $ref: '#/components/schemas/productExclusionListRequest'
    createProductExclusionListResponse:
      $ref: '#/components/schemas/productExclusionListMetaData'
    productExclusionListNameError:
      type: object
      description: Duplicated name for the product exclusion list
      properties:
        type:
          description: The error code.
          type: string
          example: SKU_LIST_TITLE_EXISTS
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Product exclusion list with this name already exists
    productExclusionListDateError:
      type: object
      description: Inconsistent start and end dates error
      properties:
        type:
          description: The error code.
          type: string
          example: DATE_ERROR
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Start date should be smaller than end date and should be in future
    missingTenantHeader:
      type: object
      description: Tenant header is missing
      properties:
        type:
          description: The error code.
          type: string
          example: TENANT_HEADER_REQUIRED
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: x-fabric-tenant-id header is required
    error400:
      type: object
      description: Bad request error
      properties:
        type:
          description: The error code.
          type: string
          example: BAD_REQUEST
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Bad request
    error401:
      type: object
      description: Unauthorized error
      properties:
        type:
          description: The error code.
          type: string
          example: UNAUTHORIZED
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Invalid credentials
    error500:
      type: object
      description: Internal server error
      properties:
        type:
          description: The error code.
          type: string
          example: INTERNAL_SERVER_ERROR
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Internal server error
    productExclusionListRequest:
      type: object
      description: Product exclusion list record detail
      required:
        - name
        - startAt
        - endAt
        - scopes
        - targetProducts
      properties:
        name:
          description: Product exclusion list name
          type: string
          example: Gucci handbags
        startAt:
          description: >-
            Start date of product exclusion list. The value must be in the
            future.
          type: string
          format: date-time
          example: '2022-05-04T09:23:51.459Z'
        endAt:
          description: >-
            End date of product exclusion list. The value must be greater than
            the start date.
          type: string
          format: date-time
          example: '2099-12-31T00:00:00.000Z'
        scopes:
          description: >-
            Applicable scope of product exclusion list. It's used to identify
            whether to exclude discounts on the SKU price or associated shipping
            price.
          type: array
          items:
            type: string
            description: Scope to exclude discounts for the product exclusion list
            enum:
              - PRODUCT_PRICE
              - SHIPPING_PRICE
            example: PRODUCT_PRICE
        targetProducts:
          description: Products to exclude from being discounted
          type: array
          items:
            $ref: '#/components/schemas/productExclusionTargetProductMetaData'
        listType:
          description: Product exclusion list type
          type: string
          enum:
            - GLOBAL_EXCLUSION
          example: GLOBAL_EXCLUSION
    productExclusionListMetaData:
      type: object
      description: Product exclusion list details
      required:
        - id
        - name
        - startAt
        - endAt
        - scopes
        - listType
        - createdAt
        - updatedAt
      properties:
        id:
          description: Product exclusion list ID
          type: string
          example: 614b58924e92f6861ac9d43b
        name:
          description: Product exclusion list name
          type: string
          example: Gucci handbags
        startAt:
          description: >-
            Start date of the product exclusion list. The value must be in the
            future.
          type: string
          format: date-time
          example: '2022-05-04T09:23:51.459Z'
        endAt:
          description: >-
            End date of product exclusion list. The value must be greater than
            the start date.
          type: string
          format: date-time
          example: '2099-12-31T00:00:00.000Z'
        scopes:
          description: >-
            Applicable scope of product exclusion list. It's used to identify
            whether to exclude discounts on the SKU price or associated shipping
            price or both.
          type: array
          items:
            type: string
            description: Scope to exclude discounts for the product exclusion list
            enum:
              - PRODUCT_PRICE
              - SHIPPING_PRICE
            example: PRODUCT_PRICE
        listType:
          description: Product exclusion list type
          type: string
          enum:
            - GLOBAL_EXCLUSION
          example: GLOBAL_EXCLUSION
        createdAt:
          $ref: '#/components/schemas/createdAt'
        updatedAt:
          $ref: '#/components/schemas/updatedAt'
        isDeleted:
          $ref: '#/components/schemas/isDeleted'
    productExclusionTargetProductMetaData:
      type: object
      description: >-
        Target products of the exclusion list that will be exempted from being
        discounted
      required:
        - type
        - values
      properties:
        type:
          type: string
          description: >-
            Type of product to be excluded <br>**SKU:** Product is excluded by
            SKU - a unique identifier of an item <br>**CATEGORY:** Product is
            excluded by its category <br>**ATTRIBUTE:** Product is excluded by
            its attribute. An attribute can be defined as a {key:value} pair.
          enum:
            - SKU
            - CATEGORY
            - ATTRIBUTE
            - COLLECTION
          example: SKU
        values:
          type: array
          description: Target products
          items:
            description: Target product description
            oneOf:
              - type: string
                example: '1000000123'
                description: SKU or Category ID
              - type: integer
                format: int32
                description: If the attribute value is integer type
                example: 188
              - type: object
                properties:
                  name:
                    type: string
                    description: Attribute name
                    example: deliveryCode
                  value:
                    description: Attribute value
                    anyOf:
                      - type: integer
                        format: int32
                        description: Attribute value is integer type
                        example: 188
                      - type: boolean
                        description: Attribute value is boolean type
                        example: true
                      - type: number
                        format: double
                        description: Attribute value is number type
                        example: 45.99
                      - type: string
                        description: Attribute value is string type
                        example: Blue
    createdAt:
      type: string
      format: date-time
      description: Record's creation time
      example: '2019-08-20T14:15:22.000Z'
    updatedAt:
      type: string
      format: date-time
      description: Record's last updated time
      example: '2019-08-20T14:15:22.000Z'
    isDeleted:
      type: boolean
      description: 'true: Record is deleted<br>false: Record isn''t deleted'
      example: false
  headers:
    xFabricRequestIdResponse:
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
  securitySchemes:
    AuthorizationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````