The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.
TypeScript b2b-marketplacecomposable-commerceecommerceenterpriseheadless-commercemarketplacemedusamedusajsmulti-vendortypescript
docs: clarify Stripe webhook events for split-order checkout (#1523)
Viktor Holik057c59247c17
diff --git a/apps/docs/resources/integrations/stripe-connect.mdx b/apps/docs/resources/integrations/stripe-connect.mdxindex 7f65f4b49..bfe7cda8d 100644--- a/apps/docs/resources/integrations/stripe-connect.mdx+++ b/apps/docs/resources/integrations/stripe-connect.mdx@@ -193,9 +193,17 @@ You need **two separate webhook endpoints** in Stripe: one for payment events, o- `payment_intent.succeeded`- `payment_intent.amount_capturable_updated`- `payment_intent.payment_failed`- - `charge.refunded`+ - `payment_intent.partially_funded` (optional, only if you support that recovery flow)Copy the signing secret and set it as `STRIPE_WEBHOOK_SECRET` in your `.env`.++ <Note>+ With `capture: false`, Stripe sends `payment_intent.amount_capturable_updated` as soon as the payment is authorized, which can be before the storefront calls `POST /store/carts/:id/complete`. A webhook-driven completion runs `completeCartWithSplitOrdersWorkflow` under the same cart lock as the store route, so it still produces an order group with per-seller orders. It also completes carts whose customer left right after authenticating, so keep it enabled.+ </Note>++ <Warning>+ Don't rely on `charge.refunded` for seller reconciliation. The Medusa Stripe provider doesn't act on it, and it never reverses Stripe Connect Transfers. See [Refunds and reversals](#refunds-and-reversals).+ </Warning></Step><Step title="Add the payout webhook (Mercur)">Add a second webhook endpoint in the Stripe Dashboard.@@ -298,6 +306,8 @@ Refunding a charge does **not** automatically reverse the associated transfers.1. **Refund the PaymentIntent.** Returns funds to the customer's payment method2. **Reverse the Transfer(s).** Claws back funds from the connected account(s)+Mercur doesn't reverse transfers for you. The Stripe Connect payout provider only handles `account.updated`, and a `charge.refunded` event is not confirmation that any seller transfer was reversed. If you refund after a seller has been paid out, reconcile their side yourself, either with a transfer reversal or by deducting the amount from their next payout.+For a full refund of a multi-seller order, you would need to reverse each seller's transfer individually. For partial refunds, you need to calculate how much to reverse from each seller based on which items are being refunded.<Info>