List the refunds made in Stripe on an invoice
const url = 'http://localhost:8080/v1/invoices/hc_inv_dbj84b2q3gpgqfoq5c40/stripe-refunds?limit=50&offset=0';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'http://localhost:8080/v1/invoices/hc_inv_dbj84b2q3gpgqfoq5c40/stripe-refunds?limit=50&offset=0' \ --header 'Authorization: Bearer <token>'Returns the refunds made in Stripe outside Hardcount on the
invoice’s payments, oldest first, whatever Hardcount did with each:
recorded as a credit note, flagged for review, or neither. An
invoice without any returns an empty list. Hardcount records them
from Stripe’s refund webhook events, of which refund. must
be turned on for the Stripe webhook endpoint.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The invoice id (hc_).
Example
hc_inv_dbj84b2q3gpgqfoq5c40Query Parameters
Section titled “Query Parameters”Rows per page, from 1 to 100. Default 50. Any other value, one that
is not a whole number, or limit sent twice is a 422 with
param: limit. It is never clamped.
Rows to skip, 0 or more. Default 0. A negative value, one that is
not a whole number, or offset sent twice is a 422 with
param: offset.
Responses
Section titled “Responses”The invoice’s refunds made in Stripe.
What GET / returns, one page of the refunds made in Stripe on the invoice’s payments, oldest first.
object
The refunds on this page. An empty list when the invoice has none.
A refund made in Stripe outside Hardcount (the Stripe dashboard, or
Stripe’s API called directly) on one of the invoice’s payments,
recorded from Stripe’s refund., refund.,
refund. and charge. webhook events. It holds
the refund as the newest of those events showed it. Hardcount’s own
refunds are never listed here. outcome is what Hardcount did with
the refund: decided when Hardcount first sees it, or, for a refund
first seen in flight (awaiting), when a later event shows how it
ended. After that only you change it, by recording a flagged refund
with a credit note or dismissing it.
object
Unique identifier of the refund record, hc_srf_ and 24 hex characters.
The invoice whose payment was refunded.
Stripe’s refund id (re_…).
The refunded payment.
The refunded Stripe charge (ch_…). Absent when Stripe did not send it.
The refunded amount, in the currency’s minor unit (cents for USD).
The refund’s currency, uppercase.
Stripe’s refund status, as Stripe sends it.
Stripe’s refund reason (duplicate, fraudulent or requested_). Absent when none was given.
Why Stripe could not make the refund, once it failed.
awaiting: first seen pending or requiring action. Nothing is
recorded or sent until a later event shows how it ended: once it
succeeded it is decided as below (the 24-hour rule counts from
Hardcount’s first sighting); failed or canceled, it becomes
not_. credit_: recorded as an issued credit note whose card
refund is this refund (credit_); Hardcount called
nothing at Stripe for it. other_: a refund of a payment
that did not pay the invoice (a second charge, or money on a
voided invoice), so no credit note. needs_: a refund of
the invoice’s own payment that Hardcount did not record
(review_ says why); the invoice shows the
refunded_ notice until a dashboard user or an API key
records it with a credit note or dismisses it. not_:
first seen already failed or canceled, so no money moved.
dismissed: a dashboard user or an API key marked it as handled
outside Hardcount.
Why a refund of the invoice’s own payment was flagged instead of
recorded. Set for needs_ and dismissed, and kept when
a dashboard user or an API key records one with a credit note.
credit_: Hardcount has not written this
refund’s credit note yet; record it as a credit note. On a top-up
the note takes back the unused credit the refund paid for, which
Hardcount could not work out when the refund arrived.
The credit note that records the refund, when outcome is credit_.
The note given when the refund was dismissed. Absent unless outcome is dismissed.
When the refund was dismissed. Absent unless outcome is dismissed.
When Stripe made the refund.
True for a live-mode payment, false for test mode.
When Hardcount first recorded the refund.
When Hardcount last updated the record.
How many rows match the request’s filters, on every page, not only this one. The audit log and the customer list’s search and name or email sort say where they stop counting.
Example
{ "data": [ { "id": "hc_srf_6f1c0a7e9b2d4c8e1a3b5d7f", "invoice_id": "hc_inv_dbj84b2q3gpgqfoq5c40", "stripe_refund_id": "re_3QHk2fLkdIwHu7ix3d4e5f6a", "stripe_payment_intent_id": "pi_3QHk2fLkdIwHu7ix0a1b2c3d", "stripe_charge_id": "ch_3QHk2fLkdIwHu7ix0a1b2c3d", "amount_cents": 2000, "currency": "USD", "status": "succeeded", "reason": "requested_by_customer", "outcome": "needs_review", "review_reason": "seen_late", "refund_created_at": "2026-11-05T16:20:00Z", "livemode": false, "created_at": "2026-11-07T09:00:12Z", "updated_at": "2026-11-07T09:00:12Z" } ], "total": 1}No valid credential: the API key or session is missing, wrong,
expired or revoked. With no API key and no valid session cookie, the
message starts with missing credentials. A wrong, expired and
revoked key all get the same message, invalid or expired API key.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "authentication_error", "code": "unauthorized", "message": "invalid or expired API key", "request_id": "req_dbjg652q3gpgqfoq5cd0" }}The credential is valid but may not call this route. A usage-only
key (hc_) can only send usage, read a customer’s live
credit balance and call GET /; use a secret key. The message names the permission the key
lacks. A browser request that would change data (POST, PUT, PATCH
or DELETE) from a page on another site gets this 403 too, with the
message cross-site request blocked.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "authentication_error", "code": "forbidden", "message": "insufficient permissions: this key type does not have customer:read access", "request_id": "req_dbjg652q3gpgqfoq5cd0" }}No invoice with this id in this account and mode.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "invalid_request_error", "code": "not_found", "message": "invoice not found", "request_id": "req_dbjg652q3gpgqfoq5cd0" }}limit or offset is out of range, not a whole number or sent twice, or the request sends the removed after cursor (param names it)
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "invalid_request_error", "code": "validation_error", "message": "limit must be a whole number from 1 to 100", "request_id": "req_dbjg652q3gpgqfoq5cd0", "param": "limit" }}Too many requests. Wait for the number of seconds in Retry-After,
then retry. The answers that pass the limit carry the
X-RateLimit-* headers too.
Each API key has its own limit, by default 1,000 requests a minute
(HARDCOUNT_), and 1,000 a second on the
usage routes (HARDCOUNT_). The dashboard
sessions of one account share one limit per mode. The routes under
/ and / (sign-in, password reset, invite
accept, setup) count per client address, by default 100 a minute
(HARDCOUNT_). The public invoice,
payment-update and cost-dashboard pages allow 60 a minute per client
address.
The body of an error answer. error. is the broad class,
error. is the exact reason for your code to branch on, and
error. is a sentence for a person. Quote
error. when you ask for help.
object
What went wrong.
object
One of invalid_, authentication_,
rate_ or api_. Every error the API
answers has this shape, including an unknown path (404,
code route_) and a method the path does not take
(405, code method_, with an Allow header).
The few exceptions are listed in
Errors.
The exact reason, such as validation_, not_,
already_, invalid_ or a more specific code
the operation lists. Branch on this, not on message.
What went wrong, written for a person to read.
The id of the request that produced this answer
(req_…). It is normally the same value as the
Hardcount-Request-Id response header. On an answer
replayed for a repeated Idempotency-Key, the body is the
first request’s, so this is the first request’s id, while
the Hardcount-Request-Id header holds the new request’s
id.
The request field or query parameter the error is about. Sent only when the error names one.
A request body may hold only the fields its operation
lists, spelled and cased as listed. Any other field, or one
the server sets (such as id), is refused with 422 and
param naming it. An operation with no request body lists
no fields: send no body, {} or null. The Stripe and
Postmark webhooks and the LiteLLM callback take their
sender’s body as it comes.
Example
{ "error": { "type": "rate_limit_error", "code": "rate_limited", "message": "too many requests — please retry after the rate limit resets", "request_id": "req_dbjg652q3gpgqfoq5cd0" }}Headers
Section titled “Headers”Example
12Seconds to wait before the next request can pass, rounded up to a whole second and at least 1.
Example
1000How many requests the limit allows in its period (a minute, or a second on the usage routes).
Example
0How many requests are left in the current period.
Example
1793870460When the whole limit is available again, as Unix seconds. One
request may pass sooner; Retry-After says when.
Stuck, or found a bug? Ask in Discussions · Open an issue