Update invoice numbering settings
curl --request POST \
--url https://api.example.com/invoices/settings \
--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 '
{
"invoice_prefix": "INV-{year}-",
"next_number": 100
}
'import requests
url = "https://api.example.com/invoices/settings"
payload = {
"invoice_prefix": "INV-{year}-",
"next_number": 100
}
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({invoice_prefix: 'INV-{year}-', next_number: 100})
};
fetch('https://api.example.com/invoices/settings', 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/settings",
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([
'invoice_prefix' => 'INV-{year}-',
'next_number' => 100
]),
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/settings"
payload := strings.NewReader("{\n \"invoice_prefix\": \"INV-{year}-\",\n \"next_number\": 100\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/settings")
.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 \"invoice_prefix\": \"INV-{year}-\",\n \"next_number\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/invoices/settings")
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 \"invoice_prefix\": \"INV-{year}-\",\n \"next_number\": 100\n}"
response = http.request(request)
puts response.read_body{
"invoice_prefix": "INV-{year}-",
"next_number": 5,
"preview": "INV-2026-5"
}{
"reason": "Signature verification failed",
"statusCode": 401
}{
"reason": "Not found",
"statusCode": 404
}Invoices
Update Numbering Settings
Updates the invoice number prefix and/or the next number. The prefix supports a token replaced with the current year at issue time (the sequence counter is continuous — only stamps the year, it does not reset the counter each January). next_number may only move forward.
POST
/
invoices
/
settings
Update invoice numbering settings
curl --request POST \
--url https://api.example.com/invoices/settings \
--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 '
{
"invoice_prefix": "INV-{year}-",
"next_number": 100
}
'import requests
url = "https://api.example.com/invoices/settings"
payload = {
"invoice_prefix": "INV-{year}-",
"next_number": 100
}
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({invoice_prefix: 'INV-{year}-', next_number: 100})
};
fetch('https://api.example.com/invoices/settings', 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/settings",
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([
'invoice_prefix' => 'INV-{year}-',
'next_number' => 100
]),
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/settings"
payload := strings.NewReader("{\n \"invoice_prefix\": \"INV-{year}-\",\n \"next_number\": 100\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/settings")
.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 \"invoice_prefix\": \"INV-{year}-\",\n \"next_number\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/invoices/settings")
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 \"invoice_prefix\": \"INV-{year}-\",\n \"next_number\": 100\n}"
response = http.request(request)
puts response.read_body{
"invoice_prefix": "INV-{year}-",
"next_number": 5,
"preview": "INV-2026-5"
}{
"reason": "Signature verification failed",
"statusCode": 401
}{
"reason": "Not found",
"statusCode": 404
}Authorizations
Your public API key
Headers
Current Unix timestamp
Your public api key
Digest Auth Signature
Body
application/json
Prefix prepended to the sequence number. Supports a {year} token (e.g. "INV-{year}-" → INV-2026-1). Allowed characters: letters, numbers, space, - _ . / and the {year} token.
Maximum string length:
24Example:
"INV-{year}-"
The next invoice number to use. Must be >= the current next number (cannot move backward, so an already-used number is never reissued).
Required range:
x >= 1Example:
100