assigned_coupon

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

Handler Class:

com.ibm.commerce.rest.order.handler.AssignedCouponHandler

Method Summary

HTTP MethodPathDescription
GET/store/{storeId}/cart/@self/assigned_couponGets assigned coupons for the shopping cart.
POST/store/{storeId}/cart/@self/assigned_couponApplies coupons to the shopping cart.
DELETE/store/{storeId}/cart/@self/assigned_coupon/{couponId}Removes coupons from the shopping cart.

Method Details

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

Gets assigned coupons for the shopping cart.

Handler Method:

getAssignedCouponInfo

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_coupon


Example

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

200

Response:
{
	"couponCode": [
		{
			"couponId": "100000000001",
			"description": [
				{
					"language": "-1",
					"longDescription": "15% off your order",
					"shortDescription": "15% off your order",
					"userData": null
				}
			],
			"effectiveDateTime": "2014-11-24T20:22:36.124Z",
			"expirationDateTime": "2014-12-01T20:22:36.124Z",
			"promotion": {
				"calculationCodeIdentifier": null,
				"externalIdentifier": {
					"name": "15% off order-10000203",
					"revision": "0",
					"storeIdentifier": null,
					"version": "1"
				},
				"uniqueID": "10000203"
			},
			"status": "2",
			"xcpcd_promotionAdministrativeDescription": "15% off order",
			"xcpcd_promotionStatus": "1"
		}
	],
	"orderId": "25207",
	"resourceId": "https:\/\/localhost:443\/wcs\/resources\/store\/10001\/cart\/@self\/assigned_coupon",
	"resourceName": "cart"
}

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

Applies coupons to the shopping cart.

Handler Method:

applyCoupon

Secure Call Mandatory:

false

Partial Authentication Allowed:

true

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
bodyThe request body for applying a coupon to the shopping cart.bodycom.ibm.commerce.rest.order.handler.AssignedCouponHandler$ApplyCouponBodytrueN/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.AssignedCouponHandler$ApplyCouponResponse


Example

Request:
POST /wcs/resources/store/10001/cart/@self/assigned_coupon?responseFormat=json
Body:
{
	"URL": "",
	"catalogId": "10052",
	"couponId": "100000000001",
	"finalView": "AjaxOrderItemDisplayView",
	"langId": "-1",
	"orderId": "25207",
	"storeId": "10001",
	"taskType": "A",
	"walletItemId": ""
}
HTTP Status Code:

201

Response:
{
	"couponId": "100000000001",
	"orderId": "25207"
}

DELETE /store/{storeId}/cart/@self/assigned_coupon/{couponId}

Removes coupons from the shopping cart.

Handler Method:

removeCoupon

Secure Call Mandatory:

false

Partial Authentication Allowed:

true

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
couponIdCoupon 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.
500Internal server error. Additional details will be contained on the server logs.
Response Data Type:

com.ibm.commerce.rest.order.handler.AssignedCouponHandler$RemoveCouponResponse


Example

Request:
DELETE /wcs/resources/store/10001/cart/@self/assigned_coupon//100000000001?responseFormat=json
HTTP Status Code:

200

Response:
{
	"orderId": "25207"
}

Data Type Details

cart-assigned_coupon

Properties:
NameData TypeRequired
couponCodecart-assigned_coupon.couponCode arrayfalse
channelcom.ibm.commerce.order.facade.datatypes.ChannelTypefalse
quoteIdentifiercom.ibm.commerce.foundation.common.datatypes.QuoteIdentifierTypefalse
quoteIDstringfalse
orderIdstringfalse
customerOrderNumberstringfalse
buyerPONumberstringfalse
externalOrderIDstringfalse

cart-assigned_coupon.couponCode

Properties:
NameData TypeRequired
couponIdstringfalse
effectiveDateTimestringfalse
statusstringfalse
promotioncom.ibm.commerce.foundation.common.datatypes.PromotionIdentifierTypefalse
userDataFieldcart-assigned_coupon.couponCode.userDataField arrayfalse
expirationDateTimestringfalse
descriptioncom.ibm.commerce.order.facade.datatypes.CouponDescriptionType arrayfalse
codestringfalse

cart-assigned_coupon.couponCode.userDataField

Properties:
NameData TypeRequired
valuestringfalse
keystringtrue

com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType

com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.calculationCodeIdentifier

Properties:
NameData TypeRequired
calculationCodeExternalIdentifiercom.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.calculationCodeIdentifier.calculationCodeExternalIdentifierfalse
uniqueIDstringfalse

com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.calculationCodeIdentifier.calculationCodeExternalIdentifier

Properties:
NameData TypeRequired
calculationUsageIDstringfalse
storeIdentifiercom.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.calculationCodeIdentifier.calculationCodeExternalIdentifier.storeIdentifierfalse
codestringfalse

com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.calculationCodeIdentifier.calculationCodeExternalIdentifier.storeIdentifier

com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.calculationCodeIdentifier.calculationCodeExternalIdentifier.storeIdentifier.externalIdentifier

Properties:
NameData TypeRequired
nameIdentifierstringfalse
ownerIDstringfalse

com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.externalIdentifier

Properties:
NameData TypeRequired
versionstringfalse
storeIdentifiercom.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.externalIdentifier.storeIdentifierfalse
namestringtrue
revisionstringfalse

com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.externalIdentifier.storeIdentifier

com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.externalIdentifier.storeIdentifier.externalIdentifier

Properties:
NameData TypeRequired
nameIdentifierstringfalse
ownerIDstringfalse

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.order.facade.datatypes.CouponDescriptionType

Properties:
NameData TypeRequired
shortDescriptionstringfalse
longDescriptionstringfalse
userDatacom.ibm.commerce.order.facade.datatypes.CouponDescriptionType.userDatafalse
languagestringfalse

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

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

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

Properties:
NameData TypeRequired
valuestringfalse
keystringtrue

com.ibm.commerce.rest.order.handler.AssignedCouponHandler$ApplyCouponBody

Body of a request to apply a coupon to a shopping cart.

Properties:
NameData TypeRequired
couponIdstringtrue

com.ibm.commerce.rest.order.handler.AssignedCouponHandler$ApplyCouponResponse

Body of a response to apply a coupon to a shopping cart.

Properties:
NameData TypeRequired
couponIdstringtrue
orderIdstringtrue

com.ibm.commerce.rest.order.handler.AssignedCouponHandler$RemoveCouponResponse

Body of a response to remove a coupon from a shopping cart.

Properties:
NameData TypeRequired
orderIdstringtrue