Simulate test scenarios
Before going live, you can use the PayPal sandbox environment to test the Disputes API integration. This ensures it works as expected and meets all business and technical requirements.Prerequisites
- Ensure you set up the sandbox environment.
- Ensure you set up buyer-side credentials in the sandbox environment. This is required to create disputes or change dispute reasons as a buyer.
Simulate buyer actions
Before testing dispute responses for your integration, you need to simulate buyer actions to create the disputes and transactions in the sandbox environment.Create transaction
Create transaction
- Log in to your sandbox personal account as a buyer.
- Select Send and Request and follow the on-page instructions to send money to your sandbox business account’s email ID.
For a transaction to be eligible for chargeback, ensure you use a credit card to send money.
- Select Go to Summary.
- In the Recent activity section, select the transaction.
- On the Summary page, copy the Transaction ID. Use this value to create a dispute.
Create dispute
Create dispute
POST call to the /v1/customer/disputes endpoint. Include the following parameters:201 Created response and an HATEOAS link for the dispute. Use the dispute ID from the HATEOAS link to perform subsequent tests on the dispute.To test Accelerated Response, see Accelerated Response sandbox testing.Create chargeback
Create chargeback
POST call to the /v2/customer-support/process-chargeback endpoint. Include the following parameters:201 Created response and a dispute ID. Use the dispute ID to perform subsequent tests on the dispute.Change dispute reason
Change dispute reason
POST call to the /v1/customer/disputes/{ID}/change-reason endpoint. Include the following parameters:ID is the dispute_id returned in the Create dispute response.200 OK response and an HATEOAS link for the dispute.Accept offer to resolve dispute
Accept offer to resolve dispute
POST call to the /v1/customer/disputes/{id}/accept-offer endpoint. Include the following parameter:id is the dispute_id returned in the Create dispute response.200 OK status code and a HATEOAS link to the dispute. If money movement for the offer is delayed due to internal reasons, the call returns an HTTP 202 Accepted status code instead.Deny offer to resolve dispute
Deny offer to resolve dispute
POST call to the /v1/customer/disputes/{id}/deny-offer endpoint. Include the following parameter:id is the dispute_id returned in the Create dispute response.200 OK status code and a HATEOAS link to the dispute.Simulate PayPal actions
Settle dispute
Settle dispute
status is UNDER_REVIEW and the adjudicate link is available in the HATEOAS links of the show dispute details response.To make this call, the dispute status must be UNDER_REVIEW and the adjudicate link must be available in the HATEOAS links of the show dispute details response.Use a valid access token and make a POST call to the /v1/customer/disputes/{id}/adjudicate endpoint. Include the following parameter:id is the dispute_id returned in the Create dispute response.200 OK status code and a HATEOAS link to the dispute.Update dispute status
Update dispute status
UNDER_REVIEW to either WAITING_FOR_BUYER_RESPONSE or WAITING_FOR_SELLER_RESPONSE. This status change enables either the customer or merchant to submit evidence for the dispute.To make this call, the dispute status must be UNDER_REVIEW and the require-evidence link must be available in the HATEOAS links of the show dispute details response.Use a valid access token and make a POST call to the /v1/customer/disputes/{id}/require-evidence endpoint. Include the following parameter:id is the dispute_id returned in the Create dispute response.200 OK status code and a HATEOAS link to the dispute.Test dispute scenarios
You can use the scenarios in this section to test how your integration handles disputes and chargebacks in the sandbox environment.Test internal disputes
Test internal disputes
OTHER as the evidence type when you provide evidence.- Webhooks:
- Case creation:
CUSTOMER.DISPUTE.CREATED - Merchant response for evidence submission:
CUSTOMER.DISPUTE.UPDATED - Case resolution:
CUSTOMER.DISPUTE.RESOLVED
- Case creation:
- Emails: Case creation, response request, and resolution.
Test chargebacks
Test chargebacks
- Mastercard: Reason code -
4853 - Visa: Reason code -
C2 - For test conditions where a temporary hold applies, the hold is placed and released when the case is resolved in the merchant’s favor.
- Webhooks:
- Case creation:
CUSTOMER.DISPUTE.CREATED - Merchant response for evidence submission:
CUSTOMER.DISPUTE.UPDATED - Case resolution:
CUSTOMER.DISPUTE.RESOLVED
- Case creation:
- Emails: Case creation, response request, and resolution.
Test merchant response
You can test and determine how to respond to disputes using different scenarios. This ensures that your integration correctly handles the merchant actions during the dispute process. Key terms:- INR: Item Not Received
- SNAD: Significantly Not As Described
Check response due date and HATEOAS links
You can use the Show dispute details response to determine how and when to respond to disputes.Inquiry stage
You can use the procedures in this section to test dispute response handling during the inquiry stage.Send message to other party
Send message to other party
Make offer to resolve dispute
Make offer to resolve dispute
Note: Merchant must have sufficient funds to issue a refund.
REFUND_WITH_RETURN - SNAD case
REFUND_WITH_RETURN - SNAD case
REFUND_WITH_REPLACEMENT - SNAD case
REFUND_WITH_REPLACEMENT - SNAD case
REPLACEMENT_WITHOUT_REFUND - SNAD case
REPLACEMENT_WITHOUT_REFUND - SNAD case
REFUND
REFUND
Acknowledge returned item
Acknowledge returned item
Provide evidence
Provide evidence
PROOF_OF_FULFILLMENT
PROOF_OF_FULFILLMENT
PROOF_OF_FULFILLMENT evidence type by providing tracking information for the INR cases.PROOF_OF_REFUND
PROOF_OF_REFUND
PROOF_OF_REFUND evidence type by providing refund details for the INR cases.OTHER
OTHER
OTHER evidence type by providing notes or documents (including photos and files) for the INR cases.
Accept claim
Accept claim
Note: Merchant must have sufficient funds to issue a refund.
Escalate dispute to claim
Escalate dispute to claim
Claim stage
You can use the procedures in this section to test dispute response handling during the claim stage.Provide evidence
Provide evidence
PROOF_OF_FULFILLMENT - INR case
PROOF_OF_FULFILLMENT - INR case
PROOF_OF_FULFILLMENT evidence type by providing tracking information for the INR cases.PROOF_OF_REFUND
PROOF_OF_REFUND
PROOF_OF_REFUND evidence type by providing refund details for the INR or SNAD cases.OTHER
OTHER
OTHER evidence type by providing notes or documents (including photos and files) for the INR or SNAD cases.
Accept claim
Accept claim
Note: Merchant must have sufficient funds to issue a refund.
REFUND
REFUND
REFUND_WITH_RETURN
REFUND_WITH_RETURN
PARTIAL_REFUND
PARTIAL_REFUND
Acknowledge returned item
Acknowledge returned item
Appeal dispute
When PayPal adjudicates a case against a party, you or the buyer may be eligible to appeal the decision. PayPal uses predefined rules to determine appeal eligibility. To test appeals, create a buyer account with a primary email address that includesallowappeal (for example, testallowappeal@personal.example.com). The disputes created with this account will trigger:
- The seller appeal workflow if you are found liable.
- The buyer appeal workflow if the buyer is found liable.
noappeal (for example, testnoappeal@personal.example.com).
You can appeal the case and provide evidence using these evidence types.
PROOF_OF_FULFILLMENT
PROOF_OF_FULFILLMENT
PROOF_OF_REFUND
PROOF_OF_REFUND
OTHER
OTHER
OTHER evidence type if the requested evidence is not covered by the PROOF_OF_FULFILLMENT and PROOF_OF_REFUND evidence types.Accelerated Response sandbox testing
To enable Accelerated Response for a dispute, include the valueACCELERATED_RESPONSE_ENABLED in the notes field under evidences when submitting your create_dispute API request.
Escalation simulation
To simulate the day of escalation in the sandbox environment, use the following transaction amounts:Applicable dispute reasons
Accelerated Response currently applies to these dispute reasons:MERCHANDISE_OR_SERVICE_NOT_AS_DESCRIBEDMERCHANDISE_OR_SERVICE_NOT_RECEIVED
Applicable document proofs
Refer to the applicable documentation requirements in Supported file types and sizes.Test webhooks
To test disputes webhooks, you need to wait a few minutes after creating the dispute for the actions to become available. You can then perform the actions to trigger the webhooks.Test dispute created webhook
You can test theCUSTOMER.DISPUTE.CREATED webhook in both the inquiry and claim stages.
Inquiry stage
You can test this webhook in the inquiry stage for these scenarios.SNAD case
SNAD case
INR case
INR case
Claim stage
You can test this webhook in the claim stage for these scenarios.SNAD case
SNAD case
INR case
INR case
Transaction error case
Transaction error case
CREDIT_NOT_PROCESSED, DUPLICATE_TRANSACTION, INCORRECT_AMOUNT, PAYMENT_BY_OTHER_MEANS, CANCELED_RECURRING_BILLING, or OTHER.Duplicate dispute creation (negative testing)
Duplicate dispute creation (negative testing)
Test dispute updated webhook
You can test theCUSTOMER.DISPUTE.UPDATED webhook in both the inquiry and claim stages.
Inquiry stage
You can test this webhook in the inquiry stage for this scenario.Buyer sends message to merchant
Buyer sends message to merchant
Claim stage
You can test this webhook in the claim stage for these scenarios.Buyer provides return tracking information
Buyer provides return tracking information
Buyer changes reason
Buyer changes reason
Test dispute resolved webhook
You can test theCUSTOMER.DISPUTE.RESOLVED webhook for these scenarios.
Buyer cancels dispute
Buyer cancels dispute
Settle dispute (buyer wins)
Settle dispute (buyer wins)
Settle dispute (merchant wins)
Settle dispute (merchant wins)
Identify unique webhook through webhook ID
You can test identifying a specific webhook using the webhook ID in the webhook payload.Test API calls: use test values and simulate responses
To simulate Disputes API responses, inject test values as a path or query parameter in the request URL. These methods allow you to trigger specific error responses without creating actual disputes.- Sample - test value as path parameter
- Sample - test value as query parameter
Common issues
If an API call fails while you test , check for these common issues:- 400 Bad Request when required fields or formats are invalid.
- 401 Unauthorized when the access token is missing, expired, or invalid.
- 403 Forbidden when the app is not permitted to perform this action.
Go live
- Set up live account.
- Set up webhooks to get real-time notifications about dispute events, such as created, updated, or resolved disputes.
- Go live with your app.