subscription

This class has the ability to return information about subscriptions

Handler Class:

com.ibm.commerce.rest.subscription.handler.SubscriptionHandler

Method Summary

HTTP MethodPathDescription
GET/store/{storeId}/subscription?q={q}Run a subscription query.
GET/store/{storeId}/subscription?q=byBuyerIdAndSubscriptionTypeFinds subscriptions by user and subscription type
GET/store/{storeId}/subscription?q=bySubscriptionIdsFinds subscriptions by subscription ids
GET/store/{storeId}/subscription/{subscriptionId}Finds subcription infomation by its subscriptionId
POST/store/{storeId}/subscription/{orderId}/submit_recurring_or_subscriptionSubmits a recurring or subscription.
DELETE/store/{storeId}/subscription/{orderId}/cancel_recurring_or_subscriptionCancel the specified recurring or subscription.

Method Details

GET /store/{storeId}/subscription?q={q}

Run a subscription query.

Handler Method:

findByQuery

Secure Call Mandatory:

false

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
qThe query name.querystringtruefalse
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:

subscription-IBM_Store_Details

GET /store/{storeId}/subscription?q=byBuyerIdAndSubscriptionType

Finds subscriptions by user and subscription type

Handler Method:

byBuyerIdAndSubscriptionType

Secure Call Mandatory:

false

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
qThe query name.querystringtruefalse
profileNameProfile name. Profiles determine the subset of data to be returned by a query.querystringfalsefalse
subscriptionTypeCodeThe subscription type code ie(All,RecurringOrder)querystringtruefalse
buyerIdThe buyer Idquerystringtruefalse
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:

subscription-IBM_Store_Summary


Example

Request:
GET /wcs/resources/store/10001/subscription?q=byBuyerIdAndSubscriptionType&buyerId=2003&subscriptionTypeCode=RecurringOrder
HTTP Status Code:

200

Response:
{
	"recordSetComplete": true,
	"recordSetCount": 1,
	"recordSetStartNumber": 0,
	"recordSetTotal": 1,
	"resourceId": "https:\/\/localhost:443\/wcs\/resources\/store\/10001\/subscription?q=byBuyerIdAndSubscriptionType&buyerId=2003&subscriptionTypeCode=RecurringOrder",
	"resourceName": "subscription",
	"resultList": [
		{
			"purchaseDetails": {
				"parentOrderIdentifier": {
					"parentOrderId": "25018"
				},
				"userData": {
					"userDataField": [
					]
				}
			},
			"state": "Active",
			"subscriptionIdentifier": {
				"subscriptionId": "4507"
			},
			"subscriptionInfo": {
				"fulfillmentSchedule": {
					"endInfo": {
						"duration": {
							"uom": "DAY             ",
							"value": 36524.0
						},
						"endDate": "2214-09-10T18:00:00.798Z",
						"totalOccurrences": null,
						"userData": null
					},
					"frequencyInfo": {
						"completedOccurrences": null,
						"frequency": {
							"uom": "WEE             ",
							"value": 1.0
						},
						"nextOccurence": "2114-09-10T18:00:00.798Z",
						"remainingOccurrences": 5218,
						"userData": null
					},
					"startInfo": {
						"startDate": "2114-09-10T18:00:00.798Z",
						"userData": null
					},
					"userData": null
				},
				"paymentInfo": {
					"amountPaid": null,
					"amountToCharge": {
						"currency": "USD",
						"value": 0.01000
					},
					"totalCost": {
						"currency": "USD",
						"value": 25.62000
					},
					"userData": {
						"userDataField": [
						]
					}
				},
				"paymentSchedule": {
					"endInfo": null,
					"frequencyInfo": {
						"completedOccurrences": null,
						"frequency": {
							"uom": "WEE             ",
							"value": 1.0
						},
						"nextOccurence": "2114-09-10T18:00:00.798Z",
						"remainingOccurrences": null,
						"userData": null
					},
					"startInfo": null,
					"userData": {
						"userDataField": [
						]
					}
				},
				"userData": null
			}
		}
	]
}

GET /store/{storeId}/subscription?q=bySubscriptionIds

Finds subscriptions by subscription ids

Handler Method:

bySubscriptionIds

Secure Call Mandatory:

false

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
qThe query name.querystringtruefalse
subscriptionIdThe subscription Idquerystringtruetrue
profileNameProfile name. Profiles determine the subset of data to be returned by a query.querystringfalsefalse
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:

