POST API/Promotion/ApplySuggestedPromotion?onlineOrderId={onlineOrderId}&orderId={orderId}&promotionId={promotionId}&quantityEarned={quantityEarned}&calcTaxes={calcTaxes}

This API will provide the ability to apply any suggested promotions the user/order qualifies for. By passing in the suggested items, and the identifies for the order and promotion (as well as the quantity earned), the qualifying suggested promotions can be applied to the order.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
onlineOrderId

If this is for an onilne order, pass in the online order. You would never need both the online order and the order id.

integer

Default value is 0

orderId

If this is for a regular order, pass in the order id. You would never need both the online order and the order id.

integer

Default value is 0

promotionId

The promotion id for the suggested promotion.

integer

Default value is 0

quantityEarned

The quantity earned for the suggested promotion.

integer

Default value is 0

calcTaxes

boolean

Default value is True

Body Parameters

This is the list of products and quantities the user selected for the qualifying suggested promotions

Collection of SuggestedPromotionViewModel
NameDescriptionTypeAdditional information
ProductId

string

None.

Quantity

integer

None.

Request Formats

application/xml, text/xml

Sample:
<ListOfSuggestedPromotionViewModel>
  <SuggestedPromotionViewModel>
    <ProductId>sample string 1</ProductId>
    <Quantity>2</Quantity>
  </SuggestedPromotionViewModel>
  <SuggestedPromotionViewModel>
    <ProductId>sample string 1</ProductId>
    <Quantity>2</Quantity>
  </SuggestedPromotionViewModel>
</ListOfSuggestedPromotionViewModel>

application/json, text/json

Sample:
[
  {
    "ProductId": "sample string 1",
    "Quantity": 2
  },
  {
    "ProductId": "sample string 1",
    "Quantity": 2
  }
]

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'FormUrlEncodedFormatter' to write type 'List`1'.

Response Information

Resource Description

IHttpActionResult

None.

Response Formats

application/xml, text/xml, application/json, text/json

Sample:

Sample not available.