Create an invoice
curl --request POST \
--url https://api.example.com/invoices \
--header 'Content-Type: application/json' \
--header 'x-digest-key: <api-key>' \
--header 'x-digest-signature: <x-digest-signature>' \
--header 'x-digest-timestamp: <x-digest-timestamp>' \
--data '
{
"currency": "USD",
"line_items": [
{
"description": "Consulting — June",
"quantity": 2,
"unit_price": 10000
}
],
"tax_percentage": 21,
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"customer_type": "business",
"name": "Jane Doe",
"company_name": "Example Co B.V.",
"email": "[email protected]",
"vat_number": "NL859090913B01",
"address": {
"line1": "Main Street 1",
"postal_code": "1000 AA",
"city": "Amsterdam",
"country": "NL"
}
},
"due_at": "2026-07-01T00:00:00Z",
"notes": "Thanks for your business.",
"invoice_number": "<string>"
}
'import requests
url = "https://api.example.com/invoices"
payload = {
"currency": "USD",
"line_items": [
{
"description": "Consulting — June",
"quantity": 2,
"unit_price": 10000
}
],
"tax_percentage": 21,
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"customer_type": "business",
"name": "Jane Doe",
"company_name": "Example Co B.V.",
"email": "[email protected]",
"vat_number": "NL859090913B01",
"address": {
"line1": "Main Street 1",
"postal_code": "1000 AA",
"city": "Amsterdam",
"country": "NL"
}
},
"due_at": "2026-07-01T00:00:00Z",
"notes": "Thanks for your business.",
"invoice_number": "<string>"
}
headers = {
"x-digest-timestamp": "<x-digest-timestamp>",
"x-digest-key": "<api-key>",
"x-digest-signature": "<x-digest-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-digest-timestamp': '<x-digest-timestamp>',
'x-digest-key': '<api-key>',
'x-digest-signature': '<x-digest-signature>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
currency: 'USD',
line_items: [{description: 'Consulting — June', quantity: 2, unit_price: 10000}],
tax_percentage: 21,
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer: {
customer_type: 'business',
name: 'Jane Doe',
company_name: 'Example Co B.V.',
email: '[email protected]',
vat_number: 'NL859090913B01',
address: {
line1: 'Main Street 1',
postal_code: '1000 AA',
city: 'Amsterdam',
country: 'NL'
}
},
due_at: '2026-07-01T00:00:00Z',
notes: 'Thanks for your business.',
invoice_number: '<string>'
})
};
fetch('https://api.example.com/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'currency' => 'USD',
'line_items' => [
[
'description' => 'Consulting — June',
'quantity' => 2,
'unit_price' => 10000
]
],
'tax_percentage' => 21,
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customer' => [
'customer_type' => 'business',
'name' => 'Jane Doe',
'company_name' => 'Example Co B.V.',
'email' => '[email protected]',
'vat_number' => 'NL859090913B01',
'address' => [
'line1' => 'Main Street 1',
'postal_code' => '1000 AA',
'city' => 'Amsterdam',
'country' => 'NL'
]
],
'due_at' => '2026-07-01T00:00:00Z',
'notes' => 'Thanks for your business.',
'invoice_number' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-digest-key: <api-key>",
"x-digest-signature: <x-digest-signature>",
"x-digest-timestamp: <x-digest-timestamp>"
],
]);
$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"
)
func main() {
url := "https://api.example.com/invoices"
payload := strings.NewReader("{\n \"currency\": \"USD\",\n \"line_items\": [\n {\n \"description\": \"Consulting — June\",\n \"quantity\": 2,\n \"unit_price\": 10000\n }\n ],\n \"tax_percentage\": 21,\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer\": {\n \"customer_type\": \"business\",\n \"name\": \"Jane Doe\",\n \"company_name\": \"Example Co B.V.\",\n \"email\": \"[email protected]\",\n \"vat_number\": \"NL859090913B01\",\n \"address\": {\n \"line1\": \"Main Street 1\",\n \"postal_code\": \"1000 AA\",\n \"city\": \"Amsterdam\",\n \"country\": \"NL\"\n }\n },\n \"due_at\": \"2026-07-01T00:00:00Z\",\n \"notes\": \"Thanks for your business.\",\n \"invoice_number\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-digest-timestamp", "<x-digest-timestamp>")
req.Header.Add("x-digest-key", "<api-key>")
req.Header.Add("x-digest-signature", "<x-digest-signature>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/invoices")
.header("x-digest-timestamp", "<x-digest-timestamp>")
.header("x-digest-key", "<api-key>")
.header("x-digest-signature", "<x-digest-signature>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"USD\",\n \"line_items\": [\n {\n \"description\": \"Consulting — June\",\n \"quantity\": 2,\n \"unit_price\": 10000\n }\n ],\n \"tax_percentage\": 21,\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer\": {\n \"customer_type\": \"business\",\n \"name\": \"Jane Doe\",\n \"company_name\": \"Example Co B.V.\",\n \"email\": \"[email protected]\",\n \"vat_number\": \"NL859090913B01\",\n \"address\": {\n \"line1\": \"Main Street 1\",\n \"postal_code\": \"1000 AA\",\n \"city\": \"Amsterdam\",\n \"country\": \"NL\"\n }\n },\n \"due_at\": \"2026-07-01T00:00:00Z\",\n \"notes\": \"Thanks for your business.\",\n \"invoice_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-digest-timestamp"] = '<x-digest-timestamp>'
request["x-digest-key"] = '<api-key>'
request["x-digest-signature"] = '<x-digest-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"USD\",\n \"line_items\": [\n {\n \"description\": \"Consulting — June\",\n \"quantity\": 2,\n \"unit_price\": 10000\n }\n ],\n \"tax_percentage\": 21,\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer\": {\n \"customer_type\": \"business\",\n \"name\": \"Jane Doe\",\n \"company_name\": \"Example Co B.V.\",\n \"email\": \"[email protected]\",\n \"vat_number\": \"NL859090913B01\",\n \"address\": {\n \"line1\": \"Main Street 1\",\n \"postal_code\": \"1000 AA\",\n \"city\": \"Amsterdam\",\n \"country\": \"NL\"\n }\n },\n \"due_at\": \"2026-07-01T00:00:00Z\",\n \"notes\": \"Thanks for your business.\",\n \"invoice_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "c9310d0f-6338-4780-b8d2-6a125e258a4a",
"invoice_number": "INV-2026-4",
"status": "sent",
"currency": "USD",
"line_items": [
{
"description": "Consulting — June",
"quantity": 2,
"unit_price": 10000
}
],
"subtotal": 20000,
"tax_percentage": 21,
"tax_total": 4200,
"total": 24200,
"issued_at": "2026-06-10T15:24:48.801Z",
"due_at": null,
"payment_id": "pt_EL1yKOzKdv",
"notes": "Thanks for your business.",
"customer": {
"id": "9c4749b3-8f18-4a25-9d67-8b1866d6c56d",
"customer_type": "business",
"name": null,
"company_name": "Example Co B.V.",
"email": "[email protected]",
"vat_number": null,
"address": null
},
"createdAt": "2026-06-10T15:24:48.791Z",
"updatedAt": "2026-06-10T15:24:48.866Z"
}{
"reason": "Signature verification failed",
"statusCode": 401
}{
"reason": "Not found",
"statusCode": 404
}Invoices
Create Invoice
Creates an invoice (line items + optional single VAT/Tax percentage on the subtotal) together with a payment to pay it. The returned payment_id links to that payment — fetch it via GET /payments/{id} to obtain the shareable payment link (shortUrl).
POST
/
invoices
Create an invoice
curl --request POST \
--url https://api.example.com/invoices \
--header 'Content-Type: application/json' \
--header 'x-digest-key: <api-key>' \
--header 'x-digest-signature: <x-digest-signature>' \
--header 'x-digest-timestamp: <x-digest-timestamp>' \
--data '
{
"currency": "USD",
"line_items": [
{
"description": "Consulting — June",
"quantity": 2,
"unit_price": 10000
}
],
"tax_percentage": 21,
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"customer_type": "business",
"name": "Jane Doe",
"company_name": "Example Co B.V.",
"email": "[email protected]",
"vat_number": "NL859090913B01",
"address": {
"line1": "Main Street 1",
"postal_code": "1000 AA",
"city": "Amsterdam",
"country": "NL"
}
},
"due_at": "2026-07-01T00:00:00Z",
"notes": "Thanks for your business.",
"invoice_number": "<string>"
}
'import requests
url = "https://api.example.com/invoices"
payload = {
"currency": "USD",
"line_items": [
{
"description": "Consulting — June",
"quantity": 2,
"unit_price": 10000
}
],
"tax_percentage": 21,
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"customer_type": "business",
"name": "Jane Doe",
"company_name": "Example Co B.V.",
"email": "[email protected]",
"vat_number": "NL859090913B01",
"address": {
"line1": "Main Street 1",
"postal_code": "1000 AA",
"city": "Amsterdam",
"country": "NL"
}
},
"due_at": "2026-07-01T00:00:00Z",
"notes": "Thanks for your business.",
"invoice_number": "<string>"
}
headers = {
"x-digest-timestamp": "<x-digest-timestamp>",
"x-digest-key": "<api-key>",
"x-digest-signature": "<x-digest-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-digest-timestamp': '<x-digest-timestamp>',
'x-digest-key': '<api-key>',
'x-digest-signature': '<x-digest-signature>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
currency: 'USD',
line_items: [{description: 'Consulting — June', quantity: 2, unit_price: 10000}],
tax_percentage: 21,
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
customer: {
customer_type: 'business',
name: 'Jane Doe',
company_name: 'Example Co B.V.',
email: '[email protected]',
vat_number: 'NL859090913B01',
address: {
line1: 'Main Street 1',
postal_code: '1000 AA',
city: 'Amsterdam',
country: 'NL'
}
},
due_at: '2026-07-01T00:00:00Z',
notes: 'Thanks for your business.',
invoice_number: '<string>'
})
};
fetch('https://api.example.com/invoices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'currency' => 'USD',
'line_items' => [
[
'description' => 'Consulting — June',
'quantity' => 2,
'unit_price' => 10000
]
],
'tax_percentage' => 21,
'customer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'customer' => [
'customer_type' => 'business',
'name' => 'Jane Doe',
'company_name' => 'Example Co B.V.',
'email' => '[email protected]',
'vat_number' => 'NL859090913B01',
'address' => [
'line1' => 'Main Street 1',
'postal_code' => '1000 AA',
'city' => 'Amsterdam',
'country' => 'NL'
]
],
'due_at' => '2026-07-01T00:00:00Z',
'notes' => 'Thanks for your business.',
'invoice_number' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-digest-key: <api-key>",
"x-digest-signature: <x-digest-signature>",
"x-digest-timestamp: <x-digest-timestamp>"
],
]);
$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"
)
func main() {
url := "https://api.example.com/invoices"
payload := strings.NewReader("{\n \"currency\": \"USD\",\n \"line_items\": [\n {\n \"description\": \"Consulting — June\",\n \"quantity\": 2,\n \"unit_price\": 10000\n }\n ],\n \"tax_percentage\": 21,\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer\": {\n \"customer_type\": \"business\",\n \"name\": \"Jane Doe\",\n \"company_name\": \"Example Co B.V.\",\n \"email\": \"[email protected]\",\n \"vat_number\": \"NL859090913B01\",\n \"address\": {\n \"line1\": \"Main Street 1\",\n \"postal_code\": \"1000 AA\",\n \"city\": \"Amsterdam\",\n \"country\": \"NL\"\n }\n },\n \"due_at\": \"2026-07-01T00:00:00Z\",\n \"notes\": \"Thanks for your business.\",\n \"invoice_number\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-digest-timestamp", "<x-digest-timestamp>")
req.Header.Add("x-digest-key", "<api-key>")
req.Header.Add("x-digest-signature", "<x-digest-signature>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/invoices")
.header("x-digest-timestamp", "<x-digest-timestamp>")
.header("x-digest-key", "<api-key>")
.header("x-digest-signature", "<x-digest-signature>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"USD\",\n \"line_items\": [\n {\n \"description\": \"Consulting — June\",\n \"quantity\": 2,\n \"unit_price\": 10000\n }\n ],\n \"tax_percentage\": 21,\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer\": {\n \"customer_type\": \"business\",\n \"name\": \"Jane Doe\",\n \"company_name\": \"Example Co B.V.\",\n \"email\": \"[email protected]\",\n \"vat_number\": \"NL859090913B01\",\n \"address\": {\n \"line1\": \"Main Street 1\",\n \"postal_code\": \"1000 AA\",\n \"city\": \"Amsterdam\",\n \"country\": \"NL\"\n }\n },\n \"due_at\": \"2026-07-01T00:00:00Z\",\n \"notes\": \"Thanks for your business.\",\n \"invoice_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-digest-timestamp"] = '<x-digest-timestamp>'
request["x-digest-key"] = '<api-key>'
request["x-digest-signature"] = '<x-digest-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"USD\",\n \"line_items\": [\n {\n \"description\": \"Consulting — June\",\n \"quantity\": 2,\n \"unit_price\": 10000\n }\n ],\n \"tax_percentage\": 21,\n \"customer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"customer\": {\n \"customer_type\": \"business\",\n \"name\": \"Jane Doe\",\n \"company_name\": \"Example Co B.V.\",\n \"email\": \"[email protected]\",\n \"vat_number\": \"NL859090913B01\",\n \"address\": {\n \"line1\": \"Main Street 1\",\n \"postal_code\": \"1000 AA\",\n \"city\": \"Amsterdam\",\n \"country\": \"NL\"\n }\n },\n \"due_at\": \"2026-07-01T00:00:00Z\",\n \"notes\": \"Thanks for your business.\",\n \"invoice_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "c9310d0f-6338-4780-b8d2-6a125e258a4a",
"invoice_number": "INV-2026-4",
"status": "sent",
"currency": "USD",
"line_items": [
{
"description": "Consulting — June",
"quantity": 2,
"unit_price": 10000
}
],
"subtotal": 20000,
"tax_percentage": 21,
"tax_total": 4200,
"total": 24200,
"issued_at": "2026-06-10T15:24:48.801Z",
"due_at": null,
"payment_id": "pt_EL1yKOzKdv",
"notes": "Thanks for your business.",
"customer": {
"id": "9c4749b3-8f18-4a25-9d67-8b1866d6c56d",
"customer_type": "business",
"name": null,
"company_name": "Example Co B.V.",
"email": "[email protected]",
"vat_number": null,
"address": null
},
"createdAt": "2026-06-10T15:24:48.791Z",
"updatedAt": "2026-06-10T15:24:48.866Z"
}{
"reason": "Signature verification failed",
"statusCode": 401
}{
"reason": "Not found",
"statusCode": 404
}Headers
Body
application/json
Response
The created invoice.