RespireSoft InvoicingAPI docsReferenceWebhooks

Plans

Recurring invoices or pay links on a schedule.

List plans

GET /v1/plans

Key scope plans:read

Newest first, 20 at a time. See pagination.

Query: status, customer, limit, starting_after

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

Retrieve plan

GET /v1/plans/{id}

Key scope plans:read

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

Create plan

POST /v1/plans

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

FieldTypeMeaning
customer requiredstring
name requiredstring
currency requiredstringISO 4217 code, for example EUR.
interval requiredstringday, week, month or year.
interval_countinteger
anchor_datestringYYYY-MM-DD of the first run.
send_asstringinvoice or pay_link.
auto_sendboolean
days_until_dueinteger
lines requiredarrayRows like those of an invoice.
curl
curl -X POST "https://api.invoicing.respiresoft.com/v1/plans" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"customer":"cus_…","name":"Hosting","currency":"EUR","interval":"month","lines":[{"description":"Managed hosting","quantity":"1","unit_amount":4900}]}'
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/plans", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "customer": "cus_…",
    "name": "Hosting",
    "currency": "EUR",
    "interval": "month",
    "lines": [
      {
        "description": "Managed hosting",
        "quantity": "1",
        "unit_amount": 4900
      }
    ]
  }),
})
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/plans");
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_…",
        "name" => "Hosting",
        "currency" => "EUR",
        "interval" => "month",
        "lines" => [
            [
                "description" => "Managed hosting",
                "quantity" => "1",
                "unit_amount" => 4900,
            ],
        ],
    ]),
]);
$data = json_decode(curl_exec($ch), true);
Python
import os, uuid, requests

res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/plans",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
      "customer": "cus_…",
      "name": "Hosting",
      "currency": "EUR",
      "interval": "month",
      "lines": [
        {
          "description": "Managed hosting",
          "quantity": "1",
          "unit_amount": 4900
        }
      ]
    },
)
data = res.json()

Update plan

PATCH /v1/plans/{id}

Key scope plans:write

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

FieldTypeMeaning
customerstring
namestring
currencystringISO 4217 code, for example EUR.
intervalstringday, week, month or year.
interval_countinteger
anchor_datestringYYYY-MM-DD of the first run.
send_asstringinvoice or pay_link.
auto_sendboolean
days_until_dueinteger
linesarrayRows like those of an invoice.
curl
curl -X PATCH "https://api.invoicing.respiresoft.com/v1/plans/ID" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customer":"cus_…","name":"Hosting","currency":"EUR","interval":"month","lines":[{"description":"Managed hosting","quantity":"1","unit_amount":4900}]}'
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/plans/ID", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "customer": "cus_…",
    "name": "Hosting",
    "currency": "EUR",
    "interval": "month",
    "lines": [
      {
        "description": "Managed hosting",
        "quantity": "1",
        "unit_amount": 4900
      }
    ]
  }),
})
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/plans/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_…",
        "name" => "Hosting",
        "currency" => "EUR",
        "interval" => "month",
        "lines" => [
            [
                "description" => "Managed hosting",
                "quantity" => "1",
                "unit_amount" => 4900,
            ],
        ],
    ]),
]);
$data = json_decode(curl_exec($ch), true);
Python
import os, uuid, requests

res = requests.request("PATCH", "https://api.invoicing.respiresoft.com/v1/plans/ID",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
    },
    json={
      "customer": "cus_…",
      "name": "Hosting",
      "currency": "EUR",
      "interval": "month",
      "lines": [
        {
          "description": "Managed hosting",
          "quantity": "1",
          "unit_amount": 4900
        }
      ]
    },
)
data = res.json()

Delete plan

DELETE /v1/plans/{id}

Key scope plans:write

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

Pause a plan

POST /v1/plans/{id}/pause

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

No runs until it is resumed.

curl
curl -X POST "https://api.invoicing.respiresoft.com/v1/plans/ID/pause" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/plans/ID/pause", {
  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
PHP
$ch = curl_init("https://api.invoicing.respiresoft.com/v1/plans/ID/pause");
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);
Python
import os, uuid, requests

res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/plans/ID/pause",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
    },
)
data = res.json()

Resume a plan

POST /v1/plans/{id}/resume

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

It starts again on its next date. Dates that passed while it was paused are not made up.

curl
curl -X POST "https://api.invoicing.respiresoft.com/v1/plans/ID/resume" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/plans/ID/resume", {
  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
PHP
$ch = curl_init("https://api.invoicing.respiresoft.com/v1/plans/ID/resume");
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);
Python
import os, uuid, requests

res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/plans/ID/resume",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
    },
)
data = res.json()

End a plan

POST /v1/plans/{id}/end

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

No more runs, for good. Invoices already made stay.

curl
curl -X POST "https://api.invoicing.respiresoft.com/v1/plans/ID/end" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/plans/ID/end", {
  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
PHP
$ch = curl_init("https://api.invoicing.respiresoft.com/v1/plans/ID/end");
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);
Python
import os, uuid, requests

res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/plans/ID/end",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
    },
)
data = res.json()

Skip the next run

POST /v1/plans/{id}/skip_next

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

The next date passes without an invoice or link and does not count towards max_runs.

curl
curl -X POST "https://api.invoicing.respiresoft.com/v1/plans/ID/skip_next" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/plans/ID/skip_next", {
  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
PHP
$ch = curl_init("https://api.invoicing.respiresoft.com/v1/plans/ID/skip_next");
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);
Python
import os, uuid, requests

res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/plans/ID/skip_next",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
    },
)
data = res.json()

Run the next date now

POST /v1/plans/{id}/run_now

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

Makes the invoice or pay link now. The answer has result.ran and, when it failed, the reason.

curl
curl -X POST "https://api.invoicing.respiresoft.com/v1/plans/ID/run_now" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Idempotency-Key: $(uuidgen)"
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/plans/ID/run_now", {
  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
PHP
$ch = curl_init("https://api.invoicing.respiresoft.com/v1/plans/ID/run_now");
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);
Python
import os, uuid, requests

res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/plans/ID/run_now",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
    },
)
data = res.json()

Change a plan from the next period

POST /v1/plans/{id}/change

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

The change waits on the plan and starts with the next run, or the first run on or after effective_on. Invoices already made are not touched.

FieldTypeMeaning
effective_onstringYYYY-MM-DD.
namestring
intervalstring
interval_countinteger
linesarrayThe new rows.
max_runsinteger
ends_onstring
cancelbooleanDrop a waiting change.
curl
curl -X POST "https://api.invoicing.respiresoft.com/v1/plans/ID/change" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"effective_on":"2027-01-01","lines":[{"description":"Managed hosting plus","quantity":"1","unit_amount":5900}]}'
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/plans/ID/change", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "effective_on": "2027-01-01",
    "lines": [
      {
        "description": "Managed hosting plus",
        "quantity": "1",
        "unit_amount": 5900
      }
    ]
  }),
})
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/plans/ID/change");
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([
        "effective_on" => "2027-01-01",
        "lines" => [
            [
                "description" => "Managed hosting plus",
                "quantity" => "1",
                "unit_amount" => 5900,
            ],
        ],
    ]),
]);
$data = json_decode(curl_exec($ch), true);
Python
import os, uuid, requests

res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/plans/ID/change",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
      "effective_on": "2027-01-01",
      "lines": [
        {
          "description": "Managed hosting plus",
          "quantity": "1",
          "unit_amount": 5900
        }
      ]
    },
)
data = res.json()