NAV
python javascript php

Introduction

Welcome to Abillio Business 2 Business API Documentation. Abillio PRO can be integrated into your website by REST API

New unified REST endpoints that mirror the dashboard are published under https://abill.io/api with interactive documentation available at https://abill.io/api/docs. They share the authentication flows described in the Authentication section above.

You can fork our POSTMAN collection, fill in your API Key and Secret in Environment, and start testing our API.

Run In Postman

Authentication

To sign requests, you can use following code:

import base64
import hashlib
import hmac
import json
import time
import requests

API_URL = 'https://api.abill.io'
API_KEY = 'my_api_key'
API_SECRET = 'my_api_secret'


def encode_hmac(key, msg, digestmod=hashlib.sha256):
    return hmac.new(key.encode(), msg=msg, digestmod=digestmod).hexdigest()


def abillio_api_request(endpoint, payload=None, method='GET', params=None):
    nonce = str(int(time.time() * 1000))
    request_path = '/v1/%s/' % endpoint
    payload = payload or {}
    payload.update({'request': request_path, 'nonce': nonce})

    # Encode payload to base64 format and create signature using your API_SECRET 
    encoded_payload = json.dumps(payload).encode()
    b64 = base64.b64encode(encoded_payload)
    signature = encode_hmac(API_SECRET, b64)

    # Add your API key, encoded payload and signature to following headers
    request_headers = {
        'X-ABILLIO-KEY': API_KEY,
        'X-ABILLIO-PAYLOAD': b64,
        'X-ABILLIO-SIGNATURE': signature,
    }

    # Make request
    response = requests.request(method, API_URL + request_path, headers=request_headers, params=params)
    return response.json()


services = abillio_api_request('services', params={'lang': 'en'})
print(json.dumps(services, indent=2))
const axios = require('axios');
const Base64 = require('js-base64').Base64;
const crypto = require('crypto');

const API_URL = 'https://api.abill.io';
const API_KEY = 'my_api_key';
const API_SECRET = 'my_api_secret';

function encode_hmac(key, msg) {
    return crypto.createHmac('sha256', key).update(msg).digest('hex');
}

function abillio_api_request(endpoint, payload = {}, method = 'GET', params = {}) {
    const request_path = '/v1/' + endpoint + '/'
    payload.request = request_path;
    payload.nonce = (new Date).getTime();

    // Encode payload to base64 format and create signature using your API_SECRET
    const encoded_payload = JSON.stringify(payload);
    const b64 = Base64.encode(encoded_payload);
    const signature = encode_hmac(API_SECRET, b64);

    // Add your API key, encoded payload and signature to following headers
    let request_headers = {
        'X-ABILLIO-KEY': API_KEY,
        'X-ABILLIO-PAYLOAD': b64,
        'X-ABILLIO-SIGNATURE': signature,
    };

    return axios({
        method: method,
        url: API_URL + request_path,
        headers: request_headers,
        params: params
    });
}

abillio_api_request('services', {'lang': 'en'}).then(function (response) {
    console.log(response);
}).catch(function (error) {
    console.log(error);
});
<?php
function abillio_api_request($endpoint, $payload = [], $method = 'GET', $params = []){
    $API_URL = 'https://api.abill.io';
    $API_KEY = 'your_api_key';
    $API_SECRET = 'your_secret';

    $request_path = '/v1/' . $endpoint . '/';
    $nonce = (string)round(microtime(true) * 1000);
    $payload = $payload ? json_encode($payload) : '';

    // Create signature data object. Keep order of keys as specified: 
    $signature_data = array(
        'path' => $request_path, 
        'nonce' => $nonce,
        'payload' => $payload,
    );

    // Convert signature data to json + base64 format and create signature using your API_SECRET
    $signature_data = json_encode($signature_data, JSON_UNESCAPED_SLASHES);
    $b64 = base64_encode($signature_data);
    $signature = hash_hmac('sha256', $b64, $API_SECRET);

    // Add your API key, nonce and signature to following headers
    $request_headers = [
        'X-ABILLIO-KEY: ' . $API_KEY,
        'X-ABILLIO-NONCE: ' . $nonce,
        'X-ABILLIO-SIGNATURE: ' . $signature,
    ];

    $url = $API_URL . $request_path;
    if(!empty($params)) {
        $url .= '?' . http_build_query($params);
    }

    $result = file_get_contents($url, null, stream_context_create(array(
        'http' => array(
            'method' => $method,
            'header' => implode("\r\n", $request_headers),
            'ignore_errors' => true,
            'content' => $payload)
        )
    ));

    return $result;
}

$response = abillio_api_request('services', [], 'GET', ['lang' => 'en']);
var_dump($response);

You can obtain API Keys by logging in and creating a key in Profile > API Keys. This will give you both an "API Key" that will serve as your user name, and an "API Secret" that you will use to sign messages.

All requests must contain a nonce, a number that will never be repeated and must increase between requests. This is to prevent an attacker who has captured a previous request from simply replaying that request. We recommend using a timestamp at millisecond or higher precision. The nonce need only be increasing with respect to the session that the message is on.

PAYLOAD

The payload of the requests must be a JSON object, which will be described in the documentation below. Rather than being sent as the body of the POST request, it will be base-64 encoded and stored as a header in the request.

The following three headers is all that is required to make requests to Abillio API:

Header Value
X-ABILLIO-KEY Your Abillio API Key
X-ABILLIO-PAYLOAD Base64-encoded JSON payload
X-ABILLIO-SIGNATURE hex(HMAC_SHA256(base64(payload), key=api_secret))

Account

Information about your account.

Account Settings

account = abillio_api_request('account/settings/')
abillio_api_request('account/settings/').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$response = abillio_api_request('account/settings');
var_dump($response);

The above command returns JSON structured like this:

{
  "result": {
    "id": "<id>",
    "name": "Your Company Name",
    "is_testnet": true,
    "url": "https://abill.io/dashboard/b2b/<company-slug>/"
  }
}

This endpoint retrieves account settings information.

HTTP Request

GET https://api.abill.io/v1/payout_method/settings/

Freelancers

Freelancers created by b2b account.

List Freelancers

freelancers = abillio_api_request('freelancers')
abillio_api_request('freelancers').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$response = abillio_api_request('freelancers');
var_dump($response);

The above command returns JSON structured like this:

