taxes.create
Creates a new tax.
You call this method submitting an HTTP POST request to the following URL with the xml data of the new tax information on the request body:
Example xml to be submitted with tax info:
<?xml version="1.0" encoding="UTF-8"?> <tax> <name>IVA19</name> <value>19.0</value> <region>PT</region> <default_tax>1</default_tax> </tax>
Parameters
Parameters are the data you will pass with the call.
api_key
Your secret identifier. Your API Key is on Account Overview in the Account section.
Rules: Required
name
Tax name.
Rules: Required. Must be unique on your account.
value
Tax value (%).
Rules: Required. Must be a number between 0 and 99.99
default tax
If “1″, the tax is chosen as the default tax on your account. Any other value is ignored.
Rules:Optional.
Parameters required to allow SAFT-T PT/2010 exportation – Portuguese only
region
Tax region. When this element is present, it’s value can’t be blank. It must match one of this options (after each option is documented it’s description):
- PT : “Portugal continental”
- PT -AC : “Açores”
- PT -MA : “Madeira”
- Desconhecido
Rules: Required
Return Values
This is the result that will be passed back to you when you have sent a call.
Success
HTTP: 201 CREATED
<?xml version="1.0" encoding="UTF-8"?> <tax> <id>3</id> <name>IVA19</name> <value>19.0</value> <region>PT</region> <default_tax>1</default_tax> <!-- default tax --> </tax>
Error
The API Key parameter is missing or incorrect.
HTTP: 422 Unprocessable Entity
Some parameters were incorrect.
Possible errors:
<?xml version="1.0" encoding="UTF-8"?> <errors> <error>Name has already been taken</error> <error>Value can't be blank</error> <error>Value must be a number between 0 and 99.99</error> <error>Tax region is empty</error> <error>Tax region is not valid</error> </errors>
