InvoiceXpress API

Clients

A Client is an entity you send invoices to.

List All

GET /clients.json

Returns a list of all your clients.

Example Request

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

url = URI("https://account_name.app.invoicexpress.com/clients.json?page=1&per_page=30&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": "/clients.json?page=1&per_page=30&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", "/clients.json?page=1&per_page=30&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/clients.json?page=1&per_page=30&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/clients.json?page=1&per_page=30&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))

}

Query Parameters

Name Type Required Description Example
page Integer Optional

You can ask for a specific page of clients. Defaults to 1.

1
per_page Integer Optional

You can specify how many results you want to fetch. Defaults to 10 or value defined in account settings (10, 20 or 30).

30

Responses

200 Success Clients List all
{
  clients: [
Array

Lists all clients.

    {
    { ... }
Object

Client Object

      "name": "Client Name",
String

[Required] Client name, normally used for a company name.

      "code": "12345",
String

[Required] Client code, your specific code for the client.

      "email": "foo@bar.com",
String

[Optional] Client email address. Must be a valid email address ex: foo@bar.com

      "language": "pt",
String

[Optional] Client language. May be 'en', 'pt' or' es'. Defaults to the account language.

      "address": "Avenida da República, Lisboa",
String

[Optional] Client company address.

      "city": "Lisboa",
String

[Optional] Client’s city.

      "postal_code": "1050-555",
String

[Optional] Client’s postal code for it’s company address.

      "country": "Portugal",
String

[Optional] Country, normally used for a company country. Although country is optional, when supplied, it should match one of the country list on the Appendix of this documentation.

      "fiscal_id": "508025338",
String

[Optional] The client fiscal ID (Número de Contribuinte)

      "website": "www.invoicexpress.com",
String

[Optional] The client website address.

      "phone": "213456789",
String

[Optional] The client phone number.

      "fax": "213456788",
String

[Optional] The client fax number

      "preferred_contact": {
      "preferred_contact": { ... }
Object

[Optional] Preferred contact details

        "name": "Bruce Norris",
String

[Optional] Name of the preferred contact for your client.

        "email": "email@invoicexpress.com",
String

[Optional] Email of the preferred contact of your client.

        "phone": "213456789"
String

[Optional] Phone number of the preferred contact of your client.

      },
      "observations": "Observations",
String

[Optional] Default observations for the client, the text in here will be added to the observations field of all the invoices sent to this client.

      "send_options": "1"
String

[Optional] Send options for the client. Available options are: 1 - send only the original document. 2 - the original and duplicate. 3 - the original, duplicate and triplicate. These affect the generated pdf.

    }
  ]
  "pagination": {
  "pagination": { ... }
Object

Pagination info.

    "total_entries": 6,
Integer
    "current_page": 1,
Integer
    "total_pages": 1,
Integer
    "per_page": 10
Integer
  }
}
401 Access denied

The API Key parameter is missing or is incorrectly entered.

(Empty Response)

Get

GET /clients/:client-id.json

Returns a specific client.

Example Request

Format:
curl --request GET \
  --url 'https://account_name.app.invoicexpress.com/clients/:client-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/clients/:client-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": "/clients/:client-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", "/clients/:client-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/clients/:client-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/clients/:client-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
client-id Integer Required

The ID of the client you want to get.

42

Responses

200 Success Clients Get
{
  "client": {
  "client": { ... }
Object
    "id": "1",
String
    "name": "Ricardo Pereira",
String
    "email": "someone@example.com",
String
    "address": "Lisbon",
String
    "city": "Lisbon",
String
    "postal_code": "1750-455",
String
    "fiscal_id": "508025338",
String
    "website": "www.invoicexpress.com",
String
    "country": "Portugal",
String
    "phone": "2313423424",
String
    "fax": "2313423425",
String
    "preferred_contact": {
    "preferred_contact": { ... }
Object
      "name": "Ricardo Pereira",
String
      "email": "someone@example.com",
String
      "phone": "2233442233"
String
    },
    "observations": "Computer Processed",
String
    "open_account_link": "https://www.app.invoicexpress.com/suppliers/1f7bba947948c50e04af20d329db5bc67c38cf89",
String
    "send_options": "1",
String
    "payment_days": "0",
String
    "tax_exemption_code": "M00"
String
  }
}
401 Access denied