{
  "pagination": {
    "num_pages": 1,
    "count": 4,
    "page": 1,
    "next_page": null,
    "previous_page": null,
    "per_page": 25
  },
  "result": [
    {
      "id": "82f6e324-81b5-4148-8ea3-5664853b9c42",
      "email": "roger.elbert@gmail.com",
      "first_name": "Roger",
      "last_name": "Ebert",
      "gender": null,
      "member_data_is_provided": true,
      "payout_method_is_provided": true,
      "payout_method_is_verified": false,
      "payout_methods": [
        {
          "id": "95ac8a23-fe24-48dc-af7d-4b07492d6962",
          "kind": "sepa",
          "name": "My Savings Account",
          "is_verified": true,
          "currency": "EUR",
          "bank_name": "Swedbank",
          "iban": "LV80BANK0000435195001"
        },
        {
          "id": "4224fc29-557e-4389-9bbe-d4461c880039",
          "kind": "swift",
          "name": "My SWIFT Account",
          "is_verified": false,
          "currency": "__ANY__",
          "bank_name": "Swift bank name",
          "bank_address": "Bank address",
          "branch_name": "Branch 1",
          "bic_swift": "ANZBNZ22",
          "account_number": "010804018604500",
          "ach": "1111",
          "wire_routing_number": "222"
        },
        {
          "id": "3a7ca22e-e4e2-498e-9143-603ccf7b38b0",
          "kind": "card",
          "name": "Wirex",
          "is_verified": false,
          "currency": "__ANY__",
          "name_on_card": "Roger Elbert",
          "card_number": "01010101010101101"
        },
        {
          "id": "06fe3859-8230-4bef-8208-87dbb73feff6",
          "kind": "paypal",
          "name": null,
          "is_verified": false,
          "currency": "__ANY__",
          "paypal_email": "roger@elbert.com"
        }
      ],
      "can_send_invoice": false,
      "country": "LT",
      "language": "en",
      "birth_date": "1990-01-01",
      "personal_code": "123456-12345",
      "tax_number": "123456-12345",
      "phone": "+371 12345678",
      "address": "Riga, Latvia",
      "kyc_is_provided": false,
      "kyc_is_pending": false,
      "kyc_is_verified": false,
      "kyc_setup_script": "<script src='https://abill.io/static/widget/abillio-kyc.js' onload='window.abillio_kyc = new AbillioKyc(\"en\",\"https://api.abill.io\", \"<API_KEY_WITH_KYC_WRITE_PERMISSION>\",\"82f6e324-81b5-4148-8ea3-5664853b9c42\", \"<MOUNTING_ELEMENT_ID>\", \"abillio-kyc\", myKycEventHandler);'></script>"
    },
    {
      "id": "58e1eb5b-ba81-4afa-bd9e-e6e0acb810ed",
      "email": "keanu.reeves+test@gmail.com",
      "first_name": "Keanu",
      "last_name": "Reeves",
      "gender": "male",
      "member_data_is_provided": true,
      "payout_method_is_provided": false,
      "payout_method_is_verified": false,
      "payout_methods": [],
      "can_send_invoice": true,
      "country": "LT",
      "language": "en",
      "birth_date": "1990-01-01",
      "personal_code": "123456-12345",
      "tax_number": "123456-12345",
      "phone": "+371 12345678",
      "address": "Riga, Latvia",
      "kyc_is_provided": false,
      "kyc_is_pending": false,
      "kyc_is_verified": false,
      "kyc_setup_script": "<script src='https://abill.io/static/widget/abillio-kyc.js' onload='window.abillio_kyc = new AbillioKyc(\"en\",\"https://api.abill.io\", \"<API_KEY_WITH_KYC_WRITE_PERMISSION>\",\"82f6e324-81b5-4148-8ea3-5664853b9c42\", \"<MOUNTING_ELEMENT_ID>\", \"abillio-kyc\", myKycEventHandler);'></script>"
    },
    {
      "id": "98390d97-fe68-400b-9d9f-34cb1b772d4d",
      "email": "keanu@reeves.com",
      "first_name": "Keanu",
      "last_name": "Reeves",
      "gender": "male",
      "member_data_is_provided": true,
      "payout_method_is_provided": false,
      "payout_method_is_verified": false,
      "payout_methods": [],
      "can_send_invoice": false,
      "country": "FM",
      "language": "lv",
      "birth_date": "1964-09-02",
      "personal_code": "123456-7890",
      "tax_number": "123456-7890",
      "phone": "12345678",
      "address": "Riga, Latvia",
      "kyc_is_provided": false,
      "kyc_is_pending": false,
      "kyc_is_verified": false,
      "kyc_setup_script": "<script src='https://abill.io/static/widget/abillio-kyc.js' onload='window.abillio_kyc = new AbillioKyc(\"en\",\"https://api.abill.io\", \"<API_KEY_WITH_KYC_WRITE_PERMISSION>\",\"82f6e324-81b5-4148-8ea3-5664853b9c42\", \"<MOUNTING_ELEMENT_ID>\", \"abillio-kyc\", myKycEventHandler);'></script>"
    },
    {
      "id": "b3b5f6c5-dffa-41d7-a2e4-37a433198bea",
      "email": "keanu.reeves@gmail.com",
      "first_name": "Keanu",
      "last_name": "Reeves",
      "gender": "male",
      "member_data_is_provided": true,
      "payout_method_is_provided": true,
      "payout_method_is_verified": false,
      "payout_methods": [],
      "can_send_invoice": true,
      "country": "LV",
      "language": "lv",
      "birth_date": "1964-09-02",
      "personal_code": "123456-7890",
      "tax_number": "123456-7890",
      "phone": "+37112345678",
      "address": "Riga, Latvia",
      "kyc_is_provided": false,
      "kyc_is_pending": false,
      "kyc_is_verified": false,
      "kyc_setup_script": "<script src='https://abill.io/static/widget/abillio-kyc.js' onload='window.abillio_kyc = new AbillioKyc(\"en\",\"https://api.abill.io\", \"<API_KEY_WITH_KYC_WRITE_PERMISSION>\",\"82f6e324-81b5-4148-8ea3-5664853b9c42\", \"<MOUNTING_ELEMENT_ID>\", \"abillio-kyc\", myKycEventHandler);'></script>"
    }
  ]
}

This endpoint retrieves all freelancers. Endpoint uses pagination and returns 25 freelancers per page. Freelancers are sorted by creation time in descending order.

HTTP Request

GET https://api.abill.io/v1/freelancers/

Query Parameters

Parameter Default Description
p None Page number.
lang LV Language Available languages
email None Filter by email.

Example

GET https://api.abill.io/v1/freelancers/?email=@gmail

Get Freelancer

freelancer = abillio_api_request('freelancers/fb18a6be-6068-4ad1-af26-ba670f6b8027')
abillio_api_request('freelancers/fb18a6be-6068-4ad1-af26-ba670f6b8027').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$response = abillio_api_request('freelancers/fb18a6be-6068-4ad1-af26-ba670f6b8027');
var_dump($response);

The above command returns JSON structured like this:

{
  "result": {
    "id": "82f6e324-81b5-4148-8ea3-5664853b9c42",
    "email": "roger.elbert@gmail.com",
    "first_name": "Roger",
    "last_name": "Elbert",
    "gender": null,
    "member_data_is_provided": true,
    "payout_method_is_provided": true,
    "payout_method_is_verified": false,
    "payout_methods": [
      {
        "id": "95ac8a23-fe24-48dc-af7d-4b07492d6962",
        "kind": "sepa",
        "name": "My Savings Account",
        "is_verified": true,
        "currency": "EUR",
        "bank_name": "Swedbank",
        "iban": "LV80BANK0000435195001"
      },
      {
        "id": "4224fc29-557e-4389-9bbe-d4461c880039",
        "kind": "swift",
        "name": "My SWIFT Account",
        "is_verified": false,
        "currency": "__ANY__",
        "bank_name": "Swift bank name",
        "bank_address": "Bank address",
        "branch_name": "Branch 1",
        "bic_swift": "ANZBNZ22",
        "account_number": "010804018604500",
        "ach": "1111",
        "wire_routing_number": "222"
      },
      {
        "id": "3a7ca22e-e4e2-498e-9143-603ccf7b38b0",
        "kind": "card",
        "name": "Wirex",
        "is_verified": false,
        "currency": "__ANY__",
        "name_on_card": "Roger Elbert",
        "card_number": "01010101010101101"
      },
      {
        "id": "06fe3859-8230-4bef-8208-87dbb73feff6",
        "kind": "paypal",
        "name": null,
        "is_verified": false,
        "currency": "__ANY__",
        "paypal_email": "roger@elbert.com"
      }
    ],
    "can_send_invoice": false,
    "country": "LT",
    "language": "en",
    "birth_date": "1990-01-01",
    "personal_code": "123456-12345",
    "tax_number": "123456-12345",
    "phone": "+371 12345678",
    "address": "Riga, Latvia",
    "kyc_is_provided": false,
    "kyc_is_pending": false,
    "kyc_is_verified": false,
    "kyc_setup_script": "<script src='https://abill.io/static/widget/abillio-kyc.js' onload='window.abillio_kyc = new AbillioKyc(\"en\",\"https://api.abill.io\", \"<API_KEY_WITH_KYC_WRITE_PERMISSION>\",\"82f6e324-81b5-4148-8ea3-5664853b9c42\", \"<MOUNTING_ELEMENT_ID>\", \"abillio-kyc\", myKycEventHandler);'></script>"
  }
}