subscription-IBM_Store_Details

GET /store/{storeId}/subscription/{subscriptionId}

Finds subcription infomation by its subscriptionId

Handler Method:

bySubscriptionId

Secure Call Mandatory:

false

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
subscriptionIdThe subcription idpathstringtrueN/A
profileNameProfile name. Profiles determine the subset of data to be returned by a query.querystringfalsefalse
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:

subscription-IBM_Store_Details

POST /store/{storeId}/subscription/{orderId}/submit_recurring_or_subscription

Submits a recurring or subscription.

Handler Method:

submitRecurringOrSubscription

Secure Call Mandatory:

false

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
orderIdThe order idpathstringtrueN/A
bodyRequest body.bodycom.ibm.commerce.rest.subscription.handler.SubscriptionHandler$SubmitRecurringOrSubscriptionfalseN/A
HTTP Status Codes:
HTTP Status CodeDescription
200The requested completed successfully.
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.
404The specified resource couldn't be found.
500Internal server error. Additional details will be contained on the server logs.
Response Data Type:

com.ibm.commerce.rest.subscription.handler.SubscriptionHandler$SubmitRecurringOrSubscriptionResponse


Example

Request:
POST /wcs/resources/store/10001/subscription/25018/submit_recurring_or_subscription
Body:
{
	"catalogId": "10001",
	"endDate": "2214-09-10T18:00:00.798Z",
	"fulfillmentInterval": "1",
	"fulfillmentIntervalUOM": "WEE",
	"orderId": "25018",
	"purchaseorder_id": "25018",
	"requesttype": "ajax",
	"startDate": "2114-09-10T18:00:00.798Z",
	"storeId": "10001"
}
HTTP Status Code:

201

Response:
{
	"orderId": [
		"25018"
	]
}

DELETE /store/{storeId}/subscription/{orderId}/cancel_recurring_or_subscription

Cancel the specified recurring or subscription.

Handler Method:

cancelRecurringOrSubscription

Secure Call Mandatory:

false

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
orderIdThe order idpathstringtrueN/A
subscriptionIdThe subcription idquerystringfalsefalse
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:

com.ibm.commerce.rest.subscription.handler.SubscriptionHandler$CancelRecurringOrSubscription


Example

Request:
DELETE /wcs/resources/store/10001/subscription/232etr/cancel_recurring_or_subscription?subscriptionId=4507
HTTP Status Code:

200

Response:
{
	"state": [
		"Cancelled"
	],
	"subscriptionId": [
		"4507"
	],
	"subscriptionType": [
		"RecurringOrder"
	]
}

Data Type Details

com.ibm.commerce.rest.subscription.handler.SubscriptionHandler$CancelRecurringOrSubscription

Cancel recurring/subscription order

Properties:
NameData TypeRequired
statestringfalse
subscriptionTypestringfalse
subscriptionIdstringfalse

com.ibm.commerce.rest.subscription.handler.SubscriptionHandler$SubmitRecurringOrSubscription

Request body from submitting a Recurring order/Subscription

Properties:
NameData TypeRequired
fulfillmentIntervalstringfalse
payMethodIdstringtrue
timePeriodUOMstringtrue
paymentIntervalUOMstringtrue
endDatestringfalse
billing_address_idstringtrue
paymentIntervalstringtrue
purchaseorder_idstringtrue
timePeriodstringtrue
startDatestringfalse
fulfillmentIntervalUOMstringfalse
paymentTCIdstringtrue
piAmountstringtrue
storeIdstringfalse
numberOfFulfillmentstringtrue

com.ibm.commerce.rest.subscription.handler.SubscriptionHandler$SubmitRecurringOrSubscriptionResponse

Information about an Subscription/Recurring order

Properties:
NameData TypeRequired
orderIdstringfalse

subscription-IBM_Store_Details

Properties:
NameData TypeRequired
recordSetTotalstringfalse
recordSetCompletestringfalse
recordSetStartNumberstringfalse
resultListsubscription-IBM_Store_Details_item arrayfalse
recordSetCountstringfalse

subscription-IBM_Store_Details_item

subscription-IBM_Store_Summary

Properties:
NameData TypeRequired
recordSetTotalstringfalse
recordSetCompletestringfalse
recordSetStartNumberstringfalse
resultListsubscription-IBM_Store_Summary_item arrayfalse
recordSetCountstringfalse

subscription-IBM_Store_Summary_item