swagger: '2.0'
info:
  title: Promotion Admin REST APIs
  version: '2.0'
paths:
  /promotions:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: false
          type: string
        - description: >-
            The position within the resulting dataset where the query begins
            returning item records. If the offset is "5", the records that
            returned begin with the sixth record that matches the query
            parameters. If the offset is "0", the records that are returned
            begin with the first record that matches the query parameters.
          format: int32
          in: query
          name: offset
          required: false
          type: integer
          x-entity-path: dataArea/get/recordSetStartNumber
        - description: The maximum number of records to return.
          format: int32
          in: query
          name: limit
          required: false
          type: integer
          x-entity-path: dataArea/get/maxItems
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionCollection'
          x-entity-path: dataArea/promotion
      summary: Get all the promotions in a store.
      x-expression-template: >-
        {_wcf.ap='{accessProfile}';_wcf.dataLanguageIds='{dataLanguageIds}'}/Promotion
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
    post:
      consumes:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/promotion[1]/promotionIdentifier/externalIdentifier/storeIdentifier/uniqueID
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/Promotion'
          x-entity-path: 'dataArea/promotion[1]'
      responses:
        '201':
          description: The operation is successful.
          headers:
            Location:
              description: The URI of the promotion.
              type: string
          x-entity-path: 'dataArea/promotion[1]/promotionIdentifier/uniqueID'
      summary: Create a promotion.
      x-action-code: Add
      x-expression-template: '/Promotion[1]'
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: processPromotion
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.ProcessPromotionType
  /promotions/by-coupon-and-name:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: true
          type: string
        - description: >-
            A boolean indicator as to whether or not the promotions are coupon
            based.
          in: query
          name: couponRequired
          required: true
          type: boolean
        - description: The administrative name pattern to search for.
          in: query
          name: searchText
          required: true
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionCollection'
          x-entity-path: dataArea/promotion
      summary: >-
        Find promotions by whether or not a coupon is required and its
        administrative name.
      x-expression-builder-class: >-
        com.ibm.commerce.foundation.internal.client.taglib.util.SearchExpressionBuilder
      x-expression-builder-method: formatExpression
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
        template: >-
          /Promotion[CouponRequired='$couponRequired$' and
          search(AdministrativeName='$searchText$')]
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
  /promotions/by-coupon-required:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: true
          type: string
        - description: >-
            A boolean indicator as to whether or not the promotions are coupon
            based.
          in: query
          name: couponRequired
          required: true
          type: boolean
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionCollection'
          x-entity-path: dataArea/promotion
      summary: Find promotions by whether or not a coupon is required.
      x-expression-template: >-
        {_wcf.ap={accessProfile};_wcf.dataLanguageIds='{dataLanguageIds}'}/Promotion[CouponRequired='{couponRequired}']
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
  /promotions/by-excluded-catalog-entry-id:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: true
          type: string
        - description: >-
            The unique ID for identifying the excluded catalog entry to be
            searched.
          in: query
          name: catalogEntryId
          required: true
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionCollection'
          x-entity-path: dataArea/promotion
      summary: Find promotions by excluded catalog entry.
      x-expression-template: >-
        {_wcf.ap={accessProfile};_wcf.dataLanguageIds='{dataLanguageIds}'}/Promotion[Element[(ElementType='ExcludeCatalogEntryIdentifier')
        and ElementVariable[(Value='{catalogEntryId}')]]]
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
  /promotions/by-excluded-category-id:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: true
          type: string
        - description: The unique ID for identifying the excluded category to be searched.
          in: query
          name: categoryId
          required: true
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionCollection'
          x-entity-path: dataArea/promotion
      summary: Find promotions by excluded category.
      x-expression-template: >-
        {_wcf.ap={accessProfile};_wcf.dataLanguageIds='{dataLanguageIds}'}/Promotion[Element[(ElementType='ExcludeCategoryIdentifier')
        and ElementVariable[(Value='{categoryId}')]]]
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
  /promotions/by-gift-catalog-entry-id:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: true
          type: string
        - description: The unique ID for identifying the gift catalog entry to be searched.
          in: query
          name: catalogEntryId
          required: true
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionCollection'
          x-entity-path: dataArea/promotion
      summary: Find promotions by gift catalog entry.
      x-expression-template: >-
        {_wcf.ap={accessProfile};_wcf.dataLanguageIds='{dataLanguageIds}'}/Promotion[Element[(ElementType='GiftCatalogEntryIdentifier')
        and ElementVariable[(Value='{catalogEntryId}')]]]
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
  /promotions/by-ids:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: query
          name: id
          required: true
          type: integer
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: true
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionCollection'
          x-entity-path: dataArea/promotion
      summary: Get promotions by ids.
      x-expression-template: >-
        {_wcf.ap='{accessProfile}';_wcf.dataLanguageIds='{dataLanguageIds}'}/Promotion[PromotionIdentifier[(UniqueID='{id}')]]
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
  /promotions/by-included-catalog-entry-id:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: true
          type: string
        - description: The unique ID for identifying the catalog entry to be searched.
          in: query
          name: catalogEntryId
          required: true
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionCollection'
          x-entity-path: dataArea/promotion
      summary: Find promotions by included catalog entry.
      x-expression-template: >-
        {_wcf.ap={accessProfile};_wcf.dataLanguageIds='{dataLanguageIds}'}/Promotion[Element[(ElementType='IncludeCatalogEntryIdentifier')
        and ElementVariable[(Value='{catalogEntryId}')]]]
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
  /promotions/by-included-category-id:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: true
          type: string
        - description: The unique ID of the category to be searched.
          in: query
          name: categoryId
          required: true
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionCollection'
          x-entity-path: dataArea/promotion
      summary: Find promotions by included category.
      x-expression-template: >-
        {_wcf.ap={accessProfile};_wcf.dataLanguageIds='{dataLanguageIds}'}/Promotion[Element[(ElementType='IncludeCategoryIdentifier')
        and ElementVariable[(Value='{categoryId}')]]]
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
  /promotions/by-included-customer-segment-id:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: true
          type: string
        - description: The included customer segment to be searched.
          in: query
          name: segmentId
          required: true
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionCollection'
          x-entity-path: dataArea/promotion
      summary: Find promotions by included customer segment.
      x-expression-template: >-
        {_wcf.ap={accessProfile};_wcf.dataLanguageIds='{dataLanguageIds}'}/Promotion[Element[(ElementType='IncludeMemberGroupIdentifier')
        and ElementVariable[(Value='{segmentId}')]]]
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
  /promotions/by-name-or-code:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: false
          type: string
        - description: The search text.
          in: query
          name: searchText
          required: false
          type: string
        - description: >-
            The position within the resulting dataset where the query begins
            returning item records. If the offset is "5", the records that
            returned begin with the sixth record that matches the query
            parameters. If the offset is "0", the records that are returned
            begin with the first record that matches the query parameters.
          format: int32
          in: query
          name: offset
          required: false
          type: integer
          x-entity-path: dataArea/get/recordSetStartNumber
        - description: The maximum number of records to return.
          format: int32
          in: query
          name: limit
          required: false
          type: integer
          x-entity-path: dataArea/get/maxItems
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionCollection'
          x-entity-path: dataArea/promotion
      summary: Find promotions by name and code pattern.
      x-expression-builder-class: >-
        com.ibm.commerce.foundation.internal.client.taglib.util.SearchExpressionBuilder
      x-expression-builder-method: formatExpression
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
        template: >-
          /Promotion[search(AdministrativeName='$searchText$' or
          Code='$searchText$')]
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
  /promotions/displayable-by-ids:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: query
          name: id
          required: true
          type: integer
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: true
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionCollection'
          x-entity-path: dataArea/promotion
      summary: Get displayable promotions by IDs.
      x-expression-template: >-
        {_wcf.ap='{accessProfile}';_wcf.dataLanguageIds='{dataLanguageIds}'}/Promotion[(Status=0
        or Status=1 or Status=3 or Status=5) and
        PromotionIdentifier[(UniqueID='{id}')]]
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
  /promotions/search:
    get:
      produces:
        - application/json
      parameters:
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: true
          type: string
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: The promotion type.
          in: query
          name: type
          required: false
          type: string
        - description: >-
            The promotion start date that falls on or after this date
            (inclusive).
          format: date-time
          in: query
          name: startDateTimeStart
          required: false
          type: string
        - description: >-
            The promotion start date that falls on or before this date
            (inclusive).
          format: date-time
          in: query
          name: startDateTimeEnd
          required: false
          type: string
        - description: The promotion status.
          in: query
          name: status
          required: false
          type: string
        - description: The promotion redemption method.
          in: query
          name: redemptionMethod
          required: false
          type: string
        - description: The search text of either the administrative name or the code.
          in: query
          name: searchText
          required: false
          type: string
        - description: >-
            The position within the resulting dataset where the query begins
            returning item records. If the offset is "5", the records that
            returned begin with the sixth record that matches the query
            parameters. If the offset is "0", the records that are returned
            begin with the first record that matches the query parameters.
          format: int32
          in: query
          name: offset
          required: false
          type: integer
          x-entity-path: dataArea/get/recordSetStartNumber
        - description: The maximum number of records to return.
          format: int32
          in: query
          name: limit
          required: false
          type: integer
          x-entity-path: dataArea/get/maxItems
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionCollection'
          x-entity-path: dataArea/promotion
      summary: Advanced search for promotions.
      x-expression-builder-class: >-
        com.ibm.commerce.rest.admin.v2.promotion.PromotionSearchExpressionBuilder
      x-expression-builder-method: formatExpression
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
        template: >-
          {_wcf.ap='{accessProfile}';_pro.type='{type}';_pro.startDateTimeStart='{startDateTimeStart}';_pro.startDateTimeEnd='{startDateTimeEnd}';_pro.status='{status}';_pro.redemptionMethod='{redemptionMethod}'}/Promotion[search(AdministrativeName='{searchText}'
          or Code='{searchText}')]
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
  '/promotions/{id}':
    delete:
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/promotion[1]/promotionIdentifier/uniqueID'
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/promotion[1]/promotionIdentifier/externalIdentifier/storeIdentifier/uniqueID
      responses:
        '204':
          description: The operation is successful.
      summary: Delete a promotion.
      x-action-code: Delete
      x-expression-template: '/Promotion[1]'
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: processPromotion
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.ProcessPromotionType
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: path
          name: id
          required: true
          type: integer
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: false
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/Promotion'
          x-entity-path: 'dataArea/promotion[1]'
      summary: Get a promotion.
      x-expression-template: >-
        {_wcf.ap='{accessProfile}';_wcf.dataLanguageIds='{dataLanguageIds}'}/Promotion[PromotionIdentifier[(UniqueID='{id}')]]
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
    patch:
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/promotion[1]/promotionIdentifier/uniqueID'
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/promotion[1]/promotionIdentifier/externalIdentifier/storeIdentifier/uniqueID
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/Promotion'
          x-entity-path: 'dataArea/promotion[1]'
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/Promotion'
          x-entity-path: 'dataArea/promotion[1]'
      summary: Update a promotion.
      x-action-code: Change
      x-expression-template: '/Promotion[1]'
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: changePromotion
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.ChangePromotionType
  '/promotions/{id}/activate':
    post:
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/promotion[1]/promotionIdentifier/uniqueID'
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/promotion[1]/promotionIdentifier/externalIdentifier/storeIdentifier/uniqueID
      responses:
        '200':
          description: The operation is successful.
      summary: Activate a promotion.
      x-action-code: Activate
      x-expression-template: '/Promotion[1]'
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: processPromotion
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.ProcessPromotionType
  '/promotions/{id}/archive':
    post:
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/promotion[1]/promotionIdentifier/uniqueID'
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/promotion[1]/promotionIdentifier/externalIdentifier/storeIdentifier/uniqueID
      responses:
        '200':
          description: The operation is successful.
      summary: Archive a promotion.
      x-action-code: Archive
      x-expression-template: '/Promotion[1]'
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: processPromotion
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.ProcessPromotionType
  '/promotions/{id}/deactivate':
    post:
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/promotion[1]/promotionIdentifier/uniqueID'
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/promotion[1]/promotionIdentifier/externalIdentifier/storeIdentifier/uniqueID
      responses:
        '200':
          description: The operation is successful.
      summary: Deactivate a promotion.
      x-action-code: Deactivate
      x-expression-template: '/Promotion[1]'
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: processPromotion
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.ProcessPromotionType
  '/promotions/{id}/descriptions':
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: path
          name: id
          required: true
          type: integer
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the promotion
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: false
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionDescriptionCollection'
          x-entity-path: 'dataArea/promotion[1]/description'
      summary: Get a description of a promotion.
      x-expression-template: >-
        {_wcf.ap='{accessProfile}';_wcf.dataLanguageIds='{dataLanguageIds}'}/Promotion[PromotionIdentifier[(UniqueID='{id}')]]
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_Details
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
    post:
      consumes:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/promotion[1]/promotionIdentifier/uniqueID'
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/promotion[1]/promotionIdentifier/externalIdentifier/storeIdentifier/uniqueID
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PromotionDescription'
          x-entity-path: 'dataArea/promotion[1]/description[1]'
      responses:
        '201':
          description: The operation is successful.
          headers:
            Location:
              description: The URI of the promotion description.
              type: string
          x-entity-path: 'dataArea/promotion[1]/description[1]/language'
      summary: Create a description of a promotion.
      x-action-code: Add
      x-expression-template: '/Promotion[1]/Description[1]'
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: changePromotion
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.ChangePromotionType
      x-request-verb: change
  '/promotions/{id}/descriptions/{languageId}':
    patch:
      consumes:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/promotion[1]/promotionIdentifier/uniqueID'
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/promotion[1]/promotionIdentifier/externalIdentifier/storeIdentifier/uniqueID
        - description: >-
            The integer for identifying the language of the promotion
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center.
          format: int32
          in: path
          name: languageId
          required: true
          type: integer
          x-entity-path: 'dataArea/promotion[1]/description[1]/language'
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PromotionDescription'
          x-entity-path: 'dataArea/promotion[1]/description[1]'
      responses:
        '200':
          description: The operation is successful.
      summary: Update a description of a promotion.
      x-action-code: Change
      x-expression-template: '/Promotion[1]/Description[1]'
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: changePromotion
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.ChangePromotionType
      x-request-verb: change
  '/promotions/{id}/elements':
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: path
          name: id
          required: true
          type: integer
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: >-
            The integer(s) for identifying the language of the member group
            description. For a list of the integers that map to the supported
            default languages, refer to the Knowledge Center. Multiple
            identifiers should be specified as a comma-separated list.
          in: query
          name: dataLanguageIds
          required: true
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/PromotionElementCollection'
          x-entity-path: 'dataArea/promotion[1]/element'
      summary: Get a collection of promotion elements by promotion ID.
      x-expression-template: >-
        {_wcf.ap={accessProfile};_wcf.dataLanguageIds='{dataLanguageIds}'}/Promotion[PromotionIdentifier[(UniqueID='{id}')]]
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: getPromotion
      x-parameters:
        accessProfile: IBM_Admin_PromotionElements
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.GetPromotionType
    post:
      consumes:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/promotion[1]/promotionIdentifier/uniqueID'
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/promotion[1]/promotionIdentifier/externalIdentifier/storeIdentifier/uniqueID
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PromotionElement'
          x-entity-path: 'dataArea/promotion[1]/element[1]'
      responses:
        '201':
          description: The operation is successful.
          headers:
            Location:
              description: The URI of the promotion element.
              type: string
          x-entity-path: 'dataArea/promotion[1]/element[1]/elementName'
      summary: Create a promotion element.
      x-action-code: Add
      x-expression-template: '/Promotion[1]/Element[1]'
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: changePromotion
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.ChangePromotionType
      x-request-verb: change
  '/promotions/{id}/elements/{name}':
    delete:
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/promotion[1]/promotionIdentifier/uniqueID'
        - description: The name of the element to be deleted.
          in: path
          name: name
          required: true
          type: string
          x-entity-path: 'dataArea/promotion[1]/element[1]/elementName'
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/promotion[1]/promotionIdentifier/externalIdentifier/storeIdentifier/uniqueID
      responses:
        '204':
          description: The operation is successful.
      summary: Delete a promotion element based on its name.
      x-action-code: Delete
      x-expression-template: '/Promotion[1]/Element[1]'
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: changePromotion
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.ChangePromotionType
      x-request-verb: change
    patch:
      consumes:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the promotion.
          format: int32
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/promotion[1]/promotionIdentifier/uniqueID'
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
          x-entity-path: >-
            dataArea/promotion[1]/promotionIdentifier/externalIdentifier/storeIdentifier/uniqueID
        - description: The name of the element to be updated.
          in: path
          name: name
          required: true
          type: string
          x-entity-path: 'dataArea/promotion[1]/element[1]/elementName'
        - description: The request body.
          in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/PromotionElement'
          x-entity-path: 'dataArea/promotion[1]/element[1]'
      responses:
        '200':
          description: The operation is successful.
      summary: Update a promotion element based on its name.
      x-action-code: Change
      x-expression-template: '/Promotion[1]/Element[1]'
      x-facade-client-class: com.ibm.commerce.promotion.facade.client.PromotionFacadeClient
      x-facade-client-method: changePromotion
      x-request-bod-class: com.ibm.commerce.promotion.facade.datatypes.ChangePromotionType
      x-request-verb: change
