RespireSoft InvoicingAPI docsReferenceWebhooks

Credit notes

Reduce or cancel an invoice.

List credit notes

GET /v1/credit_notes

Key scope documents:read

Newest first, 20 at a time. See pagination.

Query: status, customer, number, limit, starting_after

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

Retrieve credit note

GET /v1/credit_notes/{id}

Key scope documents:read

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

Create credit note

POST /v1/credit_notes

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

FieldTypeMeaning
parentstringThe invoice it corrects.
customerstring
currency requiredstringISO 4217 code, for example EUR.
lines requiredarrayRows of the document. Each row: description, quantity, unit_amount (integer minor units), product?, price?, tax_rate?, discount_percent_bp?, discount_amount?.
curl
curl -X POST "https://api.invoicing.respiresoft.com/v1/credit_notes" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"parent":"inv_…","currency":"EUR","lines":[{"description":"Refund","quantity":"1","unit_amount":4900}]}'
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/credit_notes", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "parent": "inv_…",
    "currency": "EUR",
    "lines": [
      {
        "description": "Refund",
        "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/credit_notes");
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([
        "parent" => "inv_…",
        "currency" => "EUR",
        "lines" => [
            [
                "description" => "Refund",
                "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/credit_notes",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
      "parent": "inv_…",
      "currency": "EUR",
      "lines": [
        {
          "description": "Refund",
          "quantity": "1",
          "unit_amount": 4900
        }
      ]
    },
)
data = res.json()

Update credit note

PATCH /v1/credit_notes/{id}

Key scope documents:write

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

FieldTypeMeaning
parentstringThe invoice it corrects.
customerstring
currencystringISO 4217 code, for example EUR.
linesarrayRows of the document. Each row: description, quantity, unit_amount (integer minor units), product?, price?, tax_rate?, discount_percent_bp?, discount_amount?.
curl
curl -X PATCH "https://api.invoicing.respiresoft.com/v1/credit_notes/ID" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"parent":"inv_…","currency":"EUR","lines":[{"description":"Refund","quantity":"1","unit_amount":4900}]}'
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/credit_notes/ID", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "parent": "inv_…",
    "currency": "EUR",
    "lines": [
      {
        "description": "Refund",
        "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/credit_notes/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([
        "parent" => "inv_…",
        "currency" => "EUR",
        "lines" => [
            [
                "description" => "Refund",
                "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/credit_notes/ID",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
    },
    json={
      "parent": "inv_…",
      "currency": "EUR",
      "lines": [
        {
          "description": "Refund",
          "quantity": "1",
          "unit_amount": 4900
        }
      ]
    },
)
data = res.json()

Delete credit note

DELETE /v1/credit_notes/{id}

Key scope documents:write

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

Issue credit note

POST /v1/credit_notes/{id}/issue

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

Gives the draft its number and locks it.

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

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

Send credit note

POST /v1/credit_notes/{id}/send

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

Emails the document to the customer.

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

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

Void credit note

POST /v1/credit_notes/{id}/void

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

Cancels an issued document that has no payments.

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

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

Download the PDF credit note

GET /v1/credit_notes/{id}/pdf

Key scope documents:read

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