Cloud Services

ModernOps

APIs for RateCard/SPRateCards_V2
Published On Jun 18, 2024 - 11:00 AM

APIs for RateCard/SPRateCards_V2

Learn what the RateCard/SPRateCards_V2 APIs are what they are used for.
The following are the RateCard/SPRateCards_V2 APIs, including parameters, and what they are used for.
API:
GET/shared/ratecard/sp_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
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/sp_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-15T17:44:16.991Z", "created_by": "sample1user", "currency_code": "USD", "customers": [], "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-15T17:44:16.991Z", "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/sp_ratecards/applicablefor
Used for:
RateCards class to retrieve applicable RateCards
Parameters
Name
Description
payload *
required
object
(body)
Example Value |
Model
{ "applicable_for": [ { "id": "trc001", "label": "trclbl001", "values": [ { "id": "trcval001", "label": "valbl001" } ] } ], "client_ids": [ "string" ], "customers": "customer1" }
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:
DELETE/shared/ratecard/sp_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/sp_ratecards/{rc_id}
Used for:
Get 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/sp_ratecards/{rc_id}
Used for:
Patching a specified RateCard
Parameters
Name
Description
payload *
required
object
(body)
Example Value |
Model
{ "array_filters": [ {} ], "data": {} }
Parameter content type:
application/json
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
{ "reasons": [ { "id": "oidhwd", "messages": [ "Successfully retrieved the ratecards" ], "status": "OK", "statusCode": 100, "translateCode": "RC_2002_GET_ALL_RATECARD", "translateParameters": [ "string" ] } ] }
API:
PUT/shared/ratecard/sp_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-15T18:03:45.720Z", "created_by": "sample1user", "currency_code": "USD", "customers": [], "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-15T18:03:45.721Z", "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" ] } ] }
Do you have two minutes for a quick survey?
Take Survey