InvoiceXpress API

Taxes

A Tax is applied to invoice items when creating invoices.

List All

GET /taxes.json

Returns all your taxes.

Example Request

Format:
curl --request GET \
  --url 'https://account_name.app.invoicexpress.com/taxes.json?api_key=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json'
require 'uri'
require 'net/http'

url = URI("https://account_name.app.invoicexpress.com/taxes.json?api_key=YOUR%20API%20KEY%20HERE")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "account_name.app.invoicexpress.com",
  "port": null,
  "path": "/taxes.json?api_key=YOUR%20API%20KEY%20HERE",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("account_name.app.invoicexpress.com")

headers = { 'accept': "application/json" }

conn.request("GET", "/taxes.json?api_key=YOUR%20API%20KEY%20HERE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://account_name.app.invoicexpress.com/taxes.json?api_key=YOUR%20API%20KEY%20HERE",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://account_name.app.invoicexpress.com/taxes.json?api_key=YOUR%20API%20KEY%20HERE"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Responses

200 Success Taxes List all
{
  taxes: [
Array
    {
    { ... }
Object

Taxes

      "id": 31554,
Integer
      "name": "IVA23",
String
      "region": "PT",
String
      "value": 23.0,
Number
      "default_tax": 1
Integer
    }
  ]
}
401 Access Denied

The API Key parameter is missing or is incorrectly entered.

(Empty Response)

Get

GET /taxes/:tax-id.json

Returns a specific tax.

Example Request

Format:
curl --request GET \
  --url 'https://account_name.app.invoicexpress.com/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json'
require 'uri'
require 'net/http'

url = URI("https://account_name.app.invoicexpress.com/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "account_name.app.invoicexpress.com",
  "port": null,
  "path": "/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("account_name.app.invoicexpress.com")

headers = { 'accept': "application/json" }

conn.request("GET", "/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://account_name.app.invoicexpress.com/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://account_name.app.invoicexpress.com/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
tax-id Integer Required

The ID of the tax you want to get.

42

Responses

200 Success Taxes Get
{
  "tax": {
  "tax": { ... }
Object
    "id": 31540,
Integer
    "name": "IVA23",
String
    "value": 23.0,
Number
    "region": "PT",
String
    "default_tax": 1
Integer
  }
}
401 Access denied

The API Key parameter is missing or is incorrectly entered.

(Empty Response)
404 Not Found

No tax matches the supplied tax-id.

(Empty Response)

Update

PUT /taxes/:tax-id.json

Updates a tax.

Example Body

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

Example Request

Format:
curl --request PUT \
  --url 'https://account_name.app.invoicexpress.com/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"tax":{"name":"IVA23","value":"23.0","region":"PT","default_tax":"1"}}'
require 'uri'
require 'net/http'

url = URI("https://account_name.app.invoicexpress.com/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["accept"] = 'application/json'
request["content-type"] = 'application/json'
request.body = "{\"tax\":{\"name\":\"IVA23\",\"value\":\"23.0\",\"region\":\"PT\",\"default_tax\":\"1\"}}"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "PUT",
  "hostname": "account_name.app.invoicexpress.com",
  "port": null,
  "path": "/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ tax: { name: 'IVA23', value: '23.0', region: 'PT', default_tax: '1' } }));
req.end();
import http.client

conn = http.client.HTTPSConnection("account_name.app.invoicexpress.com")

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

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("PUT", "/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://account_name.app.invoicexpress.com/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "{\"tax\":{\"name\":\"IVA23\",\"value\":\"23.0\",\"region\":\"PT\",\"default_tax\":\"1\"}}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://account_name.app.invoicexpress.com/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE"

	payload := strings.NewReader("{\"tax\":{\"name\":\"IVA23\",\"value\":\"23.0\",\"region\":\"PT\",\"default_tax\":\"1\"}}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("accept", "application/json")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
tax-id Integer Required

The ID of the tax to be updated.

42

Request Body

Name Type Required Description Example
tax Object Required

Tax data to be updated.

{
  "tax": {
  "tax": { ... }
Object
    "name": "IVA23",
String

[Required] Tax name.

    "value": "23.0",
String

[Required] Tax value (%).

    "region": "PT",
String

[Optional] 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": "1"
String

[Optional] If 1, this tax is chosen as the default tax on your account. When creating new items this will be the tax used. If the tax being updated is already the default tax on your account, then you can’t place the default tax attribute to 0. You always need to have one default tax.

  }
}

Responses

200 Success (Empty Response)
401 Access denied

The API Key parameter is missing or is incorrectly entered.

(Empty Response)
404 Not Found

No tax matches the supplied tax-id.

(Empty Response)
422 Unprocessable Entity

Some parameters were incorrect.

(Empty Response)

Create

POST /taxes.json

Creates a new tax.

Example Body

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

Example Request

Format:
curl --request POST \
  --url 'https://account_name.app.invoicexpress.com/taxes.json?api_key=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"tax":{"name":"IVA23","value":"23.0","region":"PT","default_tax":"1"}}'
require 'uri'
require 'net/http'

url = URI("https://account_name.app.invoicexpress.com/taxes.json?api_key=YOUR%20API%20KEY%20HERE")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["content-type"] = 'application/json'
request.body = "{\"tax\":{\"name\":\"IVA23\",\"value\":\"23.0\",\"region\":\"PT\",\"default_tax\":\"1\"}}"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "account_name.app.invoicexpress.com",
  "port": null,
  "path": "/taxes.json?api_key=YOUR%20API%20KEY%20HERE",
  "headers": {
    "accept": "application/json",
    "content-type": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write(JSON.stringify({ tax: { name: 'IVA23', value: '23.0', region: 'PT', default_tax: '1' } }));
req.end();
import http.client

conn = http.client.HTTPSConnection("account_name.app.invoicexpress.com")

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

headers = {
    'accept': "application/json",
    'content-type': "application/json"
    }

conn.request("POST", "/taxes.json?api_key=YOUR%20API%20KEY%20HERE", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://account_name.app.invoicexpress.com/taxes.json?api_key=YOUR%20API%20KEY%20HERE",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"tax\":{\"name\":\"IVA23\",\"value\":\"23.0\",\"region\":\"PT\",\"default_tax\":\"1\"}}",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "content-type: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://account_name.app.invoicexpress.com/taxes.json?api_key=YOUR%20API%20KEY%20HERE"

	payload := strings.NewReader("{\"tax\":{\"name\":\"IVA23\",\"value\":\"23.0\",\"region\":\"PT\",\"default_tax\":\"1\"}}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("accept", "application/json")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Request Body

Name Type Required Description Example
tax Object Required

Tax data to be created.

{
  "tax": {
  "tax": { ... }
Object
    "name": "IVA23",
String

[Required] Tax name.

    "value": "23.0",
String

[Required] Tax value (%).

    "region": "PT",
String

[Optional] 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": "1"
String

[Optional] If 1, this tax is chosen as the default tax on your account. When creating new items this will be the tax used. If the tax being updated is already the default tax on your account, then you can’t place the default tax attribute to 0. You always need to have one default tax.

  }
}

Responses

201 Success Taxes Get
{
  "tax": {
  "tax": { ... }
Object
    "id": 31540,
Integer
    "name": "IVA23",
String
    "value": 23.0,
Number
    "region": "PT",
String
    "default_tax": 1
Integer
  }
}
401 Access denied

The API Key parameter is missing or is incorrectly entered.

(Empty Response)
422 Unprocessable Entity

Some parameters were incorrect.

(Empty Response)

Delete

DELETE /taxes/:tax-id.json

Deletes a tax.

Example Request

Format:
curl --request DELETE \
  --url 'https://account_name.app.invoicexpress.com/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json'
require 'uri'
require 'net/http'

url = URI("https://account_name.app.invoicexpress.com/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "DELETE",
  "hostname": "account_name.app.invoicexpress.com",
  "port": null,
  "path": "/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE",
  "headers": {
    "accept": "application/json"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("account_name.app.invoicexpress.com")

headers = { 'accept': "application/json" }

conn.request("DELETE", "/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://account_name.app.invoicexpress.com/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://account_name.app.invoicexpress.com/taxes/:tax-id.json?api_key=YOUR%20API%20KEY%20HERE"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("accept", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
tax-id Integer Required

The ID of the tax to be deleted.

42

Responses

200 Success (Empty Response)
401 Access denied

The API Key parameter is missing or is incorrectly entered.

(Empty Response)
404 Not Found

No tax matches the supplied tax-id.

(Empty Response)