definitions:
  Promotion:
    description: A promotion.
    properties:
      comment:
        description: The promotion administrative description.
        type: string
        x-entity-path: comments
      couponRequired:
        description: >-
          Flag to indicate whether or not a coupon is required to redeem the
          promotion.
        type: boolean
      dailyEndTime:
        description: The promotion daily end time.
        format: time
        type: string
        x-entity-path: schedule/dailyEndTime
      dailyStartTime:
        description: The promotion daily start time.
        format: time
        type: string
        x-entity-path: schedule/dailyStartTime
      daysOfWeek:
        description: The promotion schedule in days of the week.
        items:
          type: string
          x-entity-class: com.ibm.commerce.promotion.facade.datatypes.DayOfWeekEnumerationType
        type: array
        x-entity-path: schedule/weekDays
      descriptions:
        description: The promotion description.
        items:
          $ref: '#/definitions/PromotionDescription'
        type: array
        x-entity-path: description
      endDateTime:
        description: The promotion end date.
        format: date-time
        type: string
        x-entity-path: schedule/endDate
      exclusiveType:
        description: The promotion exclusive type.
        type: string
      id:
        description: The unique numeric ID for identifying the promotion.
        format: int32
        type: integer
        x-entity-path: promotionIdentifier/uniqueID
      name:
        description: The promotion administrative name.
        type: string
        x-entity-path: administrativeName
      perOrderLimit:
        description: The per-order promotion redemption limit.
        format: int32
        type: integer
        x-entity-path: redemptionLimit/perOrderLimit
      perShopperLimit:
        description: The per-shopper promotion redemption limit.
        format: int32
        type: integer
        x-entity-path: redemptionLimit/perShopperLimit
      priority:
        description: The promotion priority.
        format: int32
        type: integer
      promotionCodeRequired:
        description: >-
          Flag to indicate whether or not a code is required to redeem the
          promotion.
        type: boolean
      startDateTime:
        description: The promotion start date.
        format: date-time
        type: string
        x-entity-path: schedule/startDate
      status:
        description: The promotion status.
        type: string
      storeId:
        description: The unique numeric ID for identifying the store.
        format: int32
        type: integer
        x-entity-path: promotionIdentifier/externalIdentifier/storeIdentifier/uniqueID
      targetSales:
        description: A numerical dollar value representing sales target for the promotion.
        type: number
        x-entity-path: targetSales/value
      totalLimit:
        description: The total promotion redemption limit.
        format: int32
        type: integer
        x-entity-path: redemptionLimit/totalLimit
      type:
        description: The promotion type.
        type: string
        x-entity-path: promotionType
    type: object
    x-entity-class: com.ibm.commerce.promotion.facade.datatypes.PromotionType
  PromotionCollection:
    description: A collection of promotions.
    properties:
      count:
        format: int64
        type: integer
      items:
        items:
          $ref: '#/definitions/Promotion'
        type: array
    type: object
  PromotionDescription:
    description: A promotion description.
    properties:
      languageId:
        description: The unique numeric ID for identifying the language.
        format: int32
        type: integer
        x-entity-path: language
      longDescription:
        description: The promotion long description.
        type: string
      promotionId:
        description: The unique numeric ID for identifying the promotion.
        format: int32
        type: integer
        x-entity-path: container/promotionIdentifier/uniqueID
      shortDescription:
        description: The promotion short description.
        type: string
      userData:
        additionalProperties:
          type: string
        description: Additional user data associated with the description.
        type: object
        x-entity-path: userData/userDataField
    type: object
    x-entity-class: com.ibm.commerce.promotion.facade.datatypes.DescriptionType
  PromotionDescriptionCollection:
    description: A collection of promotion descriptions.
    properties:
      count:
        format: int64
        type: integer
      items:
        items:
          $ref: '#/definitions/PromotionDescription'
        type: array
    type: object
  PromotionElement:
    description: A promotion element.
    properties:
      name:
        description: The element name.
        type: string
        x-entity-path: elementName
      parentName:
        description: The parent element name.
        type: string
        x-entity-path: parentElementName
      sequence:
        description: The sequence number of this element under the same parent element.
        format: double
        type: number
        x-entity-path: elementSequence
      setSequence:
        description: Indicate if the element sequence is set or not.
        type: boolean
        x-entity-path: setElementSequence
      subType:
        description: The element sub-type.
        type: string
        x-entity-path: elementSubType
      type:
        description: The element type.
        type: string
        x-entity-path: elementType
      userData:
        additionalProperties:
          type: string
        description: Additional user data associated with the element.
        type: object
        x-entity-path: userData/userDataField
      variables:
        description: >-
          A list of promotion element variables that are associated with the
          element.
        items:
          $ref: '#/definitions/PromotionElementVariable'
        type: array
        x-entity-path: elementVariable
    type: object
    x-entity-class: com.ibm.commerce.promotion.facade.datatypes.PromotionElementType
  PromotionElementCollection:
    description: A collection of promotion elements.
    properties:
      count:
        format: int64
        type: integer
      items:
        items:
          $ref: '#/definitions/PromotionElement'
        type: array
    type: object
  PromotionElementVariable:
    description: A promotion element variable.
    properties:
      name:
        description: The element name.
        type: string
      value:
        description: The element value.
        type: string
    type: object
    x-entity-class: com.ibm.commerce.promotion.facade.datatypes.PromotionElementVariableType
x-components: {}

