approval_status

Accurate, secure transactions require that a second individual approve some electronic marketplace actions before they proceed. This individual, called an approver, can accept or reject requests to perform a specific action. This class provides RESTful services to retrieve order and buyer approval status record details and to approve or reject them.

Handler Class:

com.ibm.commerce.rest.approvalstatus.handler.ApprovalStatusHandler

Method Summary

HTTP MethodPathDescription
GET/store/{storeId}/approval_status?q={q}Finds approval status records by a query. See each query for details on input and output.
GET/store/{storeId}/approval_status?q=allFinds all approval status records available to the current user.
GET/store/{storeId}/approval_status?q=buyerApprovalsFinds buyer approval status records available to the current user.
GET/store/{storeId}/approval_status?q=orderApprovalsFinds order approval status records available to the current user.
GET/store/{storeId}/approval_status/{approvalStatusId}Find an approval status record by its id.
POST/store/{storeId}/approval_status/{approvalStatusId}Updates the status to approve or reject and adds an optional comment to the approval status record.
POST/store/{storeId}/approval_status/{approvalStatusId}?action={action}Performs an action on an approval status record. See action for details on input and output.

Method Details

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

Finds approval status records by a query. See each query for details on input and output.

Handler Method:

findByQuery

Secure Call Mandatory:

true

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:

com.ibm.commerce.approval.beans.ApprovalStatusListDataBean_IBM_Store_Summary

GET /store/{storeId}/approval_status?q=all

Finds all approval status records available to the current user.

Handler Method:

findAll

Secure Call Mandatory:

true

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
qThe query name.querystringtruefalse
flowTypeIdentifierQuery by flow type identifier.querystringfalsefalse
submitterFirstNameQuery by approval request submitter's first name.querystringfalsefalse
submitterMiddleNameQuery by approval request submitter's middle name.querystringfalsefalse
submitterLastNameQuery by approval request submitter's last name.querystringfalsefalse
startSubmitTimeQuery by approval request start time.querystringfalsefalse
endSubmitTimeQuery by approval request end time.querystringfalsefalse
statusQuery by approval request status.queryintegerfalsefalse
approvalStatusIdQuery by approval request approval status id.queryintegerfalsefalse
entityIdQuery by approval request entity id, such as order id.queryintegerfalsefalse
approverIdQuery by approver id. Only returns approval requests that can be approved by the current user.queryintegerfalsefalse
orderByOrder by.querystringfalsefalse
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.
500Internal server error. Additional details will be contained on the server logs.
Response Data Type:

com.ibm.commerce.approval.beans.ApprovalStatusListDataBean_IBM_Store_Summary


Example

Request:
GET /wcs/resources/store/10801/approval_status?q=all&pageNumber=1&pageSize=5
HTTP Status Code:

200

Response:
{
	"recordSetCompleteIndicator": false,
	"recordSetCount": 5,
	"recordSetStartNumber": 0,
	"recordSetTotal": 34,
	"resultList": [
		{
			"approvalStatusId": "10003",
			"approveTime": null,
			"approverGroupId": "8000000000000000057",
			"approverId": "-1000",
			"comment": null,
			"entityId": "7000000000000000903",
			"flowId": "10005",
			"flowTypeId": "10005",
			"stateId": "10035",
			"status": "0",
			"submitTime": "2014-11-06T20:01:05.736000000Z",
			"submitterId": "4036"
		},
		{
			"approvalStatusId": "10004",
			"approveTime": null,
			"approverGroupId": "8000000000000000057",
			"approverId": "-1000",
			"comment": null,
			"entityId": "4036",
			"flowId": "10006",
			"flowTypeId": "10006",
			"stateId": "10040",
			"status": "0",
			"submitTime": "2014-11-06T20:01:06.908000000Z",
			"submitterId": "4036"
		},
		{
			"approvalStatusId": "10005",
			"approveTime": null,
			"approverGroupId": "8000000000000000057",
			"approverId": "-1000",
			"comment": null,
			"entityId": "7000000000000000904",
			"flowId": "10005",
			"flowTypeId": "10005",
			"stateId": "10035",
			"status": "0",
			"submitTime": "2014-11-06T20:01:12.972000000Z",
			"submitterId": "4037"
		},
		{
			"approvalStatusId": "10006",
			"approveTime": null,
			"approverGroupId": "8000000000000000057",
			"approverId": "-1000",
			"comment": null,
			"entityId": "4037",
			"flowId": "10006",
			"flowTypeId": "10006",
			"stateId": "10040",
			"status": "0",
			"submitTime": "2014-11-06T20:01:14.969000000Z",
			"submitterId": "4037"
		},
		{
			"approvalStatusId": "10007",
			"approveTime": null,
			"approverGroupId": "8000000000000000057",
			"approverId": "-1000",
			"comment": null,
			"entityId": "7000000000000000905",
			"flowId": "10005",
			"flowTypeId": "10005",
			"stateId": "10035",
			"status": "0",
			"submitTime": "2014-11-06T20:01:15.407000000Z",
			"submitterId": "4038"
		}
	]
}