The API Key parameter is missing or is incorrectly entered.

(Empty Response)
404 Not Found

No client matches the supplied client-id.

(Empty Response)

Update

PUT /clients/:client-id.json

Updates a client.

Example Body

{
  "client": {
    "name": "Client Name",
    "code": "12345",
    "email": "foo@bar.com",
    "language": "pt",
    "address": "Avenida da República, Lisboa",
    "city": "Lisboa",
    "postal_code": "1050-555",
    "country": "Portugal",
    "fiscal_id": "508025338",
    "website": "www.invoicexpress.com",
    "phone": "213456789",
    "fax": "213456788",
    "preferred_contact": {
      "name": "Bruce Norris",
      "email": "email@invoicexpress.com",
      "phone": "213456789"
    },
    "observations": "Observations",
    "send_options": "1"
  }
}

Example Request

Format:
curl --request PUT \
  --url 'https://account_name.app.invoicexpress.com/clients/:client-id.json?api_key=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"client":{"name":"Client Name","code":"12345","email":"foo@bar.com","language":"pt","address":"Avenida da República, Lisboa","city":"Lisboa","postal_code":"1050-555","country":"Portugal","fiscal_id":"508025338","website":"www.invoicexpress.com","phone":"213456789","fax":"213456788","preferred_contact":{"name":"Bruce Norris","email":"email@invoicexpress.com","phone":"213456789"},"observations":"Observations","send_options":"1"}}'
require 'uri'
require 'net/http'

url = URI("https://account_name.app.invoicexpress.com/clients/:client-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 = "{\"client\":{\"name\":\"Client Name\",\"code\":\"12345\",\"email\":\"foo@bar.com\",\"language\":\"pt\",\"address\":\"Avenida da República, Lisboa\",\"city\":\"Lisboa\",\"postal_code\":\"1050-555\",\"country\":\"Portugal\",\"fiscal_id\":\"508025338\",\"website\":\"www.invoicexpress.com\",\"phone\":\"213456789\",\"fax\":\"213456788\",\"preferred_contact\":{\"name\":\"Bruce Norris\",\"email\":\"email@invoicexpress.com\",\"phone\":\"213456789\"},\"observations\":\"Observations\",\"send_options\":\"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": "/clients/:client-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({ client: 
   { name: 'Client Name',
     code: '12345',
     email: 'foo@bar.com',
     language: 'pt',
     address: 'Avenida da República, Lisboa',
     city: 'Lisboa',
     postal_code: '1050-555',
     country: 'Portugal',
     fiscal_id: '508025338',
     website: 'www.invoicexpress.com',
     phone: '213456789',
     fax: '213456788',
     preferred_contact: 
      { name: 'Bruce Norris',
        email: 'email@invoicexpress.com',
        phone: '213456789' },
     observations: 'Observations',
     send_options: '1' } }));
req.end();
import http.client

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

payload = "{\"client\":{\"name\":\"Client Name\",\"code\":\"12345\",\"email\":\"foo@bar.com\",\"language\":\"pt\",\"address\":\"Avenida da República, Lisboa\",\"city\":\"Lisboa\",\"postal_code\":\"1050-555\",\"country\":\"Portugal\",\"fiscal_id\":\"508025338\",\"website\":\"www.invoicexpress.com\",\"phone\":\"213456789\",\"fax\":\"213456788\",\"preferred_contact\":{\"name\":\"Bruce Norris\",\"email\":\"email@invoicexpress.com\",\"phone\":\"213456789\"},\"observations\":\"Observations\",\"send_options\":\"1\"}}"

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

