API-V2

Application Programming Interface

InvoiceXpress Documentation

List all

GET /clients.json

Returns a list of all your clients.

Example Request

curl

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'

Ruby

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

Node

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

Python

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

<?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;
}

Go

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

NameTypeRequiredDescriptionExample
pageIntegerYou can ask for a specific page of clients. Defaults to 1.1
per_pageStringYou can specify how many results you want to fetch. Defaults to 10 or value defined in account settings (10, 20 or 30).30

Responses

200SUCCESSClients List all
401ACCESS DENIED
The API Key parameter is missing or is incorrectly entered.
(Empty Response)

Example Success Body Response

{
  "clients": [
    {
      "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"
    }
  ],
  "pagination": {
    "total_entries": 6,
    "current_page": 1,
    "total_pages": 1,
    "per_page": 10
  }
}