API

Application Programming Interface

InvoiceXpress Documentation



Create


taxes.create

Creates a new tax.

You call this method by submitting an HTTP POST request to the following URL with the data of the new tax on the request body:


    https://{account-name}.app.invoicexpress.com/taxes.xml
      

    https://{account-name}.app.invoicexpress.com/taxes.json
      
Header

XML: Content-Type: application/xml; charset=utf-8

JSON: Content-Type: application/json; charset=utf-8

Body
<tax> <name>IVA23</name> <value>23.0</value> <region>PT</region> <default_tax>1</default_tax> </tax>

    {
      "tax": {
        "name": "IVA23",
        "value": "23.0",
        "region": "PT",
        "default_tax": "1"
      }
    }
      

Parameters

Parameters are the data you will pass with the call.

Parameter Required Description
api_key Yes Your secret identifier. You can find your API Key under Account >> API in the Account section.
name Yes Tax name
value Yes Tax value (%)
region Depends Tax region. This parameter is required to export SAF-T PT (Portuguese accounts only). When this element is present, it’s value can’t be blank. It must match one of these options: PT (Portugal continental), PT-AC (Açores), PT-MA (Madeira), Desconhecido (Unknown).
default tax No If “1”, the tax is chosen as the default tax on your account. Any other value is ignored.

Return Values

These are the results that will be returned on success and error.

Success
HTTP: 201 CREATED
<tax> <id>31540</id> <name>IVA23</name> <value>23.0</value> <region>PT</region> <default_tax>1</default_tax> </tax>

    {
      "tax": {
        "id": 31540,
        "name": "IVA23",
        "value": 23.0,
        "region": "PT",
        "default_tax": 1
      }
    }
      
Error
Code Description
HTTP: 401 Access denied The API Key parameter is missing or is incorrectly entered.
HTTP: 422 Unprocessable Entity Some parameters were incorrect.

Possible error for HTTP: 422

<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>