> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Sample Flows ## Article: Sample Flows ## Article Link: https://dev.wix.com/docs/api-reference/business-management/payments/disputes/sample-flows.md ## Article Content: # Disputes API: Sample Flows This article presents possible use cases and corresponding sample flows that you can support. This can be a helpful jumping off point as you plan your implementation. ## Monitor dispute lifecycle and respond appropriately You need to track disputes as they progress through their lifecycle and take appropriate action based on status changes and available actions. This ensures timely responses within PSP and bank deadlines. To monitor dispute lifecycle and respond appropriately: 1. Subscribe to [Dispute Created](https://dev.wix.com/docs/api-reference/business-management/payments/disputes/disputes/dispute-created.md) and [Dispute Updated](https://dev.wix.com/docs/api-reference/business-management/payments/disputes/disputes/dispute-updated.md) events to receive real-time notifications when disputes are created or their statuses change. Handle the remaining steps in your event handlers. 1. To retrieve the dispute, call [Get Dispute](https://dev.wix.com/docs/api-reference/business-management/payments/disputes/disputes/get-dispute.md), specifying the ID from the event data payload. 1. Check the `actions` array in the dispute to determine what operations are currently available (`ACCEPT` or `DEFEND`) and their respective due dates. 1. Based on your business logic and the dispute details (reason, amount, seller protection level), decide whether to accept liability or defend the dispute. - To accept: Call [Accept Dispute](https://dev.wix.com/docs/api-reference/business-management/payments/disputes/disputes/accept-dispute.md) before the action's due date to acknowledge liability and resolve the dispute. - To defend: 1. Call [Create Dispute Evidence Document](https://dev.wix.com/docs/api-reference/business-management/payments/disputes/dispute-evidence-documents/create-dispute-evidence-document.md) and use the upload URL in the response to [upload a document](https://dev.wix.com/docs/api-reference/business-management/payments/disputes/dispute-evidence-documents/upload-an-evidence-document.md) that supports your defense. Repeat this step for every document you want to submit. 1. Call [Defend Dispute](https://dev.wix.com/docs/api-reference/business-management/payments/disputes/disputes/defend-dispute.md) to submit the evidence documents you uploaded in the previous step. 1. Monitor the dispute status as it moves to `UNDER_REVIEW` and eventually resolves as `WON` or `LOST`. ## Track dispute performance and outcomes Monitor your dispute resolution performance to identify trends, optimize defense strategies, and understand the financial impact on your business. To track dispute performance and outcomes: 1. Analyze disputes over a specific time period by calling [Query Disputes](https://dev.wix.com/docs/api-reference/business-management/payments/disputes/disputes/query-disputes.md) with date range filters using `createdDate`. 1. Calculate your dispute win rate and identify successful defense patterns by filtering the results based on the `status` values `WON` and `LOST`. 1. When reviewing the `LOST` disputes: 1. Make a list of the IDs of the `LOST` disputes retrieved in the previous steps. 1. Call [Query Dispute History Records](https://dev.wix.com/docs/api-reference/business-management/payments/disputes/dispute-history-records/query-dispute-history-records.md), filtering by the IDs of the `LOST` disputes. 1. Review the results to determine which of these disputes were defended and what type of evidence was submitted for each one. 1. When reviewing the `WON` disputes: 1. Make a list of the IDs of the `WON` disputes retrieved in the previous steps. 1. Call [Query Dispute History Records](https://dev.wix.com/docs/api-reference/business-management/payments/disputes/dispute-history-records/query-dispute-history-records.md), filtering by the IDs of the `WON` disputes. 1. Review the results to determine what type of evidence was submitted for each one. 1. Compare the results to identify trends and patterns to improve your strategy in defending disputes.