coupon

This class provides RESTful services to get and process coupon information. For example, deleting a coupon from the list.

Handler Class:

com.ibm.commerce.rest.coupon.handler.CouponHandler

Method Summary

HTTP MethodPathDescription
GET/store/{storeId}/coupon/@selfGet available coupons for the current shopper.
DELETE/store/{storeId}/coupon/{couponId}Delete the coupon from coupon wallet by coupon id.

Method Details

GET /store/{storeId}/coupon/@self

Get available coupons for the current shopper.

Handler Method:

getCoupon

Secure Call Mandatory:

true

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
pageNumberPage number, starting at 1. Valid values include positive integers of 1 and above. The "pageSize" must be specified for paging to work.queryintegerfalsefalse
pageSizePage 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.queryintegerfalsefalse
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:

coupon-coupon


Example

Request:
GET /wcs/resources/store/10001/coupon/@self/?responseFormat=json
HTTP Status Code:

200

Response:
{
	"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 /store/{storeId}/coupon/{couponId}

Delete the coupon from coupon wallet by coupon id.

Handler Method:

deleteCouponById

Secure Call Mandatory:

true

Partial Authentication Allowed:

false

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.
404The specified resource couldn't be found.
500Internal server error. Additional details will be contained on the server logs.

Data Type Details

com.ibm.commerce.foundation.common.datatypes.OrderIdentifierType

Properties:
NameData TypeRequired
customerOrderNumberstringfalse
uniqueIDstringfalse
externalOrderIDstringfalse

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.UserDataType

Properties:
NameData TypeRequired
userDataFieldcom.ibm.commerce.foundation.common.datatypes.UserDataType.userDataField arrayfalse

com.ibm.commerce.foundation.common.datatypes.UserDataType.userDataField

Properties:
NameData TypeRequired
valuestringfalse
keystringtrue

com.ibm.commerce.wallet.facade.datatypes.CouponDescriptionType

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

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

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

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

Properties:
NameData TypeRequired
valuestringfalse
keystringtrue

coupon-coupon

Properties:
NameData TypeRequired
recordSetTotalstringfalse
Couponcoupon-coupon_item arrayfalse
recordSetCompletestringfalse
recordSetStartNumberstringfalse
recordSetCountstringfalse

coupon-coupon_item

Properties:
NameData TypeRequired
couponIdstringfalse
effectiveDateTimestringfalse
statusstringfalse
couponCodestringfalse
promotioncom.ibm.commerce.foundation.common.datatypes.PromotionIdentifierTypefalse
userDatacom.ibm.commerce.foundation.common.datatypes.UserDataTypefalse
couponDescriptioncom.ibm.commerce.wallet.facade.datatypes.CouponDescriptionType arrayfalse
expirationDateTimestringfalse
ordercom.ibm.commerce.foundation.common.datatypes.OrderIdentifierTypefalse