JSON API » taxes » taxes/create

Creates a new tax.

Input parameters

Requires authentication and the commerce role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
nameStringName.Yes
accountsInteger1 if this tax applies to customer's per billing cycle account fees, 0 if not.No1
amountDecimalAmount added after rate is applied if value is non-zero.No0.00
callsInteger1 if this tax applies to calls, 0 if not.No1
cardgroupsInteger1 if this tax applies to card groups, 0 if not.No1
chargesInteger1 if this tax applies to charges by default, 0 if not. This can be overridden per charge.No1
currencyStringThe currency the amount is in.NoSystem currency.
customerIntegerID of customer to create in.NoCustomer of authentication user.
descriptionStringDescription.NoEmpty string.
featuresInteger1 if this tax applies to telephony features, 0 if not.No1
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.No2
messagesInteger1 if this tax applies to text messages, 0 if not.No1
numbersInteger1 if this tax applies to numbers, 0 if not.No1
productsInteger1 if this tax applies to products by default, 0 if not. This can be overridden per product.No1
rateDecimalThe tax rate in percent.No0.0
sharedInteger1 to share with all customers on the system, 0 not to. Only has effect if system owner.No0
validationInteger1 to validate input then return, 0 for full action.No0

Responses

CodeDescription
200Success.
201Input passed validation. Only returned if validation=1.
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.

Data returned

The ID of the created tax.

Example: With required parameters

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

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123 } }

Change history

VersionChanges
4.0Value of 2 added for liable input parameter, and default changed to 2.
3.13Function added.