Cloud Services

ModernOps configuration

APIs for RateCard/RateCards_V2
Published On Jul 08, 2024 - 9:44 AM

APIs for RateCard/RateCards_V2

Learn what the RateCard/RateCards_V2 APIs are and what they are used for.
The following are the RateCard/RateCards_V2 APIs, including parameters, and what they are used for.
API:
GET/shared/ratecard/ratecards
Used for:
RateCard class to retrieve all RateCards
Parameters
Name
Description
short
string
(query)
Return only ID and Name of the RateCards
Available values : true, false
Default value : false
offset
integer
(
query
)
The first record of the page. Default is set to 0.
Default value : 0
limit
integer
(
query
)
The number of records on the page. Default is set to 20.
Default value : 20
sort_order
string
(query)
Sort the records in ascending or descending order. The default order is asc. Allowed values: asc or desc.
Available values : asc, desc
Default value : asc
sort_by
string
(
query
)
Sorting the records can be applied on specific field. Default value is asc.
Available values : name, client_id, updated_at, updated_by, created_at, created_by
Default value : name
Response content type: application/json
Responses
Code
Description
200
Successfully Retrieved all the ratecards
Example Value |
Model
{ "limit": 20, "offset": 0, "reasons": [ { "id": "oidhwd", "messages": [ "Successfully retrieved the ratecards" ], "status": "OK", "statusCode": 100, "translateCode": "RC_2002_GET_ALL_RATECARD", "translateParameters": [ "string" ] } ], "results": [ {} ], "size": 0, "sort_by": "name", "sort_order": "asc" }
404
RateCard not found
Example Value |
Model
{ "message": "sample message", "translateCode": "SAMPLE TRANSLATE CODE", "translateParameters": [ "param1", "param2" ] }
API:
POST/shared/ratecard/ratecards
Used for:
Creating RateCard
Parameters
Name
Description
payload *required
object
(
body
)
Example Value |
Model
{ "applicable_for": [ { "id": "trc001", "is_metadata": false, "label": "trclbl001", "sequence": 1, "values": [ { "id": "trcval001", "label": "valbl001" } ] } ], "client_id": "testclient001", "created_at": "2023-05-12T21:04:29.296Z", "created_by": "sample1user", "currency_code": "USD", "description": "This is a test ratecard", "id": "1e62ac53-561d-44c3-a3c8-9d0e68f47a5b", "name": "testratecard1", "parameters": [ { "data_type": "number", "description": "This is a test param2", "id": "prm2", "max_size": 0, "min_size": 0, "name": "teamparam2", "range": [ { "max": 0, "min": 0, "step": 0 } ], "regex": "regular expression", "uom": [ { "code": "string", "value": 0 } ], "value": "string", "values": [ { "value_id": "string" } ] } ], "rate_card_plans": [ { "description": "p0lan1", "id": "2ab0f08a-c63e-4765-9bea-f670e6e10d25", "name": "rc002", "rate_card_groups": [ { "description": "test item2", "id": "ef5bd22b-408e-44c6-a051-214f376eb457", "name": "item002", "rate_card_items": [ { "description": "test item2", "expression": { "then": [ { "json_formula": "string", "name": "string", "raw_formula": "string", "uom": { "code": "string", "value": 0 } } ], "when": "string" }, "frequency": { "code": "YEAR", "value": 2013 }, "id": "87f47a4f-fff8-45f7-88ef-db1baec4e58b", "name": "item002", "sequence": 1 } ], "sequence": 1, "variables": [ { "data_type": "number", "description": "variable description", "id": "randomstring2", "name": "varname", "value": "string", "values": [ { "value_id": "string" } ] } ] } ], "sequence": 2, "variables": [ { "data_type": "number", "description": "variable description", "id": "randomstring2", "name": "varname", "value": "string", "values": [ { "value_id": "string" } ] } ] } ], "status": "invalid", "updated_at": "2023-05-12T21:04:29.297Z", "updated_by": "sampleuser", "variables": [ { "data_type": "number", "description": "variable description", "id": "randomstring2", "name": "varname", "value": "string", "values": [ { "value_id": "string" } ] } ], "visible_to_ct": true }
Parameter content type:
application/json
Response content type: application/json
Responses
Code
Description
201
Success
Example Value |
Model
{ "reasons": [ { "id": "oidhwd", "messages": [ "Successfully retrieved the ratecards" ], "status": "OK", "statusCode": 100, "translateCode": "RC_2002_GET_ALL_RATECARD", "translateParameters": [ "string" ] } ] }
400
Bad Request
Example Value |
Model
{ "message": "sample message", "translateCode": "SAMPLE TRANSLATE CODE", "translateParameters": [ "param1", "param2" ] }
API:
POST/shared/ratecard/ratecards/applicablefor
Used for:
RateCards class to retrieve applicable RateCards
Parameters
Name
Description
payload *
object
(
body
)
Example Value |
Model
{ "applicable_for": [ { "id": "trc001", "label": "trclbl001", "values": [ { "id": "trcval001", "label": "valbl001" } ] } ], "client_ids": [ "string" ] }
Parameter content type:
application/json
offset
integer
(query)
The first record of the page. Default is set to 0.
Default value : 0
limit
integer
(
query
)
The number of records on the page. Default is set to 20.
Default value : 20
sort_order
string
(query)
Sort the records in ascending or descending order. The default order is asc. Allowed values: asc or desc.
Available values : asc, desc
Default value : asc
sort_by
string
(
query
)
Sorting the records can be applied on specific field. Default value is asc.
Available values : name, client_id, updated_at, updated_by, created_at, created_by
Default value : name
Response content type: application/json
Responses
Code
Description
200
Successfully Retrieved the applicable ratecard
Example Value |
Model
{ "limit": 20, "offset": 0, "reasons": [ { "id": "oidhwd", "messages": [ "Successfully retrieved the ratecards" ], "status": "OK", "statusCode": 100, "translateCode": "RC_2002_GET_ALL_RATECARD", "translateParameters": [ "string" ] } ], "results": [ {} ], "size": 0, "sort_by": "name", "sort_order": "asc" }
404
RateCard not found
Example Value |
Model
{ "message": "sample message", "translateCode": "SAMPLE TRANSLATE CODE", "translateParameters": [ "param1", "param2" ] }
API:
GET/shared/ratecard/ratecards/play
Used for:
Returning a Play web page
Parameters:
No parameters
Response content type: text/html
Responses
Code
Description
200
Success
API:
POST/shared/ratecard/ratecards/play
Used for:
Executing a Play RateCard with a Data
Parameters
Name
Description
group_id
string
(query)
Executing a Group
plan_id
string
(query)
Executing a Pla
Response content type: application/json
Responses
Code
Description
200
Success
400
No result for given Input Data
Example Value |
Model
{ "message": "sample message", "translateCode": "SAMPLE TRANSLATE CODE", "translateParameters": [ "param1", "param2" ] }
API:
DELETE/shared/ratecard/ratecards/{rc_id}
Used for:
Deleting a specified RateCard
Parameters
Name
Description
rc_id *
required
string
(path)
rc_id
Response content type: application/json
Responses
Code
Description
200
Deleted
Example Value |
Model
{ "reasons": [ { "id": "oidhwd", "messages": [ "Successfully retrieved the ratecards" ], "status": "OK", "statusCode": 100, "translateCode": "RC_2002_GET_ALL_RATECARD", "translateParameters": [ "string" ] } ] }
API:
GET/shared/ratecard/ratecards/{rc_id}
Used for:
Getting details for a specified RateCard
Parameters
Name
Description
rc_id *
required
string
(path)
rc_id
Response content type: application/json
Responses
Code
Description
200
Get details for a specified RateCard ID
Example Value |
Model
{ "reasons": [ { "id": "oidhwd", "messages": [ "Successfully retrieved the ratecards" ], "status": "OK", "statusCode": 100, "translateCode": "RC_2002_GET_ALL_RATECARD", "translateParameters": [ "string" ] } ], "result": {} }
404
RateCard not found
Example Value |
Model
{ "message": "sample message", "translateCode": "SAMPLE TRANSLATE CODE", "translateParameters": [ "param1", "param2" ] }
API:
PATCH/shared/ratecard/ratecards/{rc_id}
Used for:
Patching a specified RateCard
Parameters
Name
Description
payload *
required
object
(body)
Example Value |
Model
{ "array_filters": [ {} ], "data": {} }
action
string
(query)
What kind of update action are you performing
Available values : set, pull, push
Default value : set
rc_id *
required
string
(path)
rc_id
Response content type: application/json
Responses
Code
Description
201
Success
Example Value |
Model
{ "reasons": [ { "id": "oidhwd", "messages": [ "Successfully retrieved the ratecards" ], "status": "OK", "statusCode": 100, "translateCode": "RC_2002_GET_ALL_RATECARD", "translateParameters": [ "string" ] } ] }
API:
PUT/shared/ratecard/ratecards/{rc_id}
Used for:
Updating a specified RateCard
Parameters
Name
Description
payload *
required
object
(body)
Example Value |
Model
{ "applicable_for": [ { "id": "trc001", "is_metadata": false, "label": "trclbl001", "sequence": 1, "values": [ { "id": "trcval001", "label": "valbl001" } ] } ], "client_id": "testclient001", "created_at": "2023-05-12T21:44:56.745Z", "created_by": "sample1user", "currency_code": "USD", "description": "This is a test ratecard", "id": "1e62ac53-561d-44c3-a3c8-9d0e68f47a5b", "name": "testratecard1", "parameters": [ { "data_type": "number", "description": "This is a test param2", "id": "prm2", "max_size": 0, "min_size": 0, "name": "teamparam2", "range": [ { "max": 0, "min": 0, "step": 0 } ], "regex": "regular expression", "uom": [ { "code": "string", "value": 0 } ], "value": "string", "values": [ { "value_id": "string" } ] } ], "rate_card_plans": [ { "description": "p0lan1", "id": "2ab0f08a-c63e-4765-9bea-f670e6e10d25", "name": "rc002", "rate_card_groups": [ { "description": "test item2", "id": "ef5bd22b-408e-44c6-a051-214f376eb457", "name": "item002", "rate_card_items": [ { "description": "test item2", "expression": { "then": [ { "json_formula": "string", "name": "string", "raw_formula": "string", "uom": { "code": "string", "value": 0 } } ], "when": "string" }, "frequency": { "code": "YEAR", "value": 2013 }, "id": "87f47a4f-fff8-45f7-88ef-db1baec4e58b", "name": "item002", "sequence": 1 } ], "sequence": 1, "variables": [ { "data_type": "number", "description": "variable description", "id": "randomstring2", "name": "varname", "value": "string", "values": [ { "value_id": "string" } ] } ] } ], "sequence": 2, "variables": [ { "data_type": "number", "description": "variable description", "id": "randomstring2", "name": "varname", "value": "string", "values": [ { "value_id": "string" } ] } ] } ], "status": "invalid", "updated_at": "2023-05-12T21:44:56.745Z", "updated_by": "sampleuser", "variables": [ { "data_type": "number", "description": "variable description", "id": "randomstring2", "name": "varname", "value": "string", "values": [ { "value_id": "string" } ] } ], "visible_to_ct": true }
Parameter content type:
application/json
rc_id *
required
string
(path)
rc_id
Response content type: application/json
Responses
Code
Description
200
Replaced
Example Value |
Model
{ "reasons": [ { "id": "oidhwd", "messages": [ "Successfully retrieved the ratecards" ], "status": "OK", "statusCode": 100, "translateCode": "RC_2002_GET_ALL_RATECARD", "translateParameters": [ "string" ] } ] }
API:
POST/shared/ratecard/ratecards/{rc_id}/execute
Used for:
Executing RateCard
Parameters
Name
Description
payload *
required
object
(body)
Example Value |
Model
{ "batch_input": [ [ { "data_type": "number", "id": "string", "value": "string", "values": [ { "value_id": "string" } ] } ] ], "input_data": [ { "data_type": "number", "id": "string", "value": "string", "values": [ { "value_id": "string" } ] } ] }
Parameter content type:
application/json
rc_id *
required
string
(path)
rc_id
Response content type: application/json
Responses
Code
Description
200
Success
Example Value |
Model
{ "rate_card_plans": [ { "id": "string", "name": "string", "rate_card_groups": [ { "id": "string", "name": "string", "rate_card_items": [ { "frequency": [ { "code": "YEAR", "value": 2013 } ], "id": "string", "name": "string", "output": [ { "computed": 0, "name": "string", "uom": { "code": "string", "value": 0 } } ], "total": 0 } ] }
400
No result for given Input Data
Example Value |
Model
{ "message": "sample message", "translateCode": "SAMPLE TRANSLATE CODE", "translateParameters": [ "param1", "param2" ] }
404
The RateCard Not Found
Example Value |
Model
{ "message": "sample message", "translateCode": "SAMPLE TRANSLATE CODE", "translateParameters": [ "param1", "param2" ] }
API:
POST/shared/ratecard/ratecards/{rc_id}/execute/plan/{plan_id}
Used for:
Executing RateCard
Parameters
Name
Description
payload *
required
object
(body)
Example Value |
Model
{ "batch_input": [ [ { "data_type": "number", "id": "string", "value": "string", "values": [ { "value_id": "string" } ] } ] ], "input_data": [ { "data_type": "number", "id": "string", "value": "string", "values": [ { "value_id": "string" } ] } ] }
rc_id *
required
string
(path)
rc_id
plan_id *
string
(path)
plan_id
Response content type: application/json
Responses
Code
Description
200
Success
Example Value |
Model
{ "rate_card_plans": [ { "id": "string", "name": "string", "rate_card_groups": [ { "id": "string", "name": "string", "rate_card_items": [ { "frequency": [ { "code": "YEAR", "value": 2013 } ], "id": "string", "name": "string", "output": [ { "computed": 0, "name": "string", "uom": { "code": "string", "value": 0 } } ], "total": 0 } ] } ] } ], "reasons": [ { "id": "oidhwd", "messages": [ "Successfully retrieved the ratecards" ], "status": "OK", "statusCode": 100, "translateCode": "RC_2002_GET_ALL_RATECARD", "translateParameters": [ "string" ] } ] }
400
No result for given Input Data
Example Value |
Model
{ "message": "sample message", "translateCode": "SAMPLE TRANSLATE CODE", "translateParameters": [ "param1", "param2" ] }
404
The Plan Not Found for given RateCard
Example Value |
Model
{ "message": "sample message", "translateCode": "SAMPLE TRANSLATE CODE", "translateParameters": [ "param1", "param2" ] }
API:
POST/shared/ratecard/ratecards/{rc_id}/execute/plan/{plan_id}/group/{group_id}
Used for:
Executing RateCard
Parameters
Name
Description
payload *
required
object
(body)
Example Value |
Model
{ "batch_input": [ [ { "data_type": "number", "id": "string", "value": "string", "values": [ { "value_id": "string" } ] } ] ], "input_data": [ { "data_type": "number", "id": "string", "value": "string", "values": [ { "value_id": "string" } ] } ] }
Parameter content type:
application/json
rc_id *
string
(path)
rc_id
plan_id *
string
(path)
plan_id
group_id *
string
(path)
group_id
Response content type: application/json
Responses
Code
Description
200
Success
Example Value |
Model
{ "rate_card_plans": [ { "id": "string", "name": "string", "rate_card_groups": [ { "id": "string", "name": "string", "rate_card_items": [ { "frequency": [ { "code": "YEAR", "value": 2013 } ], "id": "string", "name": "string", "output": [ { "computed": 0, "name": "string", "uom": { "code": "string", "value": 0 } } ], "total": 0 } ] } ] } ], "reasons": [ { "id": "oidhwd", "messages": [ "Successfully retrieved the ratecards" ], "status": "OK", "statusCode": 100, "translateCode": "RC_2002_GET_ALL_RATECARD", "translateParameters": [ "string" ] } ] }
400
No result for given Input Data
Example Value |
Model
{ "message": "sample message", "translateCode": "SAMPLE TRANSLATE CODE", "translateParameters": [ "param1", "param2" ] }
404
The Group Not Found for given RateCard
Example Value |
Model
{ "message": "sample message", "translateCode": "SAMPLE TRANSLATE CODE", "translateParameters": [ "param1", "param2" ] }
Do you have two minutes for a quick survey?
Take Survey