This endpoint retrieves a specific freelancer.

HTTP Request

GET https://api.abill.io/v1/freelancers/<ID>/

URL Parameters

Parameter Description
ID The ID of the freelancer to retrieve.

Query Parameters

Parameter Default Description
lang LV Language Available languages

Create Freelancer

This endpoint creates a new user in Abillio and assigns it to your b2b account.

import json

payload = {
    "email": "roger.elbert@gmail.com",
    "first_name": "Roger",
    "last_name": "Elbert",
    "language": "en",
    "gender": "male",
    "country": "LT",
    "birth_date": "1990-01-01",
    "personal_code": "123456-12345",
    "tax_number": "123456-12345",
    "phone": "+371 12345678",
    "address": "Riga, Latvia",
    "payout_method": {
        "kind": "sepa",
        "currency": "EUR",
        "name": "My Savings Account",
        "bank_name": "Swedbank",
        "iban": "LV80BANK0000435195001",
    },
}
freelancer = abillio_api_request('freelancers', payload, 'POST')
print(json.dumps(freelancers, indent=2))
var payload = {
  'email': 'roger.elbert@gmail.com',
  'first_name': 'Roger',
  'last_name': 'Elbert',
  'language': 'en',
  'gender': 'male',
  'country': 'LT',
  'birth_date': '1990-01-01',
  'personal_code': '123456-12345',
  'tax_number': '123456-12345',
  'phone': '+371 12345678',
  'address': 'Riga, Latvia',
  'payout_method': {
    'kind': 'sepa',
    'currency': 'EUR',
    'name': 'My Savings Account',
    'bank_name': 'Swedbank',
    'iban': 'LV80BANK0000435195001',
  },
}
abillio_api_request('freelancers', payload, 'POST').then(function(response) {
  console.log(response)
}).catch(function(error) {
  console.log(error)
})
$payload = array(
     "email"=>"roger.elbert@gmail.com",
    "first_name"=>"Roger",
    "last_name"=>"Elbert",
    "language"=>"en",
    "gender"=>"male",
    "country"=>"LT",
    "birth_date"=>"1990-01-01",
    "personal_code"=>"123456-12345",
    "tax_number"=>"123456-12345",
    "phone"=>"+371 12345678",
    "address"=>"Riga, Latvia",
    "payout_method" => array(
            "kind" => "sepa",
            "currency" => "EUR",
            "name" => "My Savings Account",
            "bank_name" => "Swedbank",
            "iban" => "LV80BANK0000435195001",
    ),
);
$response = abillio_api_request('freelancers', $payload, 'POST');
var_dump($response);

JSON response for Create Freelancer endpoint:

{
  "result": {
    "id": "82f6e324-81b5-4148-8ea3-5664853b9c42",
    "email": "roger.elbert@gmail.com",
    "first_name": "Roger",
    "last_name": "Elbert",
    "gender": null,
    "member_data_is_provided": true,
    "payout_method_is_provided": true,
    "payout_method_is_verified": false,
    "payout_methods": [
      {
        "id": "95ac8a23-fe24-48dc-af7d-4b07492d6962",
        "kind": "sepa",
        "name": "My Savings Account",
        "is_verified": true,
        "currency": "EUR",
        "bank_name": "Swedbank",
        "iban": "LV80BANK0000435195001"
      },
      {
        "id": "4224fc29-557e-4389-9bbe-d4461c880039",
        "kind": "swift",
        "name": "My SWIFT Account",
        "is_verified": false,
        "currency": "__ANY__",
        "bank_name": "Swift bank name",
        "bank_address": "Bank address",
        "branch_name": "Branch 1",
        "bic_swift": "ANZBNZ22",
        "account_number": "010804018604500",
        "ach": "1111",
        "wire_routing_number": "222"
      },
      {
        "id": "3a7ca22e-e4e2-498e-9143-603ccf7b38b0",
        "kind": "card",
        "name": "Wirex",
        "is_verified": false,
        "currency": "__ANY__",
        "name_on_card": "Roger Elbert",
        "card_number": "01010101010101101"
      },
      {
        "id": "06fe3859-8230-4bef-8208-87dbb73feff6",
        "kind": "paypal",
        "name": null,
        "is_verified": false,
        "currency": "__ANY__",
        "paypal_email": "roger@elbert.com"
      }
    ],
    "can_send_invoice": false,
    "country": "LT",
    "language": "en",
    "birth_date": "1990-01-01",
    "personal_code": "123456-12345",
    "tax_number": "123456-12345",
    "phone": "+371 12345678",
    "address": "Riga, Latvia",
    "kyc_is_provided": false,
    "kyc_is_pending": false,
    "kyc_is_verified": false,
    "kyc_setup_script": "<script src='https://abill.io/static/widget/abillio-kyc.js' onload='window.abillio_kyc = new AbillioKyc(\"en\",\"https://api.abill.io\", \"<API_KEY_WITH_KYC_WRITE_PERMISSION>\",\"82f6e324-81b5-4148-8ea3-5664853b9c42\", \"<MOUNTING_ELEMENT_ID>\", \"abillio-kyc\", myKycEventHandler);'></script>"
  }
}

HTTP Request

POST https://api.abill.io/v1/freelancers/

Payload Parameters

Parameter Description Required
email Real user email address Yes
first_name Freelancer first name Yes
last_name Freelancer last name Yes
language Freelancer UI language Available languages Yes
country Freelancer country Supported countries Yes
birth_date Freelancer birth date in format YYYY-M-D example: 1990-01-01 Yes
personal_code Freelancer personal code Yes
tax_number Freelancer tax number No
phone Freelancer contact phone No
address Freelancer address Yes
payout_method Bank Account Object Yes

Bank Account object parameters

Parameter Description Required
kind Bank Account kind, "sepa", "swift", "card", "paypal" Yes
currency Account currency Available Values If None, account is multicurrency No
name String. User friendly account name. Example "My Savings Account" No
iban IBAN Yes if sepa
bank_name String. Name of the bank Yes if swift
bic_swift BIC/SWIFT. Required for swift accounts Yes if swift
account_number Required for swift accounts Yes if swift
ach For swift accounts No
wire_routing_number For swift accounts No
branch_name For swift accounts No
bank_address For swift accounts No
card_number For card accounts Yes if card
name_on_card For card accounts Yes if card
paypal_email For paypal accounts Yes if paypal

Query Parameters

Parameter Default Description
lang LV Language Available languages

Invites

Our system enables PRO accounts to send out invites to freelancers, inviting them to join your PRO account. When a freelancer accepts your invitation, they can set up an account on Abillio and will automatically be associated with your PRO account. This integration allows you to seamlessly generate invoices for services rendered by these freelancers directly to your company.

List Invites

invites = abillio_api_request('invites')
abillio_api_request('invites').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$response = abillio_api_request('invites');
var_dump($response);

The above command returns JSON structured like this:

