sbGetUsageCreationStatus
Use this method to get the status and results of the usage creation request made using the sbCreateUsage method. Use the request ID returned by the sbCreateUsage method when you send a request using this method.
When the RESTlet receives a request using this method, it searches for the SuiteBilling operation record associated with the request ID. If an operation record is found, the method returns the usage creation status in the response object.
Request Properties
Property |
Data Type |
Required? |
Description |
---|---|---|---|
|
string |
Yes |
Method name of the process to execute. In this case, value must be |
|
number |
Yes |
Internal ID of the SuiteBilling operation record. This value is returned by the |
Sample Request
{
"method": "sbGetUsageCreationStatus",
"requestId": "1101"
}
Response Properties
Property |
Data Type |
Description |
---|---|---|
|
number |
Internal ID of the SuiteBilling operation record. |
|
string |
Status of the usage creation. Value can be one of the following:
|
|
object |
Result object that contains the information of successful records, failed records, and unhandled errors. |
|
array |
Array list of usage objects that are successfully created. Each object contains the index, data, and result.
|
|
array |
Array list of usage objects that failed. Each object contains index, data, and result.
|
|
array |
Array list of error information that occurred on the different stages of the map/reduce script. These errors occurred outside the scope of usage creation (that is, outside of SuiteBilling Operation Detail record creation).
|
Sample Response
The following example shows the response when the operation record for the specified request ID is successfully obtained. In this example, the status of the usage creation is completed, one record is successfully created, one record failed, and there are no unhandled errors.
{
"requestId": "1101",
"status": "Completed",
"result": {
"successes": [
{
"index": 0,
"data": {
"subscription": "1",
"line": "3",
"quantity": "5",
"date": "1/3/2018",
"memo": "this is a note"
},
"result": {
"usageId": 101
}
}
],
"failures": [
{
"index": 1,
"data": {
"subscription": "1",
"line": "5",
"quantity": "15",
"date": "1/3/2018"
},
"result": {
"name": "INVALID_KEY_OR_REF",
"message": "Invalid usagesubscriptionline reference key Ems SP 001 - 1/1/2018: 5."
}
}
],
"errors": []
}
}
In the following example, the status of the usage creation is completed and there is one unhandled error.
{
"requestId": "1102",
"status": "Completed",
"result": {
"successes": [],
"failures": [],
"errors": [
{
"stage": "reduce",
"key":"906",
"name":"UNEXPECTED_ERROR",
"message":"An unexpected error occurred."
}
]
}
}