This class provides RESTful services to add, get, update, and delete assigned promotion codes for the current shopping cart.
com.ibm.commerce.rest.order.handler.AssignedPromotionCodeHandler
HTTP Method | Path | Description |
---|---|---|
GET | /store/{storeId}/cart/@self/assigned_promotion_code | Gets assigned promotion codes for the shopping cart. |
POST | /store/{storeId}/cart/@self/assigned_promotion_code | Applies promotion codes to the shopping cart. |
DELETE | /store/{storeId}/cart/@self/assigned_promotion_code/{promoCode} | Removes promotion codes from the shopping cart. |
Gets assigned promotion codes for the shopping cart.
getAssignedPromotioncodeInfo
false
true
Name | Description | Parameter Type | Data Type | Required | Allow Multiple |
---|---|---|---|---|---|
storeId | The store identifier. | path | string | true | N/A |
HTTP Status Code | Description |
---|---|
200 | The requested completed successfully. |
400 | Bad request. Some of the inputs provided to the request aren't valid. |
401 | Not authenticated. The user session isn't valid. |
403 | The user isn't authorized to perform the specified request. |
404 | The specified resource couldn't be found. |
500 | Internal server error. Additional details will be contained on the server logs. |
GET /wcs/resources/store/10001/cart/@self/assigned_promotion_code
200
{ "orderId": "25207", "promotionCode": [ { "associatedPromotion": [ { "description": "", "promotionId": "10000202" } ], "code": "10%OFF" } ], "resourceId": "https:\/\/localhost:443\/wcs\/resources\/store\/10001\/cart\/@self\/assigned_promotion_code", "resourceName": "cart" }
Applies promotion codes to the shopping cart.
applyPromotioncode
false
true
Name | Description | Parameter Type | Data Type | Required | Allow Multiple |
---|---|---|---|---|---|
storeId | The store identifier. | path | string | true | N/A |
body | The request body for applying promotion codes to the shopping cart. | body | com.ibm.commerce.rest.order.handler.AssignedPromotionCodeHandler$ApplyPromotionCodeBody | true | N/A |
HTTP Status Code | Description |
---|---|
201 | The requested resource has been created. |
400 | Bad request. Some of the inputs provided to the request aren't valid. |
401 | Not authenticated. The user session isn't valid. |
403 | The user isn't authorized to perform the specified request. |
500 | Internal server error. Additional details will be contained on the server logs. |
com.ibm.commerce.rest.order.handler.AssignedPromotionCodeHandler$ApplyPromotionCodeResponse
POST /wcs/resources/store/10001/cart/@self/assigned_promotion_code?responseFormat=json
{ "URL": "", "catalogId": "10052", "langId": "-1", "promoCode": "10%OFF", "requesttype": "ajax", "storeId": "10001", "taskType": "A" }
201
{ "orderId": "25207", "promoCode": "10%OFF" }
Removes promotion codes from the shopping cart.
removePromotionCode
false
true
Name | Description | Parameter Type | Data Type | Required | Allow Multiple |
---|---|---|---|---|---|
storeId | The store identifier. | path | string | true | N/A |
promoCode | The promotion code. | path | string | true | N/A |
HTTP Status Code | Description |
---|---|
200 | The requested completed successfully. |
400 | Bad request. Some of the inputs provided to the request aren't valid. |
401 | Not authenticated. The user session isn't valid. |
403 | The user isn't authorized to perform the specified request. |
500 | Internal server error. Additional details will be contained on the server logs. |
com.ibm.commerce.rest.order.handler.AssignedPromotionCodeHandler$RemovePromotionCodeResponse
DELETE /wcs/resources/store/10001/cart/@self/assigned_promotion_code//10%25OFF?responseFormat=json
200
{ "orderId": "24208" }
Name | Data Type | Required |
---|---|---|
promotionCode | cart-assigned_promotion_code.promotionCode array | false |
channel | com.ibm.commerce.order.facade.datatypes.ChannelType | false |
quoteIdentifier | com.ibm.commerce.foundation.common.datatypes.QuoteIdentifierType | false |
quoteID | string | false |
customerOrderNumber | string | false |
orderId | string | false |
buyerPONumber | string | false |
externalOrderID | string | false |
Name | Data Type | Required |
---|---|---|
code | string | false |
associatedPromotion | cart-assigned_promotion_code.promotionCode.associatedPromotion array | false |
Name | Data Type | Required |
---|---|---|
description | string | false |
promotionId | string | false |
Name | Data Type | Required |
---|---|---|
uniqueID | string | false |
externalQuoteID | string | false |
Name | Data Type | Required |
---|---|---|
userData | com.ibm.commerce.order.facade.datatypes.ChannelType.userData | false |
channelIdentifer | com.ibm.commerce.order.facade.datatypes.ChannelType.channelIdentifer | false |
description | com.ibm.commerce.order.facade.datatypes.ChannelType.description | false |
Name | Data Type | Required |
---|---|---|
uniqueID | string | false |
channelName | string | false |
Name | Data Type | Required |
---|---|---|
value | string | false |
language | string | false |
Name | Data Type | Required |
---|---|---|
userDataField | com.ibm.commerce.order.facade.datatypes.ChannelType.userData.userDataField array | false |
Name | Data Type | Required |
---|---|---|
value | string | false |
key | string | true |
Body of a request to apply a promotion code to a shopping cart.
Name | Data Type | Required |
---|---|---|
promoCode | string | true |
Body of a response to apply a promotion code to a shopping cart.
Name | Data Type | Required |
---|---|---|
orderId | string | true |
promoCode | string | true |
Body of a response to remove a promotion code from a shopping cart.
Name | Data Type | Required |
---|---|---|
orderId | string | true |