DEV Community

Cover image for How to Handle Disputes in Payment Integration with Razor pay
Srashti Gupta
Srashti Gupta

Posted on

1 2 2 2 2

How to Handle Disputes in Payment Integration with Razor pay

Disputes Overview

Disputes arise when a customer or their bank questions a payment's legitimacy. Common reasons include:

  • Unauthorized transactions (customer claims they didn’t authorize the payment).
  • Non-receipt of goods or services.
  • Billing errors or overcharging.

When a dispute is initiated, the payment is put under review, and the customer’s bank may reach out to the merchant for resolution.

Dispute Phases

  1. Fraud: The bank suspects fraud and raises a dispute.
  2. Retrieval: The customer requests more details about the transaction (a "soft" chargeback).
  3. Chargeback: The customer’s bank starts an official inquiry for a refund.
  4. Pre-Arbitration: A chargeback that you won is challenged again by the customer.
  5. Arbitration: The chargeback is challenged for the third time, involving card networks, leading to potential high costs.

Dispute Statuses

  • Open: The dispute has been created and is under review.
  • Under Review: The bank is assessing the dispute details.
  • Won: Your evidence was accepted, and the money stays with you.
  • Lost: Your evidence was rejected, and the money is refunded to the customer.
  • Closed: The dispute is resolved, either by refunding the customer or providing sufficient information.

Dispute Process Flow

  1. Dispute Initiation:
    • By Issuing Bank: The bank detects fraud and requests an explanation.
    • By Customer: The customer reports unauthorized charges to their bank.
  2. Notification:
    • You receive a dispute notification.
  3. Accept the Dispute:
    • Fraud Cases: Refund the customer manually.
    • Other Cases: Razorpay handles the refund automatically.
  4. Contest the Dispute:
    • Provide evidence that the transaction was legitimate.
  5. Bank Review:
    • The bank reviews your evidence and makes a decision.
  6. Outcome:
    • Lost: The disputed amount is deducted and refunded to the customer.
    • Won: You retain the amount if your evidence is accepted.

Managing Disputes on Razorpay

Using Razorpay Dashboard

1. View Disputes

  • Log in to the Razorpay Dashboard.
  • Navigate to Transactions > Disputes.
  • Click on a Dispute ID to see details.

2. Accept Disputes

  • If the dispute is valid, accept it.
  • Steps:
    • Log in to the Dashboard.
    • Go to Transactions > Disputes.
    • Click on a Dispute ID, then Accept Dispute.
    • Confirm by clicking Yes, Accept.

3. Contest Disputes

  • If you believe the dispute is invalid, contest it with evidence.
  • Steps:
    • Log in to the Dashboard.
    • Go to Transactions > Disputes.
    • Click on a Dispute ID, then Contest & Upload Evidence.
    • Choose full/partial contest, provide an explanation, and upload supporting documents.
    • Click Submit Evidence and confirm.

Using Razorpay APIs

1. View Disputes

{% raw %}
GET /v1/disputes
GET /v1/disputes/{dispute_id}
{% endraw %}
Enter fullscreen mode Exit fullscreen mode

2. Accept Disputes

{% raw %}
POST /v1/disputes/{dispute_id}/accept
{% endraw %}
Enter fullscreen mode Exit fullscreen mode

3. Contest Disputes

{% raw %}
POST /v1/disputes/{dispute_id}/contest
POST /v1/documents
{% endraw %}
Enter fullscreen mode Exit fullscreen mode

Subscribe to Webhooks

Get real-time dispute notifications by subscribing to webhook events.

How to Subscribe:

  1. Log in to the Razorpay Dashboard.
  2. Navigate to Account & Settings > Webhooks to subscribe.

Webhook Events:

{% raw %}
payment.dispute.created
payment.dispute.won
payment.dispute.lost
payment.dispute.closed
payment.dispute.under_review
payment.dispute.action_required
{% endraw %}
Enter fullscreen mode Exit fullscreen mode

For more details, refer to Razorpay’s Webhooks Documentation.

Accepting the Dispute

Fraud Cases:

  • If the dispute is fraud-related (e.g., unauthorized transactions), refund the customer manually.
  • Use the Refund API or Razorpay’s Dashboard to process the refund.

Other Cases:

  • Auto-Refund: If the dispute is not fraud-related (e.g., delivery issues), Razorpay automatically handles the refund.

Handling disputes effectively ensures smooth payment processing and better customer relationships.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay