RespireSoft InvoicingAPI docsReferenceWebhooks

Payments

Money received. Record a cash or bank payment, or refund one.

List payments

GET /v1/payments

Key scope payments:read

Newest first, 20 at a time. See pagination.

Query: status, customer, method, provider, currency, limit, starting_after

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

Retrieve payment

GET /v1/payments/{id}

Key scope payments:read

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

Record a payment

POST /v1/payments

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

FieldTypeMeaning
method requiredstringcash, bank_transfer or manual.
amount requiredintegerMinor units.
currency requiredstringISO 4217 code, for example EUR.
customerstring
allocationsarrayRows of {document, amount}: what the payment pays. A receipt is issued.
received_atstringISO 8601.
referencestring
notestring
pendingbooleanWait for confirmation.
curl
curl -X POST "https://api.invoicing.respiresoft.com/v1/payments" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"method":"bank_transfer","amount":4900,"currency":"EUR","allocations":[{"document":"inv_…","amount":4900}]}'
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/payments", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "method": "bank_transfer",
    "amount": 4900,
    "currency": "EUR",
    "allocations": [
      {
        "document": "inv_…",
        "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/payments");
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([
        "method" => "bank_transfer",
        "amount" => 4900,
        "currency" => "EUR",
        "allocations" => [
            [
                "document" => "inv_…",
                "amount" => 4900,
            ],
        ],
    ]),
]);
$data = json_decode(curl_exec($ch), true);
Python
import os, uuid, requests

res = requests.request("POST", "https://api.invoicing.respiresoft.com/v1/payments",
    headers={
        "Authorization": "Bearer " + os.environ["RESPIRESOFT_KEY"],
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={
      "method": "bank_transfer",
      "amount": 4900,
      "currency": "EUR",
      "allocations": [
        {
          "document": "inv_…",
          "amount": 4900
        }
      ]
    },
)
data = res.json()

Refund a payment

POST /v1/payments/{id}/refund

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

FieldTypeMeaning
amount requiredintegerMinor units, at most what is left.
reasonstringrequested_by_customer, duplicate, fraudulent or other.
notestring
credit_notebooleanAlso make a credit note.
curl
curl -X POST "https://api.invoicing.respiresoft.com/v1/payments/ID/refund" \
  -H "Authorization: Bearer $RESPIRESOFT_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"amount":1000,"reason":"requested_by_customer"}'
Node
const res = await fetch("https://api.invoicing.respiresoft.com/v1/payments/ID/refund", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.RESPIRESOFT_KEY}`,
    "Idempotency-Key": crypto.randomUUID(),
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "amount": 1000,
    "reason": "requested_by_customer"
  }),
})
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/payments/ID/refund");
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([
        "amount" => 1000,
        "reason" => "requested_by_customer",
    ]),
]);
$data = json_decode(curl_exec($ch), true);
Python
import os, uuid, requests

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