GET /store/{storeId}/approval_status?q=buyerApprovals

Finds buyer approval status records available to the current user.

Handler Method:

findBuyerApprovals

Secure Call Mandatory:

true

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
qThe query name.querystringtruefalse
submitterFirstNameQuery by approval request submitter's first name.querystringfalsefalse
submitterMiddleNameQuery by approval request submitter's middle name.querystringfalsefalse
submitterLastNameQuery by approval request submitter's last name.querystringfalsefalse
startSubmitTimeQuery by approval request start time.querystringfalsefalse
endSubmitTimeQuery by approval request end time.querystringfalsefalse
statusQuery by approval request status.queryintegerfalsefalse
approvalStatusIdQuery by approval request approval status id.queryintegerfalsefalse
entityIdQuery by approval request entity id, such as order id.queryintegerfalsefalse
approverIdQuery by approver id. Only returns approval requests that can be approved by the current user.queryintegerfalsefalse
orderByOrder by.querystringfalsefalse
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.
500Internal server error. Additional details will be contained on the server logs.
Response Data Type:

com.ibm.commerce.approval.beans.BuyerApprovalStatusListDataBean_IBM_Store_Summary


Example

Request:
GET /wcs/resources/store/10801/approval_status?approverId=-1004&pageSize=12&q=buyerApprovals&status=0&pageNumber=1&responseFormat=json
HTTP Status Code:

200

Response:
{
	"recordSetCompleteIndicator": true,
	"recordSetCount": 1,
	"recordSetStartNumber": 0,
	"recordSetTotal": 1,
	"resultList": [
		{
			"approvalStatusId": "13003",
			"approveTime": null,
			"approverGroupId": "-999",
			"approverId": "-1004",
			"comment": null,
			"entityId": "12050",
			"flowId": "10004",
			"flowTypeId": "10004",
			"stateId": "10030",
			"status": "0",
			"submitTime": "2014-11-24T18:58:06.804000000Z",
			"submitter": {
				"firstName": "Jane",
				"lastName": "Smith",
				"middleName": ""
			},
			"submitterId": "12050"
		}
	]
}

GET /store/{storeId}/approval_status?q=orderApprovals

Finds order approval status records available to the current user.

Handler Method:

findOrderApprovals

Secure Call Mandatory:

true

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
qThe query name.querystringtruefalse
submitterFirstNameQuery by approval request submitter's first name.querystringfalsefalse
submitterMiddleNameQuery by approval request submitter's middle name.querystringfalsefalse
submitterLastNameQuery by approval request submitter's last name.querystringfalsefalse
startSubmitTimeQuery by approval request start time.querystringfalsefalse
endSubmitTimeQuery by approval request end time.querystringfalsefalse
statusQuery by approval request status.queryintegerfalsefalse
approvalStatusIdQuery by approval request approval status id.queryintegerfalsefalse
entityIdQuery by approval request entity id, such as order id.queryintegerfalsefalse
approverIdQuery by approver id. Only returns approval requests that can be approved by the current user.queryintegerfalsefalse
orderByOrder by.querystringfalsefalse
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.
500Internal server error. Additional details will be contained on the server logs.
Response Data Type:

com.ibm.commerce.approval.beans.OrderApprovalStatusListDataBean_IBM_Store_Summary

GET /store/{storeId}/approval_status/{approvalStatusId}

Find an approval status record by its id.

Handler Method:

findByApprovalStatusId

Secure Call Mandatory:

true

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
approvalStatusIdThe approval status ID.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:

com.ibm.commerce.approval.beans.ApprovalStatusDataBean_IBM_Store_Summary


Example

Request:
GET /wcs/resources/store/10801/approval_status/13002
HTTP Status Code:

200

Response:
{
	"resultList": [
		{
			"approvalStatusId": "13002",
			"approveTime": "2014-11-24T19:13:18.583000000Z",
			"approverGroupId": "-999",
			"approverId": "-1004",
			"comment": null,
			"entityId": "12049",
			"flowId": "10004",
			"flowTypeId": "10004",
			"stateId": "10030",
			"status": "1",
			"submitTime": "2014-11-24T16:43:38.562000000Z",
			"submitterId": "12049"
		}
	]
}

