AnsweredAssumed Answered

How to do a POST on TaxRate Rest API

Question asked by Sarika Tandale on Feb 2, 2018
Latest reply on Feb 5, 2018 by dkallish

Hello,

 

I am using Sugar version 7.9 Pro.

I was trying to update the tax value by accessing the "TaxRate" v10 Rest API. I want to do a POST AJAX request on to the Sugar v10 TaxRate API. I would like to update the "Name" parameter for a particular ID.

Any directions on how to go about it?

 

This is where I've got so far :

 

// The data to be passed in the POST request:

var postsugar = {id:'123', name:'7.7 Percent', date_entered: 'some_date', date_modified: 'modified_date', modified_user_id: 'some_id',};

 

// Taxrate for that ID

var url = app.api.buildURL('TaxRates', null, {
id: '123'
}, {});


// API call to update Taxrate Name for this id in the Taxrate API:

app.api.call('create', url, null, {
success: _.bind(function (response) {
console.log('sugar api',response);

}, this),
error: _.bind(function (error) {

console.log("Error", error)
}, this)
});

 

I am not sure how to pass the POST data  and which all parameters are to be passed.

 

Thank you for going through the post

Outcomes