{
  "pagination": {
    "num_pages": 1,
    "count": 3,
    "page": 1,
    "next_page": null,
    "previous_page": null,
    "per_page": 25
  },
  "result": [
    {
      "id": "93ff9554-f4b9-4ddb-ae05-79252ed06998",
      "email": "roger.elbert@gmail.com",
      "is_sent": false,
      "is_accepted": true,
      "is_expired": false,
      "expires_at": "2024-01-27T19:07:57.568990+00:00",
      "freelancer_id": "82f6e324-81b5-4148-8ea3-5664853b9c42",
      "accept_url": "https://abillio.dev/accept_invite/93ff9554-f4b9-4ddb-ae05-79252ed06998/"
    },
    {
      "id": "3ae1f3b5-228f-44e1-b191-fd23cbe44257",
      "email": "keanu.reeves+test@gmail.com",
      "is_sent": true,
      "is_accepted": true,
      "is_expired": false,
      "expires_at": "2024-01-23T12:25:26.445747+00:00",
      "freelancer_id": "58e1eb5b-ba81-4afa-bd9e-e6e0acb810ed",
      "accept_url": "https://abillio.dev/accept_invite/3ae1f3b5-228f-44e1-b191-fd23cbe44257/"
    },
    {
      "id": "e8474a4a-e145-4c0c-90b7-912afff69b25",
      "email": "keanu@reeves.com",
      "is_sent": true,
      "is_accepted": true,
      "is_expired": false,
      "expires_at": "2024-01-27T18:30:25.786773+00:00",
      "freelancer_id": "98390d97-fe68-400b-9d9f-34cb1b772d4d",
      "accept_url": "https://abillio.dev/accept_invite/e8474a4a-e145-4c0c-90b7-912afff69b25/"
    }
  ]
}

This endpoint retrieves all invites. Endpoint uses pagination and returns 25 invites per page. Invites are sorted by creation time in descending order.

HTTP Request

GET https://api.abill.io/v1/invites/

Query Parameters

Parameter Default Description
p None Page number.
lang LV Language Available languages
email None Filter by email.

Example

GET https://api.abill.io/v1/invites/?email=@gmail

Get Freelancer Invite

invite = abillio_api_request('invites/93ff9554-f4b9-4ddb-ae05-79252ed06998')
abillio_api_request('invites/93ff9554-f4b9-4ddb-ae05-79252ed06998').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$response = abillio_api_request('invites/93ff9554-f4b9-4ddb-ae05-79252ed06998');
var_dump($response);

The above command returns JSON structured like this:

{
  "result": {
    "id": "93ff9554-f4b9-4ddb-ae05-79252ed06998",
    "email": "roger.elbert@gmail.com",
    "is_sent": false,
    "is_accepted": true,
    "is_expired": false,
    "expires_at": "2024-01-27T19:07:57.568990+00:00",
    "freelancer_id": "82f6e324-81b5-4148-8ea3-5664853b9c42",
    "accept_url": "https://abillio.dev/accept_invite/93ff9554-f4b9-4ddb-ae05-79252ed06998/"
  }
}

This endpoint retrieves a specific freelancer invite.

HTTP Request

GET https://api.abill.io/v1/invites/<ID>/

URL Parameters

Parameter Description
ID The ID of the freelancer invite to retrieve.

Query Parameters

Parameter Default Description
lang LV Language Available languages

Create Freelancer Invite

This endpoint creates a new user invite in Abillio user must register or login in Abillio to accept invite to be added to your b2b account.

import json

payload = {
    "email": "roger.elbert@gmail.com",
}
invite = abillio_api_request('invites', payload, 'POST')
print(json.dumps(invites, indent=2))
var payload = {
  "email": "roger.elbert@gmail.com",
}
abillio_api_request('invites', payload, 'POST').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$payload = array(
     "email"=>"roger.elbert@gmail.com",
);
$response = abillio_api_request('invites', $payload, 'POST');
var_dump($response);

JSON response for Create Freelancer endpoint:

{
  "result": {
    "id": "93ff9554-f4b9-4ddb-ae05-79252ed06998",
    "email": "roger.elbert@gmail.com",
    "is_sent": false,
    "is_accepted": true,
    "is_expired": false,
    "expires_at": "2024-01-27T19:07:57.568990+00:00",
    "freelancer_id": "82f6e324-81b5-4148-8ea3-5664853b9c42",
    "accept_url": "https://abillio.dev/accept_invite/93ff9554-f4b9-4ddb-ae05-79252ed06998/"
  }
}

HTTP Request

POST https://api.abill.io/v1/invites/

Payload Parameters

Parameter Description Required
email Real user email address Yes

Query Parameters

Parameter Default Description
lang LV Language Available languages

Services

Service items provided by Abillio. Service item IDs are used in invoices. The endpoint returns a flat list of service items (previously returned grouped service groups with nested services).

List Services

services = abillio_api_request('services')
abillio_api_request('services').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$response = abillio_api_request('services');
var_dump($response);

The above command returns JSON structured like this:

{
  "pagination":{
    "num_pages":1,
    "count":2,
    "page": 1,
    "next_page": null,
    "previous_page": null,
    "per_page": 25
  },
  "result":[
    {
      "id":1,
      "name":"Data and text processing",
      "group":"Administrative and client support",
      "vat":null,
      "supports_royalties":false,
      "is_unsuported":false,
      "unsupported":null
    },
    {
      "id":84,
      "name":"Data and text entry",
      "group":"Administrative and client support",
      "vat":null,
      "supports_royalties":false,
      "is_unsuported":false,
      "unsupported":null
    },
    {
      "id":178,
      "name":"Document preparation",
      "group":"Administrative and client support",
      "vat":null,
      "supports_royalties":false,
      "is_unsuported":false,
      "unsupported":null
    }
  ]
}

This endpoint retrieves all service items. Service items are filtered by plan availability based on country if the country parameter is provided. Endpoint uses pagination and returns 25 service items per page. Service items are sorted by group, then by order number, then by ID.

HTTP Request

GET https://api.abill.io/v1/services/

Query Parameters

Parameter Default Description
p None Page number.
lang LV Language Available languages
country None Filter by supported country (filters service items by plan availability).
group None Filter by service item group name.
name None Filter by service item name.

Example

GET https://api.abill.io/v1/services/?country=LV&group=Learning&name=Dancing

Get Service

service = abillio_api_request('services/1')
abillio_api_request('services/1').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$response = abillio_api_request('services/1');
var_dump($response);

The above command returns JSON structured like this:

{
  "result": {
    "id": 1,
    "name": "Data and text processing",
    "group": "Administrative and client support",
    "vat": null,
    "supports_royalties": false,
    "is_unsuported": false,
    "unsupported": null
  }
}

This endpoint retrieves a specific service item.

HTTP Request

GET https://api.abill.io/v1/services/<ID>/

URL Parameters

Parameter Description
ID The ID of the service item to retrieve.

Query Parameters

Parameter Default Description
lang LV Language Available languages
country None Filter by supported country.

Invoices

Invoices created by b2b account or by your freelancers.

List Invoices

invoices = abillio_api_request('invoices')
abillio_api_request('invoices').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$response = abillio_api_request('invoices');
var_dump($response);

The above command returns JSON structured like this:

