Stripe Dispute and Chargeback Response
When a Stripe dispute (chargeback) is opened, the flow gathers order, delivery, and communication evidence from Dataverse, assembles an evidence package, alerts finance in Teams with the response deadline, and on approval submits the evidence to Stripe. Streamlines chargeback responses before the deadline.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow streamlines Stripe chargeback (dispute) responses before their deadline. On a schedule it polls Stripe for newly created disputes, enriches each from the disputed charge, gathers the matching order / delivery / communication evidence from Dataverse, assembles an evidence package, alerts Finance in Teams with the response deadline, and — on Approval — submits the evidence back to Stripe. An idempotent Dataverse case log tracks every dispute and its submission status.
Why it matters: Disputes carry tight, fixed deadlines (evidence_details.due_by) and need the right evidence assembled fast. Automating collection, sign-off, and submission improves win rates and saves Finance from manual scramble.
Status: Ships Off (demo). Going live requires only: authorize the four connections, set the environment-variable values, and turn the flow on.
Use Case
Finance and Operations want chargebacks handled quickly with the correct evidence assembled automatically, a clear deadline surfaced in Teams, and a human sign-off before anything is sent to Stripe so weak responses are never auto-submitted.
Flow Architecture
Recurrence
Recurrence (every 3 hours)Polls Stripe every 3 hours for newly created disputes.
Initialize Correlation Id
Initialize Variableguid() stamped on every case row + notification for tracing.
Initialize Case Id
Initialize VariableHolds the Dataverse case row id for the post-approval update.
Initialize config variables
Initialize VariableBind Stripe Api Base, Lookback Hours, Teams Group Id, Teams Channel Id, Finance Approver, and Auto Submit env vars to working variables.
Compose Created Window
ComposeUnix-seconds lower bound (now - lookback hours) for the Stripe query.
Get Stripe Disputes
HTTP GETLists disputes created in the window via .../disputes?created[gte]=...
Parse Disputes
Parse JSONTypes the data[] array.
Apply to each Dispute
Foreach (sequential, concurrency 1)Processes each dispute: extract ids/due date, fetch charge + customer + Dataverse evidence, assemble package, idempotent case upsert, Teams alert, Approvals sign-off, then on Approve submit evidence (HTTP POST submit=true) and update case, else mark Declined - Manual Review.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_StripeApiKey | String | sk_live_REPLACE... | Stripe secret key (Bearer) for the dispute/charge REST calls. Reused. |
| flowlibs_StripeApiBase | String | https://api.stripe.com/v1 | Stripe REST base URL. Reused. |
| flowlibs_DisputeLookbackHours | String | 24 | How many hours back to scan Stripe for new disputes each poll. |
| flowlibs_TeamsGroupId | String | REPLACE_WITH_TEAMS_GROUP_ID | Teams team (group) id for the Finance alert channel. Reused. |
| flowlibs_TeamsChannelId | String | REPLACE_WITH_TEAMS_CHANNEL_ID | Teams channel id for the Finance alert channel. Reused. |
| flowlibs_FinanceApprover | String | finance-reviewer@your-org.com | Reviewer (UPN) who approves evidence before submission. |
| flowlibs_AutoSubmit | String | false | When false, evidence is held for approval (surfaced in the approval details). |
| flowlibs_EvidenceFields | String | {"product_description":...} | JSON mapping of Stripe evidence fields -> Dataverse Order Evidence columns. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Stripe | shared_stripe | GetCustomer |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords CreateRecord UpdateRecord |
| Microsoft Teams | shared_teams | PostMessageToConversation |
| Approvals | shared_approvals |
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Template by reason
- Branch on dispute.reason (e.g. fraudulent, product_not_received) to assemble reason-specific evidence fields.
- Auto-accept low value
- Use flowlibs_AutoSubmit + an amount threshold to concede small disputes via Stripe POST .../disputes/{id} {submit:true} without an approval.
- Win tracking
- Extend the case table with an outcome column and a second flow that polls dispute.status (won/lost) for analytics.
- Polling cadence
- Adjust the Recurrence interval or flowlibs_DisputeLookbackHours to match dispute volume.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Lookback window (unix sec)
Computes the unix-seconds lower bound for the Stripe disputes query.
EXPR.02Deadline (epoch -> ISO)
Converts the dispute due_by epoch to an ISO datetime.
EXPR.03Amount (cents -> currency)
Converts the Stripe cents amount to a major-unit decimal.
EXPR.04Idempotent upsert test
True when an existing case row already exists for the dispute.
EXPR.05Submit evidence (form-encoded)
Form-encoded body submitted to the Stripe disputes endpoint.
EXPR.06Approval outcome
True when the Finance reviewer approved the evidence.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.