Customers
The people and companies you invoice.
List customers
GET /v1/customers
Key scope customers:read
Newest first, 20 at a time. See pagination.
Query: code, country, limit, starting_after
curl "https://api.invoicing.respiresoft.com/v1/customers?limit=10" \
-H "Authorization: Bearer $RESPIRESOFT_KEY"const res = await fetch("https://api.invoicing.respiresoft.com/v1/customers?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/customers?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/customers?limit=10",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
)
data = res.json()Retrieve customer
GET /v1/customers/{id}
Key scope customers:read
curl "https://api.invoicing.respiresoft.com/v1/customers/ID" \
-H "Authorization: Bearer $RESPIRESOFT_KEY"const res = await fetch("https://api.invoicing.respiresoft.com/v1/customers/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/customers/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/customers/ID",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
)
data = res.json()Create customer
POST /v1/customers
Key scope customers:write. Send an Idempotency-Key header
| Field | Type | Meaning |
|---|---|---|
name required | string | Display name. |
kind | string | person or company. |
emails | array | Up to 10 email addresses. |
phone | string | |
country | string | Two letter country code. |
tax_ids | array | Rows of {type, number, country?}. |
currency | string | Default currency. |
payment_terms_days | integer | 0 to 365. |
code | string | Your own short reference. |
curl -X POST "https://api.invoicing.respiresoft.com/v1/customers" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"name":"Acme BV","kind":"company","emails":["finance@acme.example"],"country":"NL"}'const res = await fetch("https://api.invoicing.respiresoft.com/v1/customers", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Acme BV",
"kind": "company",
"emails": [
"finance@acme.example"
],
"country": "NL"
}),
})
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/customers");
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([
"name" => "Acme BV",
"kind" => "company",
"emails" => [
"finance@acme.example",
],
"country" => "NL",
]),
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/customers",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
"Idempotency-Key": str(uuid.uuid4()),
},
json={
"name": "Acme BV",
"kind": "company",
"emails": [
"finance@acme.example"
],
"country": "NL"
},
)
data = res.json()Update customer
PATCH /v1/customers/{id}
Key scope customers:write
Send only what changes. POST to the same address works too.
| Field | Type | Meaning |
|---|---|---|
name | string | Display name. |
kind | string | person or company. |
emails | array | Up to 10 email addresses. |
phone | string | |
country | string | Two letter country code. |
tax_ids | array | Rows of {type, number, country?}. |
currency | string | Default currency. |
payment_terms_days | integer | 0 to 365. |
code | string | Your own short reference. |
curl -X PATCH "https://api.invoicing.respiresoft.com/v1/customers/ID" \
-H "Authorization: Bearer $RESPIRESOFT_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Acme BV","kind":"company","emails":["finance@acme.example"],"country":"NL"}'const res = await fetch("https://api.invoicing.respiresoft.com/v1/customers/ID", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"name": "Acme BV",
"kind": "company",
"emails": [
"finance@acme.example"
],
"country": "NL"
}),
})
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/customers/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([
"name" => "Acme BV",
"kind" => "company",
"emails" => [
"finance@acme.example",
],
"country" => "NL",
]),
]);
$data = json_decode(curl_exec($ch), true);import os, uuid, requests
res = requests.request("PATCH", "https://api.invoicing.respiresoft.com/v1/customers/ID",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
json={
"name": "Acme BV",
"kind": "company",
"emails": [
"finance@acme.example"
],
"country": "NL"
},
)
data = res.json()Delete customer
DELETE /v1/customers/{id}
Key scope customers:write
curl -X DELETE "https://api.invoicing.respiresoft.com/v1/customers/ID" \
-H "Authorization: Bearer $RESPIRESOFT_KEY"const res = await fetch("https://api.invoicing.respiresoft.com/v1/customers/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/customers/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/customers/ID",
headers={
"Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
},
)
data = res.json()