RespireSoft InvoicingAPI docsReferenceWebhooks

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
curl "https://api.invoicing.respiresoft.com/v1/customers?limit=10" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY"
Node
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
PHP
$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);
Python
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
curl "https://api.invoicing.respiresoft.com/v1/customers/ID" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY"
Node
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
PHP
$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);
Python
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

FieldTypeMeaning
name requiredstringDisplay name.
kindstringperson or company.
emailsarrayUp to 10 email addresses.
phonestring
countrystringTwo letter country code.
tax_idsarrayRows of {type, number, country?}.
currencystringDefault currency.
payment_terms_daysinteger0 to 365.
codestringYour own short reference.
curl
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"}'
Node
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
PHP
$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);
Python
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.

FieldTypeMeaning
namestringDisplay name.
kindstringperson or company.
emailsarrayUp to 10 email addresses.
phonestring
countrystringTwo letter country code.
tax_idsarrayRows of {type, number, country?}.
currencystringDefault currency.
payment_terms_daysinteger0 to 365.
codestringYour own short reference.
curl
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"}'
Node
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
PHP
$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);
Python
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
curl -X DELETE "https://api.invoicing.respiresoft.com/v1/customers/ID" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY"
Node
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
PHP
$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);
Python
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()