RespireSoft InvoicingAPI docsReferenceWebhooks

Products

What you sell.

List products

GET /v1/products

Key scope catalog:read

Newest first, 20 at a time. See pagination.

Query: active, sku, kind, limit, starting_after

curl
curl "https://api.invoicing.respiresoft.com/v1/products?limit=10" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY"
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/products?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/products?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/products?limit=10",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
    },
)
data = res.json()

Retrieve product

GET /v1/products/{id}

Key scope catalog:read

curl
curl "https://api.invoicing.respiresoft.com/v1/products/ID" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY"
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/products/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/products/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/products/ID",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
    },
)
data = res.json()

Create product

POST /v1/products

Key scope catalog:write. Send an Idempotency-Key header

FieldTypeMeaning
name requiredobjectNames per language, en is required: {"en": "Hosting"}.
kindstringProduct kind.
skustring
unitstringFor example hour or piece.
tax_ratestringId of a tax rate.
activeboolean
curl
curl -X POST "https://api.invoicing.respiresoft.com/v1/products" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"name":{"en":"Managed hosting"},"unit":"month"}'
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/products", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": {
      "en": "Managed hosting"
    },
    "unit": "month"
  }),
})
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/products");
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" => [
            "en" => "Managed hosting",
        ],
        "unit" => "month",
    ]),
]);
$data = json_decode(curl_exec($ch), true);
Python
import os, uuid, requests

res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/products",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
      "name": {
        "en": "Managed hosting"
      },
      "unit": "month"
    },
)
data = res.json()

Update product

PATCH /v1/products/{id}

Key scope catalog:write

Send only what changes. POST to the same address works too.

FieldTypeMeaning
nameobjectNames per language, en is required: {"en": "Hosting"}.
kindstringProduct kind.
skustring
unitstringFor example hour or piece.
tax_ratestringId of a tax rate.
activeboolean
curl
curl -X PATCH "https://api.invoicing.respiresoft.com/v1/products/ID" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":{"en":"Managed hosting"},"unit":"month"}'
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/products/ID", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": {
      "en": "Managed hosting"
    },
    "unit": "month"
  }),
})
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/products/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" => [
            "en" => "Managed hosting",
        ],
        "unit" => "month",
    ]),
]);
$data = json_decode(curl_exec($ch), true);
Python
import os, uuid, requests

res = requests.request("PATCH", "https://api.invoicing.respiresoft.com/v1/products/ID",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
    },
    json={
      "name": {
        "en": "Managed hosting"
      },
      "unit": "month"
    },
)
data = res.json()

Delete product

DELETE /v1/products/{id}

Key scope catalog:write

curl
curl -X DELETE "https://api.invoicing.respiresoft.com/v1/products/ID" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY"
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/products/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/products/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/products/ID",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
    },
)
data = res.json()