openapi: 3.0.0
info:
  title: Offers v2
  description: >-
    fabric's Offers APIs let you set up and manage stock keeping unit (SKU)
    prices. Its wide range of coupon and promotion features let you design
    discounts ranging from single-use, customer-specific coupons to site-wide
    promotions applicable for all SKUs.
  version: 2.0.0
  contact:
    email: support@fabric.inc
  license:
    url: https://fabric.inc/api-license
    name: fabric API license
servers:
  - url: https://live.copilot.fabric.inc
    description: Production
externalDocs:
  description: Learn more about Offers
  url: https://developer.fabric.inc/docs/offers-overview
components:
  parameters:
    xSiteContent:
      name: x-site-context
      in: header
      description: >-
        The `x-site-context` header is a JSON object that contains information
        about the source you wish to pull from. The mandatory `account` is the
        24 character identifier found in Copilot. The `channel` (Sales channel
        ID), `stage` (environment name), and `date` attributes can be used to
        further narrow the scope of your data source.
      required: true
      schema:
        type: string
        example: >-
          {"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account":
          "1234abcd5678efgh9ijklmno","stage":"production"}
    queryParameterSize:
      name: size
      in: query
      description: The maximum number of records per page.
      required: false
      schema:
        type: integer
        format: int32
        minimum: 1
        default: 10
        maximum: 100
    queryParameterOffset:
      name: offset
      in: query
      description: >-
        The number of records to skip before returning records. For example,
        with an offset of 20 and limit of 10, you will get records from 21 to
        30.
      required: false
      schema:
        type: integer
        format: int32
        minimum: 0
        example: 0
        default: 0
  requestBodies:
    priceBody:
      description: A JSON object containing price information
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/createPrice'
  schemas:
    itemPriceOverride:
      type: object
      description: >-
        Price object. This will override the promotion evaluation response
        prices.
      properties:
        sale:
          type: number
          description: Price at which the product is offered for sale
          format: double
          example: 10
        base:
          type: number
          description: Minimum fixed price of a single unit of the item
          format: double
    pricePromoParam:
      type: object
      description: Price parameters for calculating price
      properties:
        options:
          type: object
          additionalProperties:
            type: object
            description: >-
              Pricing options for calculation. If an add-on (`blindmotor` in
              this example) is set to true, price of the additional item will be
              calculated based on the price that was set earlier.
            example:
              length: '2'
              width: '15'
              blindMotor: true
          description: Pricing options for calculation
          example:
            length: '2'
            width: '15'
            blindMotor: true
    promotionEvaluationRequest:
      required:
        - items
      type: object
      description: Prices conditions
      properties:
        traceId:
          type: string
          description: Trace ID, used to trace logs
          example: '394823457'
        isLoggedIn:
          type: boolean
          description: 'true: user logged in<br /> false: user is not logged in'
          example: true
        userId:
          type: string
          description: User ID
          example: 5e2cfb9b45570b000864c4b5
        promoCodes:
          type: array
          description: >-
            A list of coupon codes that are applicable only for coupons. For
            coupons, the response includes promo codes associated with the
            coupon. For promotions, the response includes an empty array.
          example:
            - SUPERCOUPON1
            - FIRSTPURCHASE10
          items:
            type: string
        shipping:
          type: array
          description: >-
            Shipping cost for the entire cart. You can use this `shipping` array
            if you want to add shipping cost for the entire cart.<br /> If you
            want to add shipping cost for individual items, you can provide
            details for each item using `items.shippingMethodId` and
            `items.shippingPrice` fields.
          items:
            $ref: '#/components/schemas/promotionRequestShipping'
        items:
          type: array
          description: List of item information objects
          items:
            $ref: '#/components/schemas/promotionRequestItem'
        date:
          pattern: yyyy-MM-ddThh:mm:ssZ
          type: string
          description: Date for which the promotions to be evaluated
          format: date-time
          example: '2019-08-24T14:15:22Z'
        userProfile:
          type: array
          description: Segment the user belongs to
          example:
            Customer Type:
              - Wholesale
          items:
            type: object
            additionalProperties:
              type: array
              items:
                type: string
    promotionRequestItem:
      required:
        - priceList
        - quantity
      type: object
      properties:
        lineItemId:
          type: integer
          description: Item sequence number
          format: int32
          example: 1
        priceList:
          type: string
          description: Price list ID or name
          example: 100275
        sku:
          type: string
          description: >-
            SKU of the item. Either SKU or ItemId is mandatory. If both
            provided, SKU overrides itemId.
          example: 1111111
        itemId:
          type: integer
          description: >-
            ID of the item. Either SKU or ItemId is mandatory. If both provided,
            SKU overrides itemId.
          format: int32
          example: 1111111
        quantity:
          type: number
          description: Quantity of the item ordered
          format: double
          example: 5
        group:
          type: array
          description: >-
            List of Group IDs. Groups the promotions belongs to. When a group of
            promotions is subject to non-stackable, it will be compared to other
            promotion groups and the highest discount providing group will be
            applied as promotion.
          example:
            - 5e2cfb9b45570b000863c4b5
          items:
            type: string
        hierarchy:
          type: array
          description: Item hierarchy to evaluate promotions
          example:
            - - clothingId1
              - footwear
              - sandalsId1
            - - nike
              - sandalsId2
            - - clothingId2
              - beach
          items:
            type: array
            items:
              type: string
        productAttributes:
          type: object
          additionalProperties:
            description: Product attributes
            oneOf:
              - type: array
                items:
                  type: string
                  example:
                    - red
                    - green
              - type: string
                example: red
          example:
            color:
              - red
              - green
            brand: Nike
            size: '10'
        priceParams:
          $ref: '#/components/schemas/pricePromoParam'
        price:
          $ref: '#/components/schemas/itemPriceOverride'
        channel:
          type: array
          description: List of channel IDs from where the request is coming
          example:
            - 12
            - 15
          items:
            type: integer
            format: int32
        shippingMethodId:
          type: string
          description: >-
            Shipping Method ID to check if promotion is applicable to the
            shipping of the item. You can use this field if you want to add
            shipping cost for individual items. If you want to add shipping cost
            for the entire cart, use `shipping` array field.
          example: 123
        shippingPrice:
          type: number
          description: >-
            Shipping cost for the individual item. You can use this field if you
            want to add shipping cost for individual items. If you want to add
            shipping cost for the entire cart, use `shipping` array field.
          format: double
          example: 20
    promotionRequestShipping:
      type: object
      properties:
        shippingMethodId:
          type: string
          description: Shipping method ID to check if promotion is applied to it
          example: 123
        shippingPrice:
          type: number
          description: Shipping price for the entire cart
          format: double
          example: 20
    apiError:
      type: object
      properties:
        status:
          type: string
          description: Http Status
          example: NOT_FOUND
          enum:
            - 100 CONTINUE
            - 101 SWITCHING_PROTOCOLS
            - 102 PROCESSING
            - 103 CHECKPOINT
            - 200 OK
            - 201 CREATED
            - 202 ACCEPTED
            - 203 NON_AUTHORITATIVE_INFORMATION
            - 204 NO_CONTENT
            - 205 RESET_CONTENT
            - 206 PARTIAL_CONTENT
            - 207 MULTI_STATUS
            - 208 ALREADY_REPORTED
            - 226 IM_USED
            - 300 MULTIPLE_CHOICES
            - 301 MOVED_PERMANENTLY
            - 302 FOUND
            - 302 MOVED_TEMPORARILY
            - 303 SEE_OTHER
            - 304 NOT_MODIFIED
            - 305 USE_PROXY
            - 307 TEMPORARY_REDIRECT
            - 308 PERMANENT_REDIRECT
            - 400 BAD_REQUEST
            - 401 UNAUTHORIZED
            - 402 PAYMENT_REQUIRED
            - 403 FORBIDDEN
            - 404 NOT_FOUND
            - 405 METHOD_NOT_ALLOWED
            - 406 NOT_ACCEPTABLE
            - 407 PROXY_AUTHENTICATION_REQUIRED
            - 408 REQUEST_TIMEOUT
            - 409 CONFLICT
            - 410 GONE
            - 411 LENGTH_REQUIRED
            - 412 PRECONDITION_FAILED
            - 413 PAYLOAD_TOO_LARGE
            - 413 REQUEST_ENTITY_TOO_LARGE
            - 414 URI_TOO_LONG
            - 414 REQUEST_URI_TOO_LONG
            - 415 UNSUPPORTED_MEDIA_TYPE
            - 416 REQUESTED_RANGE_NOT_SATISFIABLE
            - 417 EXPECTATION_FAILED
            - 418 I_AM_A_TEAPOT
            - 419 INSUFFICIENT_SPACE_ON_RESOURCE
            - 420 METHOD_FAILURE
            - 421 DESTINATION_LOCKED
            - 422 UNPROCESSABLE_ENTITY
            - 423 LOCKED
            - 424 FAILED_DEPENDENCY
            - 425 TOO_EARLY
            - 426 UPGRADE_REQUIRED
            - 428 PRECONDITION_REQUIRED
            - 429 TOO_MANY_REQUESTS
            - 431 REQUEST_HEADER_FIELDS_TOO_LARGE
            - 451 UNAVAILABLE_FOR_LEGAL_REASONS
            - 500 INTERNAL_SERVER_ERROR
            - 501 NOT_IMPLEMENTED
            - 502 BAD_GATEWAY
            - 503 SERVICE_UNAVAILABLE
            - 504 GATEWAY_TIMEOUT
            - 505 HTTP_VERSION_NOT_SUPPORTED
            - 506 VARIANT_ALSO_NEGOTIATES
            - 507 INSUFFICIENT_STORAGE
            - 508 LOOP_DETECTED
            - 509 BANDWIDTH_LIMIT_EXCEEDED
            - 510 NOT_EXTENDED
            - 511 NETWORK_AUTHENTICATION_REQUIRED
        timestamp:
          type: string
          format: date-time
        message:
          type: string
          description: Error message
          example: Validation error
        debugMessage:
          type: string
          description: More detailed message for debugging
          example: Either item ID or SKU is mandatory.
        subErrors:
          type: array
          description: Sub errors related to validations
          items:
            $ref: '#/components/schemas/apiSubError'
    apiSubError:
      type: object
      properties:
        object:
          type: string
          description: Erroneous object
          example: promotionsEvaluationRequest
        field:
          type: string
          description: Request body field
          example: items[0].quantity
        rejectedValue:
          type: object
          description: Request body field value
          example: -2
        message:
          type: string
          description: Error message
          example: Must be greater than 0
      description: Sub errors related to validations
    appliedDiscount:
      type: object
      description: Details of discounts that are applied
      properties:
        promoId:
          type: string
          description: Promotion ID
          example: 6197ec46e836ff000952c668
        promoCode:
          type: string
          description: Coupon code
          example: SUPERCOUPON20
        promoTitle:
          type: string
          description: Promotion title
          example: 20% off
        type:
          type: string
          description: Promotion type
          example: COUPON
        amount:
          type: number
          description: Discount amount
          format: double
          example: 10
    couponError:
      type: object
      description: Details of error in case coupon is not applied
      properties:
        promoCode:
          type: string
          description: Coupon code
          example: SUPERCOUPON
        promoId:
          type: string
          description: Promotion ID
          example: 624b5aa2a8fd12000965dfdc
        message:
          type: string
          description: Reason why coupon not applied
          example: Invalid coupon
    offerDiscount:
      type: object
      properties:
        quantity:
          type: integer
          description: Number of items
          format: int32
          example: 5
        amount:
          type: number
          description: Discount amount
          format: double
          example: 10
        unit:
          type: string
          description: Unit of discount measurement
          example: '%OFF'
        value:
          type: number
          description: Discount value
          format: double
          example: 10
        promoId:
          type: string
          description: Promotion ID
          example: 6197ec46e836ff000952c668
        promoCode:
          type: string
          description: Coupon code
          example: SUPERCOUPON20
        promoTitle:
          type: string
          description: Promotion title
          example: 20% off
        type:
          type: string
          description: Promotion type
          example: COUPON
        application:
          type: integer
          description: >-
            It is used specifically for BuyGet type that applies when you Buy
            something and Get discount of some amount or percentage or free
            items. This field indicates how many times this BuyGet promotion is
            applied.
          format: int32
          example: 1
        isStackable:
          type: boolean
          description: >-
            A flag indicating whether the promotion can be stacked. Set it to
            `true` if multiple promotions can be applied together and `false` if
            the promotions cannot be combined.
          example: true
        isAlwaysApplied:
          type: boolean
          description: >-
            A flag indicating whether the promotion is always applied. Set it to
            `true` if the promotion is always applied, even on non-stackable
            promotions and `false` to apply promotions based on configured
            conditions.
          example: false
        level:
          type: integer
          format: int32
          description: >-
            The promotion execution order. Promotion types are assigned default
            execution orders. Initial evaluation begins with level 1 promotions.
            The result of level 1 is used as the base price for level 2.
            Similarly, the result of level 2 becomes the base price for level 3,
            and so on.
          example: 1
        stackingType:
          type: string
          description: >-
            Defines the rules for how a promotion can be combined with other
            promotions.  This field determines whether a specific promotion can
            be applied in conjunction  with other active promotions during a
            transaction or if it must be used exclusively. Possible values: -
            `STACKABLE`: This promotion can be combined with other stackable
            promotions, allowing multiple 
              discounts to be applied together. The order in which stackable promotions are applied 
              is determined by the `level` field, with promotions having a higher priority (lower numeric value)
              being applied before those with a lower priority.
            - `EXCLUSIVE`: This promotion cannot be combined with any other
            promotions. The `level` field is
              used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive
              promotion is applied, no other promotions can be used in the same transaction.
            - `TYPE_EXCLUSIVE`: This promotion cannot be combined with other
            promotions of the same type.
              The `level` field is used to determine which promotion within the same type will be evaluated and
              applied first.
            - `UNIVERSAL`: This promotion can be combined with any other
            promotions without restrictions.
              Universal promotions will be evaluated last.
          enum:
            - STACKABLE
            - EXCLUSIVE
            - TYPE_EXCLUSIVE
            - UNIVERSAL
          example: STACKABLE
        proratedAmount:
          type: number
          format: double
          description: >-
            The BuyGet promotions distribute the discount across specified
            parameters. For example, when buying A results in a discount on B,
            the discount amount on B is prorated across both A and B. The
            distributed amount is reflected in `proratedAmount`, while the
            quantity is captured in `proratedQuantity`.
          example: 10
        proratedQuantity:
          type: integer
          format: int32
          description: >-
            The `proratedQuantity` is used in conjunction with `proratedAmount`
            to determine the discount portion allocated to the respective units
            of BuyGet promotions. This is applicable in partial return
            scenarios.
          example: 1
    itemPrice:
      type: object
      properties:
        currency:
          type: string
          description: Currency code
          example: USD
        base:
          type: number
          description: Base price. It is the minimum fixed price of the item
          format: double
          example: 10
        kind:
          type: string
          description: Price kind name
          example: BASE
        totalPrice:
          type: number
          description: Total price after all the discounts
          format: double
          example: 50
        finalPrice:
          type: number
          description: Final Price of the item, does not include discounts
          format: double
          example: 50
        sale:
          type: number
          description: Price at which the item is offered for sale
          format: double
          example: 50
    itemPriceAttributes:
      type: object
      description: Returned if configured earlier
      properties:
        cost:
          type: number
          description: Cost price
          format: double
          example: 9
        floor:
          type: number
          description: It is the lowest price at which a product can be sold
          format: double
          example: 10
        clearance:
          type: number
          description: Selling price
          format: double
          example: 10
    promotionEvaluationResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/promotionResponseItem'
        errors:
          type: array
          example:
            - Parameter does not exist
          items:
            type: string
        shipping:
          type: array
          items:
            $ref: '#/components/schemas/promotionResponseShipping'
        appliedDiscounts:
          type: array
          items:
            $ref: '#/components/schemas/appliedDiscount'
        suggestedProducts:
          type: array
          items:
            $ref: '#/components/schemas/suggestedProducts'
        notAppliedCoupons:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/couponError'
        promotionMessages:
          $ref: '#/components/schemas/rtpePromotionMessages'
        success:
          type: boolean
          description: Indicates if promotion is successfully evaluated
    promotionResponseItem:
      type: object
      properties:
        lineItemId:
          type: integer
          description: Sequence number of the item
          format: int32
          example: 1
        sku:
          type: string
          description: Item SKU
          example: 1111111
        itemId:
          type: integer
          description: Item ID
          format: int32
          example: 1111111
        priceList:
          type: string
          description: Price list ID or name, depending on configuration
          example: 100275
        group:
          type: array
          description: >-
            Group or category the promotion belongs to. When a group of
            promotions is subject to non-stackable, it will be compared to other
            promotion groups and the highest discount providing group will be
            applied as promotion.
          example:
            - 5e2cfb9b45570b000863c4b5
            - clothingId1
            - footwear
          items:
            type: string
        quantity:
          type: number
          description: Number of items
          format: double
          example: 5
        price:
          $ref: '#/components/schemas/itemPrice'
        priceAttributes:
          $ref: '#/components/schemas/itemPriceAttributes'
        discount:
          type: array
          items:
            $ref: '#/components/schemas/offerDiscount'
        attributes:
          type: object
          additionalProperties:
            type: object
            description: Product attributes
            example:
              color: red
              brand: Nike
              size: '10'
          description: Product attributes
          example:
            color: red
            brand: Nike
            size: '10'
        shippingPrice:
          type: number
          description: Shipping price
          format: double
          example: 20
        shippingMethodId:
          type: string
          description: >-
            Shipping method ID used to check if promotion is applicable to the
            shipping method
          example: 123
        shippingDiscount:
          type: number
          description: Shipping discount if any
          format: double
          example: 5
    promotionResponseShipping:
      type: object
      properties:
        shippingMethodId:
          type: string
          description: Shipping Method ID
          example: 456
        shippingPrice:
          type: number
          description: Shipping price
          format: double
          example: 5
        shippingDiscount:
          type: number
          description: Shipping discount
          format: double
          example: 5
    suggestedProducts:
      type: object
      properties:
        promotionId:
          type: string
          description: Promotion ID
          example: 6197ec46e836ff000952c668
        promotionTitle:
          type: string
          description: Promotion title
          example: Buy Shoes, get socks for free
        itemId:
          type: string
          description: Free Item's ID
          example: 234343
        sku:
          type: string
          description: Free SKU
          example: SHOE1234
        eligiblePriceLists:
          type: array
          description: >-
            Price list IDs promotion applies to. If empty, promotion applies to
            all price lists.
          items:
            type: string
            example: 1000
        quantity:
          type: integer
          description: Number of free items promotion gives
          format: int32
          example: 2
        free:
          type: boolean
          description: true when a free item is provided as a promotion
          example: true
        discountType:
          type: string
          description: Type of discount
          enum:
            - '%OFF'
            - AMOUNT_OFF
            - FIXED_PRICE
          example: '%OFF'
        amount:
          type: number
          description: Amount for discount
          format: double
          example: 100
    getPricesRequest:
      type: object
      description: Prices conditions
      properties:
        traceId:
          type: string
          description: Trace ID, used to trace logs
          example: 394823457
        priceList:
          type: array
          description: List of price list IDs which items or SKUs belong to
          example:
            - 100275
            - 100276
          items:
            type: string
        sku:
          type: array
          description: >-
            A list of Stock Keeping Units (SKUs) for items whose prices needs to
            be retrieved. Specify either SKUs or itemIds. If both are provided,
            the SKU takes precedence.
          example:
            - 1000019501
            - 1000019502
          items:
            type: string
        itemId:
          type: array
          items:
            type: integer
            format: int32
          description: >-
            List of item IDs for items whose prices needs to be retrieved.
            Specify either SKUs or itemIds. If both are provided, the SKU takes
            precedence.
          example:
            - 111111
            - 222222
        userId:
          type: string
          description: User ID
          example: 5e2cfb9b45570b000864c4b5
        userProfile:
          type: object
          additionalProperties:
            type: array
            description: Segment the user belongs to
            example:
              Customer Type:
                - Wholesale
            items:
              type: string
              description: Segment the user belongs to
              example: '{"Customer Type":["Wholesale"]}'
          description: Segment the user belongs to
          example:
            Customer Type:
              - Wholesale
        isLoggedIn:
          type: boolean
          description: true if the user logged in<br /> false if the user is not logged in
          example: true
        channel:
          type: array
          description: List of channel ID from where the request is coming
          example:
            - 12
            - 15
          items:
            type: integer
            description: List of channel ID from where the request is coming
            format: int32
        date:
          pattern: yyyy-MM-ddThh:mm:ssZ
          type: string
          description: Date for which the prices are to be retrieved
          format: date-time
          example: '2019-08-24T14:15:22Z'
        priceParams:
          type: array
          description: Various price parameters to calculate final price
          items:
            $ref: '#/components/schemas/priceRequestParam'
        audit:
          type: boolean
          description: >-
            true if audit is required. Response body will have an audit object
            with details about how the dynamic pricing engine obtained the
            result.<br /> false if audit is not required.
          example: true
    priceRequestParam:
      type: object
      properties:
        options:
          type: object
          additionalProperties:
            type: object
            description: Pricing pptions for calculation
            example:
              length: '2'
              width: '15'
              blindMotor: true
          description: Pricing options for calculation
          example:
            length: '2'
            width: '15'
            blindMotor: true
        sku:
          type: string
          description: Item SKU. Either SKU or ItemId is mandatory
          example: '11111'
        quantity:
          type: number
          description: Number of items ordered. Mandatory for Range-Base pricing method
          format: double
          example: 5
        itemId:
          type: integer
          description: Item ID. Either SKU or ItemId is mandatory
          format: int32
          example: 12345
    calculatedPrice:
      type: object
      properties:
        priceList:
          type: string
          description: Price List ID
          example: '100275'
        sku:
          type: string
          description: Item SKU
          example: '11111111'
        itemId:
          type: integer
          description: Item SKU
          format: int32
          example: 11111111
        offers:
          $ref: '#/components/schemas/calculatedPriceOffers'
        audit:
          $ref: '#/components/schemas/calculatedPriceAudit'
    calculatedPriceAudit:
      type: object
      properties:
        userId:
          type: string
          description: ID of the user who created the price
          example: 62f5e25ca090100009c6e0f0
        priceMethodType:
          type: string
          example: SurfaceArea_Square_Increment
        quantity:
          type: number
          format: double
          example: 5
        options:
          type: object
          properties:
            length:
              type: number
              example: 12
            width:
              type: number
              example: 10
        appliedAddons:
          type: array
          items:
            type: string
            example: blind-motor
    calculatedPriceObject:
      type: object
      properties:
        sale:
          type: number
          description: Price at which the product is offered for sale
          format: double
          example: 10
        cost:
          type: number
          description: Cost price. Displayed if configured earlier
          format: double
          example: 9
        base:
          type: number
          description: Minimum fixed price of a single unit of the item
          format: double
          example: 10
        finalPrice:
          type: number
          description: Final calculated price of the item. Does not include discounts.
          format: double
          example: 20
        currency:
          type: string
          description: Currency
          example: USD
        totalPrice:
          type: number
          description: Final calculated price of the item, include discounts.
          format: double
          example: 15
    calculatedPriceOffers:
      type: object
      description: Offers on the price
      properties:
        price:
          $ref: '#/components/schemas/calculatedPriceObject'
        kind:
          type: string
          description: Price kind name
          example: BASE
        channel:
          type: integer
          description: Channel for which the price is retrieved
          format: int32
          example: 12
        discounts:
          type: array
          description: Discount object
          items:
            $ref: '#/components/schemas/promotionDiscount'
        additionalAttributes:
          type: array
          description: A placeholder for additional attributes, in key-value pairs.
          items:
            type: object
        promotionMessages:
          $ref: '#/components/schemas/rtpePromotionMessages'
          example:
            - promoId: 6197ec46e836ff000952c667
              threshold: 3
              message: Add another pair of shoes to get free socks!
              locales:
                - en-US
                - en-GB
              type: PROXIMITY
            - promoId: 6197ec46e836ff000952c668
              title: Get free socks!
              message: Buy two pairs of shoes and get a pair of socks for free!
              locales:
                - en-US
                - en-GB
              pages:
                - PDP
                - CART
              type: POTENTIAL_DISCOUNT
    promotionDiscount:
      type: object
      properties:
        amount:
          type: number
          description: Actual discount amount
          format: double
          example: 10
        value:
          type: number
          description: Discount in percent or amount
          format: double
          example: 20
        groupId:
          type: string
          description: ID of the group or category this item belongs to
          example: 61a6354d0d70e30009415f16
        promotionId:
          type: string
          description: Promotion ID
          example: 6197ec46e836ff000952c668
        priority:
          type: integer
          description: >-
            The order in which promotion should be applied. Promotion types are
            assigned a default priority. First, priority 1 promotions will be
            evaluated. The result of priority 1 will be used as a base price for
            priority 2. Similarly, the result of priority 2 will be used as a
            base price for priority 3 and so on.
          format: int32
          example: 1
        stackable:
          type: boolean
          description: >-
            true indicates promotions are stackable, meaning their discounts
            will be summed together. Stackable promotions will be applied
            regardless of other promotions being applied.<br /> false indicates
            promotions are non-stackable, meaning discounts will be compared,
            within the same priority, and the maximum discount will be applied
            for promotion.
          example: true
        title:
          type: string
          description: Promotion title
          example: 20% off
        quantity:
          type: integer
          description: Item quantity
          format: int32
          example: 5
        promotionType:
          type: string
          description: Promotion type
          example: COUPON
        discountType:
          type: string
          description: Discount Type
          enum:
            - PERCENTAGE_OFF
            - AMOUNT_OFF
            - FIXED_PRICE
        application:
          type: integer
          description: >-
            It is used specifically for BuyGet type that applies when you Buy
            something and Get discount of some amount or percentage or free
            items. This field indicates how many times this BuyGet promotion is
            applied.
          format: int32
          example: 1
        isAlwaysApplied:
          type: boolean
          description: >-
            A flag indicating whether the promotion is always applied. Set it to
            `true` if the promotion is always applied, even on non-stackable
            promotions and `false` to apply promotions based on configured
            conditions.
          example: false
        level:
          type: integer
          format: int32
          description: >-
            The promotion execution order. Promotion types are assigned default
            execution orders. Initial evaluation begins with level 1 promotions.
            The result of level 1 is used as the base price for level 2.
            Similarly, the result of level 2 becomes the base price for level 3,
            and so on.
          example: 1
        stackingType:
          type: string
          description: >-
            Defines the rules for how a promotion can be combined with other
            promotions.  This field determines whether a specific promotion can
            be applied in conjunction  with other active promotions during a
            transaction or if it must be used exclusively. Possible values: -
            `STACKABLE`: This promotion can be combined with other stackable
            promotions, allowing multiple 
              discounts to be applied together. The order in which stackable promotions are applied 
              is determined by the `level` field, with promotions having a higher priority (lower numeric value)
              being applied before those with a lower priority.
            - `EXCLUSIVE`: This promotion cannot be combined with any other
            promotions. The `level` field is
              used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive
              promotion is applied, no other promotions can be used in the same transaction.
            - `TYPE_EXCLUSIVE`: This promotion cannot be combined with other
            promotions of the same type.
              The `level` field is used to determine which promotion within the same type will be evaluated and
              applied first.
            - `UNIVERSAL`: This promotion can be combined with any other
            promotions without restrictions.
              Universal promotions will be evaluated last.
          enum:
            - STACKABLE
            - EXCLUSIVE
            - TYPE_EXCLUSIVE
            - UNIVERSAL
          example: STACKABLE
        proratedAmount:
          type: number
          format: double
          description: >-
            The BuyGet promotions distribute the discount across specified
            parameters. For example, when buying A results in a discount on B,
            the discount amount on B is prorated across both A and B. The
            distributed amount is reflected in `proratedAmount`, while the
            quantity is captured in `proratedQuantity`.
          example: 10
        proratedQuantity:
          type: integer
          format: int32
          description: >-
            The `proratedQuantity` is used in conjunction with `proratedAmount`
            to determine the discount portion allocated to the respective units
            of BuyGet promotions. This is applicable in partial return
            scenarios.
          example: 1
        promotionMessages:
          $ref: '#/components/schemas/rtpePromotionMessages'
    rtpePromotionMessages:
      type: array
      description: The promotion message that is displayed to the customer.
      required:
        - message
        - locales
        - type
      items:
        type: object
        description: The promotion message that is displayed to the customer.
        properties:
          promoId:
            type: string
            description: Promotion ID
            example: 61df12345678900009b7091c
          title:
            type: string
            description: >-
              The title of the promotion message, summarizing the offer or
              discount type.
            example: Buy 2 get 1 free
          message:
            type: string
            description: >-
              A promotional message providing details about the offer, including
              eligibility, duration, and conditions.
            example: Offer valid at participating stores through September 5, 2023.
          pages:
            type: array
            description: >-
              The web pages where the message is displayed, whether the product
              display page (PDP), product list page (PLP), the customer's cart,
              or the checkout page.
            items:
              type: string
              description: Page type
              enum:
                - PDP
                - PLP
                - Cart
                - Checkout
              example: PDP
          locales:
            type: array
            description: >-
              The geographic regions where the promotion message is displayed,
              determined by the user's IP address. Locales define language and
              country-specific settings for promotions.
            items:
              type: string
              description: Locale
              example: en-CA
          type:
            type: string
            description: |-
              Specifies the promotion message type.
                - `DISCOUNT`: The discount has been applied.
                - `PROXIMITY`: The product or cart is close to meeting discount conditions.
                - `POTENTIAL_DISCOUNT`: The product could qualify for a discount but has not yet.
            enum:
              - DISCOUNT
              - PROXIMITY
              - POTENTIAL_DISCOUNT
            example: DISCOUNT
          threshold:
            type: integer
            format: int32
            description: >-
              Indicates a quantity or amount that is close to meeting the
              discount requirement. If the user reaches this value, a promotion
              message is displayed. This field is only valid for PROXIMITY
              messages.
            example: 2
    invalidSearchFilterField:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: INVALID_SEARCH_FILTER_FIELD
        message:
          description: An error message coressponding to the `code`.
          type: string
          example: The search filter field is not valid.
    invalidPromoState:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: INVALID_PROMO_STATE
        message:
          description: An error message coressponding to the `code`.
          type: string
          example: The promotion state is not valid.
    invalidFilterOperator:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: INVALID_FILTER_OPERATOR
        message:
          description: An error message coressponding to the `code`.
          type: string
          example: The search filter operator is not valid.
    invalidPromoStackingType:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: INVALID_PROMO_STACKING_TYPE
        message:
          description: An error message coressponding to the `code`.
          type: string
          example: The promotion stacking type filter is not valid
    createExport:
      type: object
      description: The sample request to initiate data export.
      required:
        - type
      properties:
        type:
          type: string
          description: The type of data to export.
          enum:
            - REDEMPTION
            - CALCULATED_PRICE
          example: REDEMPTION
        filters:
          type: array
          maxItems: 20
          description: >-
            Filters to apply when exporting the data. You can include multiple
            `filter` values in the request. If you do not include any filters,
            all export data of the specified data type is returned. For more
            information on using filters to refine your data, see the [export
            parameters](/v2/api-reference/offers-v2/developer-guide/exporting-csv#export-parameters)
            section.
          items:
            type: object
            required:
              - field
              - value
              - operator
            properties:
              field:
                type: string
                description: >
                  The name of the field, which is always paired with `value`.
                  The field name is always paired with the corresponding `value`
                  parameter. The filtering values you can choose from depend on
                  the type of data you're exporting. For more information on the
                  available `field` options for each data type, see the  [export
                  parameters](/v2/api-reference/offers-v2/developer-guide/exporting-csv#export-parameters)
                  section.    
                minLength: 3
                maxLength: 120
                example: storeId
              value:
                description: >-
                  The value or values corresponding to the `field` parameter.
                  The `field` parameter defines the name of the field, and the
                  `value` parameter provides the corresponding value. For
                  example, if the `field` parameter is `priceListIds`, the
                  corresponding `value` parameter must be an array.
                oneOf:
                  - type: string
                    minLength: 1
                    maxLength: 120
                    example: store001
                  - type: array
                    minItems: 1
                    maxItems: 200
                    items:
                      oneOf:
                        - type: string
                          description: >-
                            The values corresponding to the `field` parameter.
                            The `field` parameter defines the name of the field,
                            and the `value` parameter provides the corresponding
                            value. For example, if the `field` parameter is
                            `priceListIds`, the corresponding `value` parameter
                            must be an array.
                          example: 60ec76eee1f1dc1234567890
                        - type: number
                          description: >-
                            The values corresponding to the `field` parameter.
                            The `field` parameter defines the name of the field,
                            and the `value` parameter provides the corresponding
                            value. For example, if the `field` parameter is
                            `priceListIds`, the corresponding `value` parameter
                            must be an array.
                          example: 100000
              operator:
                type: string
                description: Operator between `field` and `value` to filter data.
                enum:
                  - EQUAL
                  - GREATER_THAN_OR_EQUAL_TO
                  - LESS_THAN
                  - IN
                example: EQUAL
    createExportResponse:
      type: object
      description: The sample response of the create export request.
      required:
        - exportId
        - startedAt
        - status
        - type
      properties:
        exportId:
          type: string
          description: >-
            The unique ID for the export request that is used to retrieve the
            export details.
          example: ab50fe48-5da0-4e77-92d1-bb629eedf19e
        startedAt:
          type: string
          description: The start time of the export process.
          example: '2023-05-17T21:24:52.398Z'
        endedAt:
          type: string
          description: The end time of the export process.
          example: 'null'
          nullable: true
        totalDataExported:
          type: number
          description: >-
            The total number of exported data in the csv file. Each row in the
            csv file represents one record of exported data.
          example: 0
        status:
          type: string
          description: >-
            The status of the export process. The [download exported CSV
            file](/v2/api-reference/offers-v2/exports/download-exported-csv-file)
            endpoint can generate a download URL only if the export status is
            `COMPLETED`.
          enum:
            - IN_PROGRESS
            - COMPLETED
            - ERROR
          example: IN_PROGRESS
        errors:
          type: array
          description: >-
            Errors during the export process. For more information about the
            error messages, see the [exporting
            CSV](/v2/api-reference/offers-v2/developer-guide/exporting-csv#export-calculated-price-error)
            section.
          example: []
          items:
            type: object
            properties:
              type:
                type: string
                description: The error code.
              message:
                type: string
                description: An error message corresponding to the `type`.
        type:
          type: string
          description: The type of data to export.
          example: REDEMPTION
        filters:
          type: array
          items:
            type: object
            required:
              - field
              - value
              - operator
            properties:
              field:
                type: string
                description: The name of the field. This is always paired with `value`.
                example: storeId
              value:
                description: >-
                  The value or values corresponding to the `field` parameter.
                  The `field` parameter defines the name of the field, and the
                  `value` parameter provides the corresponding value. For
                  example, if the `field` parameter is `priceListIds`, the
                  corresponding `value` parameter must be an array.
                oneOf:
                  - type: string
                    minLength: 1
                    maxLength: 120
                    example: store001
                  - type: array
                    minItems: 1
                    maxItems: 200
                    items:
                      oneOf:
                        - type: string
                          description: >-
                            The values corresponding to the `field`. The `field`
                            parameter defines the name of the field, and the
                            `value` parameter provides the corresponding value.
                            For example, if the `field` parameter is
                            `priceListIds`, the corresponding `value` parameter
                            must be an array.
                          example: 60ec76eee1f1dc1234567890
                        - type: number
                          description: >-
                            The values corresponding to the `field`. The `field`
                            parameter defines the name of the field, and the
                            `value` parameter provides the corresponding value.
                            For example, if the `field` parameter is
                            `priceListIds`, the corresponding `value` parameter
                            must be an array.
                          example: 100000
              operator:
                type: string
                description: Operator between `field` and `value` to filter data.
                example: EQUAL
    exportListResponse:
      type: object
      description: A paginated response of export requests.
      properties:
        query:
          $ref: '#/components/schemas/offsetQuery'
        data:
          description: The response data.
          type: array
          items:
            $ref: '#/components/schemas/listExportData'
    listExportData:
      type: object
      description: An overview of export request.
      required:
        - exportId
        - startedAt
        - status
        - type
      properties:
        exportId:
          type: string
          description: >-
            The unique ID for the export request that is used to retrieve the
            export details.
          example: ab50fe48-5da0-4e77-92d1-bb629eedf19e
        startedAt:
          type: string
          description: The start time of the export process.
          example: '2023-05-17T21:24:52.398Z'
        endedAt:
          type: string
          description: The end time of the export process.
          example: 'null'
          nullable: true
        status:
          type: string
          description: >-
            The status of the export process. The [download exported CSV
            file](/v2/api-reference/offers-v2/exports/download-exported-csv-file)
            endpoint can generate a download URL only if the export status is
            `COMPLETED`.
          enum:
            - IN_PROGRESS
            - COMPLETED
            - ERROR
          example: IN_PROGRESS
        type:
          type: string
          description: The type of data to export.
          example: REDEMPTION
        totalDataExported:
          type: number
          description: >-
            The total number of exported data in the csv file. Each row in the
            csv file represents one record of exported data.
          example: 0
        fileId:
          type: string
          description: >-
            The S3 `fileId` value to generate a downloadable CSV using the
            [download exported CSV
            file](/v2/api-reference/offers-v2/exports/download-exported-csv-file)
            endpoint.
          example: redemption/tenantId/1687294954996-redemption-export.csv
          nullable: true
    downloadExportUrl:
      type: object
      description: The URL of the downloadable CSV.
      required:
        - fileId
      properties:
        fileId:
          type: string
          description: >-
            The `fileId` value retrieved from the [get export request by
            ID](/v2/api-reference/offers-v2/exports/get-export-request-by-id)
            endpoint. This is used to download the exported CSV.
          example: redemption/tenantId/1687472972-redemption-export.csv
    downloadExportUrlResponse:
      type: object
      description: The URL of the downloadable CSV.
      required:
        - url
        - fileId
      properties:
        url:
          type: string
          description: The AWS S3 URL to download the exported CSV.
          example: >-
            https://bucket-name.s3.amazonaws.com/redemption/tenantId/1687472972-redemption-export.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIA26KLJWUAPER5A
        fileId:
          type: string
          description: The S3 `fileId` value to generate a downloadable CSV.
          example: redemption/tenantId/1687472972-redemption-export.csv
    exportTypeNotValidError:
      type: object
      description: An error message because export type is not valid.
      properties:
        code:
          description: The error code.
          type: string
          example: REQUEST_VALIDATION
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Export type not valid.
    exportNotFoundError:
      type: object
      description: Export not found error.
      properties:
        code:
          description: The error code.
          type: string
          example: EXPORT_NOT_FOUND
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: The export ID you entered doesn’t exist.
    fileExpiredError:
      type: object
      description: File expired error
      properties:
        code:
          description: The error code.
          type: string
          example: FILE_EXPIRED
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Exported file has expired.
    invalidFileIdError:
      type: object
      description: Invalid fileId error
      properties:
        code:
          description: The error code.
          type: string
          example: INVALID_FILE_ID
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: fileId is not valid
    badSizeError:
      type: object
      description: Pagination size error, an invalid value was sent.
      properties:
        code:
          description: The error code.
          type: string
          example: REQUEST_VALIDATION
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Size should be a valid number.
    badOffsetError:
      type: object
      description: >-
        An error indicating that an invalid pagination offset value was
        provided.
      properties:
        code:
          description: The error code.
          type: string
          example: REQUEST_VALIDATION
        message:
          description: An error message corresponding to the `type`.
          type: string
          example: Offset must be an integer
    offsetQuery:
      type: object
      description: Provides pagination data.
      properties:
        size:
          type: integer
          format: int32
          example: 10
          minimum: 1
          maximum: 100
          default: 10
          description: The maximum number of records per page.
        offset:
          type: integer
          format: int32
          example: 10
          minimum: 0
          default: 0
          description: >-
            The number of records to skip before returning records. For example,
            with an offset of 20 and limit of 10, you will get records from 21
            to 30.
        count:
          type: integer
          format: int32
          example: 50
          description: The total number of available records.
    error400:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: BAD_REQUEST
        message:
          description: An error message coressponding to the `code`.
          type: string
          example: Bad Request
    error401:
      type: object
      description: Unauthorized error
      properties:
        code:
          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
      properties:
        code:
          description: The error code.
          type: string
          example: INTERNAL_SERVER_ERROR
        message:
          description: An error message coressponding to the `code`.
          type: string
          example: Internal server error.
    genericListQueryResponse:
      description: Paging details used for selecting list
      type: object
      properties:
        limit:
          description: The maximum number of records per page.
          type: number
          example: 10
          default: 10
        count:
          description: The total number of records.
          type: number
          example: 150
        offset:
          description: >-
            The number of records to skip before returning records. For example,
            when offset is 20 and limit is 10, this endpoint returns records
            from 21 to 30.
          type: number
          example: 0
          default: 0
    priceList:
      type: object
      description: Price list data
      properties:
        _id:
          description: fabric internal unique id
          type: string
          example: 614b58924e92f6861ac9d43b
        priceListId:
          description: >-
            Price list ID. This is the system generated unique ID of the
            pricelist
          type: number
          example: 10000003
        name:
          description: Price list name
          type: string
          example: BuildMuscles-CONTRACT123
        isDefault:
          description: >-
            true: This is the default price list<br /> false: This is not the
            default price list
          type: boolean
          example: false
        currency:
          description: 3 letter currency code as defined by ISO-4217
          type: string
          format: iso-4217
          example: USD
        startDate:
          description: >-
            Start date of the price list. This value can be `null`. However, if
            start date is mentioned, end date must also be mentioned.
          type: string
          nullable: true
          format: date-time
          example: '2021-05-04T09:23:51.459Z'
        endDate:
          description: >-
            The end date of priceList. This value can be `null`. However, if end
            date is mentioned, start date must also be mentioned.
          type: string
          nullable: true
          format: date-time
          example: '2021-06-09T09:23:51.459Z'
        deleted:
          description: 'true: Price list is deleted<br /> false: Price list is not deleted'
          type: boolean
          example: false
        createdAt:
          description: Creation date of the record
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: Last updated date of the record
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    priceListResponse:
      type: object
      properties:
        query:
          $ref: '#/components/schemas/genericListQueryResponse'
        data:
          description: Price list data
          type: array
          items:
            $ref: '#/components/schemas/priceList'
    newPriceListRequest:
      type: object
      required:
        - name
        - isDefault
        - currency
      properties:
        name:
          description: Pricelist name
          type: string
          example: BuildMuscles-CONTRACT123
        isDefault:
          description: >-
            true: If you want to keep the given pricelist as the default price
            list.<br /> false: If you do not want to keep the given pricelist as
            the default price list.
          type: boolean
          example: false
        currency:
          type: string
          format: iso-4217
          description: >-
            Currency code, as defined by ISO-4217, of the price specified in the
            price list.
          example: CAD
        startDate:
          description: >-
            Start date of the price list, it indicates the date when the price
            list becomes available to use.
          type: string
          format: date-time
          example: '2021-05-04T09:23:51.459Z'
        endDate:
          description: End date of the price list.
          type: string
          format: date-time
          example: '2021-06-09T09:23:51.459Z'
    priceListNameExists:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: PRICE_LIST_NAME_EXISTS
        message:
          description: The error message corresponding to the `code`.
          type: string
          example: Price list name already exists
    priceListNotFound:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: PRICE_LIST_NOT_FOUND
        message:
          description: The error message corresponding to the `code`.
          type: string
          example: No Price List with this ID Found
    updatePriceListRequest:
      type: object
      required:
        - name
        - isDefault
      properties:
        name:
          description: Pricelist name
          type: string
          maxLength: 300
          example: BuildMuscles-CONTRACT123
        isDefault:
          description: >-
            true: If you want to set the given price list as default price
            list.<br /> false: If you do not want to set the given price list as
            default price list.
          type: boolean
          example: false
        currency:
          type: string
          format: iso-4217
          description: 3 letter currency code as defined by ISO-4217
          example: CAD
        startDate:
          description: >-
            Start date of the price list. It indicates the date when the price
            list will be available to use. This value can be `null`, however if
            you mention the start date, you must provide end date as well.
          type: string
          format: date-time
          example: '2021-05-04T09:23:51.459Z'
        endDate:
          description: >-
            End date of the price list. This value can be `null`, however if you
            mention an end date, you must provide a start date as well.
          type: string
          format: date-time
          example: '2021-06-09T09:23:51.459Z'
    updatedPriceList:
      type: object
      properties:
        _id:
          description: fabric internal unique id
          type: string
          example: 614b58924e92f6861ac9d43b
        priceListId:
          description: >-
            Price list ID. This is the system generated unique ID of the
            pricelist.
          type: number
          example: 10000003
        name:
          description: Price list name
          type: string
          example: BuildMuscles-CONTRACT123
        isDefault:
          description: >-
            true: indicates this is the default price list.<br /> false:
            indicates this is not the default price list
          type: boolean
          example: false
        currency:
          description: >-
            3 letter currency code, as defined by ISO-4217, of the price
            specified in the price list
          type: string
          format: iso-4217
          example: CAD
        startDate:
          description: Start date of the price list
          type: string
          format: date-time
          example: '2021-05-04T09:23:51.459Z'
        endDate:
          description: End date of the price list
          type: string
          format: date-time
          example: '2021-06-09T09:23:51.459Z'
        deleted:
          description: 'true: Price list is deleted<br /> false: Price list is not deleted'
          type: boolean
          example: false
        createdAt:
          description: Creation date of the record
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: Last updated date of the record
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    currencyNotValid:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: INVALID_CURRENCY_CODE
        message:
          description: The error message corresponding to the `code`.
          type: string
          example: Invalid Currency Code Entered
    deletedPriceList:
      type: object
      properties:
        _id:
          description: fabric internal unique id
          type: string
          example: 614b58924e92f6861ac9d43b
        priceListId:
          description: >-
            Price list ID. This is the system generated unique ID of the
            pricelist.
          type: number
          example: 10000003
        name:
          description: PricelList name
          type: string
          example: BuildMuscles-CONTRACT123
        isDefault:
          description: >-
            true: This is the default price list<br /> false: This is the not
            default price list
          type: boolean
          example: false
        currency:
          description: >-
            3 letter currency code, as defined by ISO-4217, of the price
            specified in the price list
          type: string
          format: iso-4217
          example: CAD
        startDate:
          description: Start date of the price list if any
          type: string
          format: date-time
          example: '2021-05-04T09:23:51.459Z'
        endDate:
          description: End date of the price list if any
          type: string
          format: date-time
          example: '2021-06-09T09:23:51.459Z'
        deleted:
          description: 'true: Price list is deleted<br /> false: Price list is not deleted'
          type: boolean
          example: true
        createdAt:
          description: Creation date of the record
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: Last updated date of the record
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    priceWoOffers:
      type: object
      properties:
        _id:
          description: fabric internal unique ID
          type: string
          example: 616e011037a3810012345678
        isSoftDeleted:
          description: 'true: Price is deleted<br /> false: Price is not deleted'
          type: boolean
          example: false
        itemId:
          type: number
          description: Item ID
          example: 1000000051
        itemSku:
          type: string
          description: Item SKU
          example: SKU123456
        offerId:
          type: number
          description: ID of the created offer for the itemId or itemSku
          example: 2386
        createdAt:
          type: string
          description: Creation date of the record
          format: date-time
          example: '2020-02-02T17:22:48.570Z'
        updatedAt:
          type: string
          description: Last update date of the record
          format: date-time
          example: '2020-02-02T17:22:48.570Z'
        job:
          type: boolean
          example: false
          description: >-
            true: Job is running either to create, update, or delete the
            record<br /> false: Job is either completed or not running for some
            reason
        priceListId:
          type: number
          description: Price list ID that contains the updated or created price
          example: 100000
    price:
      type: object
      properties:
        base:
          description: Base price (Minimum fixed price) of item
          type: number
          example: 299
        sale:
          description: Price at which the product is offered for sale
          type: number
          example: 199
        cost:
          description: Cost of the item
          type: number
          example: 149
        currency:
          description: The 3 letter currency code as defined by ISO-4217
          type: string
          example: USD
    range:
      type: object
      properties:
        minQuantity:
          description: Minimum quantity to be sold for the range price to be applied
          type: number
          example: 3
        price:
          description: >-
            Range price of item to be applied for each item if quantity meets
            the minQuantity requirement
          type: number
          example: 299
    offer:
      type: object
      properties:
        kind:
          description: >-
            Pricekind ID. This ID helps to identify if the price is base price
            or clearance price or any other additional price.
          type: number
          example: 12
        channel:
          description: Sales channel ID
          type: number
          example: 12
        startDate:
          description: Start date of the price if any
          type: string
          format: date-time
          example: '2020-02-03T17:22:48.570Z'
        endDate:
          description: End date of the price if any
          type: string
          format: date-time
          example: '2020-02-05T17:22:48.570Z'
        price:
          $ref: '#/components/schemas/price'
        offerCode:
          type: number
          description: Unique code associated with the created offer price
          example: 130283400
        range:
          description: >-
            Price range, based on quantity of items sold. If price range of an
            item is setup using the *Price Range* APIs, this array should not be
            empty.
          type: array
          items:
            $ref: '#/components/schemas/range'
        priceAttributes:
          type: array
          items:
            type: object
            example:
              _id: 614dc5b0af8ee70008698202
              id: 614dc5b0af8ee70008698202
    getPriceResponse:
      type: object
      properties:
        query:
          description: >-
            Object containing the size, count and number of pages in the
            response.
          type: object
          example:
            limit: 10
            count: 8
            page: 1
        prices:
          description: An array containing all the prices in service
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/priceWoOffers'
              - type: object
                properties:
                  offers:
                    type: array
                    items:
                      allOf:
                        - $ref: '#/components/schemas/offer'
                        - type: object
                          properties:
                            priceMethodType:
                              type: string
                              description: >-
                                Type of method for calculating the price. <br />
                                **Range-Base:** Uses the quantity of sold items
                                to determine which price to use. Base price
                                (minimum fixed price) is ignored in this
                                method.<br /> **SurfaceArea_Square_Increment:**
                                Adds an incremental amount depending on the area
                                of the item. The final price is calculated by
                                adding the area multiplied by the price set for
                                quantity, to the base price. For example, if we
                                sell a rug that is 10x2, final price will be the
                                base price (50, for example), plus an increment
                                of the area (20) times the price range set for
                                min quantity.<br />
                                **SurfaceArea_Square_Increment_2Dim:** Adds
                                extra price to the base price, determined by the
                                area. The difference with this Square Area
                                method is that in this case the overprice is not
                                calculated, but instead it is looked-up in a
                                table-like structure that is already created, by
                                checking for the range of values provided in
                                `width`.
                              example: Range-Base
                            range:
                              type: array
                              items:
                                allOf:
                                  - $ref: '#/components/schemas/range'
                                  - type: object
                                    properties:
                                      maxQuantity:
                                        oneOf:
                                          - type: string
                                            example: Infinity
                                            description: >-
                                              The maximum quantity of items that can
                                              be sold to apply the price range.
                                          - type: number
                                            example: 90
                                            description: >-
                                              Set the maximum quantity to get offer
                                              price.
                                        description: Maximum quantity to get offer price.
                                      width:
                                        type: array
                                        description: >-
                                          Only for 2 dimensional price
                                          calculations, meaning when
                                          price-method-type is
                                          `SurfaceArea_Square_Increment_2Dim`.
                                        items:
                                          type: object
                                          required:
                                            - minQuantity
                                            - maxQuantity
                                            - price
                                          properties:
                                            minQuantity:
                                              type: number
                                              example: 1
                                              description: Minimum quantity to get offer price.
                                            maxQuantity:
                                              oneOf:
                                                - type: string
                                                  example: Infinity
                                                  description: The maximum quantity value `Infinity`.
                                                - type: number
                                                  example: 5
                                                  description: >-
                                                    Set the maximum quantity to get offer
                                                    price
                                              description: Maximum quantity to get offer price
                                            price:
                                              type: number
                                              example: 20.75
                                              description: Unit price for the width range
    createPrice:
      type: object
      required:
        - itemIds
        - offers
      properties:
        priceListId:
          description: ' `Optional`. ID or name of the price list to update the price for. If you do not provide ID or name, price will be updated for the *default* price list.<br /> If you''re using this endpoint to create price details, the price list ID will be generated automatically.'
          oneOf:
            - type: string
              example: 100-TwoWeeks
            - type: number
              example: 123456789
        itemIds:
          type: array
          description: Item IDs to create or update the price for
          items:
            type: number
            example: 10000001
        itemSkus:
          type: array
          description: SKUs of the products to create or update the price for
          items:
            type: string
            example: SKU0123456
        offers:
          type: array
          maxItems: 10
          minItems: 1
          items:
            type: object
            required:
              - channel
              - startDate
              - endDate
              - price
            properties:
              kind:
                description: >-
                  Pricekind ID. This ID helps to identify if the price is base
                  price or clearance price or any other additional price.
                type: number
                example: 12
              channel:
                description: Sales channel ID
                type: number
                example: 12
              startDate:
                description: Price start date and time
                type: string
                format: date-time
              endDate:
                description: Price end date and time
                type: string
                format: date-time
              price:
                type: object
                description: Price data
                properties:
                  base:
                    description: Base price of the item
                    type: number
                    example: 299
                  sale:
                    description: Price at which the product is offered for sale
                    type: number
                    example: 199
                  cost:
                    description: Cost of the item, set by the manufacturer, if any
                    type: number
                    example: 149
                  currency:
                    description: Currency code of the price
                    type: string
                    example: USD
              additionalAttributes:
                type: array
                description: A placeholder for additional attributes, in key-value pairs.
                items:
                  type: object
                  properties:
                    customSkuTitle:
                      type: string
                      example: HOUSE TREE
                    customCategory:
                      type: string
                      example: HOME
    createCopilotPriceResponse:
      type: array
      description: List of created or updated prices
      items:
        type: object
        properties:
          id:
            type: string
            description: fabric internal ID
          isSoftDeleted:
            type: boolean
            description: >-
              true: Price is soft deleted, means the details are removed from UI
              but are available in the databse.<br /> false:  Price is not
              deleted
          itemId:
            type: number
            example: 1000000051
            description: ID of the item
          itemSku:
            type: string
            example: SKU123456
            description: SKU of the item
          priceListId:
            type: number
            description: ID of the pricelist to which the created price is added or updated
            example: 100000
          offerId:
            type: number
            description: ID of the created offer for the itemId or itemSku
            example: 2386
          offers:
            type: array
            maxItems: 10
            minItems: 1
            description: Prices of the SKU or priceListId
            items:
              type: object
              properties:
                kind:
                  description: >-
                    Pricekind ID. This ID helps to identify if the price is base
                    price or clearance price or any other additional price.
                  type: number
                  example: 12
                channel:
                  description: Channel ID
                  type: number
                  example: 12
                startDate:
                  description: Price start date-time
                  type: string
                  format: date-time
                endDate:
                  description: Price end date-time
                  type: string
                  format: date-time
                price:
                  type: object
                  description: Price data
                  properties:
                    base:
                      description: Minimum fixed price of the item
                      type: number
                      example: 299
                    sale:
                      description: Price at which the product is offered for sale
                      type: number
                      example: 199
                    cost:
                      type: number
                      description: Cost of the item if any
                      example: 149
                    currency:
                      type: string
                      description: Currency code of the price
                      example: USD
                priceMethodType:
                  description: >-
                    Type of method for calculating the price. <br />
                    **Range-Base:** Uses the quantity of sold items to determine
                    which price to use. Base price (minimum fixed price) is
                    ignored in this method.<br />
                    **SurfaceArea_Square_Increment:** Adds an incremental amount
                    depending on the area of the item. The final price is
                    calculated by adding the area multiplied by the price set
                    for quantity, to the base price. For example, if we sell a
                    rug that is 10x2, final price will be the base price (50,
                    for example), plus an increment of the area (20) times the
                    price range set for min quantity.<br />
                    **SurfaceArea_Square_Increment_2Dim:** Adds extra price to
                    the base price, determined by the area. The difference with
                    this Square Area method is that in this case the overprice
                    is not calculated, but instead it is looked-up in a
                    table-like structure that is already created, by checking
                    for the range of values provided in `width`.
                  type: string
                  enum:
                    - Range-Base
                    - SurfaceArea_Square_Increment
                    - SurfaceArea_Square_Increment_2Dim
                  example: Range-Base
                additionalAttributes:
                  type: array
                  description: A placeholder for additional attributes, in key-value pairs.
                  items:
                    type: object
                    properties:
                      customSkuTitle:
                        type: string
                        example: HOUSE TREE
                      customCategory:
                        type: string
                        example: HOME
          createdAt:
            type: string
            format: date-time
            description: Price creation date-time
            example: '2020-02-02T17:22:48.570Z'
          updatedAt:
            type: string
            format: date-time
            description: price last updated date-time
            example: '2020-02-02T17:22:48.570Z'
          job:
            type: boolean
            description: >-
              true: Job is running either to create or update details<br />
              false: Job is either completed or not running for some reason
            example: false
    priceDateError:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: PRICE_TIME_RANGE_ERROR
        message:
          description: An error message corresponding to the `code`.
          type: string
          example: >-
            The start date must be at least 15 minutes before the end date, and
            both dates must be in the future.
    getByIdPriceResponse:
      type: object
      required:
        - _id
        - itemId
        - priceListId
        - offers
        - createdAt
        - updatedAt
      properties:
        _id:
          type: string
          description: fabric internal ID
          example: 62583d6e2d4b944f747127a5
        isSoftDeleted:
          type: boolean
          description: 'true: record is deleted<br /> false: record is not deleted'
          example: false
        itemId:
          type: number
          example: 1000000051
          description: Item ID
        itemSku:
          type: string
          example: SKU123456
          description: SKU of the item
        priceListId:
          type: number
          description: ID of the priceList related to the SKU or item
          example: 100000
        offers:
          type: array
          maxItems: 10
          minItems: 1
          description: Prices of the SKU/priceListId.
          items:
            type: object
            required:
              - channel
              - startDate
              - endDate
              - price
            properties:
              kind:
                description: >-
                  Pricekind ID. This ID helps to identify if the price is base
                  price or clearance price or any other additional price.
                type: number
                example: 12
              channel:
                description: Channel ID
                type: number
                example: 12
              startDate:
                description: Start date of the price
                type: string
                format: date-time
              endDate:
                description: End date of the price
                type: string
                format: date-time
              price:
                type: object
                description: Price data
                required:
                  - base
                  - currency
                properties:
                  base:
                    description: Minimum fixed price of item.
                    type: number
                    example: 299
                  sale:
                    description: Price at which product is offered for sale
                    type: number
                    example: 199
                  cost:
                    type: number
                    example: 149
                    description: Cost price of the item if any.
                  currency:
                    type: string
                    example: USD
                    description: Currency code of the price.
              range:
                type: array
                description: Range of prices if any.
                minItems: 1
                items:
                  type: object
                  properties:
                    minQuantity:
                      type: number
                      description: Minimum quantity to get a specific offer price.
                      example: 3
                    maxQuantity:
                      oneOf:
                        - type: string
                        - type: number
                      example: Infinity
                      description: Maximum quantity to get a specific price.
                    price:
                      description: >-
                        Price for the specific range. This price only exists if
                        width is not provided. That is, when the price method
                        types are `Range-Base` and
                        `SurfaceArea_Square_Increment`.
                      type: number
                      example: 299
                    width:
                      description: >-
                        Only for 2 dimensional price calculations, meaning when
                        price-method-type is
                        `SurfaceArea_Square_Increment_2Dim`. It exists if the
                        above `price` is not sent.
                      type: array
                      items:
                        type: object
                        properties:
                          minQuantity:
                            type: number
                            description: Minimum quantity to get a specific offer price.
                            example: 3
                          maxQuantity:
                            description: Maximum quantity to get a specific offer price.
                            oneOf:
                              - type: string
                              - type: number
                            example: Infinity
                          price:
                            description: Price for the width range.
                            type: number
                            example: 299
              priceMethodType:
                description: >-
                  Type of method for calculating the price. <br />
                  **Range-Base:** Uses the quantity of sold items to determine
                  which price to use. Base price (minimum fixed price) is
                  ignored in this method.<br />
                  **SurfaceArea_Square_Increment:** Adds an incremental amount
                  depending on the area of the item. The final price is
                  calculated by adding the area multiplied by the price set for
                  quantity, to the base price. For example, if we sell a rug
                  that is 10x2, final price will be the base price (50, for
                  example), plus an increment of the area (20) times the price
                  range set for min quantity.<br />
                  **SurfaceArea_Square_Increment_2Dim:** Adds extra price to the
                  base price, determined by the area. The difference with this
                  Square Area method is that in this case the overprice is not
                  calculated, but instead it is looked-up in a table-like
                  structure that is already created, by checking for the range
                  of values provided in `width`.
                type: string
                enum:
                  - Range-Base
                  - SurfaceArea_Square_Increment
                  - SurfaceArea_Square_Increment_2Dim
                example: Range-Base
              priceAttributes:
                type: array
                description: Price attributes/add-ons for the item
                items:
                  type: object
                  properties:
                    blindMotor:
                      type: number
                      example: 30
                      description: Price of the attribute/addon
              additionalAttributes:
                type: array
                description: A placeholder for additional attributes, in key-value pairs.
                items:
                  type: object
                  properties:
                    customSkuTitle:
                      type: string
                      example: HOUSE TREE
                    customCategory:
                      type: string
                      example: HOME
        createdAt:
          type: string
          format: date-time
          example: '2020-02-02T17:22:48.570Z'
          description: Date of creation of the price.
        updatedAt:
          type: string
          format: date-time
          example: '2020-02-02T17:22:48.570Z'
          description: Last updated date of the price.
        job:
          type: boolean
          description: >-
            true: Job is running<br /> false: Job operation is either completed
            or not running for some reason
          example: false
        offerId:
          type: number
          example: 1074
          description: ID of the created offer for the itemId or itemSku
        query:
          type: object
          description: >-
            Pagination details of Offers array. This field will only exist if
            the `isActive` flag is false.
          required:
            - count
            - page
            - limit
          properties:
            count:
              description: The total number of records.
              example: 15
              type: number
            page:
              description: Page number to return. Always paired with `limit`
              example: 1
              type: number
            limit:
              description: The maximum number of records per page.
              example: 10
              type: number
              default: 10
    priceEntryNotFound:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: PRICE_NOT_FOUND
        message:
          description: The error message corresponding to the `code`.
          type: string
          example: No price entry found.
    deletePricebyIdResponse:
      allOf:
        - $ref: '#/components/schemas/priceWoOffers'
        - type: object
          properties:
            offers:
              type: array
              items:
                type: object
              example: []
            isSoftDeleted:
              example: true
    UpdatePriceRange:
      type: object
      required:
        - _id
        - channel
        - price
        - priceMethodType
        - range
      properties:
        _id:
          description: Databse ID (_id) of the specific offer object you want to update
          type: string
          example: 6160b94245e7cd32de097975
        kind:
          description: >-
            Pricekind ID. This ID helps to identify if the price is base price
            or clearance price or any other additional price.
          type: number
          example: 12
        channel:
          description: Sales channel ID
          type: number
          example: 12
        startDate:
          description: Price start date-time
          type: string
          format: date-time
          example: '2021-05-04T08:30:00.459Z'
        endDate:
          description: Price end date-time
          type: string
          format: date-time
          example: '2021-07-04T08:30:00.459Z'
        price:
          type: object
          description: Price details
          required:
            - base
          properties:
            base:
              description: Minimum fixed price of item, accepts zero
              type: number
              example: 299
            sale:
              description: Price at which the product is offered for sale
              type: number
              example: 199
              default: null
            cost:
              type: number
              example: 149
              description: Cost of the item
            currency:
              type: string
              example: USD
              description: Currency code of the price for the item
        priceMethodType:
          type: string
          description: >-
            Type of method for calculating the price. <br /> **Range-Base:**
            Uses the quantity of sold items to determine which price to use.
            Base price (minimum fixed price) is ignored in this method.<br />
            **SurfaceArea_Square_Increment:** Adds an incremental amount
            depending on the area of the item. The final price is calculated by
            adding the area multiplied by the price set for quantity, to the
            base price. For example, if we sell a rug that is 10x2, final price
            will be the base price (50, for example), plus an increment of the
            area (20) times the price range set for min quantity.<br />
            **SurfaceArea_Square_Increment_2Dim:** Adds extra price to the base
            price, determined by the area. The difference with this Square Area
            method is that in this case the overprice is not calculated, but
            instead it is looked-up in a table-like structure that is already
            created, by checking for the range of values provided in `width`.
          example: SurfaceArea_Square_Increment_2Dim
          enum:
            - Range-Base
            - SurfaceArea_Square_Increment
            - SurfaceArea_Square_Increment_2Dim
        range:
          type: array
          description: Different ranges to calculate the price
          items:
            type: object
            required:
              - minQuantity
              - price
            properties:
              minQuantity:
                type: number
                example: 1
                description: >-
                  Minimum quantity of items or length of the item to get this
                  range price or offer price
              maxQuantity:
                oneOf:
                  - type: string
                    example: Infinity
                    description: '`Infinity` if that is the maximum value'
                  - type: number
                    example: 90
                    description: Set the maximum quantity to get range price or offer price
                description: >-
                  Maximum quantity of items or length of the item to get this
                  range price
              price:
                type: number
                example: 20.75
                description: >-
                  Price for the specific range. Add when width is not provided.
                  That is, when the price method types are `Range-Base` and
                  `SurfaceArea_Square_Increment`.
              width:
                type: array
                description: >-
                  Only for 2 dimensional price calculations, meaning when
                  price-method-type is `SurfaceArea_Square_Increment_2Dim`. It
                  exists if the above `price` is not sent.
                items:
                  type: object
                  required:
                    - minQuantity
                    - maxQuantity
                    - price
                  properties:
                    minQuantity:
                      type: number
                      example: 1
                      description: Minimum quantity to get range price
                    maxQuantity:
                      oneOf:
                        - type: string
                          example: Infinity
                          description: '`Infinity` if that is the maximum value'
                        - type: number
                          example: 5
                          description: Set the maximum quantity to get range price
                      description: Maximum quantity to get range price as set
                    price:
                      type: number
                      example: 20.75
                      description: Price for the specific range
        priceAttributes:
          type: array
          description: Price attributes/add-ons for the item
          items:
            type: object
            properties:
              blindMotor:
                type: number
                example: 30
                description: Price of the attribute/addon
    priceListNotFoundError:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: PRICE_LIST_DATA_NOT_FOUND
        message:
          description: The error message corresponding to the `code`.
          type: string
          example: Price list ID not found
    priceGuard:
      type: object
      properties:
        _id:
          description: fabric database ObjectId of the record
          type: string
          example: 614b58924e92f6861ac9d43b
        itemId:
          description: Item ID
          type: integer
          example: 10000000123
        itemSku:
          description: Item SKU
          type: string
          example: DEF-SKU-1
        priceListId:
          description: ID of the pricelist under which the price kinds are created
          type: integer
          example: 100000
        MSRP:
          description: Manufacturer suggested retail price
          type: number
          example: 299
        MAP:
          description: Minimum advertised price
          type: number
          example: 299
        ceiling:
          type: number
          description: >-
            Maximum price the seller is allowed to charge for the product. Price
            created for the item ID or item SKU under the specified pricelist
            should not exceed the given ceiling price.
          example: 299
        floor:
          type: number
          description: >-
            Lowest price at which the product can be sold. Price created for the
            item ID or item SKU under the specified pricelist should not be
            lower than the given floor price.
          example: 299
        deleted:
          description: 'true: price guard is deleted<br /> false: price guard is not deleted'
          type: boolean
          example: false
        createdAt:
          description: Creation date of the record
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: Last updated date of the record
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    listPriceGuardResponse:
      type: object
      properties:
        query:
          description: Pagination details used for selecting list
          type: object
          properties:
            limit:
              description: The maximum number of records per page.
              type: number
              example: 10
              default: 10
            count:
              description: The total number of records.
              type: number
              example: 150
            offset:
              description: >-
                The number of records to skip before returning records. For
                example, when offset is 20 and limit is 10, this endpoint
                returns records from 21 to 30.
              type: number
              example: 10
              default: 0
            itemId:
              description: ID of the item for which price guard records are fetched
              type: number
              example: 100000001
            priceListId:
              description: ID of the pricelist for which price guard records are fetched
              type: number
              example: 100001
            sortBy:
              type: string
              description: Field by which records are sort. Default is `updatedAt`
              enum:
                - updatedAt
                - priceListId
                - priceListName
                - ItemId
              default: updatedAt
            sortOrder:
              type: string
              description: Sorting order- ascending or descending
              enum:
                - asc
                - desc
              default: desc
        data:
          description: Price guard details
          type: array
          items:
            $ref: '#/components/schemas/priceGuard'
    newPriceGuardRequest:
      type: object
      required:
        - itemId
        - priceListId
      properties:
        itemId:
          description: Item ID
          type: integer
          example: 10000000123
        itemSku:
          description: Item SKU
          type: string
          example: DEF-SKU-1
        priceListId:
          description: PriceList ID
          type: integer
          example: 100000
        MSRP:
          description: Manufacturer suggested retail price
          type: number
          example: 299
        MAP:
          description: Minimum advertised price
          type: number
          example: 299
        ceiling:
          type: number
          description: >-
            Maximum price the seller is allowed to charge for the product. Price
            created for the item ID or item SKU under the specified pricelist
            should not exceed the given ceiling price.
          example: 299
        floor:
          type: number
          description: >-
            Lowest price at which the product can be sold. Price created for the
            item ID or item SKU under the specified pricelist should not be
            lower than the given floor price.
          example: 299
    priceGuardValidationError:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: REQUEST_VALIDATION
        message:
          description: The error message corresponding to the `code`.
          type: string
          example: MSRP must be greater than 0
    priceGuardNotFound:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: PRICE_GUARD_NOT_FOUND
        message:
          description: The error message corresponding to the `code`.
          type: string
          example: No Price Guard record with this Id Found.
    deletedPriceGuard:
      type: object
      properties:
        _id:
          description: fabric database ObjectId of the record
          type: string
          example: 614b58924e92f6861ac9d43b
        itemId:
          description: Item ID
          type: integer
          example: 10000000123
        itemSku:
          description: Item SKU
          type: string
          example: DEF-SKU-1
        priceListId:
          description: Pricelist ID
          type: integer
          example: 100000
        MSRP:
          description: Manufacturer suggested retail price
          type: number
          example: 299
        MAP:
          description: Minimum advertised price
          type: number
          example: 299
        ceiling:
          type: number
          description: >-
            Maximum price the seller is allowed to charge for the product. Price
            created for the item ID or item SKU under the specified pricelist
            should not exceed the given ceiling price.
          example: 299
        floor:
          type: number
          description: >-
            Lowest price at which the product can be sold. Price created for the
            item ID or item SKU under the specified priceList should not be
            lower than the given floor price.
          example: 299
        deleted:
          description: >-
            true indicates the price guard is deleted<br /> false indicates the
            price guard is not deleted
          type: boolean
          example: false
        createdAt:
          description: Creation date of the record
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: Last updated date of the record
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    paginationRequestBody:
      type: object
      properties:
        limit:
          description: The maximum number of records per page.
          type: number
          example: 10
          default: 10
        page:
          description: >-
            The page number to be returned and `page` is always paired with
            `limit`
          type: number
          example: 1
    priceKind:
      type: object
      properties:
        priceKindId:
          type: number
          example: 10000001
          description: Pricekind ID
        name:
          type: string
          example: PRICE_KIND_01
          description: Name of the price kind
        channel:
          type: number
          example: 123
          description: Sales channel of the price kind from which the request is made
        isActive:
          type: boolean
          description: >-
            true: price kind is active and being applied to SKUs.<br /> false:
            price kind is inactive and is not being applied to SKUs at the
            moment.
          example: true
        isSoftDeleted:
          type: boolean
          description: >-
            true: price kind is removed from the list<br /> false: price kind is
            active and running, which means it is being applied to the SKUs.
          example: false
    priceKinds:
      type: array
      items:
        $ref: '#/components/schemas/priceKind'
    getPromoList:
      type: object
      properties:
        offset:
          type: number
          minimum: 0
          description: >-
            The number of records to skip before returning records. For example,
            when offset is 20 and limit is 10, this endpoint returns records
            from 21 to 30.
          example: 0
        limit:
          type: number
          default: 10
          minimum: 1
          maximum: 100
          description: The maximum number of records per page.
          example: 10
        keyword:
          type: string
          description: >-
            Keyword to filter the matched promotion titles or promotional codes
            or coupon codes
          example: PROMO
        sortBy:
          type: string
          description: Field by which you want to sort the records
          default: updatedAt
          enum:
            - updatedAt
            - title
            - startDate
            - endDate
          example: updatedAt
        sortOrder:
          type: string
          description: >-
            Sorting order of the records<br />**desc:** Descending order<br
            />**asc:** Ascending order
          default: desc
          enum:
            - desc
            - asc
          example: desc
    searchPromoRequest:
      type: object
      description: A sample request to search for promotions or coupons.
      properties:
        offset:
          type: number
          minimum: 0
          description: >-
            The number of records to skip before returning records. For example,
            when offset is 20 and limit is 10, this endpoint returns records
            from 21 to 30.
          example: 0
        limit:
          type: number
          default: 10
          minimum: 1
          maximum: 100
          description: The maximum number of records per page.
          example: 10
        sort:
          description: >-
            The criteria to sort the results. Use the format {sort order}{field
            name}, where `-` refers to a descending order and `+` refers to an
            ascending order.
          type: string
          enum:
            - +updatedAt
            - +title
            - +startDate
            - +endDate
            - +level
            - '-updatedAt'
            - '-title'
            - '-startDate'
            - '-endDate'
            - '-level'
        filters:
          type: array
          items:
            type: object
            description: The filter conditions.
            maxItems: 20
            required:
              - field
              - value
              - operator
            properties:
              field:
                type: string
                description: >-
                  Represents the field name or title. If you're searching for
                  Black Friday promotions, this is the `title` of the promotion.
                minLength: 3
                maxLength: 120
                example: title
              value:
                description: >-
                  Represents the value or values corresponding to the `field`.
                  Use Black Friday as value to search for `Black Friday`
                  promotions.
                oneOf:
                  - type: string
                    minLength: 1
                    maxLength: 120
                    example: Black Friday
                  - type: array
                    minItems: 1
                    maxItems: 10
                    items:
                      description: >-
                        This is used to search for multiple values on the same
                        field.
                      oneOf:
                        - type: string
                          example: collectionId
                        - type: number
                          example: 100000234
                        - type: object
                          properties:
                            name:
                              type: string
                              description: >-
                                The criteria to search based on the name of a
                                segment or additional attributes.
                              minLength: 1
                              maxLength: 120
                              example: Season
                            value:
                              description: >-
                                The value corresponding to the `name`. It is
                                used to search based on segments or additional
                                attributes.
                              oneOf:
                                - type: string
                                  minLength: 1
                                  maxLength: 120
                                  example: Winter
                                - type: boolean
                                  example: true
                                - type: number
                                  example: 111
              operator:
                type: string
                description: >-
                  The type of search operation. You can use multiple values
                  separated by commas for the IN operation. However, you can use
                  only a single value for the EQUALS, GREATER_THAN_OR_EQUAL_TO,
                  and LESS_THAN operations.
                enum:
                  - EQUAL
                  - GREATER_THAN_OR_EQUAL_TO
                  - LESS_THAN
                  - IN
                example: EQUAL
    discount:
      type: object
      required:
        - unit
        - value
        - 'ON'
      properties:
        unit:
          type: string
          description: >-
            Unit of discount; represents whether the discount is in percentage
            or by a certain amount
          enum:
            - '%OFF'
            - AMOUNT_OFF
            - FIXED
          example: '%OFF'
        value:
          type: number
          description: Discount value to be applied
          example: 10
        discountId:
          type: string
          description: >-
            Discount ID to link `discount` and `targetProduct`, and is required
            for BuyGet and SpendGet type promotions
          example: 1
        autoAdd:
          type: boolean
          description: >-
            To indicate if the evaluation API (from Dynamic Pricing Engine)
            should suggest free items. Currently used for BuyGet and SpendGet
            type promotions.
          default: false
          example: false
        'ON':
          type: object
          description: Indicates kind of products promotion is applied on.
          required:
            - kind
            - value
          properties:
            kind:
              type: string
              description: >-
                SKU if discount is on products<br /> `SERVICE` if discount is on
                an SKU shipping cost<br /> `SERVICE_CART` if discount is on cart
                shipping cost
              enum:
                - SKU
                - CART
                - SERVICE
                - SERVICE_CART
              example: SKU
            value:
              oneOf:
                - type: string
                  example: '*'
                - type: array
                  items:
                    type: object
            quantity:
              type: number
              description: >-
                Quantity of items to be sold for the discount to be applied. It
                is required when `type` is SPEND_GET, BUYGET, BOGO (Buy One Get
                One)
              example: 2
            includeOperator:
              type: string
              description: >-
                Select the `AND` or `OR` condition to include products in a
                promotion. <br /> Use the `OR` condition to apply a single rule
                for product inclusion. <br /> Use the `AND` condition to apply
                multiple rules for product inclusion.
              example: OR
              default: OR
              enum:
                - AND
                - OR
            excludeOperator:
              type: string
              description: >-
                Select the `AND` or `OR` condition to exclude products from a
                promotion. <br /> Use the `OR` condition to apply a single rule
                for product exclusion. <br /> Use the `AND` condition to apply
                multiple rules for product exclusion.
              example: AND
              default: AND
              enum:
                - AND
                - OR
        set:
          type: array
          description: >-
            It is used to create a group of items in a set so that you can
            easily apply promotions or coupons to the defined set of items.
          items:
            type: string
            enum:
              - A
              - B
              - C
              - D
              - E
              - F
              - G
              - H
              - I
              - J
              - K
              - L
              - M
              - 'N'
              - O
              - P
              - Q
              - R
              - S
              - T
              - U
              - V
              - W
              - X
              - 'Y'
              - Z
    targetProduct:
      type: object
      description: Represents the type or kind of products to which discount is applied
      required:
        - kind
        - value
        - operator
      properties:
        kind:
          type: string
          description: Selection of product type
          enum:
            - SKU
            - CATEGORY
            - ATTRIBUTE
            - PRICE_KIND
            - PREVIOUS_DISCOUNT
          example: SKU
        value:
          description: >-
            Value for the kind as defined above.<br /> For `SKU`, value can be
            array of itemIds or array of SKU descriptions.<br /> For `Category`,
            value can be array of category IDs or category descriptions.<br />
            For `Attribute`, value can be array of attribute objects, for
            example [{name: 'attribute-name', value:'attribute-value'}]
          oneOf:
            - type: string
              description: >-
                Description of the product. Here * indicates that all products
                are selected for the discount to be applied.
              example: '*'
            - type: array
              items:
                oneOf:
                  - type: number
                    description: >-
                      SKU ID. [1000000234, 1000000445] could be array of itemIds
                      if you want to apply promotion on selected items
                    example: 1000000234
                  - type: string
                    description: SKU description
                    example: >-
                      Kitchen items. [Kitchen items, Garden light] could be
                      array of items if you want to apply promotion on selected
                      items
        operator:
          description: >-
            The type of search operation. You can use multiple values separated
            by commas for the IN and NOT_IN operations. However, you can use
            only a single value for the EQUALS and GREATER_THAN operations.
          type: string
          enum:
            - IN
            - NOT_IN
            - EQUAL
            - GREATER_THAN
          example: IN
        discountId:
          type: string
          description: >-
            Discount ID to link discount and targetProduct, and is required for
            BuyGet and SpendGet promotions
          example: 1
    termsAndConditions:
      type: object
      properties:
        title:
          type: string
          description: Title of the terms and conditions
          example: Terms Applied
        description:
          type: string
          description: Description of the terms and conditions
          example: Items cannot be exchanged
    promotionMessage:
      type: object
      description: Message description for the promotion
      properties:
        title:
          type: string
          description: Message name
          example: Buy 1 get 1 free
        message:
          type: string
          description: Message description
          example: Offer valid at participating stores through September 5, 2023.
        pages:
          type: array
          description: Types of web pages where the message will be displayed
          items:
            type: string
            description: Page type
            example: PDP
          example:
            - PDP
            - Cart
        locales:
          type: array
          description: >-
            Locales in which promotion message will be displayed. Locale is a
            set of language or country-based preferences for user interface.
          items:
            type: string
            description: Locale
            example: en-CA
          example:
            - en-CA
            - fr-CA
    proximityMessage:
      type: object
      properties:
        threshold:
          type: integer
          minimum: 0
          description: The proximity threshold value.
        localizedMessages:
          type: array
          items:
            type: object
            properties:
              locales:
                type: array
                items:
                  type: string
                  description: The intended language or target region for the message.
              message:
                type: string
                description: The localized message for the specified locales.
    promoResponse:
      type: object
      properties:
        _id:
          type: string
          description: A 24-character system-generated promotion ID.
          example: abcdefg1ee7ce20123456789
        promoId:
          type: number
          description: A unique identifier of the promotion, for external use.
          example: 100013
        promoCodes:
          type: array
          description: >-
            A list of coupon codes that are applicable only for coupons. For
            coupons, the response includes promo codes associated with the
            coupon. For promotions, the response includes an empty array.
          example:
            - SUMMER100
            - SUMMER20
          items:
            type: string
        state:
          type: string
          description: >-
            Promotion status. <br /> `ACTIVE` indicates that the promotion is
            applied to SKUs or items for which it is set as *Active*. Active
            promotions cannot be disabled.<br />`SCHEDULED` indicates that the
            promotion is scheduled to be applied to SKUs or items based on the
            defined start date.<br />`DISABLED` indicates that the promotion is
            set as *disabled* and is not in use. Only *Disabled* promotions can
            be enabled.<br />`EXPIRED` indicates that the promotion is stopped
            by setting the expiration date. That is, the start date and end date
            as the current date. Only those promotions that are *not expired*
            can be enabled.
          enum:
            - ACTIVE
            - SCHEDULED
            - DISABLED
            - EXPIRED
          example: SCHEDULED
        isImplicit:
          type: boolean
          description: >-
            A flag indicating whether an offer is applied automatically. Set it
            to `true` for promotions, which should be applied automatically and
            `false` for coupons, which must be applied explicitly.
          example: true
        title:
          type: string
          description: Title of the promotion
          example: CREATE PROMO
        buyOperator:
          type: string
          description: >-
            It is used to define operator between different *Buy* conditions
            (different conditions as mentioned in the `condition` object)
          default: OR
          enum:
            - AND
            - OR
          example: OR
        promo:
          type: array
          items:
            type: object
            properties:
              discount:
                type: array
                description: Discount details
                items:
                  $ref: '#/components/schemas/discount'
              targetProducts:
                type: array
                description: The products the discount is applied to.
                items:
                  $ref: '#/components/schemas/targetProduct'
              condition:
                type: array
                description: List of linked condition IDs to the promotion
                items:
                  type: string
                  example: 620d84a715f2d00001234567
        startDate:
          type: string
          format: date-time
          description: Start date of the promotion
          example: '2019-08-24T14:15:22Z'
        endDate:
          type: string
          format: date-time
          description: End date of the promotion
          example: '2019-08-25T14:15:22Z'
        isExclusive:
          type: boolean
          description: >-
            A flag indicating whether a coupon can be stacked with an existing
            promotion. Set it to `true` to prevent the coupon from being applied
            to items that have promotions and `false` to allow coupon to be
            applied with existing promotions.
          example: true
        type:
          type: string
          description: >-
            Promotion type.<br /> **Product:** SKU promotion. Promotion or
            discount on SKUs based on the value mentioned in *discount*
            object<br />**CART:** Cart promotion. Promotion or discount on cart
            amount based on the *ORDER_VALUE* that is set in *condition*
            object<br />**QUANTITY:** Quantity promotion provides discounts
            based on the quantity requirement set in the promotion<br
            />**BOGO:** Buy One Get One promotion provides discounts based on
            the Buy conditions and Get discounts<br />**SHIPPING:** Shipping
            promotion provides discounts on the shipping cost<br />**BUYGET:**
            BuyGet promotion specifies the Buy conditions and Get discounts<br
            />**SPEND_GET:** SpendGet promotion can specify the requirement of
            cart order value and the corresponding Get discounts
          enum:
            - PRODUCT
            - CART
            - QUANTITY
            - BOGO
            - SHIPPING
            - BUYGET
            - SPEND_GET
          example: PRODUCT
        stackingType:
          type: string
          description: >-
            Defines the rules for how a promotion can be combined with other
            promotions.  This field determines whether a specific promotion can
            be applied in conjunction  with other active promotions during a
            transaction or if it must be used exclusively. Possible values: -
            `STACKABLE`: This promotion can be combined with other stackable
            promotions, allowing multiple 
              discounts to be applied together. The order in which stackable promotions are applied 
              is determined by the `level` field, with promotions having a higher priority (lower numeric value)
              being applied before those with a lower priority.
            - `EXCLUSIVE`: This promotion cannot be combined with any other
            promotions. The `level` field is
              used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive
              promotion is applied, no other promotions can be used in the same transaction.
            - `TYPE_EXCLUSIVE`: This promotion cannot be combined with other
            promotions of the same type.
              The `level` field is used to determine which promotion within the same type will be evaluated and
              applied first.
            - `UNIVERSAL`: This promotion can be combined with any other
            promotions without restrictions.
              Universal promotions will be evaluated last. We don't need to define `level` for this type.
          enum:
            - STACKABLE
            - EXCLUSIVE
            - TYPE_EXCLUSIVE
            - UNIVERSAL
          example: STACKABLE
        level:
          type: integer
          format: int32
          description: >-
            The promotion execution order. Promotion types are assigned default
            execution orders. Initial evaluation begins with level 1 promotions.
            The result of level 1 is used as the base price for level 2.
            Similarly, the result of level 2 becomes the base price for level 3,
            and so on.
          example: 1
        termsAndConditions:
          type: array
          items:
            $ref: '#/components/schemas/termsAndConditions'
        promotionMessages:
          type: array
          items:
            $ref: '#/components/schemas/promotionMessage'
        proximityMessages:
          type: array
          items:
            $ref: '#/components/schemas/proximityMessage'
        shipmentMethodIds:
          type: array
          description: >-
            Required for Shipping type promo to provide eligible shipment
            Methods
          items:
            type: string
            description: >-
              Shipping method IDs of the shipping methods to which promotion is
              applicable
            example: 1000001
        eligiblePriceList:
          type: array
          description: IDs of the price lists to which this promotion is applied
          items:
            type: number
            example: 10000056
        limits:
          type: array
          description: Array of limits for the promotion to be applied
          items:
            type: object
            properties:
              kind:
                type: string
                description: Kind of limit for the promotion to be applied
                example: ORDER
              value:
                description: Value of limit for the promotion to be applied
                type: number
                example: 2
        note:
          type: string
          example: Independence day sale!
          description: Promotion note or description
        createdAt:
          type: string
          format: date-time
          description: Creation date of the record
          example: '2019-08-20T14:15:22Z'
        updatedAt:
          type: string
          format: date-time
          description: Last updated date of the record
          example: '2019-08-20T14:15:22Z'
    promoListObject:
      type: object
      description: >-
        Represents the conditions based on which the promotions apply.  For
        example, consider the `type` is `USER_SEGMENT` with multiple values. To
        target all the specified segments, use the `AND` operator and to target
        any one of the segments, use the `OR` operator.
      properties:
        _id:
          type: string
          description: A 24-character system-generated promotion ID.
          example: abcdefg1ee7ce20123456789
        promoId:
          type: number
          description: A unique identifier of the promotion, for external use.
          example: 100013
        promoCodes:
          type: array
          description: >-
            A list of coupon codes that are applicable only for coupons. For
            coupons, the response includes promo codes associated with the
            coupon. For promotions, the response includes an empty array.
          example:
            - SUMMER100
            - SUMMER20
          items:
            type: string
        promoCount:
          type: number
          description: >-
            The number of coupon codes associated with a coupon. This value is
            always `0` for promotions.
          example: 0
        state:
          type: string
          description: >-
            The status of the promotion. <br />1. `ACTIVE` indicates the
            promotion is live and available. <br />2. `SCHEDULED` indicates the
            promotion is set up and is scheduled to be active in a future date.
            <br />3. `DISABLED` indicates the promotion is turned off and can be
            re-enabled at a later time if required. <br />4. `EXPIRED` indicates
            the promotion is no longer valid.
          enum:
            - ACTIVE
            - SCHEDULED
            - DISABLED
            - EXPIRED
          example: SCHEDULED
        isImplicit:
          type: boolean
          description: >-
            A flag indicating whether an offer is applied automatically. Set it
            to `true` for promotions, which should be applied automatically and
            `false` for coupons, which must be applied explicitly.
          example: true
        title:
          type: string
          description: The name of the promotion.
          example: CREATE PROMO
        startDate:
          type: string
          format: date-time
          description: The start time of the promotion, in UTC format.
          example: '2019-08-24T14:15:22Z'
        endDate:
          type: string
          format: date-time
          description: The end time of the promotion, in UTC format.
          example: '2019-08-25T14:15:22Z'
        isExclusive:
          type: boolean
          description: >-
            A flag indicating whether a coupon can be stacked with an existing
            promotion. Set it to `true` to prevent the coupon from being applied
            to items that already have promotions and `false` to allow coupon to
            be applied with existing promotions.
          example: true
        eligiblePriceList:
          type: array
          description: The price lists to be considered for the given promotion.
          items:
            type: number
            example: 10000056
        level:
          type: integer
          format: int32
          description: >-
            The promotion execution order. Promotion types are assigned default
            execution orders. Initial evaluation begins with level 1 promotions.
            The result of level 1 is used as the base price for level 2.
            Similarly, the result of level 2 becomes the base price for level 3,
            and so on.
          example: 1
        stackingType:
          type: string
          description: >-
            Defines the rules for how a promotion can be combined with other
            promotions.  This field determines whether a specific promotion can
            be applied in conjunction  with other active promotions during a
            transaction or if it must be used exclusively. Possible values: -
            `STACKABLE`: This promotion can be combined with other stackable
            promotions, allowing multiple 
              discounts to be applied together. The order in which stackable promotions are applied 
              is determined by the `level` field, with promotions having a higher priority (lower numeric value)
              being applied before those with a lower priority.
            - `EXCLUSIVE`: This promotion cannot be combined with any other
            promotions. The `level` field is
              used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive
              promotion is applied, no other promotions can be used in the same transaction.
            - `TYPE_EXCLUSIVE`: This promotion cannot be combined with other
            promotions of the same type.
              The `level` field is used to determine which promotion within the same type will be evaluated and
              applied first.
            - `UNIVERSAL`: This promotion can be combined with any other
            promotions without restrictions.
              Universal promotions will be evaluated last.
          enum:
            - STACKABLE
            - EXCLUSIVE
            - TYPE_EXCLUSIVE
            - UNIVERSAL
          example: STACKABLE
        updatedAt:
          type: string
          format: date-time
          description: The time when the promotion was last updated, in UTC format.
          example: '2019-08-20T14:15:22Z'
    promoListResponse:
      type: object
      properties:
        query:
          type: object
          properties:
            limit:
              type: number
              description: The maximum number of records per page.
              example: 10
              default: 10
            offset:
              type: number
              description: >-
                The number of records to skip before returning records. For
                example, when offset is 20 and limit is 10, this endpoint
                returns records from 21 to 30.
              example: 0
              default: 0
            count:
              type: number
              description: The total number of records.
              example: 50
        promos:
          type: array
          items:
            $ref: '#/components/schemas/promoListObject'
    promoSearchResponse:
      type: object
      description: The pagination data.
      properties:
        query:
          type: object
          properties:
            limit:
              type: number
              description: The maximum number of records per page.
              example: 10
              default: 10
            offset:
              type: number
              description: >-
                The number of records to skip before returning records. For
                example, when offset is 20 and limit is 10, this endpoint
                returns records from 21 to 30.
              example: 0
              default: 0
            count:
              type: number
              description: The total number of records.
              example: 50
        data:
          description: The promotion details.
          type: array
          items:
            $ref: '#/components/schemas/promoListObject'
    condition:
      type: object
      required:
        - key
        - value
        - operator
      properties:
        key:
          type: string
          example: SKU
          enum:
            - SKU
            - QUANTITY
            - CATEGORY
            - ATTRIBUTE
            - PRICE_KIND
            - CHANEL
            - ORDER_VALUE
            - USER_SEGMENT
            - USER_KIND
        value:
          oneOf:
            - type: string
              description: The value corresponding to the `key`.
              example: '*'
            - type: array
              items:
                oneOf:
                  - type: number
                    description: >-
                      The Stock Keeping Units (SKUs) of items or item IDs.
                      Either SKUs or itemIds must be specified to apply discount
                      on selected item or items.
                    example:
                      - 1000000234
                      - 1000000445
                  - type: string
                    description: The description of the SKU or item IDs.
                    example:
                      - Garden light
                      - Indoor light
        operator:
          type: string
          description: >-
            Defines the condition for `key` and `value` set passed in the
            object. For example, IN indicates that the `key` and `value` set are
            included for promotion to be applied.
          example: IN
          enum:
            - NOT_EQUAL
            - EQUAL
            - GREATER_THAN
            - LESS_THAN
            - GREATER_THAN_OR_EQUAL_TO
            - LESS_THAN_OR_EQUAL_TO
            - NOT_IN
            - IN
    promoCondition:
      type: object
      required:
        - operator
        - conditions
      properties:
        operator:
          type: string
          description: >-
            Conditional operator to be applied between each object of conditions
            array
          enum:
            - AND
            - OR
        includeOperator:
          type: string
          description: >-
            Select the `AND` or `OR` condition to include products in a
            promotion. <br /> Use the `OR` condition to apply a single rule for
            product inclusion. <br /> Use the `AND` condition to apply multiple
            rules for product inclusion.
          default: OR
          example: OR
          enum:
            - AND
            - OR
        excludeOperator:
          type: string
          description: >-
            To exclude products from promotions, select the `AND` or `OR`
            operator for product exclusion rules. <br /> Use the `OR` operator
            to apply a single rule for product exclusion. <br /> Use the `AND`
            operation to apply multiple rules for product exclusion.
          default: AND
          example: AND
          enum:
            - AND
            - OR
        conditions:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/condition'
        set:
          type: string
          default: A
          description: >-
            It is used to create a group of items in a set so that you can
            easily apply promotions or coupons to the defined set of items.
          enum:
            - A
            - B
            - C
            - D
            - E
            - F
            - G
            - H
            - I
            - J
            - K
            - L
            - M
            - 'N'
            - O
            - P
            - Q
            - R
            - S
            - T
            - U
            - V
            - W
            - X
            - 'Y'
            - Z
    createPromo:
      type: object
      description: >-
        Following example shows creation of a promotion to get 10% off on any
        item sold with quantity 2 . If type is `PRODUCT` and kind is `SKU`,
        value as `*` indicates that all products are selected for the discount
        to be applied.
      required:
        - title
        - promo
        - startDate
        - endDate
        - isExclusive
        - type
      properties:
        title:
          type: string
          minLength: 3
          maxLength: 120
          description: Promotion title
          example: CREATE PROMO
        buyOperator:
          type: string
          description: >-
            It is used to define operator between different *Buy* conditions
            (different conditions as mentioned in the `condition` object)
          default: OR
          enum:
            - AND
            - OR
          example: OR
        promo:
          type: array
          items:
            type: object
            minItems: 1
            required:
              - discount
              - targetProducts
              - condition
            properties:
              discount:
                type: array
                description: Discount information
                minItems: 1
                items:
                  $ref: '#/components/schemas/discount'
              targetProducts:
                type: array
                description: The products the discounts are applied to.
                minItems: 1
                items:
                  $ref: '#/components/schemas/targetProduct'
              condition:
                type: array
                description: Conditions for the promotion to be qualified
                minItems: 1
                items:
                  $ref: '#/components/schemas/promoCondition'
        startDate:
          type: string
          description: Start date of the promotion
          format: date-time
          example: '2019-08-24T14:15:22Z'
        endDate:
          type: string
          description: End date of the promotion
          format: date-time
          example: '2019-08-25T14:15:22Z'
        isExclusive:
          type: boolean
          description: >-
            A flag indicating whether a coupon can be stacked with an existing
            promotion. Set it to `true` to prevent the coupon from being applied
            to items that already have promotions and `false` to allow coupon to
            be applied with existing promotions.
          example: true
        type:
          type: string
          description: >-
            Promotion type.<br /> **Product:** SKU promotion. Promotion or
            discount on SKUs based on the value mentioned in *discount*
            object<br />**CART:** Cart promotion. Promotion or discount on
            minimum order amount of cart based on the *ORDER_VALUE* that is set
            in *condition* object<br />**QUANTITY:** Quantity promotion provides
            discounts on items based on the quantity requirement set in the
            promotion<br />**BOGO:** Buy One Get One promotion provides
            discounts based on the Buy conditions and Get discounts<br
            />**SHIPPING:** Shipping promotion provides discounts on the
            shipping cost<br />**BUYGET:** BuyGet promotion specifies the Buy
            conditions and Get discounts<br />**SPEND_GET:** SpendGet promotion
            can specify the requirement of cart order value and the
            corresponding Get discounts
          enum:
            - PRODUCT
            - CART
            - QUANTITY
            - BOGO
            - SHIPPING
            - BUYGET
            - SPEND_GET
          example: PRODUCT
        stackingType:
          type: string
          description: >-
            Defines the rules for how a promotion can be combined with other
            promotions.  This field determines whether a specific promotion can
            be applied in conjunction  with other active promotions during a
            transaction or if it must be used exclusively. Possible values: -
            `STACKABLE`: This promotion can be combined with other stackable
            promotions, allowing multiple 
              discounts to be applied together. The order in which stackable promotions are applied 
              is determined by the `level` field, with promotions having a higher priority (lower numeric value)
              being applied before those with a lower priority.
            - `EXCLUSIVE`: This promotion cannot be combined with any other
            promotions. The `level` field is
              used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive
              promotion is applied, no other promotions can be used in the same transaction.
            - `TYPE_EXCLUSIVE`: This promotion cannot be combined with other
            promotions of the same type.
              The `level` field is used to determine which promotion within the same type will be evaluated and
              applied first.
            - `UNIVERSAL`: This promotion can be combined with any other
            promotions without restrictions.
              Universal promotions will be evaluated last. We don't need to define `level` for this type.
          enum:
            - STACKABLE
            - EXCLUSIVE
            - TYPE_EXCLUSIVE
            - UNIVERSAL
          example: STACKABLE
        level:
          type: integer
          format: int32
          description: >-
            The promotion execution order. Promotion types are assigned default
            execution orders. Initial evaluation begins with level 1 promotions.
            The result of level 1 is used as the base price for level 2.
            Similarly, the result of level 2 becomes the base price for level 3,
            and so on.
          example: 1
        termsAndConditions:
          type: array
          items:
            $ref: '#/components/schemas/termsAndConditions'
        promotionMessages:
          type: array
          items:
            $ref: '#/components/schemas/promotionMessage'
        proximityMessages:
          type: array
          items:
            $ref: '#/components/schemas/proximityMessage'
        shipmentMethodIds:
          type: array
          description: >-
            The IDs of the shipping methods. They are required for promotions
            related to shipping.
          items:
            type: string
            example: 1000001
        eligiblePriceList:
          type: array
          description: IDs of the price lists to which this promotion is applied
          items:
            type: number
            example: 10000056
        limits:
          type: array
          description: Array of limits for the promotion to be applied
          items:
            type: object
            required:
              - kind
              - value
            properties:
              kind:
                type: string
                description: Kind of limit for the promotion to be applied
                example: ORDER
              value:
                description: Value of limit for the promotion to be applied
                type: number
                example: 2
        note:
          type: string
          example: Independence day sale!
          description: Promotion note or description
        additionalAttributes:
          type: array
          description: A placeholder for additional attributes, in key-value pairs.
          items:
            type: object
            description: Details of additional attributes.
            properties:
              key:
                type: string
                description: The attribute name.
                example: type
              value:
                description: The attribute value or values corresponding to the `key`.
                oneOf:
                  - type: string
                    description: The value of the additional attribute.
                    example: Birthday
                  - type: array
                    items:
                      type: string
                      description: The values of the additional attributes.
                      example:
                        - Birthday
                        - Holiday
              attributeId:
                type: number
                description: A unique identifier of the attribute.
                example: 100000
    promoCouponDateError:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: DATE_ERROR
        message:
          description: An error message corresponding to the `code`.
          type: string
          example: >-
            The start date should be earlier than the end date and it should be
            a future date.
    promoConditionUpdate:
      type: object
      required:
        - operator
        - conditions
      properties:
        id:
          description: >-
            To link the condition object to the promo. It's optional and if not
            provided, the existing one will be reused.
          type: string
          nullable: true
          example: akjhfds1239klhasdsa
        operator:
          type: string
          description: The operator for condition within each conditions array
          enum:
            - AND
            - OR
        includeOperator:
          type: string
          description: >-
            Select the `AND` or `OR` condition to include products in a
            promotion. <br /> Use the `OR` condition to apply a single rule for
            product inclusion. <br /> Use the `AND` condition to apply multiple
            rules for product inclusion.
          default: OR
          example: OR
          enum:
            - AND
            - OR
        excludeOperator:
          type: string
          description: >-
            Select the `AND` or `OR` condition to exclude products from a
            promotion. <br /> Use the `OR` condition to apply a single rule for
            product exclusion. <br /> Use the `AND` condition to apply multiple
            rules for product exclusion.
          example: AND
          default: AND
          enum:
            - AND
            - OR
        conditions:
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/condition'
        set:
          type: string
          default: A
          description: >-
            It is used to create a group of items in a set, and to easily apply
            promotions or coupons to the defined set of items.
          enum:
            - A
            - B
            - C
            - D
            - E
            - F
            - G
            - H
            - I
            - J
            - K
            - L
            - M
            - 'N'
            - O
            - P
            - Q
            - R
            - S
            - T
            - U
            - V
            - W
            - X
            - 'Y'
            - Z
    updatePromo:
      type: object
      required:
        - title
        - promo
        - startDate
        - endDate
        - isExclusive
        - type
      properties:
        title:
          type: string
          minLength: 3
          maxLength: 120
          description: Promotion title
          example: CREATE PROMO
        buyOperator:
          type: string
          description: >-
            It is used to define operator between different *Buy* conditions
            (different conditions as mentioned in the `condition` object)
          default: OR
          enum:
            - AND
            - OR
          example: OR
        promo:
          type: array
          items:
            type: object
            minItems: 1
            required:
              - discount
              - targetProducts
              - condition
            properties:
              discount:
                type: array
                description: Discount information
                minItems: 1
                items:
                  $ref: '#/components/schemas/discount'
              targetProducts:
                type: array
                description: The products the discount is applied to.
                minItems: 1
                items:
                  $ref: '#/components/schemas/targetProduct'
              condition:
                type: array
                minItems: 1
                description: Condition for the promotion to be qualified
                items:
                  $ref: '#/components/schemas/promoConditionUpdate'
        startDate:
          type: string
          format: date-time
          description: Start date of the promotion
          example: '2019-08-24T14:15:22Z'
        endDate:
          type: string
          format: date-time
          description: End date of the promotion
          example: '2019-08-25T14:15:22Z'
        isExclusive:
          type: boolean
          description: >-
            A flag indicating whether a coupon can be stacked with an existing
            promotion. Set it to `true` to prevent the coupon from being applied
            to items that already have promotions and `false` to allow coupon to
            be applied with existing promotions.
          example: true
        type:
          type: string
          description: >-
            Promotion type.<br /> **Product:** Promotion or discount on SKUs
            based on the value mention in *discount* object<br /> **CART:**
            Promotion or discount on cart amount based on the *ORDER_VALUE* that
            is set in *condition* object<br /> **QUANTITY:** Quantity promotion
            provides discounts based on the quantity requirement set in the
            promotion<br /> **BOGO:** Buy One Get One promotion provides
            discounts based on the Buy conditions and Get discounts<br />
            **SHIPPING:** Shipping promotion provides discounts on the shipping
            cost<br /> **BUYGET:** BuyGet promotion specifies the Buy conditions
            and Get discounts<br /> **SPEND_GET:** SpendGet promotion can
            specify the requirement of cart order value and get the
            corresponding discounts
          enum:
            - PRODUCT
            - CART
            - QUANTITY
            - BOGO
            - SHIPPING
            - BUYGET
            - SPEND_GET
          example: PRODUCT
        stackingType:
          type: string
          description: >-
            Defines the rules for how a promotion can be combined with other
            promotions.  This field determines whether a specific promotion can
            be applied in conjunction  with other active promotions during a
            transaction or if it must be used exclusively. Possible values: -
            `STACKABLE`: This promotion can be combined with other stackable
            promotions, allowing multiple 
              discounts to be applied together. The order in which stackable promotions are applied 
              is determined by the `level` field, with promotions having a higher priority (lower numeric value)
              being applied before those with a lower priority.
            - `EXCLUSIVE`: This promotion cannot be combined with any other
            promotions. The `level` field is
              used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive
              promotion is applied, no other promotions can be used in the same transaction.
            - `TYPE_EXCLUSIVE`: This promotion cannot be combined with other
            promotions of the same type.
              The `level` field is used to determine which promotion within the same type will be evaluated and
              applied first.
            - `UNIVERSAL`: This promotion can be combined with any other
            promotions without restrictions.
              Universal promotions will be evaluated last. We don't need to define `level` for this type.
          enum:
            - STACKABLE
            - EXCLUSIVE
            - TYPE_EXCLUSIVE
            - UNIVERSAL
          example: STACKABLE
        level:
          type: integer
          format: int32
          description: >-
            The promotion execution order. Promotion types are assigned default
            execution orders. Initial evaluation begins with level 1 promotions.
            The result of level 1 is used as the base price for level 2.
            Similarly, the result of level 2 becomes the base price for level 3,
            and so on.
          example: 1
        termsAndConditions:
          type: array
          items:
            $ref: '#/components/schemas/termsAndConditions'
        promotionMessages:
          type: array
          items:
            $ref: '#/components/schemas/promotionMessage'
        proximityMessages:
          type: array
          items:
            $ref: '#/components/schemas/proximityMessage'
        shipmentMethodIds:
          type: array
          description: >-
            Required for *Shipping* type promo to provide eligible shipment
            methods
          items:
            type: string
            example: 1000001
        eligiblePriceList:
          type: array
          description: IDs of the price lists to which this promotion is applied
          items:
            type: number
            example: 10000056
        limits:
          type: array
          description: Array of limits for the promotion to be applied
          items:
            type: object
            required:
              - kind
              - value
            properties:
              kind:
                type: string
                description: >-
                  Kind of limit for the promotion to be applied. ORDER kind is
                  applied to *PRODUCT* type and *BuyGet* type only.
                example: ORDER
              value:
                description: Value of limit for the promotion to be applied
                type: number
                example: 2
        note:
          type: string
          example: Independence day sale!
          description: Promo note or description
        additionalAttributes:
          type: array
          description: >-
            A placeholder for additional attributes associated with the
            promotion, in key-value pairs.
          items:
            type: object
            description: Details of additional attributes
            properties:
              key:
                type: string
                description: The attribute name.
                example: type
              value:
                description: The attribute value or values corresponding to the `key`.
                oneOf:
                  - type: string
                    description: The value of the additional attribute.
                    example: Birthday
                  - type: array
                    items:
                      type: string
                      description: The values of the additional attributes.
                      example:
                        - Birthday
                        - Holiday
              attributeId:
                type: number
                description: A unique ID of the attribute.
                example: 100000
    promoCouponNotFound:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: PROMO_NOT_FOUND
        message:
          description: The error message corresponding to the `code`.
          type: string
          example: The promo code you entered doesn't exist.
    promoResponseDetails:
      type: object
      properties:
        _id:
          type: string
          description: fabric internal unique id
          example: abcdefg1ee7ce20123456789
        promoId:
          type: number
          description: System generated unique ID of promotion
          example: 100013
        promoCodes:
          type: array
          description: >-
            A list of coupon codes that are applicable only for coupons. For
            coupons, the response includes promo codes associated with the
            coupon. For promotions, the response includes an empty array.
          example:
            - SUMMER100
            - SUMMER20
          items:
            type: string
            description: Discount coupon codes
            example: 2agh56tyBZ57hkli67y
        state:
          type: string
          description: >-
            Promotion status. <br /> **ACTIVE:** Promotion is applied to the
            SKUs or items for which it is set as *Active*. Active promotions
            cannot be disabled.<br />**SCHEDULED:** Promotion is scheduled to be
            applied to the SKUs or items based on the start date. <br
            />**DISABLED:** Promotion is set as *disabled* and is not in use.
            Only *Disabled* promotions can be enabled.<br />**EXPIRED:**
            Promotion is stopped by setting the expiration date. That is, the
            start date and end date are the same as current date. Only those
            promotions that are *not expired* can be enabled.
          enum:
            - ACTIVE
            - SCHEDULED
            - DISABLED
            - EXPIRED
          example: SCHEDULED
        isImplicit:
          type: boolean
          description: >-
            A flag indicating whether an offer is applied automatically. Set it
            to `true` for promotions, which should be applied automatically and
            `false` for coupons, which must be applied explicitly.
          example: true
        title:
          type: string
          description: Title of the promotion
          example: CREATE PROMO
        buyOperator:
          type: string
          description: >-
            It is used to define operator between different *Buy* conditions
            (different conditions as mentioned in the `condition` object)
          default: OR
          enum:
            - AND
            - OR
          example: OR
        promo:
          type: array
          items:
            type: object
            properties:
              discount:
                type: array
                description: Discount information
                items:
                  $ref: '#/components/schemas/discount'
              targetProducts:
                type: array
                description: The products the discount is applied to.
                items:
                  $ref: '#/components/schemas/targetProduct'
              condition:
                type: array
                description: Condition for the promotion to be qualified
                items:
                  $ref: '#/components/schemas/promoCondition'
        startDate:
          type: string
          format: date-time
          description: Start date of the promotion
          example: '2019-08-24T14:15:22Z'
        endDate:
          type: string
          format: date-time
          description: End date of the promotion
          example: '2019-08-25T14:15:22Z'
        isExclusive:
          type: boolean
          description: >-
            A flag indicating whether a coupon can be stacked with an existing
            promotion. Set it to `true` to prevent the coupon from being applied
            to items that already have promotions and `false` to allow coupon to
            be applied with existing promotions.
          example: true
        type:
          type: string
          description: >-
            Promotion type.<br /> **Product:** SKU promotion. Promotion or
            discount on SKUs based on the value mentioned in *discount*
            object<br />**CART:** Cart promotion. Promotion or discount on
            minimum cart amount based on the *ORDER_VALUE* that is set in
            *condition* object<br />**QUANTITY:** Quantity promotion provides
            discounts based on the quantity requirement set in the promotion<br
            />**BOGO:** Buy One Get One promotion provides discounts based on
            the Buy conditions and Get discounts<br />**SHIPPING:** Shipping
            promotion provides discounts on the shipping cost<br />**BUYGET:**
            BuyGet promotion specifies the Buy conditions and Get discounts<br
            />**SPEND_GET:** SpendGet promotion can specify the requirement of
            cart order value and the corresponding Get discounts
          enum:
            - PRODUCT
            - CART
            - QUANTITY
            - BOGO
            - SHIPPING
            - BUYGET
            - SPEND_GET
          example: PRODUCT
        stackingType:
          type: string
          description: >-
            Defines the rules for how a promotion can be combined with other
            promotions.  This field determines whether a specific promotion can
            be applied in conjunction  with other active promotions during a
            transaction or if it must be used exclusively. Possible values: -
            `STACKABLE`: This promotion can be combined with other stackable
            promotions, allowing multiple 
              discounts to be applied together. The order in which stackable promotions are applied 
              is determined by the `level` field, with promotions having a higher priority (lower numeric value)
              being applied before those with a lower priority.
            - `EXCLUSIVE`: This promotion cannot be combined with any other
            promotions. The `level` field is
              used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive
              promotion is applied, no other promotions can be used in the same transaction.
            - `TYPE_EXCLUSIVE`: This promotion cannot be combined with other
            promotions of the same type.
              The `level` field is used to determine which promotion within the same type will be evaluated and
              applied first.
            - `UNIVERSAL`: This promotion can be combined with any other
            promotions without restrictions.
              Universal promotions will be evaluated last. We don't need to define `level` for this type.
          enum:
            - STACKABLE
            - EXCLUSIVE
            - TYPE_EXCLUSIVE
            - UNIVERSAL
          example: STACKABLE
        level:
          type: integer
          format: int32
          description: >-
            The promotion execution order. Promotion types are assigned default
            execution orders. Initial evaluation begins with level 1 promotions.
            The result of level 1 is used as the base price for level 2.
            Similarly, the result of level 2 becomes the base price for level 3,
            and so on.
          example: 1
        termsAndConditions:
          type: array
          items:
            $ref: '#/components/schemas/termsAndConditions'
        promotionMessages:
          type: array
          items:
            $ref: '#/components/schemas/promotionMessage'
        proximityMessages:
          type: array
          items:
            $ref: '#/components/schemas/proximityMessage'
        shipmentMethodIds:
          type: array
          description: Required for *Shipping promo* to provide eligible shipment methods
          items:
            type: string
            example: 1000001
        eligiblePriceList:
          type: array
          description: IDs of the price lists to which this promotion is applied
          items:
            type: number
            example: 10000056
        limits:
          type: array
          description: >-
            The array of limits that are applied to the coupon. It should be
            empty array for all promotions except for BuyGet and Product
            promotions. That is, if the `type` is mentioned as Product and
            BuyGet.
          example: []
          items:
            type: object
        note:
          type: string
          example: Independence day sale!
          description: Promo note or description
        createdAt:
          type: string
          format: date-time
          description: Creation date of the record
          example: '2019-08-20T14:15:22Z'
        updatedAt:
          type: string
          format: date-time
          description: Last updated date of the record
          example: '2019-08-20T14:15:22Z'
    enableDisablePromo:
      type: object
      required:
        - enable
      properties:
        enable:
          description: >-
            flag to enable or disable a promotion.<br />If set it to true, this
            endpoint enables a disabled promotion.<br />If set to false, this
            endpoint disables an enabled promotion.
          type: boolean
          example: false
    couponListResponse:
      type: object
      properties:
        query:
          type: object
          properties:
            limit:
              type: number
              description: The maximum number of records per page.
              example: 10
              default: 10
            offset:
              type: number
              description: >-
                The number of records to skip before returning records. For
                example, when offset is 20 and limit is 10, this endpoint
                returns records from 21 to 30.
              example: 0
              default: 0
            count:
              type: number
              description: The total number of records.
              example: 50
        promos:
          type: array
          items:
            allOf:
              - $ref: '#/components/schemas/promoListObject'
              - type: object
                properties:
                  promoCodes:
                    example:
                      - SUMMER100
                      - SUMMER20
                  isImplicit:
                    example: false
                  promoCount:
                    example: 1
    createCoupon:
      type: object
      required:
        - title
        - promo
        - startDate
        - endDate
        - isExclusive
        - type
        - promoCodes
      properties:
        title:
          type: string
          minLength: 3
          maxLength: 120
          description: Coupon title
          example: CREATE COUPON
        buyOperator:
          type: string
          description: >-
            It is used to define operator between different *Buy* conditions
            (different conditions as mentioned in the `condition` object)
          default: OR
          enum:
            - AND
            - OR
          example: OR
        promo:
          type: array
          items:
            type: object
            minItems: 1
            required:
              - discount
              - targetProducts
              - condition
            properties:
              discount:
                type: array
                description: Discount information
                minItems: 1
                items:
                  $ref: '#/components/schemas/discount'
              targetProducts:
                type: array
                description: The products the discount is applied to.
                minItems: 1
                items:
                  $ref: '#/components/schemas/targetProduct'
              condition:
                type: array
                description: Condition for the promotion to be qualified
                minItems: 1
                items:
                  $ref: '#/components/schemas/promoCondition'
        startDate:
          type: string
          description: Start date of the promotion
          format: date-time
          example: '2019-08-24T14:15:22Z'
        endDate:
          type: string
          description: End date of the promotion
          format: date-time
          example: '2019-08-25T14:15:22Z'
        isExclusive:
          type: boolean
          description: >-
            A flag indicating whether a coupon can be stacked with an existing
            promotion. Set it to `true` to prevent the coupon from being applied
            to items that already have promotions and `false` to allow coupon to
            be applied with existing promotions.
          example: true
        type:
          type: string
          description: >-
            Promotion type.<br /> **Product:** SKU promotion. Promotion or
            discount on SKUs based on the value mentioned in *discount*
            object<br />**CART:** Cart promotion. Promotion or discount on
            minimum cart value based on the *ORDER_VALUE* that is set in
            *condition* object<br />**QUANTITY:** Quantity promotion provides
            discounts based on the quantity requirement set in the promotion<br
            />**BOGO:** Buy One Get One promotion provides discounts based on
            the Buy conditions and Get discounts<br />**SHIPPING:** Shipping
            promotion provides discounts on the shipping cost<br />**BUYGET:**
            BuyGet promotion specifies the Buy conditions and Get discounts<br
            />**SHIPPING:** Shipping promotion provides discounts on the
            shipping cost<br />**SPEND_GET:** SpendGet promotion can specify the
            requirement of cart order value and the corresponding Get discounts
          enum:
            - PRODUCT
            - CART
            - QUANTITY
            - BOGO
            - SHIPPING
            - BUYGET
            - SPEND_GET
          example: PRODUCT
        stackingType:
          type: string
          description: >-
            Defines the rules for how a promotion can be combined with other
            promotions.  This field determines whether a specific promotion can
            be applied in conjunction  with other active promotions during a
            transaction or if it must be used exclusively. Possible values: -
            `STACKABLE`: This promotion can be combined with other stackable
            promotions, allowing multiple 
              discounts to be applied together. The order in which stackable promotions are applied 
              is determined by the `level` field, with promotions having a higher priority (lower numeric value)
              being applied before those with a lower priority.
            - `EXCLUSIVE`: This promotion cannot be combined with any other
            promotions. The `level` field is
              used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive
              promotion is applied, no other promotions can be used in the same transaction.
            - `TYPE_EXCLUSIVE`: This promotion cannot be combined with other
            promotions of the same type.
              The `level` field is used to determine which promotion within the same type will be evaluated and
              applied first.
            - `UNIVERSAL`: This promotion can be combined with any other
            promotions without restrictions.
              Universal promotions will be evaluated last. We don't need to define `level` for this type.
          enum:
            - STACKABLE
            - EXCLUSIVE
            - TYPE_EXCLUSIVE
            - UNIVERSAL
          example: STACKABLE
        level:
          type: integer
          format: int32
          description: >-
            The promotion execution order. Promotion types are assigned default
            execution orders. Initial evaluation begins with level 1 promotions.
            The result of level 1 is used as the base price for level 2.
            Similarly, the result of level 2 becomes the base price for level 3,
            and so on.
          example: 1
        termsAndConditions:
          type: array
          items:
            $ref: '#/components/schemas/termsAndConditions'
        promotionMessages:
          type: array
          items:
            $ref: '#/components/schemas/promotionMessage'
        proximityMessages:
          type: array
          items:
            $ref: '#/components/schemas/proximityMessage'
        shipmentMethodIds:
          type: array
          description: >-
            Required for shipping type promo to provide eligible shipment
            methods
          items:
            type: string
            example: '1000001'
        eligiblePriceList:
          type: array
          description: IDs of the price lists to which this promotion is applied
          items:
            type: number
            example: 10000056
        note:
          type: string
          example: Independence day sale!
          description: Promotion note or description
        promoCodes:
          type: array
          description: >-
            A list of coupon codes that are applicable only for coupons. For
            coupons, the response includes promo codes associated with the
            coupon. For promotions, the response includes an empty array.
          items:
            type: string
            minLength: 4
            example:
              - SUMMER100
              - SUMMER20
        limits:
          description: Array of limits for the coupon to be applied
          type: array
          items:
            type: object
            required:
              - kind
              - value
            properties:
              kind:
                type: string
                description: >-
                  The type of coupon. The Order type applies only to the
                  `PRODUCT` and `BUYGET`.
                enum:
                  - PER_USER
                  - SITE_WIDE
                  - ORDER
                example: ORDER
              value:
                description: Value of limit for the coupon to be applied
                type: number
                example: 2
        additionalAttributes:
          type: array
          description: >-
            A placeholder for additional attributes associated with promotions,
            in key-value pairs.
          items:
            type: object
            description: Details of additional attributes.
            properties:
              key:
                type: string
                description: The attribute name.
                example: type
              value:
                description: The attribute value or values corresponding to the `key`.
                oneOf:
                  - type: string
                    description: The value of the additional attribute.
                    example: Birthday
                  - type: array
                    items:
                      type: string
                      description: The values of the additional attributes.
                      example:
                        - Birthday
                        - Holiday
              attributeId:
                type: number
                description: A unique identifier of the attribute.
                example: 100000
    updateCoupon:
      type: object
      required:
        - title
        - promo
        - startDate
        - endDate
        - isExclusive
        - type
        - promoCodes
      properties:
        title:
          type: string
          minLength: 3
          maxLength: 120
          description: Promotion or coupon title
          example: CREATE COUPON
        buyOperator:
          type: string
          description: >-
            It is used to define operator between different *Buy* conditions
            (different conditions as mentioned in the `condition` object)
          default: OR
          enum:
            - AND
            - OR
          example: OR
        promo:
          type: array
          items:
            type: object
            minItems: 1
            required:
              - discount
              - targetProducts
              - condition
            properties:
              discount:
                type: array
                description: Discount information
                minItems: 1
                items:
                  $ref: '#/components/schemas/discount'
              targetProducts:
                type: array
                description: The products the discount is applied to.
                minItems: 1
                items:
                  $ref: '#/components/schemas/targetProduct'
              condition:
                type: array
                minItems: 1
                description: Condition for the promotion to be qualified
                items:
                  $ref: '#/components/schemas/promoConditionUpdate'
        startDate:
          type: string
          format: date-time
          description: Start date of the promotion
          example: '2019-08-24T14:15:22Z'
        endDate:
          type: string
          format: date-time
          description: End date of the promotion
          example: '2019-08-25T14:15:22Z'
        isExclusive:
          type: boolean
          description: >-
            A flag indicating whether a coupon can be stacked with an existing
            promotion. Set it to `true` to prevent the coupon from being applied
            to items that already have promotions and `false` to allow coupon to
            be applied with existing promotions.
          example: true
        type:
          type: string
          description: >-
            Promotion type.<br /> **Product:** SKU promotion. Promotion or
            discount on SKUs based on the value mentioned in *discount*
            object<br />**CART:** Cart promotion. Promotion or discount on
            minimum cart value based on the *ORDER_VALUE* that is set in
            *condition* object<br />**QUANTITY:** Quantity promotion provides
            discounts based on the quantity requirement set in the promotion<br
            />**BOGO:** Buy One Get One promotion provides discounts based on
            the Buy conditions and Get discounts<br />**SHIPPING:** Shipping
            promotion provides discounts on the shipping cost<br />**BUYGET:**
            BuyGet promotion specifies the Buy conditions and Get discounts<br
            />**SHIPPING:** Shipping promotion provides discounts on the
            shipping cost<br />**SPEND_GET:** SpendGet promotion can specify the
            requirement of cart order value and the corresponding Get discounts
          enum:
            - PRODUCT
            - CART
            - QUANTITY
            - BOGO
            - SHIPPING
            - BUYGET
            - SPEND_GET
          example: PRODUCT
        stackingType:
          type: string
          description: >-
            Defines the rules for how a promotion can be combined with other
            promotions.  This field determines whether a specific promotion can
            be applied in conjunction  with other active promotions during a
            transaction or if it must be used exclusively. Possible values: -
            `STACKABLE`: This promotion can be combined with other stackable
            promotions, allowing multiple 
              discounts to be applied together. The order in which stackable promotions are applied 
              is determined by the `level` field, with promotions having a higher priority (lower numeric value)
              being applied before those with a lower priority.
            - `EXCLUSIVE`: This promotion cannot be combined with any other
            promotions. The `level` field is
              used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive
              promotion is applied, no other promotions can be used in the same transaction.
            - `TYPE_EXCLUSIVE`: This promotion cannot be combined with other
            promotions of the same type.
              The `level` field is used to determine which promotion within the same type will be evaluated and
              applied first.
            - `UNIVERSAL`: This promotion can be combined with any other
            promotions without restrictions.
              Universal promotions will be evaluated last. We don't need to define `level` for this type.
          enum:
            - STACKABLE
            - EXCLUSIVE
            - TYPE_EXCLUSIVE
            - UNIVERSAL
          example: STACKABLE
        level:
          type: integer
          format: int32
          description: >-
            The promotion execution order. Promotion types are assigned default
            execution orders. Initial evaluation begins with level 1 promotions.
            The result of level 1 is used as the base price for level 2.
            Similarly, the result of level 2 becomes the base price for level 3,
            and so on.
          example: 1
        termsAndConditions:
          type: array
          items:
            $ref: '#/components/schemas/termsAndConditions'
        promotionMessages:
          type: array
          items:
            $ref: '#/components/schemas/promotionMessage'
        proximityMessages:
          type: array
          items:
            $ref: '#/components/schemas/proximityMessage'
        shipmentMethodIds:
          type: array
          description: >-
            Required for Shipping type promo to provide eligible shipment
            Methods
          items:
            type: string
            example: 1000001
        eligiblePriceList:
          type: array
          description: IDs of the price lists to which this promotion is applied
          items:
            type: number
            example: 10000056
        promoCodes:
          type: array
          description: >-
            A list of coupon codes that are applicable only for coupons. For
            coupons, the response includes promo codes associated with the
            coupon. For promotions, the response includes an empty array.
          items:
            type: string
            minLength: 4
            example:
              - SUMMER100
              - SUMMER20
        limits:
          description: Array of limits for the coupon to be applied
          type: array
          items:
            type: object
            required:
              - kind
              - value
            properties:
              kind:
                type: string
                description: >-
                  Kind of limit for the coupon to be applied. ORDER kind is
                  applicable to **PRODUCT** type and **BUYGET** type only.
                enum:
                  - PER_USER
                  - SITE_WIDE
                  - ORDER
                example: ORDER
              value:
                description: Value of limit for the coupon to be applied
                type: number
                example: 2
        note:
          type: string
          example: Independence day sale!
          description: Promo note or description
        additionalAttributes:
          type: array
          description: >-
            A placeholder for additional attributes associated with promotions,
            in key-value pairs.
          items:
            type: object
            description: Details of additional attributes
            properties:
              key:
                type: string
                description: The attribute name.
                example: type
              value:
                description: The attribute value or values corresponding to the `key`.
                oneOf:
                  - type: string
                    description: The value of the additional attribute.
                    example: Birthday
                  - type: array
                    items:
                      type: string
                      description: The values of the additional attributes.
                      example:
                        - Birthday
                        - Holiday
              attributeId:
                type: number
                description: A unique identifier of the attribute.
                example: 100000
    generateCouponCodeRequest:
      type: object
      required:
        - prefix
        - start
        - count
      properties:
        prefix:
          type: string
          description: Prefix string to generate the coupon
          minLength: 2
          maxLength: 12
          example: SUMMER
        start:
          type: number
          description: Initial number to begin generating the coupon codes
          minimum: 1
          example: 1
        count:
          type: number
          description: Number of coupon codes to be generated
          minimum: 1
          example: 3
    generateCouponCodeResponse:
      type: object
      properties:
        codes:
          type: array
          description: List of generated coupon codes
          items:
            type: string
          example:
            - SUMMER1
            - SUMMER2
            - SUMMER3
    skuListTargetProduct:
      type: object
      description: Details of the products that are not considered to be discounted
      properties:
        kind:
          type: string
          enum:
            - SKU
            - CATEGORY
            - ATTRIBUTE
          example: SKU
        value:
          type: array
          items:
            type: string
            example: 1000000123
    skuList:
      type: object
      properties:
        _id:
          description: fabric database objectId of the record
          type: string
          example: 614b58924e92f6861ac9d43b
        title:
          description: SkuList name or title
          type: string
          example: GlobalExc_1
        listType:
          description: Type of skulist
          type: string
          enum:
            - GLOBAL_EXCLUSION
          example: GLOBAL_EXCLUSION
        applicableOn:
          description: Applicable scope of skulist
          type: array
          items:
            type: string
            enum:
              - PRODUCT_PRICE
              - SHIPPING_PRICE
            example: PRODUCT_PRICE
        targetProducts:
          type: array
          description: Array of products to be exempted from being discounted
          items:
            $ref: '#/components/schemas/skuListTargetProduct'
        startDate:
          description: >-
            Start date of sku-list. The value must be in the future. It
            indicates the date from when the discount will not be applicable to
            the products mentioned in the sku-list.
          type: string
          format: date-time
          example: '2022-05-04T09:23:51.459Z'
        endDate:
          description: >-
            End date of sku-list. The value must be greater than the start date.
            It indicates the date from when discount be applicable to the
            products mentioned in the sku-list.
          type: string
          format: date-time
          example: '2099-12-31T00:00:00.000Z'
        deleted:
          description: 'true: sku-list is deleted<br /> false: sku-list is not deleted'
          type: boolean
          example: false
        createdAt:
          description: Creation date of the record
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: Last updated date of the record
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    listSkuListResponse:
      type: object
      properties:
        query:
          $ref: '#/components/schemas/genericListQueryResponse'
        data:
          description: Response data
          type: array
          items:
            $ref: '#/components/schemas/skuList'
    newSkuListRequest:
      type: object
      properties:
        title:
          description: SkuList name or title
          type: string
          example: GlobalExc_1
        listType:
          description: Type of skulist
          type: string
          enum:
            - GLOBAL_EXCLUSION
          example: GLOBAL_EXCLUSION
        applicableOn:
          description: Applicable scope of skulist
          type: array
          items:
            type: string
            description: Product_Price ensures that the item SKU is
            enum:
              - PRODUCT_PRICE
              - SHIPPING_PRICE
            example: PRODUCT_PRICE
        targetProducts:
          type: array
          items:
            $ref: '#/components/schemas/skuListTargetProduct'
        startDate:
          description: >-
            Start date of sku-list. From this date, the products provided in the
            SKU list will be exempted from being discounted. The value must be
            in the future.
          type: string
          format: date-time
          example: '2022-05-04T09:23:51.459Z'
        endDate:
          description: >-
            End date of sku-list. The value must be greater than the start date.
            From this date the products mentioned in the SKU list will again be
            applicable for discount to be applied.
          type: string
          format: date-time
          example: '2099-12-31T00:00:00.000Z'
        deleted:
          description: 'true: sku-list is deleted<br /> false: sku-list is not deleted'
          type: boolean
          example: false
        createdAt:
          description: Creation date of the record
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: Last updated date of the record
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
      required:
        - title
        - startDate
        - endDate
        - applicableOn
        - targetProducts
    deletedSkuList:
      type: object
      properties:
        _id:
          description: A 24-character system-generated ID of the record.
          type: string
          example: 614b58924e92f6861ac9d43b
        title:
          description: SkuList name/title
          type: string
          example: GlobalExc_1
        listType:
          description: type of skulist
          type: string
          enum:
            - GLOBAL_EXCLUSION
          example: GLOBAL_EXCLUSION
        applicableOn:
          description: Applicable scope of skulist
          type: array
          items:
            type: string
            enum:
              - PRODUCT_PRICE
              - SHIPPING_PRICE
            example: PRODUCT_PRICE
        targetProducts:
          type: array
          items:
            $ref: '#/components/schemas/skuListTargetProduct'
        startDate:
          description: Start date of start-list. The value must be in the future.
          type: string
          format: date-time
          example: '2022-05-04T09:23:51.459Z'
        endDate:
          description: >-
            The end date of priceList. The value must be greater than the start
            date.
          type: string
          format: date-time
          example: '2099-12-31T00:00:00.000Z'
        deleted:
          description: Represents deleted SkuList.
          type: boolean
          example: true
        createdAt:
          description: The creation date of the record.
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: The last update date of the record.
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    endedSkuList:
      type: object
      properties:
        _id:
          description: A 24-character system-generated ID of the record.
          type: string
          example: 614b58924e92f6861ac9d43b
        title:
          description: SkuList name/title
          type: string
          example: GlobalExc_1
        listType:
          description: Type of skulist
          type: string
          enum:
            - GLOBAL_EXCLUSION
          example: GLOBAL_EXCLUSION
        applicableOn:
          description: Applicable scope of skulist
          type: array
          items:
            type: string
            enum:
              - PRODUCT_PRICE
              - SHIPPING_PRICE
            example: PRODUCT_PRICE
        targetProducts:
          type: array
          items:
            $ref: '#/components/schemas/skuListTargetProduct'
        startDate:
          description: >-
            Start date of the sku-list. This is the date from which the products
            under the sku-list were excluded from being discounted.
          type: string
          format: date-time
          example: '2021-05-04T09:23:51.459Z'
        endDate:
          description: >-
            End date of sku-list. This is the date from which the products under
            the sku-list will again be applicable for being discounted. The
            value must be greater than the start date.
          type: string
          format: date-time
          example: '2021-05-04T09:23:51.459Z'
        deleted:
          description: 'true: sku-list is deleted<br /> false: sku-list is not deleted'
          type: boolean
          example: true
        createdAt:
          description: Creation date of the record
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: Last updated date of the record
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    newRedemptionRequest:
      type: object
      required:
        - promoId
        - orderId
      properties:
        promoId:
          description: >-
            fabric database objectId of the promotion to redeem, received from
            promotion structure
          type: string
          example: 614b58924e92f6861ac91234
        promoCode:
          type: string
          description: >-
            promoCode of the coupon that is redeemed, could be null if no
            promoCode available
          nullable: true
          example: BESTSUMMER
        userId:
          type: string
          description: >-
            ID of the user who redeem the promotion, could be null if no user ID
            available
          nullable: true
          example: 614b58924e92f61234567890
        email:
          description: Email address of the user who redeem the promotion
          type: string
          example: john.doe@gmail.com
        orderId:
          description: Order ID of this purchase
          type: string
          example: 1590-2016-12345
    redemption:
      type: object
      properties:
        _id:
          description: fabric internal ID
          type: string
          example: 614b58924e92f6861ac9d43b
        promoId:
          description: fabric database objectId of the promotion to redeem
          type: string
          example: 614b58924e92f6861ac91234
        promoCode:
          description: promoCode of the coupon that is redeemed
          type: string
          example: BESTSUMMER
        userId:
          description: ID of the user who redeem the coupon
          type: string
          example: 614b58924e92f61234567890
        email:
          description: Email address of the user who redeem the coupon
          type: string
          example: guest@gmail.com
        orderId:
          description: Order ID of this purchase
          type: string
          example: 1590-2016-12345
        createdAt:
          description: Creation date of the record
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: Last updated date of the record
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    listRedemptionResponse:
      type: object
      properties:
        query:
          $ref: '#/components/schemas/genericListQueryResponse'
        data:
          description: Segment information.
          type: array
          items:
            $ref: '#/components/schemas/redemption'
    redemptionDeleteResponse:
      type: object
      properties:
        redemptionId:
          description: fabric internal ID
          type: string
          example: 614b58924e92f6861ac9d43b
        deleted:
          description: >-
            true: redemption record is deleted<br /> false: redemption record is
            not deleted
          type: boolean
          example: true
    redemptionNotFound:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: REDEMPTION_NOT_FOUND
        message:
          description: An error message corresponding to the `code`.
          type: string
          example: The redemption record doesn't exist.
    getSegmentResponse:
      type: object
      properties:
        _id:
          description: fabric internal database ObjectId of the record
          type: string
          example: 614b58924e92f6861ac9d43b
        segmentId:
          description: System generated unique ID of the Segment
          type: number
          example: 100002
        name:
          description: Name of the segment
          type: string
          example: Customer Type
        value:
          description: Array of segment values
          type: array
          items:
            type: string
            example: High Spender
        deleted:
          description: 'true: segment is deleted<br /> false: segment is not deleted'
          type: boolean
          example: false
        createdAt:
          description: Creation date of the record
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: Last updated date of the record
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    listSegmentResponse:
      type: object
      properties:
        query:
          $ref: '#/components/schemas/genericListQueryResponse'
        data:
          description: Segment information
          type: array
          items:
            $ref: '#/components/schemas/getSegmentResponse'
    createSegmentRequest:
      type: object
      required:
        - name
        - value
      properties:
        name:
          description: Name of segment
          type: string
          example: Customer Type
        value:
          description: Array of segment value
          type: array
          items:
            type: string
            example: High Spender
    createSegmentResponse:
      type: object
      properties:
        _id:
          description: fabric internal database ObjectId of the record
          type: string
          example: 614b58924e92f6861ac9d43b
        segmentId:
          description: System generated unique ID of the segment
          type: number
          example: 100002
        name:
          description: Name of segment
          type: string
          example: Customer Type
        value:
          description: Array of segment value
          type: array
          items:
            type: string
            example: High Spender
        deleted:
          description: 'true: Segment is deleted<br /> false: Segment is not deleted'
          type: boolean
          example: false
        createdAt:
          description: Creation date of the record
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: Last updated date of the record
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    segmentNameExist:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: SEGMENT_NAME_EXISTS
        message:
          description: An error message corresponding to the `code`.
          type: string
          example: Segment name already exists.
    segmentNotFound:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: SEGMENT_NOT_FOUND
        message:
          description: An error message corresponding to the `code`.
          type: string
          example: No segment with this Id is found.
    deleteSegmentResponse:
      type: object
      properties:
        _id:
          description: fabric internal database ObjectId of the record
          type: string
          example: 614b58924e92f6861ac9d43b
        segmentId:
          description: System generated unique ID of the segment
          type: number
          example: 100002
        name:
          description: Name of segment
          type: string
          example: Customer Type
        value:
          description: Array of segment value
          type: array
          items:
            type: string
            example: High Spender
        deleted:
          description: 'true: segment is deleted<br /> false: segment is not deleted'
          type: boolean
          example: true
        createdAt:
          description: Creation date of the record
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: Last updated date of the record
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    uploadUrlRequest:
      type: object
      properties:
        fileName:
          type: string
          example: file1.csv
          description: Name of the file to upload
        type:
          description: >-
            Folder to save the csv files; depending on this will trigger one or
            other event
          example: price
          required:
            - fileName
            - type
          enum:
            - price
            - price-range
            - price-range-sku
          oneOf:
            - title: price
              type: string
              example: price
              description: >-
                `price`: Folder to upload the CSV to apply bulk changes to
                normal or current offer prices. The CSV to be uploaded must have
                following columns:
                 - **SKU ID**: `Required` SKU of the item.

                 - **Cost**: `Required` Cost of the item.

                 - **Price**: `Required` Base price of the item.

                 - **Clearance Price**: `Optional` Sale price of the item.

                 - **Start Date(UTC)**: `Required` From this start date, the
                current price will be available. The format must be
                `YYYY-MM-DDThh:mm:ssZ`. For example, `2021-08-31T17:09:18.407Z`.
                The date has to be greater than the current date.

                 - **Price List Id**: `Required` Price list ID for the price.


                 CSV Example:
                   ```
                   SKU ID,Cost,Price,Clearance Price,Start Date(UTC),Price List
                Id
                   COFFEE,10,25,15,2021-08-31T17:09:18.407Z,100000

                   ```

                 The result of the upload will be saved on import history.
            - title: price-range
              type: string
              example: price-range
              description: >
                `price-range` - Folder to upload prices with range (1 and 2
                dimensional). The CSV to be uploaded must have the following
                columns:

                - **REFID**: `Required` SKU of the item.

                - **Length**: `Required` Length or minimum quantity to get a
                specific price. It has to be a valid integer.

                - **Width**: `Optional` Width to get a specific price. It has to
                be a valid integer. It is required only if Price Method Type is
                SurfaceArea_Square_Increment_2Dim.

                - **Price**: `Required` The price for an item, it has to be a
                valid float.

                - **motorized**: `Optional` Attributes or addons, on the rows
                the prices for this addon has to be set. Any extra column will
                be taken as an attribute or addon.

                - **Price Method Type**: `Optional` It must be one of the three
                allowed price method types: `Range-Base`,
                `SurfaceArea_Square_Increment`,
                `SurfaceArea_Square_Increment_2Dim`, otherwise that row will
                display an error

                - **Start Date(UTC)**: `Optional` Start Date and End date are
                optional. If set, they must be equal or greater than `now` and
                have consistency between them. The format must be
                `YYYY-MM-DDThh:mm:ssZ`. For example, `2021-08-31T17:09:18.407Z`.

                - **End Date(UTC)**: `Optional` Start Date and End date are
                optional. If set, they must be equal or greater than `now` and
                have consistency between them. The format must be
                `YYYY-MM-DDThh:mm:ssZ`. For example, `2021-08-31T17:09:18.407Z`.

                - **Price List Name**: `Optional` The price list ID has to be
                provided. If not sent, the prices will registered under the
                default price list.


                CSV Example with full headers:
                  ```
                  REFID,Length,Width,Price,motorized
                  TEST,30,30,285,665
                  TEST,30,34,300,665
                  TEST,36,42,365,665
                  TEST,36,48,390,665
                  TEST,42,54,405,665
                  ```
                CSV Example with some headers:
                  ```
                  REFID,Length,Width,Price,motorized,Price Method Type,Start
                Date(UTC),End Date(UTC),Price List Name
                  TEST,30,30,285,665,SurfaceArea_Square_Increment_2Dim,,,100000
                  TEST,30,34,300,665,SurfaceArea_Square_Increment_2Dim,,,100000
                  TEST,36,42,365,665,SurfaceArea_Square_Increment_2Dim,,,100000
                  TEST,36,48,390,665,SurfaceArea_Square_Increment_2Dim,,,100000
                  TEST,42,54,405,665,SurfaceArea_Square_Increment_2Dim,,,100000
                  ```
            - title: price-range-sku
              type: string
              example: price-range-sku
              description: >-
                `price-range-sku` - Folder to upload RH prices, only for
                SurfaceArea_Square_Increment types. This event will request RH
                service internally to get the price. Only SKU is needed in the
                CSV.

                The CSV to be uploaded has to have the following columns:

                - **FULL_SKU_ID**: `Required` SKU of the item


                CSV Example:
                  ```
                  FULL_SKU_ID
                  10015762FOG
                  10015760CRBN
                  ```

                As we are only uploading the SKU the process will load
                internally the following values for each SKU uploaded:
                  - priceListId: default price list
                  - startDate: now()
                  - endDate: 2100-01-01
                  - base: 0
                  - currency: it will be set to *USD*
                  - price method type: SurfaceArea_Square_Increment
                  - range.minQuantity: 1.
                  - range.maxQuantity: Infinity.
                  - price: this value will be populated by RH service.
    getUploadURLResponse:
      type: object
      properties:
        url:
          type: string
          description: URL to upload the CSV. The URL is valid for 5 minutes.
          example: >-
            https://example.s3.amazonaws.com/pricelist/123/dev02/123-priceList1.csv?X-Amz-Algorithm...x-amz-meta-stage=dev02
        keyId:
          type: string
          description: Key ID associated with the file
          example: 1646680518524-priceList1
    getProductResponse:
      type: object
      properties:
        id:
          type: string
          example: 60c789cfe6e0910008fdcd19
          description: fabric internal ID of the product
        channel:
          type: array
          description: Sales channel of the product
          items:
            type: number
          example:
            - 12
            - 13
        startDate:
          type: string
          format: date-time
          description: Start date of the product
          example: '2021-06-14T16:53:56.020Z'
        endDate:
          type: string
          description: End date of the product
          format: date-time
          example: '2021-06-14T16:53:56.020Z'
        group:
          type: array
          description: ID of the group or category the product belongs to
          items:
            type: string
          example:
            - 60c7894b25c05d00087e882c
        imageSetOnAttributes:
          type: array
          description: Array of URLs to images of different variants or attributes
          items:
            type: string
            example: http://example.com/virpilalphal.jpg
        isDefault:
          type: boolean
          description: >-
            false for parent product<br /> If a parent product has child items,
            true represents the default child item to be displayed, under the
            parent product, on the product listing page.
        isActive:
          type: boolean
          description: >-
            true if the item is active and displayed in the catalog. isActive
            will be true only when state is `READY` <br /> false if the state is
            `DRAFT`, and item is not displayed in the catalog
        isSoftDeleted:
          type: boolean
          description: >-
            true indicates the product is deleted <br /> false indicates the
            product is not deleted
          example: false
        title:
          type: string
          example: Oval shaped table
          description: Title of the product
        itemFamily:
          type: object
          description: Family of products the item belongs to
          properties:
            id:
              type: string
              example: 60c789973af6bf0009c023df
            name:
              type: string
              example: Shoes
        sku:
          type: string
          example: Ovaltable101
          description: SKU of the product
        description:
          type: string
          example: Oval shaped table used as home furniture
          description: Description of the product
        state:
          type: string
          example: READY
          description: >-
            Status of the product. It indicates if the product is ready to be
            published on the product listing page.
        itemId:
          type: number
          example: 1000000269
          description: Item ID of the product
        images:
          type: array
          description: Details of images of the product displayed on copilot UI
          items:
            type: object
            properties:
              id:
                type: string
                description: Image ID
                example: 5fd7577251a93f0007e48383
              order:
                type: number
                description: Image sequence number
                example: 0
              label:
                type: string
                example: >-
                  https://abchome-xpm-images.s3.amazonaws.com/12.01.20+Giving+Tuesday/Homepage/HP_HolidaySix_GI_1.jpg?w=1067
              source:
                type: array
                description: Source of product images
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      example: 5fd7577251a93f0007e48383
                    url:
                      type: string
                      example: >-
                        https://abchome-xpm-images.s3.amazonaws.com/12.01.20+Giving+Tuesday/Homepage/HP_HolidaySix_GI_1.jpg?w=1067
        attributes:
          type: array
          description: Details of product attributes if any
          items:
            type: object
            properties:
              attributeGroupId:
                type: string
                description: >-
                  Attribute group ID. Related attributes are grouped for easy
                  identification and maintenance
                example: 5fd7577251a93f0007e48383
              value:
                type: string
                example: size
              isDefault:
                type: boolean
                description: >-
                  true indicates this attribute is the default attribute of the
                  product<br /> false indicates this is not the default
                  attribute of the product
              id:
                type: string
                description: attribute ID
                example: 100034567
        variants:
          type: array
          description: Different variants of the product
          items:
            type: string
          example:
            - VARIANT-01
            - VARIANT-55
        createdAt:
          type: string
          format: date-time
          example: '2021-06-14T16:54:39.461Z'
          description: Creation date of the product
        updatedAt:
          type: string
          format: date-time
          example: '2021-06-14T16:54:39.461Z'
          description: Last updated date of the product
        items:
          type: array
          description: Lists fabric objectId of child products if there are any
          items:
            type: object
            properties:
              _id:
                type: string
                description: fabric internal ID
                example: cfbc28dd-26b8-40e6-9c37-f233c5a2d004
        price:
          type: object
          description: Price details of the product if it was setup previously
          properties:
            id:
              type: string
              description: fabric internal ID
              example: 5e31832ccaf608b232bb4cdrr
            isSoftDeleted:
              type: boolean
              description: 'true: price is deleted<br /> false: price is not deleted'
            itemId:
              type: number
              description: Item ID of the product
              example: 1000000269
            offerId:
              type: number
              description: ID of the created offer for the itemId or itemSku
              example: 1074
            createdAt:
              type: string
              description: Creation date of the record
              example: '2020-08-19T10:53:29.918Z'
            updatedAt:
              type: string
              description: Last updated date of the record
              example: '2020-08-19T10:53:29.918Z'
            offers:
              type: array
              description: >-
                Returns offer details for the product if it was created
                previously
              items:
                type: object
                properties:
                  price:
                    type: object
                    description: Offer price details
                    properties:
                      sale:
                        type: number
                        description: Price at which the product is offered for sale
                        example: 0
                      base:
                        type: number
                        description: Minimum fixed price of the product
                        example: 229
                      currency:
                        type: string
                        description: Currency code for the price set for the product
                        example: USD
                  channel:
                    type: number
                    description: Sales channel of the product
                    example: 12
                  startDate:
                    type: string
                    format: date-time
                    description: Offer start date
                    example: '2018-10-19T16:46:45Z'
                  endDate:
                    type: string
                    format: date-time
                    description: Offer end date
                    example: '2099-12-31T00:00:00Z'
                  kind:
                    type: number
                    description: >-
                      PriceKindId. It indicates if the offer price is a
                      promotional offer price or clearance offer price
                    example: 10000001
            query:
              type: object
              description: Pagination information for offers array
              properties:
                limit:
                  type: number
                  description: The maximum number of records per page.
                  example: 10
                  default: 10
                count:
                  type: number
                  example: 50
                  description: The total number of records.
                offset:
                  type: number
                  description: >-
                    The number of records to skip before returning records. For
                    example, when offset is 20 and limit is 10, this endpoint
                    returns records from 21 to 30.
                  example: 0
                  default: 0
        priceRange:
          type: object
          description: Price ranges of the product
          properties:
            min:
              type: number
              description: >-
                Minimum price of the product. The product cannot be sold below
                this price
              example: 35
            max:
              type: number
              description: >-
                Maximum price of the product. The product cannot be sold above
                this price
              example: 12000
        livePrice:
          type: array
          description: Current market price of the product with which the product is sold
          items:
            type: object
            properties:
              price:
                type: object
                properties:
                  base:
                    description: Minimum fixed price of item if any
                    type: number
                    example: 299
                  sale:
                    description: Price at which the product is offered for sale
                    type: number
                    example: 199
                  cost:
                    type: number
                    description: Cost of the item if any
                    example: 149
                  currency:
                    type: string
                    description: Currency of the price
                    example: USD
              channel:
                type: number
                description: Sales channel
                example: 12
              startDate:
                type: string
                format: date-time
                description: Start date and time of the current price of the product
                example: '2099-12-31T10:51:00.000Z'
              endDate:
                type: string
                format: date-time
                description: End date and time of the current price of the product
                example: '2099-12-31T10:51:00.000Z'
              kind:
                type: object
                description: >-
                  Price kind details that indicates if the offer price is a
                  promotion kind price or clearance kind price
                properties:
                  id:
                    type: string
                    description: fabric internal ID
                    example: 5fe35c6244076c5ff4968917
                  name:
                    type: string
                    example: Clearance
                  channel:
                    type: number
                    description: Sales channel
                    example: 12
                  priceKindId:
                    type: number
                    description: >-
                      Pricekind ID. This ID helps to identify if the price is
                      base price or clearance price or any other additional
                      price.
                    example: 12
              offerCode:
                type: number
                description: ID associated with the live price object
                example: 128755531
              range:
                type: object
                description: >-
                  Maximum and minimum price range within which the live price of
                  the product varies depending upon the applicable offers
                properties:
                  min:
                    type: number
                    example: 100
                  max:
                    type: number
                    example: 300
        promoDates:
          type: object
          description: Start date and end date of the offer price
          properties:
            startDate:
              type: string
              format: date-time
              example: '2099-12-31T10:51:00.000Z'
            endDate:
              type: string
              format: date-time
              example: '2099-12-31T10:51:00.000Z'
    getProductNotFound:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: PRODUCT_NOT_FOUND
        message:
          description: An error message corresponding to the `code`.
          type: string
          example: Product not found.
    productById:
      type: object
      properties:
        channel:
          type: array
          items:
            type: number
          example:
            - 12
            - 13
          description: Sales channel of the product
        startDate:
          type: string
          format: date-time
          example: '2020-08-17T07:39:29.092Z'
          description: Start date of the product
        endDate:
          type: string
          format: date-time
          example: '2099-12-31T00:00:00.000Z'
          description: End date of the product
        group:
          type: array
          description: Item's group/category ID
          items:
            type: string
          example:
            - 5e2cfa5245570b000863c4ab
        title:
          type: string
          example: Arper Dizzie Oval Coffee Table
          description: Title of the product
        itemId:
          type: number
          example: 1000000269
          description: Item ID
        price:
          type: object
          description: >-
            Price of the product. It displays price details if the price was
            setup previously. If price is not setup previously, it displays
            `null`
          properties:
            id:
              type: string
              description: fabric database ID of the item
              example: 5e31832ccaf608b232bb4cdrr
            isSoftDeleted:
              type: boolean
              description: >-
                true indicates price information of the item is deleted<br />
                false indicates price information of the item is not deleted
            itemId:
              type: number
              example: 1000000269
            offerId:
              type: number
              description: ID of the created offer for the itemId or itemSku
              example: 1074
            createdAt:
              type: string
              description: Creation date of the item and its price information
              example: '2020-08-19T10:53:29.918Z'
            updatedAt:
              type: string
              description: Last updated date of the item and its price information
              example: '2020-08-19T10:53:29.918Z'
            offers:
              type: array
              items:
                type: object
                properties:
                  price:
                    type: object
                    properties:
                      sale:
                        type: number
                        description: Price at which the product is offered for sale
                        example: 0
                      base:
                        type: number
                        description: Minimum fixed price of the item if any
                        example: 229
                      currency:
                        type: string
                        description: Currency code of the price set for the item
                        example: USD
                  channel:
                    type: number
                    description: Sales channel of the item
                    example: 12
                  startDate:
                    type: string
                    format: date-time
                    description: Start date and time of the offer price
                    example: '2018-10-19T16:46:45Z'
                  endDate:
                    type: string
                    format: date-time
                    description: End date and time of the offer price
                    example: '2099-12-31T00:00:00Z'
                  kind:
                    type: number
                    description: >-
                      Price kind ID that indicates what kind of price is this-
                      promotion price or clearance price.
                    example: 12
            query:
              type: object
              description: Pagination information for offers array
              properties:
                limit:
                  type: number
                  description: The maximum number of records per page.
                  example: 10
                  default: 10
                count:
                  type: number
                  example: 50
                  description: Total number of offers for specified price.
                offset:
                  type: number
                  description: >-
                    The number of records to skip before returning records. For
                    example, when offset is 20 and limit is 10, this endpoint
                    returns records from 21 to 30.
                  example: 0
                  default: 0
        isDefault:
          type: boolean
          description: >-
            false for parent product<br /> If a parent product has child items,
            true represents the default child item to be displayed, under the
            parent product, on the product listing page.
        isActive:
          type: boolean
          description: >-
            true if the item is active and displayed in the catalog. isActive
            will be true only when state is `READY` <br /> false if the state is
            `DRAFT`, and item is not displayed in the catalog
        attributes:
          type: array
          items:
            type: object
            properties:
              attributeGroupId:
                type: string
                description: >-
                  Attribute group ID. Related attributes are grouped for easy
                  identification and maintenance
                example: 123123
              id:
                type: string
                description: Attribute ID
                example: 321321
              value:
                oneOf:
                  - type: string
                    example: size
                  - type: number
                  - type: boolean
              isDefault:
                type: boolean
                description: Indicates if this is the default attribute of the item
        parent:
          type: string
          description: If the item has a parent product, it displays the parent product ID
          example: 5f3a355075cc4900085fb1b1
        itemFamily:
          type: string
          description: >-
            Parent family to which the item belongs to. All items belongs to an
            itemFamily
          example: 5f3a3371d9bf7b0007d699d8
        description:
          type: string
          example: >-
            This smart band's OLED display (300 nits) can show up to 48
            characters, thereby letting you view everything with a single
            glance. The display is fingerprint-coated to offer you a clear view
            every time.
          description: Description of the product
        variants:
          type: array
          description: >-
            Shows if any variant of the product is available, based on color or
            size and other details.
          items:
            type: string
          example:
            - VARIANT-01
            - VARIANT-55
        state:
          type: string
          example: READY
          description: >-
            Status of the product. READY indicates the item along with all of
            its attributes is rady is to be published on the product listing
            page.
        images:
          type: array
          description: Details of images of the item displayed on the copilot UI
          items:
            type: object
            properties:
              id:
                type: string
                description: Image ID
                example: 5fd7577251a93f0007e48383
              order:
                type: number
                description: Sequence number of the product on copilot UI
                example: 0
              label:
                type: string
                example: >-
                  https://abchome-xpm-images.s3.amazonaws.com/12.01.20+Giving+Tuesday/Homepage/HP_HolidaySix_GI_1.jpg?w=1067
              source:
                type: array
                description: Source of the images of the item
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: Source ID of the image
                      example: 5fd7577251a93f0007e48383
                    url:
                      type: string
                      description: Source URL of the image
                      example: >-
                        https://abchome-xpm-images.s3.amazonaws.com/12.01.20+Giving+Tuesday/Homepage/HP_HolidaySix_GI_1.jpg?w=1067
        sku:
          type: string
          example: XMSH99KLW10
          description: SKU of the product
        isSoftDeleted:
          example: false
          type: boolean
          description: >-
            true indicates the item is removed from the copilot UI<br /> false
            indicates item is not removed from the copilot UI
    productByIdNotFound:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: ITEM_NOT_FOUND
        message:
          description: An error message corresponding to the `code`.
          type: string
          example: Item not found.
    searchItemsByPrice:
      type: object
      properties:
        offset:
          description: >-
            The number of records to skip before returning records. For example,
            when offset is 20 and limit is 10, this endpoint returns records
            from 21 to 30.
          type: number
          default: 0
          example: 0
        limit:
          description: The maximum number of records per page.
          type: number
          default: 10
          example: 10
        keyword:
          description: Search parameter to filter the query
          type: string
          example: CAN
        sku:
          description: >-
            If SKU is true then this endpoint returns products that have SKU
            value mentioned.
          type: boolean
        isListView:
          description: >-
            true indicates that the response data will be displayed in list<br
            /> false indicates that the response data will be displayed in a
            tile view
          type: boolean
        priceListId:
          description: >-
            ID of the priceList for which the price and product information are
            to be retrieved
          type: number
    productSearchResponse:
      type: object
      description: Child item details if any
      properties:
        variants:
          type: array
          description: Child item variants
          items:
            type: string
          example:
            - VARIANT-01
            - VARIANT-55
        itemId:
          type: number
          description: Child item ID
          example: 1000002411
        channel:
          type: array
          items:
            type: number
          example:
            - 12
            - 13
        isDefault:
          type: boolean
          description: >-
            true: child item is the default child item to be displayed, under
            the parent product, on the product listing page.<br /> false: child
            item is not the default item of the parent product
        state:
          type: string
          description: >-
            Child item's state. READY indicates the child item is active and
            ready to be consumed by the shoppers.
          example: READY
        createdAt:
          type: string
          description: Creation date of the child itemn
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          type: string
          description: Last updated date of the child item
          example: '2020-12-14T12:15:43.646Z'
        startDate:
          type: string
          description: Date from which the child item is available to be sold
          example: '2020-12-14T12:14:35.331Z'
        endDate:
          type: string
          description: Date from which the child item is not available to be sold
          example: '2020-12-14T12:14:35.331Z'
        isActive:
          type: boolean
          description: >-
            true if the item is active and displayed in the catalog. isActive
            will be true only when state is `READY` <br /> false if the state is
            `DRAFT`, and item is not displayed in the catalog
        sku:
          type: string
          description: Child item sku
          example: WALL123
        title:
          type: string
          description: Title of the child item
          example: wall posters
        images:
          type: array
          description: Image details of the child item
          items:
            type: object
            properties:
              id:
                type: string
                example: 5fd7577251a93f0007e48383
              order:
                type: number
                example: 0
              label:
                type: string
                example: >-
                  https://abchome-xpm-images.s3.amazonaws.com/12.01.20+Giving+Tuesday/Homepage/HP_HolidaySix_GI_1.jpg?w=1067
              source:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      example: 5fd7577251a93f0007e48383
                    url:
                      type: string
                      example: >-
                        https://abchome-xpm-images.s3.amazonaws.com/12.01.20+Giving+Tuesday/Homepage/HP_HolidaySix_GI_1.jpg?w=1067
        price:
          type: object
          description: Price details of the child item
          properties:
            sale:
              type: number
              description: Price at which the product is offered for sale
              example: 2800
            cost:
              type: number
              description: Cost of item if any
              example: 2500
            currency:
              type: string
              description: 3 letter currency code for price
              example: USD
            base:
              type: number
              description: Minimum fixed price of the product
              example: 3000
        kind:
          type: object
          properties:
            priceKindId:
              type: number
              description: >-
                Indicates if the offer price of the item is promotional price or
                clearance price
              example: 12
            name:
              type: string
              example: Clearance
            channel:
              type: number
              example: 12
        priceStartDate:
          type: string
          description: Start date of active price
          format: date-time
          example: '2021-01-06T19:00:00+00:00'
        priceEndDate:
          type: string
          description: End date of active price
          format: date-time
          example: '2099-12-31T18:59:00+00:00'
        status:
          type: string
          description: Item status
          example: ACTIVE
    productResponse:
      type: object
      properties:
        variants:
          type: array
          description: Variants of the product
          items:
            type: string
          example:
            - VARIANT-01
            - VARIANT-55
        itemId:
          type: number
          example: 1000002411
          description: Item ID
        channel:
          type: array
          description: Sales channel of the product
          items:
            type: number
          example:
            - 12
            - 13
        isDefault:
          type: boolean
          description: >-
            false for parent product<br /> If a parent product has child items,
            true represents the default child item to be displayed, under the
            parent product, on the product listing page.
        state:
          type: string
          example: READY
          description: >-
            Status of the product. READY indicates the product is ready to be
            published on the product listing page for shopper's consumption.
        createdAt:
          type: string
          description: Creation date of the record
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          type: string
          description: Last updated date of the record
          example: '2020-12-14T12:15:43.646Z'
        startDate:
          type: string
          example: '2020-12-14T12:14:35.331Z'
          description: Start date of the product
        endDate:
          type: string
          example: '2020-12-14T12:14:35.331Z'
          description: End date of the product
        isActive:
          type: boolean
          description: >-
            true if the item is active and displayed in the catalog. isActive
            will be true only when state is `READY` <br /> false if the state is
            `DRAFT`, and item is not displayed in the catalog
        sku:
          type: string
          example: WALL123
          description: SKU of the product
        title:
          type: string
          example: wall posters
          description: Title of the product
        images:
          type: array
          description: Details of images of item to be displayed on the copilot UI
          items:
            type: object
            properties:
              id:
                type: string
                example: 5fd7577251a93f0007e48383
              order:
                type: number
                example: 0
              label:
                type: string
                example: >-
                  https://abchome-xpm-images.s3.amazonaws.com/12.01.20+Giving+Tuesday/Homepage/HP_HolidaySix_GI_1.jpg?w=1067
              source:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      example: 5fd7577251a93f0007e48383
                    url:
                      type: string
                      example: >-
                        https://abchome-xpm-images.s3.amazonaws.com/12.01.20+Giving+Tuesday/Homepage/HP_HolidaySix_GI_1.jpg?w=1067
        price:
          description: >-
            Price of the product, it will only exist if the price was set up for
            the product.
          type: object
          properties:
            sale:
              type: number
              description: Price at which the product is offered for sale
              example: 2800
            cost:
              type: number
              description: Cost of item if any
              example: 2500
            currency:
              type: string
              description: 3 letter currency code for price
              example: USD
            base:
              type: number
              description: Minimum fixed price of the product
              example: 3000
        kind:
          type: object
          properties:
            priceKindId:
              type: number
              description: >-
                Pricekind ID. This ID helps to identify if the price is base
                price or clearance price or any other additional price.
              example: 12
            name:
              type: string
              example: Clearance
            channel:
              type: number
              example: 12
        priceStartDate:
          type: string
          format: date-time
          example: '2021-01-06T19:00:00+00:00'
          description: Start date of the active price
        priceEndDate:
          type: string
          format: date-time
          example: '2099-12-31T18:59:00+00:00'
          description: End date of the active price
        priceLastUpdatedAt:
          type: string
          format: date-time
          example: '2099-12-31T18:59:00+00:00'
          description: Last updated date of the price
        status:
          type: string
          example: ACTIVE
          description: Status of the price
        basePriceRange:
          type: object
          description: Minimum and maximum base price of the item if it was set up earlier
          properties:
            min:
              type: number
              example: 100
            max:
              type: number
              example: 300
        salePriceRange:
          type: object
          description: Minimum and maximum price at which the product is offered for a sale
          properties:
            min:
              type: number
              example: 100
            max:
              type: number
              example: 300
        costPriceRange:
          type: object
          description: Minimum and maximum cost price if it was set up earlier
          properties:
            min:
              type: number
              example: 100
            max:
              type: number
              example: 300
        items:
          type: array
          items:
            $ref: '#/components/schemas/productSearchResponse'
    searchProductResponse:
      type: object
      properties:
        query:
          type: object
          properties:
            limit:
              type: number
              example: 10
              default: 10
              description: The maximum number of records per page.
            offset:
              type: number
              example: 0
              default: 0
              description: >-
                The number of records to skip before returning records. For
                example, when offset is 20 and limit is 10, this endpoint
                returns records from 21 to 30.
            count:
              type: number
              example: 50
              description: The total number of records.
        results:
          type: array
          items:
            $ref: '#/components/schemas/productResponse'
    getItemIdsAndItemSkusResponse:
      type: object
      properties:
        query:
          description: >-
            Object containing the limit, count and offset of records in the
            response.
          type: object
          properties:
            limit:
              description: The maximum number of records per page.
              type: number
              example: 10
              default: 10
            offset:
              description: >-
                The number of records to skip before returning records. For
                example, when offset is 20 and limit is 10, this endpoint
                returns records from 21 to 30.
              type: number
              example: 0
              default: 10
            count:
              description: The total number of records.
              type: number
              example: 80
        data:
          description: Array containing the itemIds and itemSkus
          type: array
          items:
            type: object
            properties:
              itemId:
                description: itemId of the product
                type: number
                example: 1000000011
              itemSku:
                description: SKU of the product
                type: string
                example: 10112_SKU
    getAttributeResponse:
      type: object
      properties:
        _id:
          description: A 24-character system-generated attribute ID.
          type: string
          example: 614b58924e92f6861ac9d43b
        attributeId:
          description: A unique identifier of the attribute, for external use.
          type: number
          example: 100002
        name:
          description: The attribute name.
          type: string
          example: Brand
        values:
          description: The attribute values.
          type: array
          items:
            type: string
            example: CHS
          example:
            - CHS
            - SOMA
            - WHBM
        deleted:
          description: >-
            A flag indicating the deletion status of the attribute. Set it to
            `true` to indicate the attribute is deleted and false to indicate
            otherwise.
          type: boolean
          example: false
        createdAt:
          description: The time of attribute creation, in UTC format.
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: The time when the attribute was last updated, in UTC format.
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    listAttributeResponse:
      type: object
      properties:
        query:
          $ref: '#/components/schemas/genericListQueryResponse'
        data:
          description: The attribute details.
          type: array
          items:
            $ref: '#/components/schemas/getAttributeResponse'
    createAttributeRequest:
      type: object
      required:
        - name
        - values
      properties:
        name:
          description: The attribute name.
          type: string
          example: Brand
        values:
          description: The attribute values corresponding to the `name`.
          type: array
          items:
            type: string
            example: CHS
          example:
            - CHS
            - SOMA
            - WHBM
    createAttributeResponse:
      type: object
      properties:
        _id:
          description: A 24-character system-generated attribute ID.
          type: string
          example: 614b58924e92f6861ac9d43b
        attributeId:
          description: A unique identifier of the attribute, for external use.
          type: number
          example: 100002
        name:
          description: The attribute name.
          type: string
          example: Brand
        values:
          description: The attribute values corresponding to the `name`.
          type: array
          items:
            type: string
            example: CHS
          example:
            - CHS
            - SOMA
            - WHBM
        deleted:
          description: >-
            A flag indicating the deletion status of the attribute. Set it to
            `true` to indicate the attribute is deleted and `false` to indicate
            otherwise.
          type: boolean
          example: false
        createdAt:
          description: The time of attribute creation, in UTC format.
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: The time when the attribute was last updated, in UTC format.
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
    attributeNameExist:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: ATTRIBUTE_NAME_EXISTS
        message:
          description: An error message corresponding to the `code`.
          type: string
          example: The attribute name already exists.
    attributeNotFound:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: ATTRIBUTE_NOT_FOUND
        message:
          description: An error message corresponding to the `code`.
          type: string
          example: No attribute found with this ID.
    deleteAttributeResponse:
      type: object
      properties:
        _id:
          description: A 24-character system-generated attribute ID.
          type: string
          example: 614b58924e92f6861ac9d43b
        attributeId:
          description: A unique identifier of the attribute, for external use.
          type: number
          example: 100002
        name:
          description: The attribute name.
          type: string
          example: Brand
        values:
          description: The attribute values.
          type: array
          items:
            type: string
            example:
              - CHS
              - HCS
        deleted:
          description: >-
            A flag indicating the deletion status of the attribute. Set it to
            `true` to indicate the attribute is deleted and `false` to indicate
            otherwise.
          type: boolean
          example: true
        createdAt:
          description: The time of attribute creation, in UTC format.
          type: string
          format: date-time
          example: '2020-12-14T12:15:43.646Z'
        updatedAt:
          description: The time when the attribute was last updated, in UTC format.
          type: string
          format: date-time
          example: '2021-12-14T12:15:43.646Z'
  securitySchemes:
    AuthorizationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
security:
  - AuthorizationToken: []
tags:
  - name: Price List
    description: >-
      Price list is a collection of items and their assigned prices. An item can
      exist in multiple price lists. This gives you the ability to assign
      different prices to the same item. Price lists let you set currency and
      duration of the prices. For example, if the price list expires, prices of
      items within the price list will also expire. You can configure the
      pricing API to include your default price. <br />When requesting pricelist
      of items or evaluating promotions, you should mention the price list ID
      that you want to use.
  - name: Pricing
    description: >-
      Pricing endpoints let you create and manage price details for one or many
      items. You can configure the pricing API to include your default price
      list in all requests.
  - name: Price Guard
    description: >-
      Price Guard allows you to create and manage more diversified price-kinds
      for the item, such as manufacturer recommended retail price (MSRP),
      minimum advertised price (MAP), floor price, ceiling price, clearance
      price,  and so on.  Price guard works as a protection mechanism against
      any further creation of prices for the item. These endpoints let you
      create and manage such price-kinds.
  - name: Price Kind
    description: >-
      Unlike price guard, price kind endpoint lets you get the fundamental price
      kinds (for example, base price and sale price) that are created while
      setting up the item information.
  - name: Promotion
    description: >-
      Promotion is a discount on an item, cart or shipping method based on set
      conditions. As promotions can be linked to specific price lists, it is
      important to submit the correct price list ID. Promotion endpoints let you
      create and manage discounts that will be applied to all customers' carts
      that meet the required conditions.
  - name: Coupon
    description: >-
      Coupon endpoints let you create and manage coupon codes that customers can
      enter at checkout to receive a discount.
  - name: Dynamic Pricing Engine
    description: >-
      fabric's Dynamic Pricing Engine APIs evaluate promotions and calculate
      prices instantly for the cart items using real-time price calculation
      method, that incorporates the latest information, to provide personalized
      and competitive prices for specific customers. It supports formula based
      custom SKU dynamic pricing, and shows discount breakdown details for
      separate items having separate promotions. It uses the cache information,
      instead of fetching offer details of items from database, to evaluate
      promotions and calculate prices instantly. It is fast, scalable to
      millions of pricing requests per day, and supports complex promotional
      strategies.
  - name: Global exclusion
    description: >-
      Global exclusions let you exclude SKUs from being discounted by active
      promotions. These endpoints let you manage those sku-lists.
  - name: Redemption
    description: Redemption endpoints let you manage the records of coupon redemptions.
  - name: Segment
    description: >-
      Segment endpoints let you target promotions at specific groups of
      customers by linking the promotion to a segment identifier. A customer
      segment is a group of customers that have been given a unique reference to
      easily identify them. They may be grouped in a number of ways such as
      demographics, locations, device type, and so on. fabric Offers supports
      the assignment of a customer segment to a promotion so that the promotion
      is applied only to a specific group of customers. You must enter your
      customer segment identifiers in the *Settings* of the Copilot application.
  - name: Upload price CSV
    description: This endpoint lets you bulk upload price details using a CSV file.
  - name: Product
    description: >-
      Product endpoint lets you get product and price information based on sku.
      Product information is retrieved from Product Catalog and price details
      are retrieved from Offers service.
  - name: Item
    description: >-
      Item endpoints let you get products and prices information based on
      itemId. Product information of an item is retrieved from Product Catalog
      and price details are retrieved from Offers service.
  - name: Attributes
    description: >-
      Attributes refer to a collection of attributes names and their values.
      Using attributes, you can group entities, such as products or shoppers,
      that share similar characteristics, such as dimension, age group,
      location, device type, and more. For example, the shopper segmentation can
      be used to tailor promotions to a specific customer segment by linking the
      promotion to the segment identifier.
  - name: Exports
    description: >-
      fabric Export endpoints let you export data to CSV files based on the
      provided filters.
x-tagGroups:
  - name: Pricing APIs
    tags:
      - Price List
      - Pricing
      - Price Range
      - Price Add-on
      - Price Method Type
      - Price Guard
      - Price Kind
  - name: Promotion APIs
    tags:
      - Promotion
      - Coupon
      - Global exclusion
      - Redemption
  - name: Segment APIs
    tags:
      - Segment
  - name: Utility APIs
    tags:
      - Upload price CSV
      - Product
      - Item
      - Exports
paths:
  /v1/promo/evaluate-promotions:
    post:
      tags:
        - Dynamic Pricing Engine
      summary: Evaluate promotions
      description: >-
        Evaluates a cart's promotions, discount coupons and implicit promotions,
        either by specified itemId or by SKU (based on the customer specific
        configuration set in the backend)
      operationId: evaluatePromotions
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/promotionEvaluationRequest'
        required: true
      responses:
        '200':
          description: Successfully evaluated the promotions
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/promotionEvaluationResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
  /v1/price/get-by-sku:
    post:
      tags:
        - Dynamic Pricing Engine
      summary: Get calculated prices
      description: >-
        Retrieves prices for items either by SKUs or by item IDs based on the
        customer specific configuration set in the backend.
      operationId: getBySKU
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/getPricesRequest'
        required: true
      responses:
        '200':
          description: Successfully retrieved the prices
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/calculatedPrice'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
  /api-offers/price-list:
    post:
      tags:
        - Price List
      summary: Create price list
      description: >-
        Enables you to create a price list. Depending upon the currency code you
        set for a price list, you will be able to create or update price (using
        POST/api-offers/price) under the pricelist for the defined currency code
        only.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/newPriceListRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceList'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceListNameExists'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    get:
      tags:
        - Price List
      summary: Get all price lists
      description: Retrieves a paginated list of all price lists.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: limit
          in: query
          description: The maximum number of records per page.
          required: false
          schema:
            type: number
            default: 10
            minimum: 0
        - name: offset
          in: query
          description: >-
            The number of records to skip before returning records. For example,
            when offset is 20 and limit is 10, this endpoint returns records
            from 21 to 30.
          required: false
          schema:
            type: number
            minimum: 0
            default: 0
        - name: sortBy
          in: query
          description: Field by which you want to sort the records
          required: false
          schema:
            type: string
            default: updatedAt
            enum:
              - updatedAt
              - name
              - priceListId
        - name: sortOrder
          in: query
          description: Sorting order of the records
          required: false
          schema:
            type: string
            default: desc
            enum:
              - asc
              - desc
        - name: filter
          in: query
          description: Value by which price lists are filtered
          required: false
          schema:
            type: string
            enum:
              - not_expired
        - name: isDefault
          description: If set to `true`, this endpoint returns the default price list
          in: query
          schema:
            type: boolean
            enum:
              - true
              - false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceListResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/price-list/{priceListId}:
    get:
      tags:
        - Price List
      summary: Get a specific price list
      description: >-
        Enables you to retrieve details of a price list by price list ID or
        name.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: priceListId
          in: path
          required: true
          description: ID or name of the price list to get details for
          schema:
            oneOf:
              - type: string
                example: BuildMuscles-CONTRACT123
              - type: number
                example: 10000003
        - name: filterBy
          in: query
          description: >-
            Field by which you want to filter the record; by priceListId or by
            name of the price list
          required: false
          schema:
            type: string
            default: priceListId
            enum:
              - priceListId
              - name
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceList'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceListNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    put:
      tags:
        - Price List
      summary: Update a specific price list
      description: Updates a specific price list by price list ID.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: priceListId
          in: path
          required: true
          description: Price list ID
          schema:
            type: number
            example: 10000003
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updatePriceListRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/updatedPriceList'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceListNotFound'
        '406':
          description: Not Acceptable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/currencyNotValid'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    delete:
      tags:
        - Price List
      summary: Delete a specific price list
      description: Delets a price list by priceListId.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: priceListId
          in: path
          required: true
          description: Price list ID
          schema:
            type: number
            example: 10000003
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deletedPriceList'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceListNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/price:
    post:
      tags:
        - Pricing
      summary: Create or update price
      description: >-
        Creates or updates price details for one or many items based on given
        item IDs. Support for currency code is determined based on the currency
        code you have set while creating the price list, whuch is identified by
        priceListId in the request body.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        $ref: '#/components/requestBodies/priceBody'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createCopilotPriceResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceDateError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceListNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    get:
      tags:
        - Pricing
      summary: Get all prices
      description: Gets a paginated list of all prices.
      parameters:
        - name: x-site-context
          in: header
          description: >-
            The `x-site-context` header is a JSON object that contains
            information about the source you wish to pull from. The mandatory
            `account` is the 24 character identifier found in Copilot. The
            `channel` (Sales channel ID), `stage` (environment name), and `date`
            attributes can be used to further narrow the scope of your data
            source.
          required: true
          schema:
            type: string
            example: >-
              {"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account":
              "1234abcd5678efgh9ijklmno","stage":"production"}
        - name: limit
          in: query
          description: The maximum number of records per page.
          required: false
          schema:
            type: number
            minimum: 1
            default: 10
            maximum: 100
        - name: page
          in: query
          description: Page number you want to get the record for.
          required: false
          schema:
            type: number
            default: 1
            minimum: 1
        - name: priceListId
          in: query
          description: ID of the price list for which you want to get the price details
          required: false
          schema:
            type: number
        - name: sortBy
          in: query
          description: Field by which you want to sort the records
          required: false
          schema:
            type: string
            default: updatedAt
            enum:
              - itemId
              - priceListId
              - updatedAt
        - name: sortOrder
          in: query
          description: Sorting order the records- ascending or descending
          required: false
          schema:
            type: string
            default: desc
            enum:
              - asc
              - desc
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getPriceResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/price/{priceId}/priceList/{priceListId}:
    get:
      tags:
        - Pricing
      summary: Get price by priceId
      description: >-
        Retrieves paginated list of price details based on priceListId and
        priceId or itemSku or itemId.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: priceId
          in: path
          required: true
          description: >-
            Value for this field can be database ID (_id) of the price or
            itemSku or itemId based on the type mentioned in the `type` query
            parameter.<br /> If a type is not specified in the `type` query
            parameter, you must provide itemSku in this priceId field.
          schema:
            type: string
            example: SKU123456
        - name: priceListId
          in: path
          required: true
          description: ID of the priceList to search the price for.
          schema:
            type: number
            example: 100000
        - name: type
          in: query
          description: >-
            The `priceId` path parameter will be treated as itemSku, itemId or
            _id based on the value of this field. The default search will be
            done by `itemSku`.
          required: false
          schema:
            type: string
            enum:
              - itemSku
              - itemId
              - _id
            example: itemId
        - name: limit
          in: query
          description: >-
            The maximum number of records per page. If the `isActive` flag is
            sent, the `limit` will be ignored.
          required: false
          schema:
            type: number
            example: 10
            default: 10
        - name: page
          in: query
          description: >-
            Number of pages you wish to retrieve when selecting records in the
            price offers array. Default is `1`. If the `isActive` flag is true,
            `page` will be ignored.
          required: false
          schema:
            type: number
            example: 1
        - name: isActive
          in: query
          description: >-
            If isActive is `false`, offers array response based on limit and
            page parameters.<br /> If isActive is `true`, only the offer object
            whose price is active will be returned in the offers array.<br />
            Default value is `false`.
          required: false
          schema:
            type: boolean
            example: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getByIdPriceResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceEntryNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    delete:
      tags:
        - Pricing
      summary: Delete price by priceId
      description: Deletes a price based on priceListID, and priceId or itemSku or itemId.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: priceId
          in: path
          required: true
          description: >-
            Value for this field can be database ID (_id) of the price or
            itemSku or itemId based on the type mentioned in the `type` query
            parameter.<br /> If a type is not specified in the `type` query
            parameter, you must provide itemSku in this priceId field.
          schema:
            type: string
            example: SKU123456
        - name: priceListId
          in: path
          required: true
          description: ID of the priceList to search the price for.
          schema:
            type: number
            example: 100000
        - name: type
          in: query
          description: >-
            The `priceId` path parameter will be treated as itemSku, itemId or
            databse ID (_id) depending on this field. The default search will be
            done by `itemSku`.
          required: false
          schema:
            type: string
            enum:
              - itemSku
              - itemId
              - _id
            example: itemId
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deletePricebyIdResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceEntryNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/price-guard:
    post:
      tags:
        - Price Guard
      summary: Create price guard
      description: >-
        Creates a price guard record that can contain various price kinds other
        than the elemental prices such as base price, sale price, and clearance
        price.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/newPriceGuardRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceGuard'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceGuardValidationError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceListNotFoundError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    get:
      tags:
        - Price Guard
      summary: Get all price guards
      description: Retrieves a paginated list of price guards based on query parameters.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: limit
          in: query
          description: The maximum number of records per page.
          required: false
          schema:
            type: number
        - name: offset
          in: query
          description: >-
            The number of records to skip before returning records. For example,
            when offset is 20 and limit is 10, this endpoint returns records
            from 21 to 30.
          required: false
          schema:
            type: number
        - name: itemId
          in: query
          description: Item ID for which price guards are to be retrieved
          required: false
          schema:
            type: integer
        - name: priceListId
          in: query
          description: The ID of the price list under which price guards are retrieved.
          required: false
          schema:
            type: integer
        - name: sortBy
          in: query
          description: Field by which you want to sort the records
          required: false
          schema:
            type: string
            enum:
              - priceListId
              - itemId
              - updatedAt
        - name: sortOrder
          in: query
          description: Ascending or Descending
          required: false
          schema:
            type: string
            enum:
              - desc, asc
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listPriceGuardResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/price-guard/{priceGuardId}:
    put:
      tags:
        - Price Guard
      summary: Update a specific price guard
      description: Updates a specific price guard record by priceguardId.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: priceGuardId
          in: path
          required: true
          description: ID of the price guard to update
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/newPriceGuardRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceGuard'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceGuardValidationError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceGuardNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    delete:
      tags:
        - Price Guard
      summary: Delete a specific price guard
      description: Deletes a specific price guard record by ID.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: priceGuardId
          in: path
          required: true
          description: ID of the price guard to delete
          schema:
            type: number
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deletedPriceGuard'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceGuardNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/price-kind:
    post:
      tags:
        - Price Kind
      summary: Get all price kinds
      description: >-
        Retrieves a paginated list of all normal price kinds that are setup
        earlier. It returns only price-kinds, not the price information. Price
        kinds indicate if the offer is under clearance or promotion or base
        price status. If clearance or promotion price is not set up earlier, a
        price kind is considered as base price.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/paginationRequestBody'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceKinds'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/promo/create:
    post:
      tags:
        - Promotion
      summary: Create promotion
      description: Enables you to create a promotion
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createPromo'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoCouponDateError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/promo/list:
    post:
      tags:
        - Promotion
      summary: Get all promotions
      description: Retrieves a paginated list of all promotions.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/getPromoList'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoListResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/promo/search:
    post:
      tags:
        - Promotion
      summary: Search for promotions
      description: Use this endpont to search for promotions using filter conditions.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/searchPromoRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoSearchResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/error400'
                  - $ref: '#/components/schemas/invalidSearchFilterField'
                  - $ref: '#/components/schemas/invalidPromoState'
                  - $ref: '#/components/schemas/invalidFilterOperator'
                  - $ref: '#/components/schemas/invalidPromoStackingType'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/promo/{promoId}:
    get:
      tags:
        - Promotion
      summary: Get a specific promotion
      description: Retrieves details of a specific promotion by ID
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - in: path
          name: promoId
          schema:
            type: string
          required: true
          description: ID of the promotion to be retrieved
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoResponseDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoCouponNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    delete:
      tags:
        - Promotion
      summary: Delete a specific promotion
      description: >-
        Deletes a specific promotion by ID. You can delete all promotions except
        an active promotion that has `state` defined as `ACTIVE`.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: promoId
          in: path
          required: true
          description: ID of the promotion to be deleted
          schema:
            type: number
            example: 61dfc146bf98990009b7091c
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/promoResponse'
                  - type: object
                    properties:
                      deleted:
                        type: boolean
                        description: >-
                          true: promotion is deleted<br /> false: promotion is
                          not deleted
                        example: true
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoCouponNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/promo/update/{promoId}:
    put:
      tags:
        - Promotion
      summary: Update a specific promotion
      description: Updates a specific promotion based on promotion ID
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: promoId
          in: path
          required: true
          description: ID of the promotion to be updated
          schema:
            type: string
            example: 61df12345678900009b7091c
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updatePromo'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoCouponDateError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoCouponNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/promo/{promoId}/enable-disable:
    put:
      tags:
        - Promotion
      summary: Enable or disable a promotion
      description: >-
        Lets you toggle promotion status by enabling or disabling a promotion,
        not applicable to *ACTIVE* promotions. <br />**Enable a promotion:**
        Only *disabled* promotions can be enabled.<br /> **Disable a
        promotion:** Only *not expired* promotions can be disabled.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - in: path
          name: promoId
          schema:
            type: string
          required: true
          description: ID of the promotion to be toggled
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/enableDisablePromo'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/promoResponse'
                  - type: object
                    properties:
                      state:
                        example: DISABLED
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoCouponNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/promo/{promoId}/kill:
    post:
      tags:
        - Promotion
      summary: Stop a promotion
      description: >-
        Lets you stop a specific promotion. This endpoint sets `state` as
        `EXPIRED`, and expiration date (both start date and end date) to the
        same current date.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - in: path
          name: promoId
          schema:
            type: string
          required: true
          description: ID of the promotion to be stopped
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/promoResponse'
                  - type: object
                    properties:
                      state:
                        example: EXPIRED
                      startDate:
                        example: '2021-10-18T23:45:40.289Z'
                      endDate:
                        example: '2021-10-18T23:45:40.289Z'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoCouponNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/coupon-codes:
    get:
      tags:
        - Coupon codes
      summary: Get a list of all coupon codes
      description: Retrieves a paginated list of all coupon codes.
      x-eov-operation-handler: /api-offers/coupon-codes
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: size
          in: query
          description: Records the number returned by the endpoint.
          required: false
          schema:
            type: integer
            format: int32
            default: 10
            minimum: 1
            maximum: 100
            example: 10
        - name: startCursor
          in: query
          description: Record pointer to get items after that record
          required: false
          schema:
            type: string
            example: 641cf986ca5b2c3180787e09
            nullable: true
        - name: userId
          in: query
          description: Filter records by the user ID.
          required: false
          schema:
            type: string
            example: user0001
        - name: promotionId
          in: query
          description: Filter records by the promotion ID.
          required: false
          schema:
            type: string
            example: 641cf986ca5b2c3180787e09
        - name: promoCode
          in: query
          description: Filter records by coupon code.
          required: false
          schema:
            type: string
            example: SUMMER
        - name: status
          in: query
          description: Filter records by status.
          required: false
          schema:
            type: string
            example: ACTIVE
            enum:
              - ACTIVE
              - INACTIVE
              - REDEEMED
        - name: startFrom
          in: query
          description: Filter records from a specific start date.
          required: false
          schema:
            type: string
            format: date-time
            example: '2023-03-24T01:14:50.967Z'
        - name: startTo
          in: query
          description: Filter records until a specific start date.
          required: false
          schema:
            type: string
            format: date-time
            example: '2023-03-24T01:14:50.967Z'
        - name: endFrom
          in: query
          description: Filter the records since a specific end date
          required: false
          schema:
            type: string
            format: date-time
            example: '2023-03-24T01:14:50.967Z'
        - name: endTo
          in: query
          description: Filter records until a specific end date.
          required: false
          schema:
            type: string
            format: date-time
            example: '2023-03-24T01:14:50.967Z'
        - name: additionalAttributes
          in: query
          description: >-
            Filter by the coupon code's additional attributes. This filter needs
            to be a valid JSON array to be able to make the search.
          required: false
          schema:
            type: string
            example: '[{key:''type'',value:''My Birthday''}]'
        - name: promoAdditionalAttributes
          in: query
          description: >-
            Filter by the related promotion or coupon's additional attributes.
            This filter needs to be a valid JSON array to be able to make the
            search.
          required: false
          schema:
            type: string
            example: '[{key:''type'',value:''Holiday''}]'
        - name: title
          in: query
          description: Filter coupon codes by the related promotion title.
          required: false
          schema:
            type: string
            example: Summer promotion
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/couponListResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/coupon/list:
    post:
      tags:
        - Coupon
      summary: Get list of all coupons
      description: Retrieves a paginated list of all coupons.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/getPromoList'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/couponListResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/coupon/create:
    post:
      tags:
        - Coupon
      summary: Create coupon
      description: Enables you to create a coupon that can be applied to get discounts
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createCoupon'
      responses:
        '200':
          description: OK
          content:
            application./json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/promoResponse'
                  - type: object
                    properties:
                      promoCodes:
                        example:
                          - SUMMER100
                          - SUMMER20
                      isImplicit:
                        example: false
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoCouponDateError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/coupon/search:
    post:
      tags:
        - Coupon
      summary: Search for coupons
      description: Use this endpoint to search for coupons based on filter conditions.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/searchPromoRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoSearchResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/error400'
                  - $ref: '#/components/schemas/invalidSearchFilterField'
                  - $ref: '#/components/schemas/invalidPromoState'
                  - $ref: '#/components/schemas/invalidFilterOperator'
                  - $ref: '#/components/schemas/invalidPromoStackingType'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/coupon/update/{couponId}:
    put:
      tags:
        - Coupon
      summary: Update a coupon
      description: Use this endpoint to update a specific coupon, by coupon ID.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: couponId
          in: path
          required: true
          description: The ID of the coupon that needs to be updated.
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/updateCoupon'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/promoResponse'
                  - type: object
                    properties:
                      promoCodes:
                        example:
                          - SUMMER100
                          - SUMMER20
                      isImplicit:
                        example: false
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoCouponDateError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoCouponNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/coupon/{couponId}:
    get:
      tags:
        - Coupon
      summary: Get a specific coupon
      description: Retrieves details of a specific coupon by ID
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - in: path
          name: couponId
          schema:
            type: string
          required: true
          description: ID of the coupon to be retrieved
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/promoResponseDetails'
                  - type: object
                    properties:
                      promoCodes:
                        example:
                          - SUMMER100
                          - SUMMER20
                      isImplicit:
                        example: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoCouponNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    delete:
      tags:
        - Coupon
      summary: Delete a coupon
      description: Enables you to delete a specific coupon by ID.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: couponId
          in: path
          required: true
          description: ID of the coupon to be deleted
          schema:
            type: number
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/promoResponse'
                  - type: object
                    properties:
                      deleted:
                        type: boolean
                        description: >-
                          true: coupon is deleted<br /> false: coupon is not
                          deleted
                        example: true
                      promoCodes:
                        example:
                          - SUMMER100
                          - SUMMER20
                      isImplicit:
                        example: false
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoCouponNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/coupon/{couponId}/enable-disable:
    put:
      tags:
        - Coupon
      summary: Enable or disable a coupon
      description: >-
        This endpoint lets you toggle coupon status- enable or disable.<br />
        **Enable a coupon:** Only disabled coupons can be enabled.<br />
        **Disable a coupon:** Only *not expired* coupons can be disabled.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - in: path
          name: couponId
          schema:
            type: string
          required: true
          description: ID of the coupon to be toggled.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/enableDisablePromo'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/promoResponse'
                  - type: object
                    properties:
                      state:
                        example: DISABLED
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/promoCouponNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/coupon/generate-codes:
    post:
      tags:
        - Coupon
      summary: Generate coupon codes
      description: Enables you to generate coupon codes based on given parameters
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/generateCouponCodeRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/generateCouponCodeResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/sku-list:
    get:
      tags:
        - Global exclusion
      summary: Get all sku-lists excluded from discounts
      description: >-
        Retrieves a paginated list of sku-lists that contain products that are
        excluded from being discounted.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: limit
          in: query
          description: The maximum number of records per page.
          required: false
          schema:
            type: number
        - name: offset
          in: query
          description: >-
            The number of records to skip before returning records. For example,
            when offset is 20 and limit is 10, this endpoint returns records
            from 21 to 30.
          required: false
          schema:
            type: number
        - name: date
          in: query
          description: >-
            Date that lies between start date and end date of active time of the
            excluded sku-list.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listSkuListResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    post:
      tags:
        - Global exclusion
      summary: Create sku-list
      description: >-
        Creates a sku-list with the target products that are exempted from
        discounts to be applied.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/newSkuListRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/skuList'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/sku-list/{skuListId}:
    get:
      tags:
        - Global exclusion
      summary: Get specific sku-list
      description: Retrieves a specific sku-list by ID.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: skuListId
          in: path
          required: true
          description: ID of the SKU list to get details for
          schema:
            type: number
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/skuList'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    put:
      tags:
        - Global exclusion
      summary: Update specific sku-list
      description: Updates a specific sku-list record by ID.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: skuListId
          in: path
          required: true
          description: ID of the SKU list to update
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/newSkuListRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/skuList'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    delete:
      tags:
        - Global exclusion
      summary: Delete specific SKU-list
      description: Deletes a specific SKU-list record by ID.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: skuListId
          in: path
          required: true
          description: ID of the list to delete
          schema:
            type: number
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deletedSkuList'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/sku-list/{skuListId}/end-now:
    post:
      tags:
        - Global exclusion
      summary: End specific sku-list
      description: >-
        This endpoint lets you end the exclusion of a sku-list from discount,
        there by allowing the products under the sku-list to be applicable for
        discount.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: skuListId
          in: path
          required: true
          description: ID of the list to end
          schema:
            type: number
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/endedSkuList'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/redemption:
    post:
      tags:
        - Redemption
      summary: Create redemption
      description: Enables you to create a redemption record
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/newRedemptionRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/redemption'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/redemptions:
    get:
      tags:
        - Redemption
      summary: Get redemption List
      description: Enables you to get a paginated redemption list.
      x-eov-operation-handler: /api-offers/redemptions
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: size
          in: query
          description: The size of records per page.
          required: false
          schema:
            type: number
            minimum: 0
            maximum: 100
            default: 10
        - name: startCursor
          in: query
          description: The value for start cursor.
          required: false
          schema:
            type: string
            nullable: true
        - name: promoId
          in: query
          description: The filter value for promoId.
          required: false
          schema:
            type: string
        - name: promoCode
          in: query
          description: The filter value for promoCode.
          required: false
          schema:
            type: string
        - name: userId
          in: query
          description: The filter value for userId.
          required: false
          schema:
            type: string
        - name: email
          in: query
          description: The filter value for email.
          required: false
          schema:
            type: string
        - name: orderId
          in: query
          description: The filter value for orderId.
          required: false
          schema:
            type: string
        - name: storeId
          in: query
          description: The filter value for storeId.
          required: false
          schema:
            type: string
        - name: status
          in: query
          description: The filter value for status.
          required: false
          schema:
            type: string
            enum:
              - ACTIVE
              - INACTIVE
        - name: redeemedFrom
          in: query
          description: The filter value for redeemedFrom.
          required: false
          schema:
            type: string
            format: date-time
        - name: redeemedTo
          in: query
          description: The filter value for redeemedTo.
          required: false
          schema:
            type: string
            format: date-time
        - name: updatedFrom
          in: query
          description: The filter value for updatedFrom.
          required: false
          schema:
            type: string
            format: date-time
        - name: updatedTo
          in: query
          description: The filter value for updatedTo.
          required: false
          schema:
            type: string
            format: date-time
        - name: title
          in: query
          description: The filter value for title.
          required: false
          schema:
            type: string
            minLength: 3
        - name: isImplicit
          in: query
          description: The filter value for isImplicit.
          required: false
          schema:
            type: boolean
        - name: singleMultiUse
          in: query
          description: The filter value for singleMultiUse.
          required: false
          schema:
            type: string
            enum:
              - MULTI_USE
              - SINGLE_USE
        - name: additionalAttributes
          in: query
          description: The filter value for additionalAttributes.
          required: false
          schema:
            type: string
        - name: promoAdditionalAttributes
          in: query
          description: The filter value for promoAdditionalAttributes.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listRedemptionResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/redemption/{redemptionId}:
    delete:
      tags:
        - Redemption
      summary: Delete specific redemption record
      description: Delete a specific redemption record by redemptionId
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: redemptionId
          in: path
          description: ID of the redemption record to be deleted
          required: true
          schema:
            type: string
            example: 614b58924e92f6861ac9d43b
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/redemptionDeleteResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/redemptionNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/segment/list:
    get:
      tags:
        - Segment
      summary: Get list of all segments
      description: Retrieves a paginated list of segments based on query parameters.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: limit
          in: query
          description: The maximum number of records per page.
          required: false
          schema:
            type: number
        - name: offset
          in: query
          description: >-
            The number of records to skip before returning records. For example,
            when offset is 20 and limit is 10, this endpoint returns records
            from 21 to 30.
          required: false
          schema:
            type: number
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listSegmentResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/segment:
    post:
      tags:
        - Segment
      summary: Create segment
      description: Create a segment record.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createSegmentRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createSegmentResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/segmentNameExist'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/segment/{segmentId}:
    get:
      tags:
        - Segment
      summary: Get a specific segment
      description: Retrieves details of a specific segment by segmentId
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: segmentId
          in: path
          description: ID of the segment to be retrieved
          required: true
          schema:
            type: number
            example: 100002
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getSegmentResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/segmentNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    put:
      tags:
        - Segment
      summary: Update a specific segment
      description: Updates a specific segment by segmentId
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: segmentId
          in: path
          description: ID of the segment to be updated
          required: true
          schema:
            type: number
            example: 100002
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createSegmentRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getSegmentResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/segmentNameExist'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/segmentNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    delete:
      tags:
        - Segment
      summary: Delete a specific segment
      description: Delete a specific segment by segmentId
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: segmentId
          in: path
          description: ID of the segment to be deleted
          required: true
          schema:
            type: number
            example: 100002
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deleteSegmentResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/segmentNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-pim/item/upload-url:
    post:
      tags:
        - Upload price CSV
      summary: Generate URL to bulk upload price details
      description: >-
        This endpoint lets you generate a secured S3 URL using which you can
        upload the CSV file containing price details. Ensure that all the
        headers and values in the CSV file are double-quoted. After a file is
        uploaded, it is processed internally to apply bulk changes to price
        details.<br /><br />**Note:** The maximum number of rows with price
        records to upload per CSV file is 5000.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/uploadUrlRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getUploadURLResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/get-product/{sku}:
    get:
      tags:
        - Product
      summary: Get product and price by sku
      description: >-
        Retrieves product and price details, along with its child products'
        details if there are any, by specific SKU and priceListId. If price
        details are not set up previously, it only retrieves the product
        information; price details are not returned in such cases.
      operationId: getProduct
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - in: path
          name: sku
          schema:
            type: string
          required: true
          description: >-
            SKU of the product whose details are to be retrieved. If the product
            has child products, details of the child products are also
            retrieved.
        - in: query
          name: priceListId
          schema:
            type: string
          required: false
          description: >-
            Get product by ID in a given price list. If priceListId is not
            provided, default priceList is selected to search the details for.
            If the SKUdoesn't belong to the default price list, price details
            are not returned.
        - in: query
          name: limit
          schema:
            type: number
            default: 10
            minimum: 1
          required: false
          description: The maximum number of records per page.
        - in: query
          name: offset
          schema:
            type: number
            default: 0
            minimum: 0
          required: false
          description: >-
            The number of records to skip before returning records. For example,
            when offset is 20 and limit is 10, this endpoint returns records
            from 21 to 30.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getProductResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getProductNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/item/{itemId}:
    get:
      tags:
        - Item
      summary: Get price of a specific item
      description: Retrieves price details of an item by itemId
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - in: path
          name: itemId
          schema:
            type: number
          required: true
          description: ID of the item to get price details for
          example: 1000000269
        - in: query
          name: priceListId
          schema:
            type: number
          required: false
          description: >-
            ID of the price list to which the item belongs to. If priceListId is
            not provided, default priceList is considered for search. If the
            itemId does not belong to the default priceList, then the price
            object is not returned.
        - in: query
          name: limit
          schema:
            type: number
            default: 10
            minimum: 1
          required: false
          description: The maximum number of records per page.
        - in: query
          name: offset
          schema:
            type: number
            default: 0
            minimum: 0
          required: false
          description: >-
            The number of records to skip before returning records. For example,
            when offset is 20 and limit is 10, this endpoint returns records
            from 21 to 30.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/productById'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/productByIdNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/items/search:
    post:
      tags:
        - Item
      summary: Search products and assigned prices in a specific price list
      description: >-
        Retrieves a paginated list of products and assigned prices in a specific
        price list based on priceListId and other search parameters as passed in
        the request body. If price list ID is not provided, default price list
        is selected for the search.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/searchItemsByPrice'
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/searchProductResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceListNotFoundError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/items/priceListId/{priceListId}:
    get:
      tags:
        - Item
      summary: Get Skus and itemIds in a specific pricelist
      description: >-
        Retrieves Skus and itemIds for which there is a price entry in a
        specific pricelist. The pricelist is identified by priceListId.
      operationId: itemIdsByPriceListId
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: priceListId
          in: path
          description: ID of the pricelist from which the items are to be returned
          required: true
          schema:
            type: string
        - in: query
          name: offset
          schema:
            type: number
          description: >-
            The number of records to skip before returning records. For example,
            when offset is 20 and limit is 10, this endpoint returns records
            from 21 to 30.
        - in: query
          name: limit
          schema:
            type: number
          description: The maximum number of records per page.
        - name: sortBy
          in: query
          description: Field using which you want to sort the records
          required: false
          schema:
            type: string
            enum:
              - itemId
              - updatedAt
        - name: sortOrder
          in: query
          description: Sorting order of the records- ascending or descending
          required: false
          schema:
            type: string
            enum:
              - desc, asc
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getItemIdsAndItemSkusResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceListNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/attributes:
    get:
      tags:
        - Attributes
      summary: Get list of all attributes
      description: >-
        Using this endpoint, you can get a paginated list of attributes. By
        specfiying the pagination criteria, such as `offset` and `limit`, you
        can tailor the search results.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: limit
          in: query
          description: The maximum number of records per page.
          required: false
          schema:
            type: number
            example: 10
        - name: offset
          in: query
          description: >-
            The number of records to skip before returning records. For example,
            when offset is 20 and limit is 10, this endpoint returns records
            from 21 to 30.
          required: false
          schema:
            type: number
            example: 20
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/listAttributeResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    post:
      tags:
        - Attributes
      summary: Create attribute
      description: Create a attribute record.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createAttributeRequest'
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createAttributeResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/attributeNameExist'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/attributes/{attributeId}:
    get:
      tags:
        - Attributes
      summary: Get a specific attribute
      description: Retrieves details of a specific attribute by attributeId
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: attributeId
          in: path
          description: ID of the attribute to be retrieved
          required: true
          schema:
            type: number
            example: 100002
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getAttributeResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/attributeNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    put:
      tags:
        - Attributes
      summary: Update a specific attribute
      description: Updates a specific attribute by attributeId
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: attributeId
          in: path
          description: ID of the attribute to be updated
          required: true
          schema:
            type: number
            example: 100002
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createAttributeRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getAttributeResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/attributeNameExist'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/attributeNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    delete:
      tags:
        - Attributes
      summary: Delete a specific attribute
      description: Delete a specific attribute by attributeId
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - name: attributeId
          in: path
          description: ID of the attribute to be deleted
          required: true
          schema:
            type: number
            example: 100002
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/deleteAttributeResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/attributeNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/offers-exports:
    post:
      tags:
        - Exports
      summary: Initiate export request
      description: Initiate an export request based on the specified filter criteria.
      operationId: createExport
      security:
        - AuthorizationToken: []
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createExport'
      responses:
        '200':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createExportResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/exportTypeNotValidError'
                  - $ref: '#/components/schemas/error400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error401'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
    get:
      tags:
        - Exports
      summary: Get all export requests
      description: Get a paginated list of all the export requests.
      operationId: listExports
      security:
        - AuthorizationToken: []
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - $ref: '#/components/parameters/queryParameterSize'
        - $ref: '#/components/parameters/queryParameterOffset'
        - name: sort
          in: query
          description: Field to sort export requests.
          required: false
          schema:
            type: string
            example: +startedAt
        - name: type
          in: query
          description: Type of data to export.
          required: false
          schema:
            type: string
            example: REDEMPTION
            enum:
              - REDEMPTION
              - CALCULATED_PRICE
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/exportListResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/badSizeError'
                  - $ref: '#/components/schemas/badOffsetError'
                  - $ref: '#/components/schemas/error400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error401'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/offers-exports/{exportId}:
    get:
      tags:
        - Exports
      summary: Get export request by ID
      description: >-
        Get the details of a specific export request by the corresponding
        `exportId` that was generated from the [initiate export
        request](/v2/api-reference/offers-v2/exports/initiate-export-request)
        endpoint.
      operationId: getExportById
      security:
        - AuthorizationToken: []
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
        - in: path
          name: exportId
          required: true
          description: >-
            The `exportId` value that was generated from the [initiate export
            request](/v2/api-reference/offers-v2/exports/initiate-export-request)
            endpoint.
          schema:
            type: string
            example: 1e7b9912-1d88-4412-9f25-ff4730eb14ce
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/createExportResponse'
                  - type: object
                    properties:
                      fileId:
                        type: string
                        description: >-
                          The S3 [fileId] to generate a downloadable CSV using
                          the [download exported CSV
                          file](/v2/api-reference/offers-v2/exports/download-exported-csv-file)
                          endpoint.
                        example: >-
                          redemption/tenantId/1687472977242-redemption-export.csv
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/exportNotFoundError'
                  - $ref: '#/components/schemas/error400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error401'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
  /api-offers/offers-exports/actions/download-export-file:
    post:
      tags:
        - Exports
      summary: Download exported CSV file
      description: >-
        This endpoint lets you generate a URL, using fileId, from which you can
        download the exported CSV file. The generated URL expires in five mins.
      operationId: downloadExport
      security:
        - AuthorizationToken: []
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/downloadExportUrl'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/downloadExportUrlResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/fileExpiredError'
                  - $ref: '#/components/schemas/invalidFileIdError'
                  - $ref: '#/components/schemas/error400'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error401'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
