Skip to content
Hardcount
Run it locally
Pre-1.0 · one maintainer · Stripe and cards only · no SDKs (client libraries) yet · no production users yet. Docs describe v0.12.0 (30 Nov 2026) · What’s new →

List the refunds made in Stripe on an invoice

GET
/v1/invoices/{id}/stripe-refunds
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.created must be turned on for the Stripe webhook endpoint.

id
required
string

The invoice id (hc_inv_…).

Example

hc_inv_dbj84b2q3gpgqfoq5c40
limit
integer
default: 50 >= 1 <= 100

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.

offset
integer
0

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.

The invoice’s refunds made in Stripe.

Media typeapplication/json

What GET /v1/invoices/{id}/stripe-refunds returns, one page of the refunds made in Stripe on the invoice’s payments, oldest first.

object
data
required

The refunds on this page. An empty list when the invoice has none.

Array<object>

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.created, refund.updated, refund.failed and charge.refund.updated 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
id
required

Unique identifier of the refund record, hc_srf_ and 24 hex characters.

string
invoice_id
required

The invoice whose payment was refunded.

string
stripe_refund_id
required

Stripe’s refund id (re_…).

string
stripe_payment_intent_id
required

The refunded payment.

string
stripe_charge_id

The refunded Stripe charge (ch_…). Absent when Stripe did not send it.

string
amount_cents
required

The refunded amount, in the currency’s minor unit (cents for USD).

integer format: int64
currency
required

The refund’s currency, uppercase.

string
status
required

Stripe’s refund status, as Stripe sends it.

string
Allowed values: pending requires_action succeeded failed canceled
reason

Stripe’s refund reason (duplicate, fraudulent or requested_by_customer). Absent when none was given.

string
failure_reason

Why Stripe could not make the refund, once it failed.

string
outcome
required

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_refunded. credit_note: recorded as an issued credit note whose card refund is this refund (credit_note_id); Hardcount called nothing at Stripe for it. other_payment: 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_review: a refund of the invoice’s own payment that Hardcount did not record (review_reason says why); the invoice shows the refunded_in_stripe notice until a dashboard user or an API key records it with a credit note or dismisses it. not_refunded: first seen already failed or canceled, so no money moved. dismissed: a dashboard user or an API key marked it as handled outside Hardcount.

string
Allowed values: awaiting credit_note other_payment needs_review not_refunded dismissed
review_reason

Why a refund of the invoice’s own payment was flagged instead of recorded. Set for needs_review and dismissed, and kept when a dashboard user or an API key records one with a credit note. credit_note_not_written: 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.

string
Allowed values: invoice_not_paid currency_mismatch seen_late credit_note_refund_failed exceeds_card_refundable exceeds_creditable credit_note_not_written
credit_note_id

The credit note that records the refund, when outcome is credit_note.

string
dismissed_note

The note given when the refund was dismissed. Absent unless outcome is dismissed.

string
dismissed_at

When the refund was dismissed. Absent unless outcome is dismissed.

string format: date-time
refund_created_at
required

When Stripe made the refund.

string format: date-time
livemode
required

True for a live-mode payment, false for test mode.

boolean
created_at
required

When Hardcount first recorded the refund.

string format: date-time
updated_at
required

When Hardcount last updated the record.

string format: date-time
total
required

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.

integer

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.

Media typeapplication/json

The body of an error answer. error.type is the broad class, error.code is the exact reason for your code to branch on, and error.message is a sentence for a person. Quote error.request_id when you ask for help.

object
error

What went wrong.

object
type
required

One of invalid_request_error, authentication_error, rate_limit_error or api_error. Every error the API answers has this shape, including an unknown path (404, code route_not_found) and a method the path does not take (405, code method_not_allowed, with an Allow header). The few exceptions are listed in Errors.

string
code
required

The exact reason, such as validation_error, not_found, already_exists, invalid_state or a more specific code the operation lists. Branch on this, not on message.

string
message
required

What went wrong, written for a person to read.

string
request_id
required

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.

string
param

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.