{
  "pagination": {
    "num_pages": 1,
    "count": 1,
    "page": 1,
    "next_page": null,
    "previous_page": null,
    "per_page": 25
  },
  "result": [
    {
      "id": "fb18a6be-6068-4ad1-af26-ba670f6b8027",
      "invoice_nr": "M53Z-J9Z6-8",
      "kind": "advance",
      "status": "approved",
      "created_at": "2023-10-29T21:20:40.665480+00:00",
      "updated_at": "2023-10-29T21:20:40.763379+00:00",
      "sent_at": null,
      "sent_final_invoice_at": null,
      "invoiced_at": "2023-10-29",
      "due_date": "2023-11-12",
      "payment_date": null,
      "paid_at": null,
      "reject_reason": null,
      "client": {
        "id": "5cec5d2a-1ba6-4e36-abf6-18260e4ea2eb",
        "name": "SIA \"PIXELS\"",
        "is_vat_payer": false,
        "reg_nr": "40103564678",
        "vat_nr": null,
        "kind": "legal",
        "currency": "EUR",
        "country": "LV"
      },
      "contact_person": "Mr Accountant",
      "email": "keanu.reeves@my-company.com",
      "accounting_email": "accounting@my-company.com",
      "payout_method": null,
      "currency": "EUR",
      "language": "lv",
      "payment_penalty_percent": "0.01",
      "notes": null,
      "service_group": "Administrative and client support",
      "service_group_id": 29,
      "subtotal": "100.00",
      "total": "120.00",
      "total_without_vat": "100.00",
      "vat": "20.00",
      "commission": "5.00",
      "footer": null,
      "discount_kind": "%",
      "discount": "0.00",
      "credit_bill": null,
      "items": [
        {
          "service": "Focus puller services",
          "service_item_id": 1,
          "unit": "gab.",
          "currency": "EUR",
          "description": "My description about service",
          "amount": 1.0,
          "rate": 100.0,
          "subtotal": 100.0,
          "vat": 20.0,
          "total": 120.0
        }
      ],
      "invoice_pdf": "https://abill.io/pdf/invoice/fb18a6be-6068-4ad1-af26-ba670f6b8027/download/",
      "payment_details": [
        {
          "country": "LV",
          "currency": "EUR",
          "name": "AS Citadele - Abillio Services",
          "bank_name": "AS Citadele banka",
          "iban": "LV71PARX0027111580001",
          "bic": "PARXLV22",
          "ach": null,
          "wire_routing_number": null,
          "branch_name": null,
          "bank_address": null
        },
        {
          "country": "LV",
          "currency": "EUR",
          "name": "AS SEB Banka - Abillio Services",
          "bank_name": "AS SEB Banka",
          "iban": "LV86UNLA0055002633556",
          "bic": "UNLALV2X",
          "ach": null,
          "wire_routing_number": null,
          "branch_name": null,
          "bank_address": null
        },
        {
          "country": "LV",
          "currency": "EUR",
          "name": "AS Swedbank - Abillio Services",
          "bank_name": "AS Swedbank",
          "iban": "LV37HABA0551050123907",
          "bic": "HABALV22",
          "ach": null,
          "wire_routing_number": null,
          "branch_name": null,
          "bank_address": null
        }
      ]
    }
  ]
}

This endpoint retrieves all invoices. Endpoint uses pagination and returns 25 invoices per page. Invoices are sorted by creation time in descending order.

HTTP Request

GET https://api.abill.io/v1/invoices/

Query Parameters

Parameter Default Description
lang LV Language Available languages
p None Page number.
status None Filter by status. Available values: draft, sent, pending, approved, overdue, rejected, partial_paid, paid, over_paid, canceled, forbidden.
invoice_nr None Filter by invoice nr.

Example

GET https://api.abill.io/v1/invoices/?status=approved&invoice_nr=M53Z-J9Z6

Get Invoice

invoice = abillio_api_request('invoices/fb18a6be-6068-4ad1-af26-ba670f6b8027')
abillio_api_request('invoices/fb18a6be-6068-4ad1-af26-ba670f6b8027').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$response = abillio_api_request('invoices/fb18a6be-6068-4ad1-af26-ba670f6b8027');
var_dump($response);

The above command returns JSON structured like this:

{
  "id": "fb18a6be-6068-4ad1-af26-ba670f6b8027",
  "invoice_nr": "M53Z-J9Z6-8",
  "kind": "advance",
  "status": "approved",
  "created_at": "2023-10-29T21:20:40.665480+00:00",
  "updated_at": "2023-10-29T21:20:40.763379+00:00",
  "sent_at": null,
  "sent_final_invoice_at": null,
  "invoiced_at": "2023-10-29",
  "due_date": "2023-11-12",
  "payment_date": null,
  "paid_at": null,
  "reject_reason": null,
  "client": {
    "id": "5cec5d2a-1ba6-4e36-abf6-18260e4ea2eb",
    "name": "SIA \"PIXELS\"",
    "is_vat_payer": false,
    "reg_nr": "40103564678",
    "vat_nr": null,
    "kind": "legal",
    "currency": "EUR",
    "country": "LV"
  },
  "contact_person": "Mr Accountant",
  "email": "keanu.reeves@my-company.com",
  "accounting_email": "accounting@my-company.com",
  "payout_method": null,
  "currency": "EUR",
  "language": "lv",
  "payment_penalty_percent": "0.01",
  "notes": null,
  "service_group": "Administrative and client support",
  "service_group_id": 29,
  "subtotal": "100.00",
  "total": "120.00",
  "total_without_vat": "100.00",
  "vat": "20.00",
  "commission": "5.00",
  "footer": null,
  "discount_kind": "%",
  "discount": "0.00",
  "credit_bill": null,
  "items": [
    {
      "service": "Focus puller services",
      "service_item_id": 1,
      "unit": "gab.",
      "currency": "EUR",
      "description": "My description about service",
      "amount": 1.0,
      "rate": 100.0,
      "subtotal": 100.0,
      "vat": 20.0,
      "total": 120.0
    }
  ],
  "invoice_pdf": "https://abill.io/pdf/invoice/fb18a6be-6068-4ad1-af26-ba670f6b8027/download/",
  "payment_details": [
    {
      "country": "LV",
      "currency": "EUR",
      "name": "AS Citadele - Abillio Services",
      "bank_name": "AS Citadele banka",
      "iban": "LV71PARX0027111580001",
      "bic": "PARXLV22",
      "ach": null,
      "wire_routing_number": null,
      "branch_name": null,
      "bank_address": null
    },
    {
      "country": "LV",
      "currency": "EUR",
      "name": "AS SEB Banka - Abillio Services",
      "bank_name": "AS SEB Banka",
      "iban": "LV86UNLA0055002633556",
      "bic": "UNLALV2X",
      "ach": null,
      "wire_routing_number": null,
      "branch_name": null,
      "bank_address": null
    },
    {
      "country": "LV",
      "currency": "EUR",
      "name": "AS Swedbank - Abillio Services",
      "bank_name": "AS Swedbank",
      "iban": "LV37HABA0551050123907",
      "bic": "HABALV22",
      "ach": null,
      "wire_routing_number": null,
      "branch_name": null,
      "bank_address": null
    }
  ]
}

This endpoint retrieves a specific invoice.

HTTP Request

GET https://api.abill.io/v1/invoices/<ID>/

URL Parameters

Parameter Description
ID The ID of the invoice to retrieve.

Query Parameters

Parameter Default Description
lang LV Language Available languages

Create Invoice

import json