POST /store/{storeId}/approval_status/{approvalStatusId}

Updates the status to approve or reject and adds an optional comment to the approval status record.

Handler Method:

updateApprovalStatus

Secure Call Mandatory:

true

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
approvalStatusIdThe approval status ID.pathstringtrueN/A
bodyThe request body for updating an approval status record.bodycom.ibm.commerce.rest.approvalstatus.handler.ApprovalStatusHandler$UpdateApprovalStatusParameterDescriptiontrueN/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.approvalstatus.handler.ApprovalStatusHandler$UpdateApprovalStatusResponse

POST /store/{storeId}/approval_status/{approvalStatusId}?action={action}

Performs an action on an approval status record. See action for details on input and output.

Handler Method:

performAction

Secure Call Mandatory:

true

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
approvalStatusIdThe approval status ID.pathstringtrueN/A
actionThe action.querystringtruefalse
bodyThe body data.bodystringfalseN/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.

Data Type Details

com.ibm.commerce.approval.beans.ApprovalStatusDataBean_IBM_Store_Summary

Properties:
NameData TypeRequired
approverIdstringfalse
approvalStatusIdstringfalse
statusstringfalse
flowTypeIdstringfalse
submitterIdstringfalse
submitTimestringfalse
approverGroupIdstringfalse
flowIdstringfalse
approveTimestringfalse
stateIdstringfalse
entityIdstringfalse
commentstringfalse

com.ibm.commerce.approval.beans.ApprovalStatusListDataBean_IBM_Store_Summary

Properties:
NameData TypeRequired
recordSetTotalstringfalse
recordSetCompleteIndicatorstringfalse
recordSetStartNumberstringfalse
resultListcom.ibm.commerce.approval.beans.ApprovalStatusListDataBean_IBM_Store_Summary.resultList arrayfalse
recordSetCountstringfalse

com.ibm.commerce.approval.beans.ApprovalStatusListDataBean_IBM_Store_Summary.resultList

Properties:
NameData TypeRequired
approverIdstringfalse
approvalStatusIdstringfalse
statusstringfalse
flowTypeIdstringfalse
submitterIdstringfalse
submitTimestringfalse
approverGroupIdstringfalse
flowIdstringfalse
approveTimestringfalse
stateIdstringfalse
entityIdstringfalse
commentstringfalse

com.ibm.commerce.approval.beans.BuyerApprovalStatusListDataBean_IBM_Store_Summary

Properties:
NameData TypeRequired
recordSetTotalstringfalse
recordSetCompleteIndicatorstringfalse
recordSetStartNumberstringfalse
resultListcom.ibm.commerce.approval.beans.BuyerApprovalStatusListDataBean_IBM_Store_Summary.resultList arrayfalse
recordSetCountstringfalse

com.ibm.commerce.approval.beans.BuyerApprovalStatusListDataBean_IBM_Store_Summary.resultList

Properties:
NameData TypeRequired
approverIdstringfalse
approvalStatusIdstringfalse
statusstringfalse
flowTypeIdstringfalse
submitterIdstringfalse
submitTimestringfalse
approverGroupIdstringfalse
flowIdstringfalse
approveTimestringfalse
stateIdstringfalse
entityIdstringfalse
commentstringfalse

com.ibm.commerce.approval.beans.OrderApprovalStatusListDataBean_IBM_Store_Summary

Properties:
NameData TypeRequired
recordSetTotalstringfalse
recordSetCompleteIndicatorstringfalse
recordSetStartNumberstringfalse
resultListcom.ibm.commerce.approval.beans.OrderApprovalStatusListDataBean_IBM_Store_Summary.resultList arrayfalse
recordSetCountstringfalse

com.ibm.commerce.approval.beans.OrderApprovalStatusListDataBean_IBM_Store_Summary.resultList

Properties:
NameData TypeRequired
approverIdstringfalse
approvalStatusIdstringfalse
statusstringfalse
flowTypeIdstringfalse
submitterIdstringfalse
submitTimestringfalse
approverGroupIdstringfalse
flowIdstringfalse
approveTimestringfalse
stateIdstringfalse
entityIdstringfalse
commentstringfalse

com.ibm.commerce.rest.approvalstatus.handler.ApprovalStatusHandler$UpdateApprovalStatusParameterDescription

Description of the post input body to update an approval status record.

Properties:
NameData TypeRequired
commentsstringfalse
aprv_actstringtrue

com.ibm.commerce.rest.approvalstatus.handler.ApprovalStatusHandler$UpdateApprovalStatusResponse

Description of approval status record update response.

Properties:
NameData TypeRequired
resultmsgstringfalse