API-V2

Application Programming Interface

InvoiceXpress Documentation

List all

GET /invoices.json

Returns all your invoices. You can filter your invoices by passing parameters in the query string. You can also call /invoice_receipts.json/simplified_invoices.json/vat_moss_invoices.json/credit_notes.json/debit_notes.json or /receipts.json which will return only those types of documents. Note: When applying filters use /invoices.json.

Example Request

curl

curl --request GET \
  --url 'https://account_name.app.invoicexpress.com/invoices.json?text=foo&type%5B%5D=Invoice&status%5B%5D=sent&date%5Bfrom%5D=30%2F09%2F2017&date%5Bto%5D=31%2F10%2F2017&due_date%5Bfrom%5D=30%2F09%2F2017&due_date%5Bto%5D=31%2F10%2F2017&total_before_taxes%5Bfrom%5D=100.00&total_before_taxes%5Bto%5D=500.00&non_archived=true&archived=false&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/invoices.json?text=foo&type%5B%5D=Invoice&status%5B%5D=sent&date%5Bfrom%5D=30%2F09%2F2017&date%5Bto%5D=31%2F10%2F2017&due_date%5Bfrom%5D=30%2F09%2F2017&due_date%5Bto%5D=31%2F10%2F2017&total_before_taxes%5Bfrom%5D=100.00&total_before_taxes%5Bto%5D=500.00&non_archived=true&archived=false&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": "/invoices.json?text=foo&type%5B%5D=Invoice&status%5B%5D=sent&date%5Bfrom%5D=30%2F09%2F2017&date%5Bto%5D=31%2F10%2F2017&due_date%5Bfrom%5D=30%2F09%2F2017&due_date%5Bto%5D=31%2F10%2F2017&total_before_taxes%5Bfrom%5D=100.00&total_before_taxes%5Bto%5D=500.00&non_archived=true&archived=false&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", "/invoices.json?text=foo&type%5B%5D=Invoice&status%5B%5D=sent&date%5Bfrom%5D=30%2F09%2F2017&date%5Bto%5D=31%2F10%2F2017&due_date%5Bfrom%5D=30%2F09%2F2017&due_date%5Bto%5D=31%2F10%2F2017&total_before_taxes%5Bfrom%5D=100.00&total_before_taxes%5Bto%5D=500.00&non_archived=true&archived=false&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/invoices.json?text=foo&type%5B%5D=Invoice&status%5B%5D=sent&date%5Bfrom%5D=30%2F09%2F2017&date%5Bto%5D=31%2F10%2F2017&due_date%5Bfrom%5D=30%2F09%2F2017&due_date%5Bto%5D=31%2F10%2F2017&total_before_taxes%5Bfrom%5D=100.00&total_before_taxes%5Bto%5D=500.00&non_archived=true&archived=false&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/invoices.json?text=foo&type%5B%5D=Invoice&status%5B%5D=sent&date%5Bfrom%5D=30%2F09%2F2017&date%5Bto%5D=31%2F10%2F2017&due_date%5Bfrom%5D=30%2F09%2F2017&due_date%5Bto%5D=31%2F10%2F2017&total_before_taxes%5Bfrom%5D=100.00&total_before_taxes%5Bto%5D=500.00&non_archived=true&archived=false&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
textStringSearch for invoice, client or item details.foo
type[]StringRequiredPossible values: InvoiceInvoiceReceiptSimplifiedInvoiceVatMossInvoiceCreditNoteDebitNoteReceiptCashInvoiceVatMossReceipt or VatMossCreditNote.Invoice
status[]StringRequiredPossible values: draftsentsettledcanceled or second_copy.sent
date[from]StringDate in format dd/mm/yyyy. Ex: 30/09/201730%2F09%2F2017
date[to]StringDate in format dd/mm/yyyy. Ex: 31/10/201731%2F10%2F2017
due_date[from]StringDue Date in format dd/mm/yyyy. Ex: 30/09/201730%2F09%2F2017
due_date[to]StringDue Date in format dd/mm/yyyy. Ex: 31/10/201731%2F10%2F2017
total_before_taxes[from]NumberMinimum document amount. Ex: 100.00100.00
total_before_taxes[to]NumberMaximum document amount. Ex: 500.00500.00
non_archivedBooleanRequiredPossible values: true or false.true
archivedBooleanPossible values: true or false.false
pageIntegerYou can ask for a specific page of invoices. 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
referenceStringSearch for the reference detailfb30

Responses

200SUCCESS
Invoices were returned successfully.
Invoices List all
401ACCESS DENIED
The API Key parameter is missing or is incorrectly entered.
(Empty Response)

Example Success Body Response

{
  "invoices": [
    {
      "id": 541793,
      "status": "final",
      "archived": true,
      "type": "Invoice",
      "sequence_number": "28/A",
      "inverted_sequence_number": "A/28",
      "atcud": "ABCD1234-28",
      "date": "27/06/2017",
      "due_date": "27/06/2017",
      "reference": "fb30",
      "observations": "foo",
      "retention": "foo",
      "permalink": "https://www.app.invoicexpress.com/documents/541793e1ab2ebd5c06def40c346ffbe0ff2b463eb1c0f0",
      "saft_hash": "Tdik",
      "sum": 1,
      "discount": 0,
      "before_taxes": 1,
      "taxes": 0.07,
      "total": 1.07,
      "currency": "Euro",
      "client": {
        "id": 1310176,
        "name": "John",
        "country": "Portugal"
      },
      "items": [
        {
          "name": " iPhone ",
          "description": "foo",
          "unit_price": "1.0",
          "unit": "foo",
          "quantity": "1.0",
          "tax": {
            "id": 31597,
            "name": "IVA7",
            "value": 7
          },
          "discount": 0,
          "subtotal": 1,
          "tax_amount": 0.07,
          "discount_amount": 0,
          "total": 1.07
        }
      ],
      "sequence_id": "12345",
      "tax_exemption": "M01"
    }
  ],
  "pagination": {
    "total_entries": 6,
    "current_page": 1,
    "total_pages": 1,
    "per_page": 10
  }
}

Possible values for field atcud:

  • ABCD1234-1 or similar: Unique document identifier to the Tax Authority, when the sequence is registered.
  • N/D: The document’s sequence is relevant for ATCUD but is not registered in the Tax Authority.
  • N/A: The document’s sequence is not relevant for ATCUD and is not registered in the Tax Authority.