payload = {
    "freelancer": "keanu.reeves+test@gmail.com",
    "currency": "EUR",
    "payout_method": "__ANY__",
    "items": [
        {
            "service_item_id": 1,
            "description": "My description about service",
            "amount": 1.0,
            "rate": 100.0,
        }
    ],
}
invoice = abillio_api_request('invoices', payload, 'POST')
print(json.dumps(invoice, indent=2))
var payload = {
  "freelancer": "keanu.reeves+test@gmail.com",
  "currency": "EUR",
  "payout_method": "__ANY__",
  "items": [
    {
      "service_item_id": 1,
      "description": "My description about service",
      "amount": 1.0,
      "rate": 100.0,
    }
  ],
}
abillio_api_request('invoices', payload, 'POST').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$payload = array(
    "freelancer" => "keanu.reeves+test@gmail.com",
    "currency" => "EUR",
    "payout_method" => "__ANY__",
    "items" => array(
        array(
            "service_item_id" => 1,
            "description" => "My description about service",
            "amount" => 1.0,
            "rate" => 100.0,
        )
    ),
);
$response = abillio_api_request('invoices', $payload, 'POST');
var_dump($response);

JSON response for Create Invoice endpoint:

{
  "id": "fb18a6be-6068-4ad1-af26-ba670f6b8027",
  "invoice_nr": "M53Z-J9Z6-8",
  "kind": "advance",
  "status": "approved",
  "created_at": "2023-10-29T21:20:40.665480+00:00",
  "updated_at": "2023-10-29T21:20:40.763379+00:00",
  "sent_at": null,
  "sent_final_invoice_at": null,
  "invoiced_at": "2023-10-29",
  "due_date": "2023-11-12",
  "payment_date": null,
  "paid_at": null,
  "reject_reason": null,
  "client": {
    "id": "5cec5d2a-1ba6-4e36-abf6-18260e4ea2eb",
    "name": "SIA \"PIXELS\"",
    "is_vat_payer": false,
    "reg_nr": "40103564678",
    "vat_nr": null,
    "kind": "legal",
    "currency": "EUR",
    "country": "LV"
  },
  "contact_person": "Mr Accountant",
  "email": "keanu.reeves@my-company.com",
  "accounting_email": "accounting@my-company.com",
  "payout_method": null,
  "currency": "EUR",
  "language": "lv",
  "payment_penalty_percent": "0.01",
  "notes": null,
  "service_group": "Administrative and client support",
  "service_group_id": 29,
  "subtotal": "100.00",
  "total": "120.00",
  "total_without_vat": "100.00",
  "vat": "20.00",
  "commission": "5.00",
  "footer": null,
  "discount_kind": "%",
  "discount": "0.00",
  "credit_bill": null,
  "items": [
    {
      "service": "Focus puller services",
      "service_item_id": 1,
      "unit": "gab.",
      "currency": "EUR",
      "description": "My description about service",
      "amount": 1.0,
      "rate": 100.0,
      "subtotal": 100.0,
      "vat": 20.0,
      "total": 120.0
    }
  ],
  "invoice_pdf": "https://abill.io/pdf/invoice/fb18a6be-6068-4ad1-af26-ba670f6b8027/download/",
  "payment_details": [
    {
      "country": "LV",
      "currency": "EUR",
      "name": "AS Citadele - Abillio Services",
      "bank_name": "AS Citadele banka",
      "iban": "LV71PARX0027111580001",
      "bic": "PARXLV22",
      "ach": null,
      "wire_routing_number": null,
      "branch_name": null,
      "bank_address": null
    },
    {
      "country": "LV",
      "currency": "EUR",
      "name": "AS SEB Banka - Abillio Services",
      "bank_name": "AS SEB Banka",
      "iban": "LV86UNLA0055002633556",
      "bic": "UNLALV2X",
      "ach": null,
      "wire_routing_number": null,
      "branch_name": null,
      "bank_address": null
    },
    {
      "country": "LV",
      "currency": "EUR",
      "name": "AS Swedbank - Abillio Services",
      "bank_name": "AS Swedbank",
      "iban": "LV37HABA0551050123907",
      "bic": "HABALV22",
      "ach": null,
      "wire_routing_number": null,
      "branch_name": null,
      "bank_address": null
    }
  ]
}

This endpoint creates an invoice. Response is identical to Get Invoice endpoint response.

HTTP Request

POST https://api.abill.io/v1/invoices/

Payload Parameters

Parameter Description Required
freelancer Registered freelancer email or id Yes
currency Invoice currency Available Values Yes
language Invoice language, if not provided client language is used No
payout_method Freelancer bank account ID or iban to enable auto payout. You also can provide __ANY__ so that first verified users bank account is selected Yes
items Array of Items objects Yes
discount Invoice discount amount No
discount_kind Invoice discount kind % or amount No
notes Invoice notes No

Query Parameters

Parameter Default Description
lang LV Language Available languages

Items object parameters

Parameter Description Required
service_item_id Service item ID Get from services endpoint Yes
description Custom description of provided service Yes
amount Amount of units Yes
rate Price per unit Yes

Countries

Following is a endpoint for retrieving all supported countries.

List Countries

countries = abillio_api_request('countries')
abillio_api_request('countries').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$response = abillio_api_request('countries');
var_dump($response);

The above command returns JSON structured like this:

{
  "result": [
   {
      "id": "LV",
      "name": "Latvia",
      "flag": "🇱🇻"
    },
    {
      "id": "LT",
      "name": "Lithuania",
      "flag": "🇱🇹"
    },
    {
      "id": "EE",
      "name": "Estonia",
      "flag": "🇪🇪"
    },
    {
      "id": "PL",
      "name": "Poland",
      "flag": "🇵🇱"
    },
    {
      "id": "CH",
      "name": "Switzerland",
      "flag": "🇨🇭"
    },
    ...
  ]
}

This endpoint retrieves all countries.

HTTP Request

GET https://api.abill.io/v1/countries/

Query Parameters

Parameter Default Description
p None Page number.
lang LV Language Available languages

Currencies

Currencies provided by Abillio. ID (code) of currencies are widely used. Abillio uses only currencies that are enabled for invoicing - is_payment_currency parameter.

List Currencies

currencies = abillio_api_request('currencies')
abillio_api_request('currencies').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$response = abillio_api_request('currencies');
var_dump($response);

The above command returns JSON structured like this:

{
  "result": [
    {
      "id": "AUD",
      "symbol": "$",
      "title": "Australian Dollar",
      "network": null,
      "kind": "fiat",
      "is_payment_currency": true,
      "rate_eur": "0.6038639620027264",
      "rate_usd": "0.6367722534299786",
      "rate_btc": "0.00002297351751298739",
      "updated_at": "2023-10-06T15:00:06.759940+00:00",
      "rates": {
        "BGN": 1.1772710830661675,
        "BRL": 3.290597508480397,
        "BTC": 0.00002297351751298739,
        "CAD": 0.8730467375448759,
        "CHF": 0.5812266911352602,
        "CNY": 4.650386496887946,
        "CZK": 14.745056534266164,
        "DKK": 4.5023560157972184,
        "EUR": 0.6038639620027264,
        "GBP": 0.5225863569531127,
        "HKD": 4.9858065574639445,
        "HRK": 4.485169923706895,
        "HUF": 233.92722202604858,
        "IDR": 9934.537304550087,
        "ILS": 2.461398852840199,
        "INR": 52.99293918547953,
        "ISK": 87.440308572144,
        "JPY": 94.54331293249852,
        "KRW": 855.3705083730074,
        "MXN": 11.641516086795336,
        "MYR": 3.010226809263672,
        "NOK": 6.982444676377066,
        "NZD": 1.0674341918968147,
        "PHP": 36.10444461080722,
        "PLN": 2.7777029149172683,
        "RON": 3.000668683927412,
        "RUB": 63.13217766132907,
        "SEK": 7.0146332855121765,
        "SGD": 0.8705505415827344,
        "THB": 23.522689066423204,
        "TRY": 17.55918785796862,
        "USD": 0.6367722534299786,
        "ZAR": 12.430254900943929
      }
    },
    {
      "id": "CAD",
      "symbol": "$",
      "title": "Canadian Dollar",
      "network": null,
      "kind": "fiat",
      "is_payment_currency": true,
      "rate_eur": "0.6916742667189531",
      "rate_usd": "0.7293678861004248",
      "rate_btc": "0.00002631418975070222",
      "updated_at": "2023-10-06T15:00:06.784429+00:00",
      "rates": {
        "AUD": 1.1454140505835158,
        "BGN": 1.3484628398896616,
        "BRL": 3.7690966210285564,
        "BTC": 0.000026314189750702224,
        "CHF": 0.6657452186004924,
        "CNY": 5.326618034179309,
        "CZK": 16.889194930996744,
        "DKK": 5.157061841223352,
        "EUR": 0.6916742667189532,
        "GBP": 0.598577755897348,
        "HKD": 5.710812884410632,
        "HRK": 5.137376649868473,
        "HUF": 267.94352692260577,
        "IDR": 11379.158614677759,
        "ILS": 2.8193208301333113,
        "INR": 60.69885712476602,
        "ISK": 100.15535802589199,
        "JPY": 108.29123902159802,
        "KRW": 979.7533987452075,
        "MXN": 13.334356095909408,
        "MYR": 3.447956082773795,
        "NOK": 7.997790239744361,
        "NZD": 1.2226541214718725,
        "PHP": 41.35453814573289,
        "PLN": 3.181619947093027,
        "RON": 3.4370080717164044,
        "RUB": 72.31248333722108,
        "SEK": 8.034659524916458,
        "SGD": 0.9971408220719532,
        "THB": 26.94321856418838,
        "TRY": 20.112540489352728,
        "USD": 0.7293678861004248,
        "ZAR": 14.237788615875784
      }
    },
    {
      "id": "EUR",
      "symbol": "€",
      "title": "Euro",
      "network": null,
      "kind": "fiat",
      "is_payment_currency": true,
      "rate_eur": "1.0000000000000000",
      "rate_usd": "1.0544962003000000",
      "rate_btc": "0.00003804419365711986",
      "updated_at": "2023-10-06T15:00:06.820185+00:00",
      "rates": {
        "AUD": 1.6560021179,
        "BGN": 1.9495634069,
        "BRL": 5.4492364432,
        "BTC": 0.00003804419365711986,
        "CAD": 1.4457672464,
        "CHF": 0.9625126315,
        "CNY": 7.7010498879,
        "CZK": 24.4178448493,
        "DKK": 7.4559110977,
        "GBP": 0.8654041139,
        "HKD": 8.2565062186,
        "HRK": 7.4274508928,
        "HUF": 387.3839751096,
        "IDR": 16451.6148166915,
        "ILS": 4.0760817133,
        "INR": 87.7564195249,
        "ISK": 144.8013361853,
        "JPY": 156.5639264495,
        "KRW": 1416.4953734549,
        "MXN": 19.2783752953,
        "MYR": 4.9849419715,
        "NOK": 11.5629431722,
        "NZD": 1.7676732825,
        "PHP": 59.7890367411,
        "PLN": 4.59988191,
        "RON": 4.9691136957,
        "RUB": 104.5470199148,
        "SEK": 11.6162475771,
        "SGD": 1.4416335406,
        "THB": 38.9536229127,
        "TRY": 29.0780522814,
        "USD": 1.0544962003,
        "ZAR": 20.584528442
      }
    },
    {
      "id": "GBP",
      "symbol": "£",
      "title": "British Pound Sterling",
      "network": null,
      "kind": "fiat",
      "is_payment_currency": true,
      "rate_eur": "1.1555295196060888",
      "rate_usd": "1.2185014877591050",
      "rate_btc": "0.00004396118882041272",
      "updated_at": "2023-10-06T15:00:06.827109+00:00",
      "rates": {
        "AUD": 1.9135593317636526,
        "BGN": 2.252778067016767,
        "BRL": 6.296753569430888,
        "BTC": 0.00004396118882041272,
        "CAD": 1.6706267316948098,
        "CHF": 1.1122117586919873,
        "CNY": 8.89879047742761,
        "CZK": 28.215540528527637,
        "DKK": 8.615525368950987,
        "EUR": 1.1555295196060889,
        "HKD": 9.540636664403543,
        "HRK": 8.582638762054998,
        "HUF": 447.63361866149313,
        "IDR": 19010.32656587594,
        "ILS": 4.710032744044712,
        "INR": 101.40513329595808,
        "ISK": 167.32221844051946,
        "JPY": 180.91423871783377,
        "KRW": 1636.8022184125878,
        "MXN": 22.276731743763897,
        "MYR": 5.760247601591623,
        "NOK": 13.36132216900477,
        "NZD": 2.0425986589477434,
        "PHP": 69.08799690315408,
        "PLN": 5.3152993337070376,
        "RON": 5.741957561660257,
        "RUB": 120.80716769839705,
        "SEK": 13.422916982391754,
        "SGD": 1.665850112617543,
        "THB": 45.012061171228964,
        "TRY": 33.60054778380688,
        "USD": 1.218501487759105,
        "ZAR": 23.78603026190213
      }
    },
    {
      "id": "USD",
      "symbol": "$",
      "title": "US Dollar",
      "network": null,
      "kind": "fiat",
      "is_payment_currency": true,
      "rate_eur": "0.9483201548905572",
      "rate_usd": "1.0000000000000000",
      "rate_btc": "0.00003607807562160625",
      "updated_at": "2023-10-06T15:00:07.008380+00:00",
      "rates": {
        "AUD": 1.5704201849460186,
        "BGN": 1.8488102720003703,
        "BRL": 5.167620747850693,
        "BTC": 0.000036078075621606256,
        "CAD": 1.3710502190417424,
        "CHF": 0.9127701277881978,
        "CNY": 7.303060822513236,
        "CZK": 23.155934409581768,
        "DKK": 7.070590767021088,
        "EUR": 0.9483201548905571,
        "GBP": 0.8206801633365735,
        "HKD": 7.8298112560776,
        "HRK": 7.0436013811021025,
        "HUF": 367.3640312780556,
        "IDR": 15601.39791116467,
        "ILS": 3.8654304417032233,
        "INR": 83.22118135649387,
        "ISK": 137.3180255596033,
        "JPY": 148.47272698086363,
        "KRW": 1343.2911119565083,
        "MXN": 18.282071846077184,
        "MYR": 4.727320942533319,
        "NOK": 10.965372060051415,
        "NZD": 1.6763202010562996,
        "PHP": 56.69914858307716,
        "PLN": 4.362160725369471,
        "RON": 4.712310669575013,
        "RUB": 99.1440461189493,
        "SEK": 11.015921701562531,
        "SGD": 1.3671301425172144,
        "THB": 36.94050571412002,
        "TRY": 27.57530304341297,
        "ZAR": 19.52072320046652
      }
    }
}

This endpoint retrieves all currencies. Currencies are sorted by is_payment_currency then by id.

HTTP Request

GET https://api.abill.io/v1/currencies/

Query Parameters

Parameter Default Description
lang LV Language Available languages
is_payment_currency None Abillio enabled currencies
kind None Filter by currency kind. fiat or crypto

Example

GET https://api.abill.io/v1/currencies/?is_payment_currency

Get Currencies

service = abillio_api_request('currencies/EUR')
abillio_api_request('currencies/EUR').then(function(response) {
  console.log(response);
}).catch(function(error) {
  console.log(error);
});
$response = abillio_api_request('currencies/EUR');
var_dump($response);

The above command returns JSON structured like this:

{
  "result": {
    "id": "EUR",
    "symbol": "€",
    "title": "Euro",
    "network": null,
    "kind": "fiat",
    "is_payment_currency": true,
    "rate_eur": "1.0000000000000000",
    "rate_usd": "1.0544962003000000",
    "rate_btc": "0.00003804419365711986",
    "updated_at": "2023-10-06T15:00:06.820185+00:00",
    "rates": {
      "AUD": 1.6560021179,
      "BGN": 1.9495634069,
      "BRL": 5.4492364432,
      "BTC": 0.00003804419365711986,
      "CAD": 1.4457672464,
      "CHF": 0.9625126315,
      "CNY": 7.7010498879,
      "CZK": 24.4178448493,
      "DKK": 7.4559110977,
      "GBP": 0.8654041139,
      "HKD": 8.2565062186,
      "HRK": 7.4274508928,
      "HUF": 387.3839751096,
      "IDR": 16451.6148166915,
      "ILS": 4.0760817133,
      "INR": 87.7564195249,
      "ISK": 144.8013361853,
      "JPY": 156.5639264495,
      "KRW": 1416.4953734549,
      "MXN": 19.2783752953,
      "MYR": 4.9849419715,
      "NOK": 11.5629431722,
      "NZD": 1.7676732825,
      "PHP": 59.7890367411,
      "PLN": 4.59988191,
      "RON": 4.9691136957,
      "RUB": 104.5470199148,
      "SEK": 11.6162475771,
      "SGD": 1.4416335406,
      "THB": 38.9536229127,
      "TRY": 29.0780522814,
      "USD": 1.0544962003,
      "ZAR": 20.584528442
    }
  }
}

This endpoint retrieves a specific service.

HTTP Request

GET https://api.abill.io/v1/currencies/<ID>/

URL Parameters

Parameter Description
ID The ID of the currency to retrieve.

Query Parameters

Parameter Default Description
lang LV Language Available languages

Errors

Error payload

Example of validation error response

{
  "errors": [
    {
      "field": "vat_nr",
      "message": "PVN Nr. nav pareizs!"
    }
  ]
}

All API errors return a non-2xx HTTP status and a JSON object with an errors array. Each entry contains:

  1. field – the field that failed validation. null for non field-specific issues.
  2. message – a localized, human readable description of the problem.

Validation failures and schema issues always use status 400. Authentication and authorization errors use the appropriate 401/403 status codes, and missing resources return 404.

HTTP error codes

Error Code Meaning
400 Bad Request – Your request is invalid.
401 Unauthorized – Bearer token or session is missing/invalid.
403 Forbidden – Not enough permissions.
404 Not Found – The specified resource could not be found.
405 Method Not Allowed – You tried to access endpoint with an invalid method.
409 Conflict – The request conflicts with the current resource state.
415 Unsupported Media Type – File uploads use an unsupported format.
422 Legacy validation status code (deprecated; use 400).
500 Internal Server Error – We had a problem with our server.
503 Service Unavailable – We're temporarily offline for maintenance.

Supported Languages

Following is a support list of languages. Across majority of API endpoints language parameter is widely used. Here are all the possible values:

Currency Title
LV Latvian
EN English

Callbacks

Callbacks are POST (as JSON encoded request body) requests made by Abillio to URL endpoint specified in API Key that was used for related invoice creation.

Callback expects HTTP 200 OK success status response code. For any other status code or timeout, it will try to reach endpoint again with exponential time increase between retries. If after 72 hours endpoint will be still unreachable callback sender will stop trying.

You can view the history of callbacks in Abillio app under every instance that has callbacks.

🔍 Verifying callbacks

You can enable a Notification channel to receive callbacks for the desired event by navigating to Profile > Notification channels > New channel.

Choose the Channel type as Webhook, provide the Webhook URL, and enable the desired events.

When the event that triggers the webhook occurs in our system, we will send a POST request to the URL you specify. This request will contain a JSON-formatted message with all relevant information about the event. For example:

{
  "signature":"0b56d87702aae2f4565a89fc7b5885d731eb12fa9ce88f66969eb551f6eebd94",
  "event_type":"invoice_paid",
  "id":"ecbcb376-1722-4773-8ca2-f1a76b9b0cea",
  "invoice": {
    "id":"6776294e-4384-432b-897a-c33925c895b4",
    ...
  }
}

To ensure requests are properly signed, you can utilize the following code snippets in your preferred programming language.

import hashlib
import hmac
import json

# You will find your callback token for channel under Profile > Notification channels
CALLBACK_TOKEN = 'your_callback_token'


# You can reuse same method used in API auth signature generation
def encode_hmac(key, msg, digestmod=hashlib.sha256):
    return hmac.new(key.encode(), msg=msg, digestmod=digestmod).hexdigest()


# Decode request json body
payload = json.loads(request.body)

# Get signature and callback_id fields from provided data
signature = payload['signature']
event_type = payload['event_type']
callback_id = payload['id']

# Compare signatures
is_valid = signature == encode_hmac(CALLBACK_TOKEN, callback_id.encode())
assert is_valid, 'Failed to verify Abillio callback signature.'

# Debug callback data
print(json.dumps(payload, indent=2))
const Base64 = require('js-base64').Base64;
const crypto = require('crypto');

// You will find your callback token for channel under Profile > Notification channels
const CALLBACK_TOKEN = 'your_callback_token';

// You can reuse same method used in API auth signature generation
function encode_hmac(key, msg) {
  return crypto.createHmac('sha256', key).update(msg).digest('hex');
}

// Decode request json body
var payload = JSON.parse(request.body);

// Get signature and callback_id fields from provided data
const signature = payload['signature'];
const event_type = payload['event_type'];
const callback_id = payload['id'];

// Compare signatures
const is_valid = signature === encode_hmac(CALLBACK_TOKEN, callback_id);
if (!is_valid) {
  throw new Error('Failed to verify Abillio callback signature.');
}

// Debug callback data
console.log(payload);
<?php

// You will find your callback token for the channel under Profile > Notification channels
$CALLBACK_TOKEN = 'your_callback_token';

// Function to calculate HMAC SHA256
function encode_hmac($key, $msg) {
    return hash_hmac('sha256', $msg, $key);
}

// Retrieve JSON body from the request
$body = file_get_contents('php://input');

// Decode JSON body
$payload = json_decode($body, true);

// Get signature, event_type, and callback_id fields from the provided data
$signature = $payload['signature'];
$event_type = $payload['event_type'];
$callback_id = $payload['id'];

// Calculate signature using HMAC SHA256
$calculated_signature = encode_hmac($CALLBACK_TOKEN, $callback_id);

// Compare signatures
$is_valid = ($signature === $calculated_signature);

// Verify if the signature is valid
if (!$is_valid) {
    throw new Exception('Failed to verify Abillio callback signature.');
}

// Debug callback data
print_r($payload);

?>

To verify callback and make sure it really comes from Abillio, you must use Callback Token which you can find in Abillio app under PRO Profile > API Keys.

Always verify if signature provided in callback POST data matches the one you generate on your own by signing callback_id value with callback_token using following hashing algorithm:

signature = hex(HMAC_SHA256(<callback_id>, key=<callback_token>))

Callbacks Response

All callbacks have these fields in common:

Key Meaning
id Unique callback ID. If callback fails to reach endpoint, it will retry with the same ID.
event_type Event type identifying specific event.
signature Abillio signature for verification.