Optional analytics on public pages. No session recording. Support works either way. Privacy details
API reference
Refunds recorded for an invoice.
/invoices/:invoiceId/refundsRefunds recorded for an invoice, newest first.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
| invoiceId | path | string | Yes | Invoice identifier. |
const response = await fetch(`${process.env.BOSPAY_API_BASE}/invoices/inv_1048/refunds`, {
method: "GET",
headers: {
"Content-Type": "application/json",
"BOSPay-Version": "2026-09-23",
"X-API-Key": process.env.BOSPAY_API_KEY,
}
});
if (!response.ok) {
throw new Error(`BOSPay request failed: ${response.status}`);
}
const data = await response.json();Success
{
"id": "rf_7Xq2Lm9Pz4Ka1Bc8Dn3Ev5Rt",
"object": "refund",
"invoiceId": "inv_1048",
"amount": "2.1",
"tokenSymbol": "USDC",
"chain": "sepolia",
"txHash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060",
"reason": "Overpayment returned",
"recordedBy": "key_9f2c",
"createdAt": "2026-09-24T09:12:00.000Z"
}Validation error
{
"error": {
"type": "invalid_request_error",
"code": "validation_error",
"message": "A valid fiatAmount is required.",
"field": "fiatAmount",
"requestId": "req_3f0c9a1b2c4d5e6f7a8b9c0d"
}
}