When retrieving a quote using the rest api, one of the retrieved fields is the taxrate_id.
How do I retrieve the actual tax rates using REST?
When retrieving a quote using the rest api, one of the retrieved fields is the taxrate_id.
How do I retrieve the actual tax rates using REST?
You can fetch the full list of Tax Rates in the system using the following request.
GET sugarcrm/rest/v10/TaxRates
{
"next_offset": -1,
"records": [{
"id": "cc7d9da2-024a-dca7-a94b-56ab83c84ad0",
"deleted": false,
"date_entered": "2016-01-29T10:20:09-05:00",
"date_modified": "2016-01-29T10:20:09-05:00",
"modified_user_id": "1",
"created_by": "1",
"name": "8.25 - Cupertino, CA",
"value": 8.25,
"list_order": 1,
"status": "Active",
"my_favorite": false,
"_acl": {
"fields": {}
},
"_module": "TaxRates"
}]
}
To get an individual Tax Rate, you get fetch it by ID like the request below.
GET sugarcrm/rest/v10/TaxRates/cc7d9da2-024a-dca7-a94b-56ab83c84ad0
{
"id": "cc7d9da2-024a-dca7-a94b-56ab83c84ad0",
"deleted": false,
"date_entered": "2016-01-29T10:20:09-05:00",
"date_modified": "2016-01-29T10:20:09-05:00",
"modified_user_id": "1",
"created_by": "1",
"name": "8.25 - Cupertino, CA",
"value": 8.25,
"list_order": 1,
"status": "Active",
"my_favorite": false,
"_acl": {
"fields": {}
},
"_module": "TaxRates"
}
App Ecosystem @ SugarCRM
Thanks Matt.
This seems to work, it's just a little unfortunate that there is no relate field for TaxRates on a Quote, I only have the id field taxrate_id.
If a relate field could be added in the future, it would work 'automatically' in my code.