assigned_promotion_code

This class provides RESTful services to add, get, update, and delete assigned promotion codes for the current shopping cart.

Handler Class:

com.ibm.commerce.rest.order.handler.AssignedPromotionCodeHandler

Method Summary

HTTP MethodPathDescription
GET/store/{storeId}/cart/@self/assigned_promotion_codeGets assigned promotion codes for the shopping cart.
POST/store/{storeId}/cart/@self/assigned_promotion_codeApplies promotion codes to the shopping cart.
DELETE/store/{storeId}/cart/@self/assigned_promotion_code/{promoCode}Removes promotion codes from the shopping cart.

Method Details

GET /store/{storeId}/cart/@self/assigned_promotion_code

Gets assigned promotion codes for the shopping cart.

Handler Method:

getAssignedPromotioncodeInfo

Secure Call Mandatory:

false

Partial Authentication Allowed:

true

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
HTTP Status Codes:
HTTP Status CodeDescription
200The requested completed successfully.
400Bad request. Some of the inputs provided to the request aren't valid.
401Not authenticated. The user session isn't valid.
403The user isn't authorized to perform the specified request.
404The specified resource couldn't be found.
500Internal server error. Additional details will be contained on the server logs.
Response Data Type:

cart-assigned_promotion_code


Example

Request:
GET /wcs/resources/store/10001/cart/@self/assigned_promotion_code
HTTP Status Code:

200

Response:
{
	"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"
}

POST /store/{storeId}/cart/@self/assigned_promotion_code

Applies promotion codes to the shopping cart.

Handler Method:

applyPromotioncode

Secure Call Mandatory:

false

Partial Authentication Allowed:

true

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
bodyThe request body for applying promotion codes to the shopping cart.bodycom.ibm.commerce.rest.order.handler.AssignedPromotionCodeHandler$ApplyPromotionCodeBodytrueN/A
HTTP Status Codes:
HTTP Status CodeDescription
201The requested resource has been created.
400Bad request. Some of the inputs provided to the request aren't valid.
401Not authenticated. The user session isn't valid.
403The user isn't authorized to perform the specified request.
500Internal server error. Additional details will be contained on the server logs.
Response Data Type:

com.ibm.commerce.rest.order.handler.AssignedPromotionCodeHandler$ApplyPromotionCodeResponse


Example

Request:
POST /wcs/resources/store/10001/cart/@self/assigned_promotion_code?responseFormat=json
Body:
{
	"URL": "",
	"catalogId": "10052",
	"langId": "-1",
	"promoCode": "10%OFF",
	"requesttype": "ajax",
	"storeId": "10001",
	"taskType": "A"
}
HTTP Status Code:

201

Response:
{
	"orderId": "25207",
	"promoCode": "10%OFF"
}

DELETE /store/{storeId}/cart/@self/assigned_promotion_code/{promoCode}

Removes promotion codes from the shopping cart.

Handler Method:

removePromotionCode

Secure Call Mandatory:

false

Partial Authentication Allowed:

true

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
promoCodeThe promotion code.pathstringtrueN/A
HTTP Status Codes:
HTTP Status CodeDescription
200The requested completed successfully.
400Bad request. Some of the inputs provided to the request aren't valid.
401Not authenticated. The user session isn't valid.
403The user isn't authorized to perform the specified request.
500Internal server error. Additional details will be contained on the server logs.
Response Data Type:

com.ibm.commerce.rest.order.handler.AssignedPromotionCodeHandler$RemovePromotionCodeResponse


Example

Request:
DELETE /wcs/resources/store/10001/cart/@self/assigned_promotion_code//10%25OFF?responseFormat=json
HTTP Status Code:

200

Response:
{
	"orderId": "24208"
}

Data Type Details

cart-assigned_promotion_code

Properties:
NameData TypeRequired
promotionCodecart-assigned_promotion_code.promotionCode arrayfalse
channelcom.ibm.commerce.order.facade.datatypes.ChannelTypefalse
quoteIdentifiercom.ibm.commerce.foundation.common.datatypes.QuoteIdentifierTypefalse
quoteIDstringfalse
customerOrderNumberstringfalse
orderIdstringfalse
buyerPONumberstringfalse
externalOrderIDstringfalse

cart-assigned_promotion_code.promotionCode

Properties:
NameData TypeRequired
codestringfalse
associatedPromotioncart-assigned_promotion_code.promotionCode.associatedPromotion arrayfalse

cart-assigned_promotion_code.promotionCode.associatedPromotion

Properties:
NameData TypeRequired
descriptionstringfalse
promotionIdstringfalse

com.ibm.commerce.foundation.common.datatypes.QuoteIdentifierType

Properties:
NameData TypeRequired
uniqueIDstringfalse
externalQuoteIDstringfalse

com.ibm.commerce.order.facade.datatypes.ChannelType

com.ibm.commerce.order.facade.datatypes.ChannelType.channelIdentifer

Properties:
NameData TypeRequired
uniqueIDstringfalse
channelNamestringfalse

com.ibm.commerce.order.facade.datatypes.ChannelType.description

Properties:
NameData TypeRequired
valuestringfalse
languagestringfalse

com.ibm.commerce.order.facade.datatypes.ChannelType.userData

Properties:
NameData TypeRequired
userDataFieldcom.ibm.commerce.order.facade.datatypes.ChannelType.userData.userDataField arrayfalse

com.ibm.commerce.order.facade.datatypes.ChannelType.userData.userDataField

Properties:
NameData TypeRequired
valuestringfalse
keystringtrue

com.ibm.commerce.rest.order.handler.AssignedPromotionCodeHandler$ApplyPromotionCodeBody

Body of a request to apply a promotion code to a shopping cart.

Properties:
NameData TypeRequired
promoCodestringtrue

com.ibm.commerce.rest.order.handler.AssignedPromotionCodeHandler$ApplyPromotionCodeResponse

Body of a response to apply a promotion code to a shopping cart.

Properties:
NameData TypeRequired
orderIdstringtrue
promoCodestringtrue

com.ibm.commerce.rest.order.handler.AssignedPromotionCodeHandler$RemovePromotionCodeResponse

Body of a response to remove a promotion code from a shopping cart.

Properties:
NameData TypeRequired
orderIdstringtrue