conn.request("PUT", "/clients/:client-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/clients/:client-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 => "{\"client\":{\"name\":\"Client Name\",\"code\":\"12345\",\"email\":\"foo@bar.com\",\"language\":\"pt\",\"address\":\"Avenida da República, Lisboa\",\"city\":\"Lisboa\",\"postal_code\":\"1050-555\",\"country\":\"Portugal\",\"fiscal_id\":\"508025338\",\"website\":\"www.invoicexpress.com\",\"phone\":\"213456789\",\"fax\":\"213456788\",\"preferred_contact\":{\"name\":\"Bruce Norris\",\"email\":\"email@invoicexpress.com\",\"phone\":\"213456789\"},\"observations\":\"Observations\",\"send_options\":\"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/clients/:client-id.json?api_key=YOUR%20API%20KEY%20HERE"

	payload := strings.NewReader("{\"client\":{\"name\":\"Client Name\",\"code\":\"12345\",\"email\":\"foo@bar.com\",\"language\":\"pt\",\"address\":\"Avenida da República, Lisboa\",\"city\":\"Lisboa\",\"postal_code\":\"1050-555\",\"country\":\"Portugal\",\"fiscal_id\":\"508025338\",\"website\":\"www.invoicexpress.com\",\"phone\":\"213456789\",\"fax\":\"213456788\",\"preferred_contact\":{\"name\":\"Bruce Norris\",\"email\":\"email@invoicexpress.com\",\"phone\":\"213456789\"},\"observations\":\"Observations\",\"send_options\":\"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
client-id Integer Required

The ID of the client to be updated.

42

Request Body

Name Type Required Description Example
client Object Required

client data to be updated.

{
  "client": {
  "client": { ... }
Object
    "name": "Client Name",
String

[Required] Client name, normally used for a company name.

    "code": "12345",
String

[Required] Client code, your specific code for the client.

    "email": "foo@bar.com",
String

[Optional] Client email address. Must be a valid email address ex: foo@bar.com

    "language": "pt",
String

[Optional] Client language. May be 'en', 'pt' or' es'. Defaults to the account language.

    "address": "Avenida da República, Lisboa",
String

[Optional] Client company address.

    "city": "Lisboa",
String

[Optional] Client’s city.

    "postal_code": "1050-555",
String

[Optional] Client’s postal code for it’s company address.

    "country": "Portugal",
String

[Optional] Country, normally used for a company country. Although country is optional, when supplied, it should match one of the country list on the Appendix of this documentation.

    "fiscal_id": "508025338",
String

[Optional] The client fiscal ID (Número de Contribuinte)

    "website": "www.invoicexpress.com",
String

[Optional] The client website address.

    "phone": "213456789",
String

[Optional] The client phone number.

    "fax": "213456788",
String

[Optional] The client fax number

    "preferred_contact": {
    "preferred_contact": { ... }
Object

[Optional] Preferred contact details

      "name": "Bruce Norris",
String

[Optional] Name of the preferred contact for your client.

      "email": "email@invoicexpress.com",
String

[Optional] Email of the preferred contact of your client.

      "phone": "213456789"
String

[Optional] Phone number of the preferred contact of your client.

    },
    "observations": "Observations",
String

[Optional] Default observations for the client, the text in here will be added to the observations field of all the invoices sent to this client.

    "send_options": "1"
String

[Optional] Send options for the client. Available options are: 1 - send only the original document. 2 - the original and duplicate. 3 - the original, duplicate and triplicate. These affect the generated pdf.

  }
}

Responses

200 Success (Empty Response)
401 Access denied

The API Key parameter is missing or is incorrectly entered.

(Empty Response)
404 Not Found

No client matches the supplied client-id.

(Empty Response)
422 Unprocessable Entity

Some parameters were incorrect.

(Empty Response)

Create

POST /clients.json

Creates a new client.

Example Body

{
  "client": {
    "name": "Client Name",
    "code": "12345",
    "email": "foo@bar.com",
    "language": "pt",
    "address": "Avenida da República, Lisboa",
    "city": "Lisboa",
    "postal_code": "1050-555",
    "country": "Portugal",
    "fiscal_id": "508025338",
    "website": "www.invoicexpress.com",
    "phone": "213456789",
    "fax": "213456788",
    "preferred_contact": {
      "name": "Bruce Norris",
      "email": "email@invoicexpress.com",
      "phone": "213456789"
    },
    "observations": "Observations",
    "send_options": "1"
  }
}

Example Request

Format:
curl --request POST \
  --url 'https://account_name.app.invoicexpress.com/clients.json?api_key=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"client":{"name":"Client Name","code":"12345","email":"foo@bar.com","language":"pt","address":"Avenida da República, Lisboa","city":"Lisboa","postal_code":"1050-555","country":"Portugal","fiscal_id":"508025338","website":"www.invoicexpress.com","phone":"213456789","fax":"213456788","preferred_contact":{"name":"Bruce Norris","email":"email@invoicexpress.com","phone":"213456789"},"observations":"Observations","send_options":"1"}}'
require 'uri'
require 'net/http'

url = URI("https://account_name.app.invoicexpress.com/clients.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 = "{\"client\":{\"name\":\"Client Name\",\"code\":\"12345\",\"email\":\"foo@bar.com\",\"language\":\"pt\",\"address\":\"Avenida da República, Lisboa\",\"city\":\"Lisboa\",\"postal_code\":\"1050-555\",\"country\":\"Portugal\",\"fiscal_id\":\"508025338\",\"website\":\"www.invoicexpress.com\",\"phone\":\"213456789\",\"fax\":\"213456788\",\"preferred_contact\":{\"name\":\"Bruce Norris\",\"email\":\"email@invoicexpress.com\",\"phone\":\"213456789\"},\"observations\":\"Observations\",\"send_options\":\"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": "/clients.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({ client: 
   { name: 'Client Name',
     code: '12345',
     email: 'foo@bar.com',
     language: 'pt',
     address: 'Avenida da República, Lisboa',
     city: 'Lisboa',
     postal_code: '1050-555',
     country: 'Portugal',
     fiscal_id: '508025338',
     website: 'www.invoicexpress.com',
     phone: '213456789',
     fax: '213456788',
     preferred_contact: 
      { name: 'Bruce Norris',
        email: 'email@invoicexpress.com',
        phone: '213456789' },
     observations: 'Observations',
     send_options: '1' } }));
req.end();
import http.client

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

payload = "{\"client\":{\"name\":\"Client Name\",\"code\":\"12345\",\"email\":\"foo@bar.com\",\"language\":\"pt\",\"address\":\"Avenida da República, Lisboa\",\"city\":\"Lisboa\",\"postal_code\":\"1050-555\",\"country\":\"Portugal\",\"fiscal_id\":\"508025338\",\"website\":\"www.invoicexpress.com\",\"phone\":\"213456789\",\"fax\":\"213456788\",\"preferred_contact\":{\"name\":\"Bruce Norris\",\"email\":\"email@invoicexpress.com\",\"phone\":\"213456789\"},\"observations\":\"Observations\",\"send_options\":\"1\"}}"

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

conn.request("POST", "/clients.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/clients.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 => "{\"client\":{\"name\":\"Client Name\",\"code\":\"12345\",\"email\":\"foo@bar.com\",\"language\":\"pt\",\"address\":\"Avenida da República, Lisboa\",\"city\":\"Lisboa\",\"postal_code\":\"1050-555\",\"country\":\"Portugal\",\"fiscal_id\":\"508025338\",\"website\":\"www.invoicexpress.com\",\"phone\":\"213456789\",\"fax\":\"213456788\",\"preferred_contact\":{\"name\":\"Bruce Norris\",\"email\":\"email@invoicexpress.com\",\"phone\":\"213456789\"},\"observations\":\"Observations\",\"send_options\":\"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/clients.json?api_key=YOUR%20API%20KEY%20HERE"

	payload := strings.NewReader("{\"client\":{\"name\":\"Client Name\",\"code\":\"12345\",\"email\":\"foo@bar.com\",\"language\":\"pt\",\"address\":\"Avenida da República, Lisboa\",\"city\":\"Lisboa\",\"postal_code\":\"1050-555\",\"country\":\"Portugal\",\"fiscal_id\":\"508025338\",\"website\":\"www.invoicexpress.com\",\"phone\":\"213456789\",\"fax\":\"213456788\",\"preferred_contact\":{\"name\":\"Bruce Norris\",\"email\":\"email@invoicexpress.com\",\"phone\":\"213456789\"},\"observations\":\"Observations\",\"send_options\":\"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
client Object Required

Client data to be created.

{
  "client": {
  "client": { ... }
Object
    "name": "Client Name",
String

[Required] Client name, normally used for a company name.

    "code": "12345",
String

[Required] Client code, your specific code for the client.

    "email": "foo@bar.com",
String

[Optional] Client email address. Must be a valid email address ex: foo@bar.com

    "language": "pt",
String

[Optional] Client language. May be 'en', 'pt' or' es'. Defaults to the account language.

    "address": "Avenida da República, Lisboa",
String

[Optional] Client company address.

    "city": "Lisboa",
String

[Optional] Client’s city.

    "postal_code": "1050-555",
String

[Optional] Client’s postal code for it’s company address.

    "country": "Portugal",
String

[Optional] Country, normally used for a company country. Although country is optional, when supplied, it should match one of the country list on the Appendix of this documentation.

    "fiscal_id": "508025338",
String

[Optional] The client fiscal ID (Número de Contribuinte)

    "website": "www.invoicexpress.com",
String

[Optional] The client website address.

    "phone": "213456789",
String

[Optional] The client phone number.

    "fax": "213456788",
String

[Optional] The client fax number

    "preferred_contact": {
    "preferred_contact": { ... }
Object

[Optional] Preferred contact details

      "name": "Bruce Norris",
String

[Optional] Name of the preferred contact for your client.

      "email": "email@invoicexpress.com",
String

[Optional] Email of the preferred contact of your client.

      "phone": "213456789"
String

[Optional] Phone number of the preferred contact of your client.

    },
    "observations": "Observations",
String

[Optional] Default observations for the client, the text in here will be added to the observations field of all the invoices sent to this client.

    "send_options": "1"
String

[Optional] Send options for the client. Available options are: 1 - send only the original document. 2 - the original and duplicate. 3 - the original, duplicate and triplicate. These affect the generated pdf.

  }
}

Responses

201 Success Clients Get
{
  "client": {
  "client": { ... }
Object
    "id": "1",
String
    "name": "Ricardo Pereira",
String
    "email": "someone@example.com",
String
    "address": "Lisbon",
String
    "city": "Lisbon",
String
    "postal_code": "1750-455",
String
    "fiscal_id": "508025338",
String
    "website": "www.invoicexpress.com",
String
    "country": "Portugal",
String
    "phone": "2313423424",
String
    "fax": "2313423425",
String
    "preferred_contact": {
    "preferred_contact": { ... }
Object
      "name": "Ricardo Pereira",
String
      "email": "someone@example.com",
String
      "phone": "2233442233"
String
    },
    "observations": "Computer Processed",
String
    "open_account_link": "https://www.app.invoicexpress.com/suppliers/1f7bba947948c50e04af20d329db5bc67c38cf89",
String
    "send_options": "1",
String
    "payment_days": "0",
String
    "tax_exemption_code": "M00"
String
  }
}
401 Access denied

The API Key parameter is missing or is incorrectly entered.

(Empty Response)
422 Unprocessable Entity

Some parameters were incorrect.

(Empty Response)

Find by Name

GET /clients/find-by-name.json

Returns a specific client.

Example Request

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

url = URI("https://account_name.app.invoicexpress.com/clients/find-by-name.json?client_name=foo&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": "/clients/find-by-name.json?client_name=foo&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", "/clients/find-by-name.json?client_name=foo&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/clients/find-by-name.json?client_name=foo&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/clients/find-by-name.json?client_name=foo&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))

}

Query Parameters

Name Type Required Description Example
client_name String Required

The client name you want to search. Warning: partial search is not supported.

foo

Responses

200 Success Clients Get
{
  "client": {
  "client": { ... }
Object
    "id": "1",
String
    "name": "Ricardo Pereira",
String
    "email": "someone@example.com",
String
    "address": "Lisbon",
String
    "city": "Lisbon",
String
    "postal_code": "1750-455",
String
    "fiscal_id": "508025338",
String
    "website": "www.invoicexpress.com",
String
    "country": "Portugal",
String
    "phone": "2313423424",
String
    "fax": "2313423425",
String
    "preferred_contact": {
    "preferred_contact": { ... }
Object
      "name": "Ricardo Pereira",
String
      "email": "someone@example.com",
String
      "phone": "2233442233"
String
    },
    "observations": "Computer Processed",
String
    "open_account_link": "https://www.app.invoicexpress.com/suppliers/1f7bba947948c50e04af20d329db5bc67c38cf89",
String
    "send_options": "1",
String
    "payment_days": "0",
String
    "tax_exemption_code": "M00"
String
  }
}
401 Access denied

The API Key parameter is missing or is incorrectly entered.

(Empty Response)
404 Not Found

No client was found with the supplied client name.

(Empty Response)

Find by Code

GET /clients/find-by-code.json

Returns a specific client.

Example Request

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

url = URI("https://account_name.app.invoicexpress.com/clients/find-by-code.json?client_code=foo&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": "/clients/find-by-code.json?client_code=foo&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", "/clients/find-by-code.json?client_code=foo&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/clients/find-by-code.json?client_code=foo&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/clients/find-by-code.json?client_code=foo&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))

}

Query Parameters

Name Type Required Description Example
client_code String Required

The client code you want to search.

foo

Responses

200 Success Clients Get
{
  "client": {
  "client": { ... }
Object
    "id": "1",
String
    "name": "Ricardo Pereira",
String
    "email": "someone@example.com",
String
    "address": "Lisbon",
String
    "city": "Lisbon",
String
    "postal_code": "1750-455",
String
    "fiscal_id": "508025338",
String
    "website": "www.invoicexpress.com",
String
    "country": "Portugal",
String
    "phone": "2313423424",
String
    "fax": "2313423425",
String
    "preferred_contact": {
    "preferred_contact": { ... }
Object
      "name": "Ricardo Pereira",
String
      "email": "someone@example.com",
String
      "phone": "2233442233"
String
    },
    "observations": "Computer Processed",
String
    "open_account_link": "https://www.app.invoicexpress.com/suppliers/1f7bba947948c50e04af20d329db5bc67c38cf89",
String
    "send_options": "1",
String
    "payment_days": "0",
String
    "tax_exemption_code": "M00"
String
  }
}
401 Access denied

The API Key parameter is missing or is incorrectly entered.

(Empty Response)
404 Not Found

No client was found with the supplied client code.

(Empty Response)

List Invoices

POST /clients/:client-id/invoices.json

This method allows you to obtain the invoices for a specific client. You can filter the results by document status, type and if it's archived or not.

Example Body

{
  "filter": {
    "status": [
      "final",
      "settled"
    ],
    "by_type": [
      "Invoice",
      "InvoiceReceipt"
    ],
    "archived": [
      "non_archived"
    ]
  }
}

Example Request

Format:
curl --request POST \
  --url 'https://account_name.app.invoicexpress.com/clients/:client-id/invoices.json?page=42&per_page=42&api_key=YOUR%20API%20KEY%20HERE' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --data '{"filter":{"status":["final","final","final"],"by_type":["Invoice","Invoice","Invoice"],"archived":["non_archived","non_archived","non_archived"]}}'
require 'uri'
require 'net/http'

url = URI("https://account_name.app.invoicexpress.com/clients/:client-id/invoices.json?page=42&per_page=42&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 = "{\"filter\":{\"status\":[\"final\",\"final\",\"final\"],\"by_type\":[\"Invoice\",\"Invoice\",\"Invoice\"],\"archived\":[\"non_archived\",\"non_archived\",\"non_archived\"]}}"

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": "/clients/:client-id/invoices.json?page=42&per_page=42&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({ filter: 
   { status: [ 'final', 'final', 'final' ],
     by_type: [ 'Invoice', 'Invoice', 'Invoice' ],
     archived: [ 'non_archived', 'non_archived', 'non_archived' ] } }));
req.end();
import http.client

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

payload = "{\"filter\":{\"status\":[\"final\",\"final\",\"final\"],\"by_type\":[\"Invoice\",\"Invoice\",\"Invoice\"],\"archived\":[\"non_archived\",\"non_archived\",\"non_archived\"]}}"

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

conn.request("POST", "/clients/:client-id/invoices.json?page=42&per_page=42&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/clients/:client-id/invoices.json?page=42&per_page=42&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 => "{\"filter\":{\"status\":[\"final\",\"final\",\"final\"],\"by_type\":[\"Invoice\",\"Invoice\",\"Invoice\"],\"archived\":[\"non_archived\",\"non_archived\",\"non_archived\"]}}",
  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/clients/:client-id/invoices.json?page=42&per_page=42&api_key=YOUR%20API%20KEY%20HERE"

	payload := strings.NewReader("{\"filter\":{\"status\":[\"final\",\"final\",\"final\"],\"by_type\":[\"Invoice\",\"Invoice\",\"Invoice\"],\"archived\":[\"non_archived\",\"non_archived\",\"non_archived\"]}}")

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

}

Query Parameters

Name Type Required Description Example
page Integer Optional

The page of results you want. Defaults to 1.

42
per_page Integer Optional

The number of results per page. Defaults to 10.

42

Request Body

Name Type Required Description Example
filter Object Optional

Filters to apply on the list.

{
  "filter": {
  "filter": { ... }
Object

Filters to apply on the list.

    "status": [
    "final",
    "final",
    "final"
  ],
Array

[Optional] Document status. For example: draft, final, settled, canceled or second_copy.

    "by_type": [
    "Invoice",
    "Invoice",
    "Invoice"
  ],
Array

[Optional] Document type. For example: Invoice, InvoiceReceipt, SimplifiedInvoice, CreditNote, DebitNote or Receipt.

    "archived": [
    "non_archived",
    "non_archived",
    "non_archived"
  ]
Array

Document archived status. For example: only_archived or non_archived.

  }
}

Path Parameters

Name Type Required Description Example
client-id Integer Required

Filter invoices for this client.

42

Responses

200 Success

The client's invoices.

Clients Client invoices
{
  invoices: [
Array

Client invoices.

    {
    { ... }
Object

Invoice Object

      "id": 541793,
Integer
      "status": "final",
String
      "archived": true,
Boolean
      "type": "Invoice",
String
      "sequence_number": "28/A",
String
      "inverted_sequence_number": "A/28",
String
      "date": "27/06/2017",
String
      "due_date": "27/06/2017",
String
      "reference": "foo",
String
      "observations": "foo",
String
      "retention": "foo",
String
      "permalink": "https://www.app.invoicexpress.com/documents/541793e1ab2ebd5c06def40c346ffbe0ff2b463eb1c0f0",
String
      "saft_hash": "Tdik",
String
      "sum": 1,
Integer
      "discount": 0,
Integer
      "before_taxes": 1,
Integer
      "taxes": 0.07,
Number
      "total": 1.07,
Number
      "currency": "Euro",
String
      "client": {
      "client": { ... }
Object
        "id": 1310176,
Integer
        "name": "John",
String
        "country": "Portugal"
String
      },
      items: [
Array
        {
        { ... }
Object

Items

          "name": " iPhone ",
String
          "description": "foo",
String
          "unit_price": "1.0",
String
          "unit": "foo",
String
          "quantity": "1.0",
String
          "tax": {
          "tax": { ... }
Object
            "id": 31597,
Integer
            "name": "IVA7",
String
            "value": 7
Integer
          },
          "discount": 0,
Integer
          "subtotal": 1,
Integer
          "tax_amount": 0.07,
Number
          "discount_amount": 0,
Integer
          "total": 1.07
Number
        }
      ]
      "sequence_id": "12345",
String
      "tax_exemption": "M01"
String
    }
  ]
  "pagination": {
  "pagination": { ... }
Object

Pagination info.

    "total_entries": 6,
Integer
    "current_page": 1,
Integer
    "total_pages": 1,
Integer
    "per_page": 10
Integer
  }
}
401 Access denied

The API Key parameter is missing or is incorrectly entered.

(Empty Response)
404 Not Found

Client with :client-id not found.

(Empty Response)