This class provides RESTful services to add, get, update, and delete assigned coupons for the current shopping cart.
com.ibm.commerce.rest.order.handler.AssignedCouponHandler
HTTP Method | Path | Description |
---|---|---|
GET | /store/{storeId}/cart/@self/assigned_coupon | Gets assigned coupons for the shopping cart. |
POST | /store/{storeId}/cart/@self/assigned_coupon | Applies coupons to the shopping cart. |
DELETE | /store/{storeId}/cart/@self/assigned_coupon/{couponId} | Removes coupons from the shopping cart. |
Gets assigned coupons for the shopping cart.
getAssignedCouponInfo
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_coupon
200
{ "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" }
Applies coupons to the shopping cart.
applyCoupon
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 a coupon to the shopping cart. | body | com.ibm.commerce.rest.order.handler.AssignedCouponHandler$ApplyCouponBody | 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.AssignedCouponHandler$ApplyCouponResponse
POST /wcs/resources/store/10001/cart/@self/assigned_coupon?responseFormat=json
{ "URL": "", "catalogId": "10052", "couponId": "100000000001", "finalView": "AjaxOrderItemDisplayView", "langId": "-1", "orderId": "25207", "storeId": "10001", "taskType": "A", "walletItemId": "" }
201
{ "couponId": "100000000001", "orderId": "25207" }
Removes coupons from the shopping cart.
removeCoupon
false
true
Name | Description | Parameter Type | Data Type | Required | Allow Multiple |
---|---|---|---|---|---|
storeId | The store identifier. | path | string | true | N/A |
couponId | Coupon 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. |
500 | Internal server error. Additional details will be contained on the server logs. |
com.ibm.commerce.rest.order.handler.AssignedCouponHandler$RemoveCouponResponse
DELETE /wcs/resources/store/10001/cart/@self/assigned_coupon//100000000001?responseFormat=json
200
{ "orderId": "25207" }
Name | Data Type | Required |
---|---|---|
couponCode | cart-assigned_coupon.couponCode array | false |
channel | com.ibm.commerce.order.facade.datatypes.ChannelType | false |
quoteIdentifier | com.ibm.commerce.foundation.common.datatypes.QuoteIdentifierType | false |
quoteID | string | false |
orderId | string | false |
customerOrderNumber | string | false |
buyerPONumber | string | false |
externalOrderID | string | false |
Name | Data Type | Required |
---|---|---|
couponId | string | false |
effectiveDateTime | string | false |
status | string | false |
promotion | com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType | false |
userDataField | cart-assigned_coupon.couponCode.userDataField array | false |
expirationDateTime | string | false |
description | com.ibm.commerce.order.facade.datatypes.CouponDescriptionType array | false |
code | string | false |
Name | Data Type | Required |
---|---|---|
value | string | false |
key | string | true |
Name | Data Type | Required |
---|---|---|
externalIdentifier | com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.externalIdentifier | false |
uniqueID | string | false |
calculationCodeIdentifier | com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.calculationCodeIdentifier | false |
Name | Data Type | Required |
---|---|---|
calculationCodeExternalIdentifier | com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.calculationCodeIdentifier.calculationCodeExternalIdentifier | false |
uniqueID | string | false |
Name | Data Type | Required |
---|---|---|
calculationUsageID | string | false |
storeIdentifier | com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.calculationCodeIdentifier.calculationCodeExternalIdentifier.storeIdentifier | false |
code | string | false |
Name | Data Type | Required |
---|---|---|
externalIdentifier | com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.calculationCodeIdentifier.calculationCodeExternalIdentifier.storeIdentifier.externalIdentifier | false |
uniqueID | string | false |
Name | Data Type | Required |
---|---|---|
nameIdentifier | string | false |
ownerID | string | false |
Name | Data Type | Required |
---|---|---|
version | string | false |
storeIdentifier | com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.externalIdentifier.storeIdentifier | false |
name | string | true |
revision | string | false |
Name | Data Type | Required |
---|---|---|
externalIdentifier | com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType.externalIdentifier.storeIdentifier.externalIdentifier | false |
uniqueID | string | false |
Name | Data Type | Required |
---|---|---|
nameIdentifier | string | false |
ownerID | 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 |
Name | Data Type | Required |
---|---|---|
shortDescription | string | false |
longDescription | string | false |
userData | com.ibm.commerce.order.facade.datatypes.CouponDescriptionType.userData | false |
language | string | false |
Name | Data Type | Required |
---|---|---|
userDataField | com.ibm.commerce.order.facade.datatypes.CouponDescriptionType.userData.userDataField array | false |
Name | Data Type | Required |
---|---|---|
value | string | false |
key | string | true |
Body of a request to apply a coupon to a shopping cart.
Name | Data Type | Required |
---|---|---|
couponId | string | true |
Body of a response to apply a coupon to a shopping cart.
Name | Data Type | Required |
---|---|---|
couponId | string | true |
orderId | string | true |
Body of a response to remove a coupon from a shopping cart.
Name | Data Type | Required |
---|---|---|
orderId | string | true |