A refund made in Stripe
A refund made in Stripe is one made outside Hardcount: in the Stripe dashboard, or with Stripe’s API called directly. This page is for checking what Hardcount did with one, and for finishing the ones it left to you. Back to the runbook index.
Symptom
Section titled “Symptom”One of these:
- An invoice shows the notice “A refund of … was made in Stripe and not recorded here”.
- Your system receives the webhook event
payment..refunded_ in_ stripe - You refunded a payment in the Stripe dashboard and want to know what Hardcount recorded.
-
A credit note is how Hardcount knows money went back. A credit note is a document that lowers what a customer owes on an invoice, or records money given back after it was paid. The invoice page, the customer’s invoice page, the PDF, the refund limit and the Stripe Tax reversal all read credit notes.
-
Hardcount writes the credit note itself when the refund is plain, once Stripe says it succeeded (a pending refund waits). The refund becomes an issued credit note when all of these are true:
- it refunds the payment that paid the invoice, and the invoice is paid;
- it is in the invoice’s currency;
- it fits what the invoice has left;
- Hardcount hears of it within a day.
The note’s card refund is that refund, so Hardcount calls nothing at Stripe for it, and it reverses its share of the tax. The note carries
recorded_and names the refund infrom_ stripe: true stripe_; its row on the invoice’s Activity list reads “Refunded in Stripe”.refund_ id -
On a top-up, the note also takes back credit: the unused credit the refund’s amount paid for, at the price paid (
commit_). Each refund stands alone, at its own amount; two partial refunds take what one of their sum would. A refund for credit already used takes none, and its note is still written. A note that, with the earlier ones, returns the whole payment takes all the unused credit.retired_ cents -
Anything else is flagged, never documented. Hardcount does not guess: an issued credit note cannot be undone. A refund of another payment (a second charge), or one that failed, shows on the invoice’s Activity list only. A refund of the invoice’s own payment that does not fit shows the notice, with the reason.
-
Hardcount hears of refunds only if Stripe sends them. The Stripe webhook endpoint needs
refund., with the other refund events. The Hardcount settings page lists them under the webhook address. An endpoint set up before v0.9.2 lackscreated refund.: in Stripe open Developers → Webhooks, open the endpoint, and add it. Without it, Hardcount sees most card refunds only through their latercreated refund., more than a day after they were made, and flags them instead of recording them.updated -
Hardcount sends the customer nothing. Stripe emails a refund receipt if you turned on Email customers for refunds in Stripe. You can send the credit note yourself with Send.
List the refunds made in Stripe on the invoice:
curl -s "$API/v1/invoices/$INVOICE_ID/stripe-refunds" -H "Authorization: Bearer $KEY"You see: one entry per refund, with stripe_, amount_,
status (Stripe’s) and outcome:
outcome |
Meaning | To do |
|---|---|---|
awaiting |
Stripe has not said yet whether it went through | Nothing: Hardcount decides it on Stripe’s next event |
credit_ |
Recorded as the credit note credit_ |
Nothing |
other_ |
A refund of a payment that did not pay this invoice | Nothing: that money was never on the invoice |
not_ |
It failed or was canceled before it succeeded | Nothing: no money moved |
needs_ |
Not recorded; review_ says why |
See Fix |
dismissed |
You marked it handled outside Hardcount | Nothing |
In the dashboard, open the invoice. The “Refunded in Stripe” notice has a button for each step below that applies to the refund, and each asks before it acts:
- Record as credit note (step 1). Offered on a paid invoice when the
reason is
seen_,late invoice_,not_ paid credit_ornote_ refund_ failed credit_.note_ not_ written - Dismiss (step 2), with a note saying how you handled it. Always offered.
- Attach to the credit note whose refund failed (step 3). Offered for
credit_when that note’s refund amount is the refund’s.note_ refund_ failed
With several refunds flagged on one invoice, each gets its own row of buttons. On an invoice whose payment Hardcount also flagged, the notice is titled “Payment needs review” and carries the same buttons after its own.
A note recorded either way shows the tag “Recorded from Stripe”. Under the invoice the refund’s id is shown with it; on the Credit notes page the id is in the tag’s tooltip.
The same steps through the API follow. Act on a needs_ refund by its
review_:
review_ |
Do this |
|---|---|
credit_ |
A credit note on the invoice has a card refund that failed. If this refund replaces it, attach it to that note (step 3). Otherwise record it (step 1) or dismiss it (step 2). Retry refund on that note is refused until then, so the customer is not refunded twice. |
seen_ |
If no credit note on the invoice records it yet, record it (step 1). If you already recorded it by hand, dismiss it (step 2). |
invoice_ |
Check the invoice’s payments in Stripe. Once the invoice is paid, record it (step 1); otherwise dismiss it. |
exceeds_ |
The refund is more than the card payment had left after the card refunds of the invoice’s credit notes and the refunds made in Stripe that no credit note holds. Check the payment in Stripe, record the difference in your own books, and dismiss it. |
exceeds_ |
An earlier credit note already gave part of the invoice back another way, for example as account credit. If that credit was not meant as well, take it back from the customer’s balance. Then dismiss it. |
credit_ |
Hardcount has not written this refund’s credit note yet; record it as a credit note (step 1). On a top-up it takes back the credit the refund paid for, which the customer can spend until then, so the notice is critical. It happens when Hardcount could not read the customer’s usage not invoiced yet as the refund arrived (the log line refund made in Stripe on a top-up recorded without its credit note). A refund of a top-up is otherwise recorded by Hardcount itself. |
currency_ |
Record it in your own books and dismiss it. |
-
Record it with a credit note that names the refund. Send the refund’s amount as the card refund, and its id:
POST /v1/credit-notes{"invoice_id": "inv_…","reason": "Refund made in Stripe","auto_issue": true,"refund_amount_cents": 4000,"stripe_refund_id": "re_…","lines": [{"description": "Refund made in Stripe", "quantity": 1, "unit_amount_cents": 4000}]}You see:
201with the issued note,recorded_andfrom_ stripe: true refund_from Stripe. Hardcount reads the refund from Stripe first: it must be of this invoice’s payment, not made by Hardcount, and not failed. Nothing goes to the credit balance on this note. On a top-up the note takes back the unused credit the refund paid for (status commit_), as Hardcount’s own recording does. A refund made before the customer’s bank won a dispute on the payment is recorded the same way: it moved its money before the dispute.retired_ cents On a top-up, a
503unbilled_means Hardcount could not read the customer’s usage not invoiced yet, which the note counts as credit already used, and wrote nothing: send the same request again. The cause is in the server log, on the lineusage_ unavailable request refused as unavailable; the client may send it againwithresourcecredit_.note -
Or dismiss it, with how you handled it:
Terminal window curl -s -X POST "$API/v1/invoices/$INVOICE_ID/stripe-refunds/$STRIPE_REFUND_ID/dismiss" \-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \-d '{"note": "Recorded in our books on 2026-10-30"}'You see:
200withoutcome: dismissed. The note is kept on the refund and in the audit log. -
Or attach it to the credit note whose refund failed, when you refunded in Stripe what that note’s refund was for. The amounts must match:
Terminal window curl -s -X POST "$API/v1/credit-notes/$CREDIT_NOTE_ID/attach-stripe-refund" \-H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \-d '{"stripe_refund_id": "re_…"}'You see:
200with the note, itsstripe_the refund andrefund_ id refund_status succeeded. No new note, and no second tax reversal.
Never record a refund made in Stripe by hand with an ordinary credit note. One with a card refund refunds the customer again; one without leaves the refund unlinked, and Hardcount may record it a second time. Use step 1 or 3.
If the refund of a recorded credit note fails later (Stripe can fail a
card refund up to 30 days on, and you can cancel a card refund in the Stripe
dashboard for a short time), the note’s refund_ becomes failed and
it shows in the refunds needing attention list. The customer was not
refunded. Retry refund on the note makes a new refund through Hardcount:
use it only if you still mean to refund. If you canceled it on purpose, the
note stays as a record of the attempt; issue a new invoice if the customer
owes the money again. A refund canceled before it succeeded never gets a
note (not_).
Verify
Section titled “Verify”The invoice’s notice is gone, and the list shows credit_ or
dismissed. For a recorded note on an invoice with Stripe Tax, the note’s
tax_ names the reversal.
Two log lines matter:
refund webhook names a payment no Hardcount invoice holds: the payment was not made through Hardcount, so nothing was recorded. For the first 15 minutes after Stripe makes a refund, Hardcount asks Stripe to send the event again instead, because it may not have recorded its own payment yet.refund webhook carries a status Hardcount does not know: Stripe added a refund status. The delivery fails, so Stripe sends it again for up to three days. Upgrade Hardcount to a release that knows the status.
Related: how Hardcount handles card payments and refunds, the webhook events, and ADR-134.
On a top-up: two cases to know
Section titled “On a top-up: two cases to know”- A refund for credit already used, then a void. You refund in Stripe
money for credit the customer already used, so the note takes little or
no credit back. If you then void the usage invoice that used it, the
credit comes back to the top-up, on a payment already refunded. Both are
your own acts; no more money can go back by card than was paid, and a
later refund of the unused credit is bounded by what the credit notes
leave. If the customer should not keep that credit: while the credit
notes leave part of the payment to return, refund it with commit relief.
Once they return all of it, relief answers
409(“This payment has already been returned in full.”), so remove the credit withPOST /and a negativev1/ credits/ adjust amount_. A removal draws the customer’s credit in the order invoices do, promotional credit first.cents - A partial refund meant as goodwill takes credit. Hardcount cannot
tell a goodwill refund from a refund of credit, so every refund of a
top-up’s payment takes back the credit it paid for. For goodwill, grant
credit (
POST /) or pay the customer another way; don’t refund the top-up’s payment. If you did, grant the credit again.v1/ credits/ grant
Stuck, or found a bug? Ask in Discussions · Open an issue