openapi: 3.0.1
info:
  title: Discounts
  description: Api to manage discounts
  license:
    name: Nexway License Version 1.0
  version: '1.0'
servers:
  - url: https://api.staging.nexway.build
    description: Generated server url
security:
  - Bearer:
      - read
      - write
paths:
  /discounts/{id}/generate:
    post:
      tags:
        - Discount
      summary: generateSingleUseCodes
      description: Generate coupons
      operationId: generateSingleUseCodes
      parameters:
        - name: id
          in: path
          description: Discount id
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingleUseCodeGenerationResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingleUseCodeGenerationResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingleUseCodeGenerationResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingleUseCodeGenerationResponse'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SingleUseCodeGenerationResponse'
  /discounts/import:
    post:
      tags:
        - Discount
      summary: importDiscount
      description: Import a discount
      operationId: importDiscount
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discount'
        '201':
          description: Created
          headers:
            Location:
              description: UUID generated for the new discount ref
              style: simple
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
        '500':
          description: Failure
          content:
            application/json:
              schema:
                type: object
  /discounts/usages:
    get:
      tags:
        - DiscountUsage
      summary: Get items
      operationId: getItems_1
      parameters:
        - name: orderId
          in: query
          description: Order Id discount applied to
          schema:
            type: string
        - name: customerId
          in: query
          description: Customer Id discount applied to
          schema:
            type: string
        - name: storeId
          in: query
          description: Store Id discount applied to
          schema:
            type: string
        - name: discountId
          in: query
          description: Discount Id
          schema:
            type: string
        - name: discountCode
          in: query
          description: Discount Code
          schema:
            type: string
        - name: endUserEmail
          in: query
          description: Email used
          schema:
            type: string
        - name: endUserId
          in: query
          description: EndUser Id
          schema:
            type: string
        - name: catalogId
          in: query
          description: Catalog Id
          schema:
            type: string
        - name: target
          in: query
          description: >-
            Return selected fields only (multiple occurrences allowed for
            selecting multiple fields)
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResultDiscountUsage'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
      x-operationWeight: '300'
    post:
      tags:
        - Discount
      summary: declareUsages
      description: Declare discount usages
      operationId: declareUsages
      responses:
        '200':
          description: Success
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not Found
        '500':
          description: Failure
  /discounts/discount/cart:
    post:
      tags:
        - Discount
      summary: applyDiscountsOnCart
      description: Apply discounts on cart
      operationId: applyDiscountsByCart
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
  /discounts/discount/voucher:
    post:
      tags:
        - Discount
      summary: applyDiscountsOnCart
      description: Apply discounts on cart
      operationId: applyCartLevelDiscounts
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Cart'
  /discounts:
    get:
      tags:
        - Discount
      summary: Get items
      operationId: getItems
      parameters:
        - name: target
          in: query
          description: >-
            Return selected fields only (multiple occurrences allowed for
            selecting multiple fields)
          required: true
          schema:
            type: string
        - name: customerId
          in: query
          description: Customer Id
          schema:
            type: string
        - name: storeIds
          in: query
          description: Stores discount can be applied to
          schema:
            type: string
        - name: productIds
          in: query
          description: Products to which discount is restricted
          schema:
            type: string
        - name: parentProductIds
          in: query
          description: Products to which discount is restricted
          schema:
            type: string
        - name: name
          in: query
          description: Name of discount
          schema:
            type: string
        - name: startDate
          in: query
          description: Discount start date
          schema:
            type: string
        - name: endDate
          in: query
          description: Discount end date
          schema:
            type: string
        - name: level
          in: query
          description: Level of product discount applies
          schema:
            type: string
            enum:
              - PRODUCT
              - FORCED_CROSS_SELL
              - CROSS_SELL
              - UP_SELL
              - CART
        - name: model
          in: query
          description: Model type of discount
          schema:
            type: string
            enum:
              - CAMPAIGN
              - COUPON
              - SINGLE_USE_CODE
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResultDiscount'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
      x-operationWeight: '300'
    post:
      tags:
        - Discount
      summary: Create an item
      operationId: createItem
      responses:
        '201':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discount'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
      x-operationWeight: '300'
  /discounts/{id}:
    get:
      tags:
        - Discount
      summary: Get item
      operationId: getItem
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discount'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
      x-operationWeight: '200'
    put:
      tags:
        - Discount
      summary: Update item
      operationId: updateItem
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Discount'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
      x-operationWeight: '400'
    delete:
      tags:
        - Discount
      summary: Delete item
      operationId: deleteItem
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content
          content:
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
      x-operationWeight: '500'
  /discounts/distinct:
    get:
      tags:
        - Discount
      summary: Get distinct values for a given field
      operationId: distinct
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResultObject'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
      x-operationWeight: '100'
  /discounts/recap:
    get:
      tags:
        - Discount
      summary: Get recap quantities for a given field
      operationId: recap
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResultRecapEntry'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
      x-operationWeight: '150'
  /discounts/unwind:
    get:
      tags:
        - Discount
      summary: Search unwind for a given field
      operationId: unwind
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResultDocument'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
      x-operationWeight: '150'
  /discounts/usages/distinct:
    get:
      tags:
        - DiscountUsage
      summary: Get distinct values for a given field
      operationId: distinct_1
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResultObject'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
      x-operationWeight: '100'
  /discounts/usages/{id}:
    get:
      tags:
        - DiscountUsage
      summary: Get item
      operationId: getItem_1
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DiscountUsage'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
      x-operationWeight: '200'
  /discounts/usages/recap:
    get:
      tags:
        - DiscountUsage
      summary: Get recap quantities for a given field
      operationId: recap_1
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResultRecapEntry'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
      x-operationWeight: '150'
  /discounts/usages/unwind:
    get:
      tags:
        - DiscountUsage
      summary: Search unwind for a given field
      operationId: unwind_1
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResultDocument'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
        '500':
          description: Failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NormalizeException'
      x-operationWeight: '150'
