POST API/Promotion/PromoCode?onlineOrderId={onlineOrderId}&orderId={orderId}&evaluate={evaluate}

This API will provide the ability to apply a list of promotion codes. The API will replace (not append) the promotion codes applied to the order Note that means that an empty list will remove all promotion codes applied.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
onlineOrderId

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

integer

None.

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

None.

evaluate

Optional. Defaulted to false. If set to true, the API will validate the provided promo codes. Only qualified promotion codes will be applied to the online order or order.

boolean

Default value is False

Body Parameters

This is the list of promotion codes to apply to an order

Collection of string

Request Formats

application/xml, text/xml

Sample:
<ListOfString>
  <String>sample string 1</String>
  <String>sample string 2</String>
</ListOfString>

application/json, text/json

Sample:
[
  "sample string 1",
  "sample string 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

ApplyPromotionViewModel
NameDescriptionTypeAdditional information
IsSuccessful

boolean

None.

MessageTranslationKey

string

None.

Message

string

None.

Messages

Collection of ApiResultMessage

None.

Evaluations

Collection of IPromotionCodeEvaluationResult

None.

Response Formats

application/xml, text/xml

Sample:
<ApplyPromotionViewModel>
  <IsSuccessful>True</IsSuccessful>
  <MessageTranslationKey>sample string 2</MessageTranslationKey>
  <Message>sample string 3</Message>
  <Messages>
    <ApiResultMessage>
      <Key>sample string 1</Key>
      <Message>sample string 2</Message>
    </ApiResultMessage>
    <ApiResultMessage>
      <Key>sample string 1</Key>
      <Message>sample string 2</Message>
    </ApiResultMessage>
  </Messages>
  <Evaluations />
</ApplyPromotionViewModel>

application/json, text/json

Sample:
{
  "IsSuccessful": true,
  "MessageTranslationKey": "sample string 2",
  "Message": "sample string 3",
  "Messages": [
    {
      "Key": "sample string 1",
      "Message": "sample string 2"
    },
    {
      "Key": "sample string 1",
      "Message": "sample string 2"
    }
  ]
}