API reference
Receipts
A paid invoice has a receipt. Read it, or create a signed link to its PDF for your customer.
| Endpoint | What it does |
|---|---|
GET /api/v1/receipts/{invoiceId} | Get a receipt |
POST /api/v1/receipts/{invoiceId}/links | Create a receipt link |
Receipts are addressed by the paid invoice's id. Asking for an unpaid invoice's receipt gets 404 not_paid; wait for invoice.paid or receipt.issued.
The receipt object#
The receipt for a paid invoice.
| Field | Description |
|---|---|
| invoiceIdinteger | The paid invoice. |
| invoiceNumberstring | The invoice number. |
| customerIdinteger | The customer. |
| currencystring | ISO currency code. One of NGN, USD, CAD, EUR, GBP. |
| amountnumber (decimal) | The invoice total. |
| paidAttimestamp · nullable | When it was paid. Server time, no offset. |
| paymentMethodstring · nullable | online or offline. |
{
"invoiceId": 5012,
"invoiceNumber": "MAX-2026-0042",
"customerId": 812,
"currency": "NGN",
"amount": 860000.00,
"paidAt": "2026-11-03T14:02:00",
"paymentMethod": "online"
}Get a receipt#
GET
/api/v1/receipts/{invoiceId}Returns the receipt for a paid invoice.
Path parameters
| Field | Description |
|---|---|
| invoiceIdinteger | required The paid invoice's id. |
Request
curl "$FLUX_BASE_URL/api/v1/receipts/5012" \
-H "Authorization: ApiKey $FLUX_API_KEY"// Node.js 18+ (built-in fetch). Save as an .mjs file.
const response = await fetch(`${process.env.FLUX_BASE_URL}/api/v1/receipts/5012`, {
headers: {
Authorization: `ApiKey ${process.env.FLUX_API_KEY}`,
},
});
console.log(response.status, await response.json());import os
import requests
response = requests.get(
f"{os.environ['FLUX_BASE_URL']}/api/v1/receipts/5012",
headers={"Authorization": f"ApiKey {os.environ['FLUX_API_KEY']}"},
timeout=30,
)
print(response.status_code, response.json())<?php
$ch = curl_init(getenv('FLUX_BASE_URL') . '/api/v1/receipts/5012');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => [
'Authorization: ApiKey ' . getenv('FLUX_API_KEY'),
],
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), ' ', $response, PHP_EOL;using System.Net.Http.Headers;
var baseUrl = Environment.GetEnvironmentVariable("FLUX_BASE_URL");
using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("ApiKey", Environment.GetEnvironmentVariable("FLUX_API_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Get, $"{baseUrl}/api/v1/receipts/5012");
using var response = await http.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", os.Getenv("FLUX_BASE_URL")+"/api/v1/receipts/5012", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "ApiKey "+os.Getenv("FLUX_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(out))
}Responses
200 OK
{
"invoiceId": 5012,
"invoiceNumber": "MAX-2026-0042",
"customerId": 812,
"currency": "NGN",
"amount": 860000.00,
"paidAt": "2026-11-03T14:02:00",
"paymentMethod": "online"
}5 possible errors
| Status | Code | When |
|---|---|---|
404 | not_found | Unknown id, or an id that belongs to another organization. |
404 | not_paid | You asked for the receipt of an unpaid invoice. |
401 | unauthorized | No API key, an unknown key or a revoked key. |
403 | insufficient_scope | The key lacks the scope. details names it: { "required": "invoices:write" }. |
429 | rate_limited | Too many requests for this key. Wait for the Retry-After seconds. |
Create a receipt link#
POST
/api/v1/receipts/{invoiceId}/linksReturns a signed link to the receipt PDF. payUrl is always null here.
Path parameters
| Field | Description |
|---|---|
| invoiceIdinteger | required The paid invoice's id. |
Request
curl -X POST "$FLUX_BASE_URL/api/v1/receipts/5012/links" \
-H "Authorization: ApiKey $FLUX_API_KEY"// Node.js 18+ (built-in fetch). Save as an .mjs file.
const response = await fetch(`${process.env.FLUX_BASE_URL}/api/v1/receipts/5012/links`, {
method: "POST",
headers: {
Authorization: `ApiKey ${process.env.FLUX_API_KEY}`,
},
});
console.log(response.status, await response.json());import os
import requests
response = requests.post(
f"{os.environ['FLUX_BASE_URL']}/api/v1/receipts/5012/links",
headers={"Authorization": f"ApiKey {os.environ['FLUX_API_KEY']}"},
timeout=30,
)
print(response.status_code, response.json())<?php
$ch = curl_init(getenv('FLUX_BASE_URL') . '/api/v1/receipts/5012/links');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: ApiKey ' . getenv('FLUX_API_KEY'),
],
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), ' ', $response, PHP_EOL;using System.Net.Http.Headers;
var baseUrl = Environment.GetEnvironmentVariable("FLUX_BASE_URL");
using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("ApiKey", Environment.GetEnvironmentVariable("FLUX_API_KEY"));
using var request = new HttpRequestMessage(HttpMethod.Post, $"{baseUrl}/api/v1/receipts/5012/links");
using var response = await http.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("POST", os.Getenv("FLUX_BASE_URL")+"/api/v1/receipts/5012/links", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "ApiKey "+os.Getenv("FLUX_API_KEY"))
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(resp.StatusCode, string(out))
}Responses
200 OK
{
"pdfUrl": "https://api.flux.example/public/receipts/NDIuNTAxMi5ycC4xNzk2MTE2NDAw.Zt4hQ1vB8kW0mXc3sR7eLp2yN6uGaJ9oFdKiT5wHqEs/pdf",
"payUrl": null,
"expiresAt": "2026-12-01T10:00:00.5236411Z"
}6 possible errors
| Status | Code | When |
|---|---|---|
404 | not_found | Unknown id, or an id that belongs to another organization. |
404 | not_paid | You asked for the receipt of an unpaid invoice. |
503 | links_not_configured | The server has no link-signing key configured. |
401 | unauthorized | No API key, an unknown key or a revoked key. |
403 | insufficient_scope | The key lacks the scope. details names it: { "required": "invoices:write" }. |
429 | rate_limited | Too many requests for this key. Wait for the Retry-After seconds. |