JSON API » taxes » taxes/update

Updates an existing tax.

Input parameters

Requires authentication and the commerce role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
idIntegerID of tax to update.Yes
accountsInteger1 if this tax applies to customer's per billing cycle account fees, 0 if not.NoCurrent value.
amountDecimalAmount added after rate is applied if value is non-zero.NoCurrent value.
callsInteger1 if this tax applies to calls, 0 if not.NoCurrent value.
cardgroupsInteger1 if this tax applies to card groups, 0 if not.NoCurrent value.
chargesInteger1 if this tax applies to charges by default, 0 if not. This can be overridden per charge.NoCurrent value.
currencyStringThe currency the amount is in.NoCurrent value.
descriptionStringDescription.NoCurrent value.
featuresInteger1 if this tax applies to telephony features, 0 if not.NoCurrent value.
liableInteger0 if customers are not liable for this tax by default. 1 if new customers are. 2 if new and existing customers are. This can be overridden per customer. This can be overridden per customer.NoCurrent value.
messagesInteger1 if this tax applies to text messages, 0 if not.NoCurrent value.
nameStringName.NoCurrent value.
numbersInteger1 if this tax applies to numbers, 0 if not.NoCurrent value.
productsInteger1 if this tax applies to products by default, 0 if not. This can be overridden per product.NoCurrent value.
rateDecimalThe tax rate in percent.NoCurrent value.
sharedInteger1 to share with all customers on the system, 0 not to. Only has effect if system owner.NoCurrent value.
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
201Input passed validation. Only returned if validation=1.
204Success.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
404The tax does not exist, or you do not have permission to update it.

Data returned

No data is returned.

Example: Changing the name

http://enswitch.example.com/api/json/taxes/update/?auth_username=user;auth_password=password;id=123;name=example

{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }

Change history

VersionChanges
4.0Value of 2 added for liable input parameter.
3.13Function added.