Invoices
Create a draft, issue it (it gets its number), send it, take payment.
List invoices
GET /v1/invoices
Key scope documents:read
Newest first, 20 at a time. See pagination.
Query: status, customer, number, limit, starting_after
curl "https://api.invoicing.respiresoft.com/v1/invoices?limit=10" \
-H "Authorization: Bearer $RESPIRESOFT_KEY"const res = await fetch("https://api.invoicing.respiresoft.com/v1/invoices?limit=10", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/invoices?limit=10");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("GET", "https://api.invoicing.respiresoft.com/v1/invoices?limit=10",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
)
data = res.json()Retrieve invoice
GET /v1/invoices/{id}
Key scope documents:read
curl "https://api.invoicing.respiresoft.com/v1/invoices/ID" \
-H "Authorization: Bearer $RESPIRESOFT_KEY"const res = await fetch("https://api.invoicing.respiresoft.com/v1/invoices/ID", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/invoices/ID");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("GET", "https://api.invoicing.respiresoft.com/v1/invoices/ID",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
)
data = res.json()Create invoice
POST /v1/invoices
Key scope documents:write. Send an Idempotency-Key header
| Field | Type | Meaning |
|---|---|---|
customer | string | Customer id. |
currency required | string | ISO 4217 code, for example EUR. |
issue_date | string | YYYY-MM-DD. |
due_date | string | YYYY-MM-DD. |
title | string | |
notes | string | |
reference | string | |
discounts | object | {document: {percent_bp | amount}, coupon}. |
lines required | array | Rows of the document. Each row: description, quantity, unit_amount (integer minor units), product?, price?, tax_rate?, discount_percent_bp?, discount_amount?. |
curl -X POST "https://api.invoicing.respiresoft.com/v1/invoices" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"customer":"cus_…","currency":"EUR","due_date":"2026-12-01","lines":[{"description":"Managed hosting, December","quantity":"1","unit_amount":4900}]}'const res = await fetch("https://api.invoicing.respiresoft.com/v1/invoices", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
"customer": "cus_…",
"currency": "EUR",
"due_date": "2026-12-01",
"lines": [
{
"description": "Managed hosting, December",
"quantity": "1",
"unit_amount": 4900
}
]
}),
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/invoices");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
"Idempotency-Key: " . bin2hex(random_bytes(16)),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"customer" => "cus_…",
"currency" => "EUR",
"due_date" => "2026-12-01",
"lines" => [
[
"description" => "Managed hosting, December",
"quantity" => "1",
"unit_amount" => 4900,
],
],
]),
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/invoices",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"customer": "cus_…",
"currency": "EUR",
"due_date": "2026-12-01",
"lines": [
{
"description": "Managed hosting, December",
"quantity": "1",
"unit_amount": 4900
}
]
},
)
data = res.json()Update invoice
PATCH /v1/invoices/{id}
Key scope documents:write
Send only what changes. POST to the same address works too.
| Field | Type | Meaning |
|---|---|---|
customer | string | Customer id. |
currency | string | ISO 4217 code, for example EUR. |
issue_date | string | YYYY-MM-DD. |
due_date | string | YYYY-MM-DD. |
title | string | |
notes | string | |
reference | string | |
discounts | object | {document: {percent_bp | amount}, coupon}. |
lines | array | Rows of the document. Each row: description, quantity, unit_amount (integer minor units), product?, price?, tax_rate?, discount_percent_bp?, discount_amount?. |
curl -X PATCH "https://api.invoicing.respiresoft.com/v1/invoices/ID" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Content-Type: application/json" \
-d '{"customer":"cus_…","currency":"EUR","due_date":"2026-12-01","lines":[{"description":"Managed hosting, December","quantity":"1","unit_amount":4900}]}'const res = await fetch("https://api.invoicing.respiresoft.com/v1/invoices/ID", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"customer": "cus_…",
"currency": "EUR",
"due_date": "2026-12-01",
"lines": [
{
"description": "Managed hosting, December",
"quantity": "1",
"unit_amount": 4900
}
]
}),
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/invoices/ID");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"customer" => "cus_…",
"currency" => "EUR",
"due_date" => "2026-12-01",
"lines" => [
[
"description" => "Managed hosting, December",
"quantity" => "1",
"unit_amount" => 4900,
],
],
]),
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("PATCH", "https://api.invoicing.respiresoft.com/v1/invoices/ID",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
json={
"customer": "cus_…",
"currency": "EUR",
"due_date": "2026-12-01",
"lines": [
{
"description": "Managed hosting, December",
"quantity": "1",
"unit_amount": 4900
}
]
},
)
data = res.json()Delete invoice
DELETE /v1/invoices/{id}
Key scope documents:write
curl -X DELETE "https://api.invoicing.respiresoft.com/v1/invoices/ID" \
-H "Authorization: Bearer $RESPIRESOFT_KEY"const res = await fetch("https://api.invoicing.respiresoft.com/v1/invoices/ID", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/invoices/ID");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("DELETE", "https://api.invoicing.respiresoft.com/v1/invoices/ID",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
)
data = res.json()Issue invoice
POST /v1/invoices/{id}/issue
Key scope documents:write. Send an Idempotency-Key header
Gives the draft its number and locks it.
curl -X POST "https://api.invoicing.respiresoft.com/v1/invoices/ID/issue" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Idempotency-Key: $(uuidgen)"const res = await fetch("https://api.invoicing.respiresoft.com/v1/invoices/ID/issue", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/invoices/ID/issue");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
"Idempotency-Key: " . bin2hex(random_bytes(16)),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/invoices/ID/issue",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
"Idempotency-Key": str(uuid.uuid4()),
},
)
data = res.json()Send invoice
POST /v1/invoices/{id}/send
Key scope documents:write. Send an Idempotency-Key header
Emails the document to the customer.
curl -X POST "https://api.invoicing.respiresoft.com/v1/invoices/ID/send" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Idempotency-Key: $(uuidgen)"const res = await fetch("https://api.invoicing.respiresoft.com/v1/invoices/ID/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/invoices/ID/send");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
"Idempotency-Key: " . bin2hex(random_bytes(16)),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/invoices/ID/send",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
"Idempotency-Key": str(uuid.uuid4()),
},
)
data = res.json()Void invoice
POST /v1/invoices/{id}/void
Key scope documents:write. Send an Idempotency-Key header
Cancels an issued document that has no payments.
curl -X POST "https://api.invoicing.respiresoft.com/v1/invoices/ID/void" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Idempotency-Key: $(uuidgen)"const res = await fetch("https://api.invoicing.respiresoft.com/v1/invoices/ID/void", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/invoices/ID/void");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
"Idempotency-Key: " . bin2hex(random_bytes(16)),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/invoices/ID/void",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
"Idempotency-Key": str(uuid.uuid4()),
},
)
data = res.json()Download the PDF invoice
GET /v1/invoices/{id}/pdf
Key scope documents:read
curl "https://api.invoicing.respiresoft.com/v1/invoices/ID/pdf" \
-H "Authorization: Bearer $RESPIRESOFT_KEY"const res = await fetch("https://api.invoicing.respiresoft.com/v1/invoices/ID/pdf", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/invoices/ID/pdf");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("GET", "https://api.invoicing.respiresoft.com/v1/invoices/ID/pdf",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
)
data = res.json()Make a pay link invoice
POST /v1/invoices/{id}/pay_link
Key scope documents:write. Send an Idempotency-Key header
Answers with a link to the hosted payment page.
curl -X POST "https://api.invoicing.respiresoft.com/v1/invoices/ID/pay_link" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Idempotency-Key: $(uuidgen)"const res = await fetch("https://api.invoicing.respiresoft.com/v1/invoices/ID/pay_link", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
},
})
const data = await res.json()
if (!res.ok) throw new Error(data.detail) // RFC 9457 problem document$ch = curl_init("https://api.invoicing.respiresoft.com/v1/invoices/ID/pay_link");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("RESPIRESOFT_KEY"),
"Idempotency-Key: " . bin2hex(random_bytes(16)),
],
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/invoices/ID/pay_link",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
"Idempotency-Key": str(uuid.uuid4()),
},
)
data = res.json()