-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Description
Why
When we issue a refund in stripe, we don't adjust the balance of the user.
What
Implement the proper webhook event handler when refunds are issued.
- https://github.com/akash-network/console/blob/main/apps/api/src/billing/services/stripe-webhook/stripe-webhook.service.ts
- https://docs.stripe.com/api/events/types#event_types-refund.created
The webhook event in Stripe for refunds is refund.created. This event is triggered whenever a new refund is successfully created, whether it's a full or partial refund on a charge, PaymentIntent, or other payment object.
Key Details
- When it fires: Immediately after you create a refund via the API (e.g., using the Refunds API endpoint). It includes details like the refund amount, reason, and status (typically
succeededfor most cases). - Related events for refund lifecycle:
refund.updated: Fires if the refund status changes (e.g., tofailedorcanceled).
- Legacy note: Older integrations might reference
charge.refunded(for charge-based refunds), but as of API version 2024-10-28, Stripe unified refund events under therefund.*types for consistency across all refund scenarios, including those without a direct charge.
For full implementation, listen for this event in your webhook endpoint and verify the signature for security. See Stripe's events documentation for the exact payload structure.
Metadata
Metadata
Assignees
Labels
No labels