This class provides RESTful services to get and process coupon information. For example, deleting a coupon from the list.
com.ibm.commerce.rest.coupon.handler.CouponHandler
HTTP Method | Path | Description |
---|---|---|
GET | /store/{storeId}/coupon/@self | Get available coupons for the current shopper. |
DELETE | /store/{storeId}/coupon/{couponId} | Delete the coupon from coupon wallet by coupon id. |
Get available coupons for the current shopper.
getCoupon
true
false
Name | Description | Parameter Type | Data Type | Required | Allow Multiple |
---|---|---|---|---|---|
storeId | The store identifier. | path | string | true | N/A |
pageNumber | Page number, starting at 1. Valid values include positive integers of 1 and above. The "pageSize" must be specified for paging to work. | query | integer | false | false |
pageSize | Page size. Used to limit the amount of data returned by a query. Valid values include positive integers of 1 and above. The "pageNumber" must be specified for paging to work. | query | integer | false | false |
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/coupon/@self/?responseFormat=json
200
{ "Coupon": [ { "couponDescription": [ { "language": "-1", "longDescription": "15% off your order", "shortDescription": "15% off your order", "userData": null } ], "couponId": "100000000001", "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" }, "resourceId": "https:\/\/localhost:443\/wcs\/resources\/store\/10001\/coupon\/100000000001", "status": "0", "userData": { "userDataField": [ { "key": "promotionAdministrativeDescription", "value": "15% off order" }, { "key": "promotionStatus", "value": "1" } ] } } ], "recordSetComplete": true, "recordSetCount": 1, "recordSetStartNumber": 0, "recordSetTotal": 1, "resourceId": "https:\/\/localhost:443\/wcs\/resources\/store\/10001\/coupon\/@self\/?responseFormat=json", "resourceName": "coupon" }
Delete the coupon from coupon wallet by coupon id.
deleteCouponById
true
false
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. |
404 | The specified resource couldn't be found. |
500 | Internal server error. Additional details will be contained on the server logs. |
Name | Data Type | Required |
---|---|---|
customerOrderNumber | string | false |
uniqueID | string | false |
externalOrderID | string | false |
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 |
---|---|---|
userDataField | com.ibm.commerce.foundation.common.datatypes.UserDataType.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.wallet.facade.datatypes.CouponDescriptionType.userData | false |
language | string | false |
Name | Data Type | Required |
---|---|---|
userDataField | com.ibm.commerce.wallet.facade.datatypes.CouponDescriptionType.userData.userDataField array | false |
Name | Data Type | Required |
---|---|---|
value | string | false |
key | string | true |
Name | Data Type | Required |
---|---|---|
recordSetTotal | string | false |
Coupon | coupon-coupon_item array | false |
recordSetComplete | string | false |
recordSetStartNumber | string | false |
recordSetCount | string | false |
Name | Data Type | Required |
---|---|---|
couponId | string | false |
effectiveDateTime | string | false |
status | string | false |
couponCode | string | false |
promotion | com.ibm.commerce.foundation.common.datatypes.PromotionIdentifierType | false |
userData | com.ibm.commerce.foundation.common.datatypes.UserDataType | false |
couponDescription | com.ibm.commerce.wallet.facade.datatypes.CouponDescriptionType array | false |
expirationDateTime | string | false |
order | com.ibm.commerce.foundation.common.datatypes.OrderIdentifierType | false |