components:
  schemas:
    SingleUseCodeGenerationResponse:
      type: object
      properties:
        remaining:
          type: integer
          format: int64
        codes:
          type: array
          items:
            type: string
    Campaign:
      required:
        - endDate
        - level
        - name
        - storeIds
      type: object
      allOf:
        - $ref: '#/components/schemas/Discount'
        - type: object
          properties:
            weight:
              type: integer
              description: >-
                Determines which coupon is applied when there are two with the
                same name. Higher value increases priority.
              format: int32
              example: 100
            maxUsePerStore:
              minimum: 1
              type: integer
              format: int32
            maxUsePerEndUser:
              minimum: 1
              type: integer
              format: int32
    Coupon:
      required:
        - endDate
        - level
        - name
        - storeIds
      type: object
      allOf:
        - $ref: '#/components/schemas/Discount'
        - type: object
          properties:
            weight:
              type: integer
              description: >-
                Determines which coupon is applied when there are two with the
                same name. Higher value increases priority.
              format: int32
              example: 100
            maxUsePerStore:
              minimum: 1
              type: integer
              format: int32
            maxUsePerEndUser:
              minimum: 1
              type: integer
              format: int32
            codes:
              type: object
              additionalProperties:
                type: object
    Discount:
      required:
        - endDate
        - level
        - name
        - storeIds
      type: object
      properties:
        id:
          type: string
          deprecated: true
        customerId:
          type: string
        enduserId:
          type: string
          description: End User Id
        createDate:
          type: string
          format: date-time
          deprecated: true
        updateDate:
          type: string
          format: date-time
          deprecated: true
        modelVersion:
          type: string
          deprecated: true
        dbVersion:
          type: integer
          format: int64
        lastUpdateReason:
          type: string
        originalId:
          type: string
          writeOnly: true
        startDate:
          type: string
          description: Discount start date timestamp in milliseconds
          format: date-time
        endDate:
          type: string
          description: Discount end date timestamp in milliseconds
          format: date-time
        catalogId:
          type: string
          description: Catalog Id
        storeIds:
          uniqueItems: true
          type: array
          description: Stores to which discount can be applied
          items:
            type: string
            description: Stores to which discount can be applied
        productIds:
          uniqueItems: true
          type: array
          description: Products to which discount can be applied
          items:
            type: string
            description: Products to which discount can be applied
        parentProductIds:
          uniqueItems: true
          type: array
          description: Parent products IDs to which discount can be applied
          items:
            type: string
            description: Parent products IDs to which discount can be applied
        publisherRefIds:
          uniqueItems: true
          type: array
          description: Product publisher references to which discount can be applied
          items:
            type: string
            description: Product publisher references to which discount can be applied
        sources:
          type: array
          description: >-
            Sources to which discount can be applied: PURCHASE, MANUAL_RENEWAL,
            SUBSCRIPTION, BILLING_PLAN
          items:
            type: string
            description: >-
              Sources to which discount can be applied: PURCHASE,
              MANUAL_RENEWAL, SUBSCRIPTION, BILLING_PLAN
            enum:
              - PURCHASE
              - SUBSCRIPTION
              - MANUAL_RENEWAL
              - BILLING_PLAN
        subscriptionId:
          type: string
          description: Subscription id on which discount can be applied
        dynamicVariables:
          type: object
          additionalProperties:
            type: object
            description: Dynamic variables
          description: Dynamic variables
        discountRate:
          maximum: 1
          exclusiveMaximum: false
          minimum: 0
          exclusiveMinimum: true
          type: number
          description: Value of discount rate
          format: double
        amountByCurrency:
          type: object
          additionalProperties:
            type: number
            description: Discount amount by currencies
            format: double
          description: Discount amount by currencies
        applyOnNetPrice:
          type: boolean
          description: Apply discount on net price instead gross
          default: false
        externalContext:
          type: string
          description: External context
        startingDate:
          type: string
          writeOnly: true
        endingDate:
          type: string
          writeOnly: true
        productOrParentId:
          type: string
          writeOnly: true
        code:
          type: string
          writeOnly: true
        source:
          type: string
          writeOnly: true
        name:
          type: string
        localizedLabels:
          type: object
          additionalProperties:
            type: string
        model:
          type: string
          enum:
            - CAMPAIGN
            - COUPON
            - SINGLE_USE_CODE
        countries:
          uniqueItems: true
          type: array
          items:
            type: string
        status:
          type: string
          enum:
            - ENABLED
            - DISABLED
        maxUsages:
          type: integer
          format: int32
        level:
          type: string
          enum:
            - PRODUCT
            - FORCED_CROSS_SELL
            - CROSS_SELL
            - UP_SELL
            - CART
        thresholds:
          type: object
          additionalProperties:
            type: number
            format: double
        endUserEmails:
          uniqueItems: true
          type: array
          items:
            type: string
        endUserTypes:
          uniqueItems: true
          type: array
          description: >-
            Define list of end user types to which coupon can be applied. BUYER
            : allows apply coupon in cart / RESELLER : allows apply coupon in
            reseller portal
          items:
            type: string
            description: >-
              Define list of end user types to which coupon can be applied.
              BUYER : allows apply coupon in cart / RESELLER : allows apply
              coupon in reseller portal
        endUserGroupIds:
          uniqueItems: true
          type: array
          items:
            type: string
        buyerBehaviorTriggers:
          uniqueItems: true
          type: array
          items:
            type: string
            enum:
              - RETAIN_BUYER
              - ABANDONED_CART
              - RENEWAL
        used:
          type: integer
          format: int64
        generated:
          type: integer
          format: int64
        cumulative:
          type: boolean
      discriminator:
        propertyName: model
        mapping:
          COUPON: '#/components/schemas/Coupon'
          CAMPAIGN: '#/components/schemas/Campaign'
          SINGLE_USE_CODE: '#/components/schemas/SingleUseCode'
      oneOf:
        - $ref: '#/components/schemas/Coupon'
        - $ref: '#/components/schemas/Campaign'
        - $ref: '#/components/schemas/SingleUseCode'
    SingleUseCode:
      required:
        - endDate
        - level
        - name
        - storeIds
      type: object
      allOf:
        - $ref: '#/components/schemas/Discount'
    BuyerBehavior:
      type: object
      properties:
        retainBuyer:
          type: boolean
        abandonedCart:
          type: boolean
        renewal:
          type: boolean
    Cart:
      type: object
      properties:
        id:
          type: string
        storeId:
          type: string
        customerId:
          type: string
        locale:
          type: string
        products:
          type: array
          items:
            $ref: '#/components/schemas/Product'
        endUser:
          $ref: '#/components/schemas/EndUser'
        totalAmount:
          type: number
          format: double
        vouchersTotalAmount:
          type: number
          format: double
        currency:
          type: object
          properties:
            currencyCode:
              type: string
            defaultFractionDigits:
              type: integer
              format: int32
            numericCode:
              type: integer
              format: int32
            displayName:
              type: string
            symbol:
              type: string
            numericCodeAsString:
              type: string
        discounts:
          type: array
          items:
            type: string
        discountsStatus:
          type: array
          items:
            $ref: '#/components/schemas/DiscountStatus'
        buyerBehavior:
          $ref: '#/components/schemas/BuyerBehavior'
        catalogId:
          type: string
        source:
          type: string
          enum:
            - PURCHASE
            - SUBSCRIPTION
            - MANUAL_RENEWAL
            - BILLING_PLAN
        price:
          $ref: '#/components/schemas/Price'
        vouchers:
          uniqueItems: true
          type: array
          items:
            $ref: '#/components/schemas/Voucher'
        subscriptionId:
          type: string
    DiscountStatus:
      type: object
      properties:
        discount:
          type: string
        status:
          type: string
          enum:
            - APPLIED
            - NOT_APPLICABLE
            - OVERLAPPING
            - OVERUSED
            - INVALID
        discountLabel:
          type: string
    DiscountedPrice:
      type: object
      properties:
        discountedNetPrice:
          type: number
          format: double
        discountedGrossPrice:
          type: number
          format: double
        discountRate:
          type: number
          format: double
        netPriceDiscountAmount:
          type: number
          format: double
        grossPriceDiscountAmount:
          type: number
          format: double
        vatDiscountAmount:
          type: number
          format: double
        signedDiscount:
          type: string
        discountCode:
          type: string
        discountId:
          type: string
        discountLabel:
          type: string
        discountExternalContext:
          type: string
    EndUser:
      type: object
      properties:
        id:
          type: string
        locale:
          type: string
        country:
          type: string
        type:
          type: string
        groupId:
          type: string
        email:
          type: string
    FullPrice:
      type: object
      properties:
        vatAmount:
          type: number
          format: double
        netPrice:
          type: number
          format: double
        vatRate:
          type: number
          format: double
        grossPrice:
          type: number
          format: double
        vatAmountMsrp:
          type: number
          format: double
        netMsrp:
          type: number
          format: double
        grossMsrp:
          type: number
          format: double
        currency:
          type: object
          properties:
            currencyCode:
              type: string
            defaultFractionDigits:
              type: integer
              format: int32
            numericCode:
              type: integer
              format: int32
            displayName:
              type: string
            symbol:
              type: string
            numericCodeAsString:
              type: string
        discountedPrice:
          $ref: '#/components/schemas/DiscountedPrice'
        discounted:
          type: boolean
    Price:
      type: object
      properties:
        currency:
          type: object
          properties:
            currencyCode:
              type: string
            defaultFractionDigits:
              type: integer
              format: int32
            numericCode:
              type: integer
              format: int32
            displayName:
              type: string
            symbol:
              type: string
            numericCodeAsString:
              type: string
        netPrice:
          type: number
          format: double
        grossPrice:
          type: number
          format: double
        vatIncluded:
          type: boolean
        vatRate:
          type: number
          format: double
        vatAmount:
          type: number
          format: double
        vatAmountMsrp:
          type: number
          format: double
        netMsrp:
          type: number
          format: double
        grossMsrp:
          type: number
          format: double
        discountedPrice:
          $ref: '#/components/schemas/DiscountedPrice'
        initialGrossPrice:
          type: number
          format: double
        initialNetPrice:
          type: number
          format: double
        initialVatAmount:
          type: number
          format: double
    Product:
      type: object
      properties:
        id:
          type: string
        customerId:
          type: string
        fullPrice:
          $ref: '#/components/schemas/FullPrice'
        unitPrice:
          $ref: '#/components/schemas/FullPrice'
        price:
          $ref: '#/components/schemas/FullPrice'
        variantOf:
          type: string
        publisherRefId:
          type: string
        quantity:
          type: number
          format: double
        discountsStatus:
          type: array
          items:
            $ref: '#/components/schemas/DiscountStatus'
        forcedBy:
          type: string
        crossSellBy:
          type: string
        upSellBy:
          type: string
        priceFunctionParametersValues:
          type: object
          additionalProperties:
            type: object
    Voucher:
      type: object
      properties:
        id:
          type: string
        code:
          type: string
        amount:
          type: number
          format: double
        localizedLabel:
          type: string
        status:
          type: string
          enum:
            - APPLIED
            - NOT_APPLICABLE
            - OVERLAPPING
            - OVERUSED
            - INVALID
        discountExternalContext:
          type: string
    ExceptionDetail:
      type: object
      properties:
        errorType:
          type: string
        resourceType:
          type: string
        resourceId:
          type: string
        resourceDisplayName:
          type: string
        specific:
          type: object
    NormalizeException:
      type: object
      properties:
        timestamp:
          type: integer
          format: int64
        status:
          type: integer
          format: int32
        error:
          type: string
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/ExceptionDetail'
    SearchResultDiscount:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Discount'
        last:
          type: boolean
        totalItems:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
        size:
          type: integer
          format: int32
        number:
          type: integer
          format: int32
    SearchResultObject:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
        last:
          type: boolean
        totalItems:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
        size:
          type: integer
          format: int32
        number:
          type: integer
          format: int32
    RecapEntry:
      type: object
      properties:
        targetValue:
          type: string
        count:
          type: integer
          format: int32
    SearchResultRecapEntry:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/RecapEntry'
        last:
          type: boolean
        totalItems:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
        size:
          type: integer
          format: int32
        number:
          type: integer
          format: int32
    Document:
      type: object
      properties:
        empty:
          type: boolean
      additionalProperties:
        type: object
    SearchResultDocument:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Document'
        last:
          type: boolean
        totalItems:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
        size:
          type: integer
          format: int32
        number:
          type: integer
          format: int32
    DiscountUsage:
      type: object
      properties:
        id:
          type: string
          deprecated: true
        customerId:
          type: string
        enduserId:
          type: string
        createDate:
          type: string
          format: date-time
          deprecated: true
        updateDate:
          type: string
          format: date-time
          deprecated: true
        modelVersion:
          type: string
          deprecated: true
        dbVersion:
          type: integer
          format: int64
        lastUpdateReason:
          type: string
        originalId:
          type: string
          writeOnly: true
        discountId:
          type: string
        discountCode:
          type: string
        orderId:
          type: string
        storeId:
          type: string
        endUserEmail:
          type: string
        useDate:
          type: string
          format: date-time
        used:
          type: boolean
        usingDate:
          type: string
          writeOnly: true
    SearchResultDiscountUsage:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/DiscountUsage'
        last:
          type: boolean
        totalItems:
          type: integer
          format: int64
        totalPages:
          type: integer
          format: int32
        size:
          type: integer
          format: int32
        number:
          type: integer
          format: int32
  securitySchemes:
    Bearer:
      type: http
      description: Enter Bearer token
      scheme: bearer
      bearerFormat: JWT