string

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_ingest_…) can only send usage, read a customer’s live credit balance and call GET /v1/whoami; 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.

Media typeapplication/json

The body of an error answer. error.type is the broad class, error.code is the exact reason for your code to branch on, and error.message is a sentence for a person. Quote error.request_id when you ask for help.

object
error

What went wrong.

object
type
required

One of invalid_request_error, authentication_error, rate_limit_error or api_error. Every error the API answers has this shape, including an unknown path (404, code route_not_found) and a method the path does not take (405, code method_not_allowed, with an Allow header). The few exceptions are listed in Errors.

string
code
required

The exact reason, such as validation_error, not_found, already_exists, invalid_state or a more specific code the operation lists. Branch on this, not on message.

string
message
required

What went wrong, written for a person to read.

string
request_id
required

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.

string
param

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.

string

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.

Media typeapplication/json

The body of an error answer. error.type is the broad class, error.code is the exact reason for your code to branch on, and error.message is a sentence for a person. Quote error.request_id when you ask for help.

object
error

What went wrong.

object
type
required

One of invalid_request_error, authentication_error, rate_limit_error or api_error. Every error the API answers has this shape, including an unknown path (404, code route_not_found) and a method the path does not take (405, code method_not_allowed, with an Allow header). The few exceptions are listed in Errors.

string
code
required

The exact reason, such as validation_error, not_found, already_exists, invalid_state or a more specific code the operation lists. Branch on this, not on message.

string
message
required

What went wrong, written for a person to read.

string
request_id
required

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.

string
param

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.

string

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)

Media typeapplication/json

The body of an error answer. error.type is the broad class, error.code is the exact reason for your code to branch on, and error.message is a sentence for a person. Quote error.request_id when you ask for help.

object
error

What went wrong.

object
type
required

One of invalid_request_error, authentication_error, rate_limit_error or api_error. Every error the API answers has this shape, including an unknown path (404, code route_not_found) and a method the path does not take (405, code method_not_allowed, with an Allow header). The few exceptions are listed in Errors.

string
code
required

The exact reason, such as validation_error, not_found, already_exists, invalid_state or a more specific code the operation lists. Branch on this, not on message.

string
message
required

What went wrong, written for a person to read.

string
request_id
required

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.

string
param

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.

string

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_RATE_LIMIT_GENERAL_PER_MIN), and 1,000 a second on the usage routes (HARDCOUNT_RATE_LIMIT_INGEST_PER_SEC). The dashboard sessions of one account share one limit per mode. The routes under /v1/auth and /v1/bootstrap (sign-in, password reset, invite accept, setup) count per client address, by default 100 a minute (HARDCOUNT_RATE_LIMIT_AUTH_PER_MIN). The public invoice, payment-update and cost-dashboard pages allow 60 a minute per client address.

Media typeapplication/json

The body of an error answer. error.type is the broad class, error.code is the exact reason for your code to branch on, and error.message is a sentence for a person. Quote error.request_id when you ask for help.

object
error

What went wrong.

object
type
required

One of invalid_request_error, authentication_error, rate_limit_error or api_error. Every error the API answers has this shape, including an unknown path (404, code route_not_found) and a method the path does not take (405, code method_not_allowed, with an Allow header). The few exceptions are listed in Errors.

string
code
required

The exact reason, such as validation_error, not_found, already_exists, invalid_state or a more specific code the operation lists. Branch on this, not on message.

string
message
required

What went wrong, written for a person to read.

string
request_id
required

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.

string
param

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.

string

Example

{
"error": {
"type": "rate_limit_error",
"code": "rate_limited",
"message": "too many requests — please retry after the rate limit resets",
"request_id": "req_dbjg652q3gpgqfoq5cd0"
}
}
Retry-After
integer
Example
12

Seconds to wait before the next request can pass, rounded up to a whole second and at least 1.

X-RateLimit-Limit
integer
Example
1000

How many requests the limit allows in its period (a minute, or a second on the usage routes).

X-RateLimit-Remaining
integer
Example
0

How many requests are left in the current period.

X-RateLimit-Reset
integer format: int64
Example
1793870460

When 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