Skip to main content
Implement and validate the PayPal Disputes API in sandbox and live environments as a developer or QA engineer.

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

  1. Ensure you set up the sandbox environment.
  2. 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.
To create a transaction in the sandbox environment, do these steps:
  1. Log in to your sandbox personal account as a buyer.
  2. 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.
  3. Select Go to Summary.
  4. In the Recent activity section, select the transaction.
  5. On the Summary page, copy the Transaction ID. Use this value to create a dispute.
You can create disputes as a buyer using this endpoint and test how to handle them in the sandbox environment.
This is a sandbox-only endpoint. You cannot use it to create disputes in the live environment.
Use a valid access token, include the PayPal-Auth-Assertion request header with a valid JWT, and make a POST call to the /v1/customer/disputes endpoint. Include the following parameters:
A successful call returns a 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.
You can create chargebacks using this endpoint and test how to handle them in the sandbox environment.
This is a sandbox-only endpoint. You cannot use it to create chargebacks in the live environment.
Use a valid access token and make a POST call to the /v2/customer-support/process-chargeback endpoint. Include the following parameters:
A successful call returns a 201 Created response and a dispute ID. Use the dispute ID to perform subsequent tests on the dispute.
You can change the reason for a dispute using this endpoint in the sandbox environment. This allows you to test how your integration handles changes to dispute reasons.
This is a sandbox-only endpoint. You cannot use it to change dispute reasons in the live environment.
Use a valid access token, include the PayPal-Auth-Assertion request header with a valid JWT, and make a POST call to the /v1/customer/disputes/{ID}/change-reason endpoint. Include the following parameters:Path parameter: ID is the dispute_id returned in the Create dispute response.
A successful call returns a 200 OK response and an HATEOAS link for the dispute.
Accept a merchant’s offer to resolve a dispute by ID. PayPal automatically refunds the proposed amount to the customer.Use a valid access token and make a POST call to the /v1/customer/disputes/{id}/accept-offer endpoint. Include the following parameter:Path parameter: id is the dispute_id returned in the Create dispute response.
A successful call returns an HTTP 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.
The customer denies a merchant’s offer to resolve a dispute, by ID.Use a valid access token and make a POST call to the /v1/customer/disputes/{id}/deny-offer endpoint. Include the following parameter:Path parameter: id is the dispute_id returned in the Create dispute response.
A successful call returns an HTTP 200 OK status code and a HATEOAS link to the dispute.

Simulate PayPal actions

This is a sandbox-only endpoint. You cannot use it to settle disputes in the live environment.
Settle a dispute in the customer’s or merchant’s favor to complete end-to-end dispute resolution testing in the sandbox. Before you make this call, confirm that the 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:Path parameter: id is the dispute_id returned in the Create dispute response.
A successful call returns an HTTP 200 OK status code and a HATEOAS link to the dispute.
This is a sandbox-only endpoint. You cannot use it to update dispute statuses in the live environment.
Updates the status of a dispute, by ID, from 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:Path parameter: id is the dispute_id returned in the Create dispute response.
A successful call returns an HTTP 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.
You can test internal disputes by creating a dispute for a transaction with PayPal. The dispute can be for payments made using a card, bank account, digital wallet, or other supported payment methods.Test data condition: Use OTHER as the evidence type when you provide evidence.Possible notifications
  • Webhooks:
    • Case creation: CUSTOMER.DISPUTE.CREATED
    • Merchant response for evidence submission: CUSTOMER.DISPUTE.UPDATED
    • Case resolution: CUSTOMER.DISPUTE.RESOLVED
  • Emails: Case creation, response request, and resolution.
You can create chargebacks for card transactions and test them using these scenarios.Test data conditions:
  • 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.
Possible notifications
  • Webhooks:
    • Case creation: CUSTOMER.DISPUTE.CREATED
    • Merchant response for evidence submission: CUSTOMER.DISPUTE.UPDATED
    • Case resolution: CUSTOMER.DISPUTE.RESOLVED
  • 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
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.
You can test sending a message to the buyer during the inquiry stage of a dispute. For example, when a buyer creates an INR or SNAD case for a completed transaction, you can send a message to the buyer directly and help resolve the issue before it escalates.
You can test making an offer to the buyer in these scenarios.
Note: Merchant must have sufficient funds to issue a refund.
For a SNAD case in the inquiry stage, you can test offering the buyer a refund in exchange for returning the item.
For a SNAD case in the inquiry stage, you can test offering the buyer a replacement item along with a refund.
For a SNAD case in the inquiry stage, you can test offering the buyer a replacement item without a refund.
For an INR or SNAD case in the inquiry stage, you can test offering the buyer a refund without the replacement of the item.
For the actions involving return, you can acknowledge returned item when the buyer returns the item and uploads the tracking information.
You can test offering a refund with the return of the item, accept it as a buyer and upload the return tracking information. After this, the acknowledge return item option will be available for you.
You can test providing evidence for these evidence types. This section applies to INR cases only.
You can test the PROOF_OF_FULFILLMENT evidence type by providing tracking information for the INR cases.
You can test the PROOF_OF_REFUND evidence type by providing refund details for the INR cases.
You can test the OTHER evidence type by providing notes or documents (including photos and files) for the INR cases.
For more information about the supported file types and size limits, see Supported file types and sizes.
You can test accepting the claim and refunding the buyer when you choose not to dispute the case.
Note: Merchant must have sufficient funds to issue a refund.
You can test escalating the dispute to a claim to simulate cases where you cannot reach an amicable resolution with the buyer.To test Accelerated Response, see Accelerated Response sandbox testing.

Claim stage

You can use the procedures in this section to test dispute response handling during the claim stage.
You can test providing evidence for these evidence types.
You can test the PROOF_OF_FULFILLMENT evidence type by providing tracking information for the INR cases.
You can test the PROOF_OF_REFUND evidence type by providing refund details for the INR or SNAD cases.
You can test the OTHER evidence type by providing notes or documents (including photos and files) for the INR or SNAD cases.
For more information about the supported file types and size limits, see Supported file types and sizes.
You can test accepting the claim and refunding the buyer if you choose to resolve the case using these accept claim types.
Note: Merchant must have sufficient funds to issue a refund.
The test procedure to refund the dispute amount is identical in the inquiry and claim stages. For detailed information, see Accept claim.
You can test accepting the claim for a SNAD case and refunding the buyer after they return the item to a specified address.
You can test accepting the claim and providing a partial refund (amount less than the buyer-requested refund) to the buyer for a INR or SNAD cases.
You can test offering a refund with the return of the item, accept it as a buyer and upload the return tracking information. After this, the acknowledge return item option will be available for you.

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 includes allowappeal (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.
Each party can submit only one appeal per case.
To simulate cases where appeals are not allowed for a buyer, create a buyer account with a primary email address that includes noappeal (for example, testnoappeal@personal.example.com). You can appeal the case and provide evidence using these evidence types.
If the case is resolved in the buyer’s favor, you can appeal by providing the fulfillment information for INR, unauthorized, or other cases.
If the case is resolved in the buyer’s favor, you can appeal by providing the refund information for all the dispute reasons.
If the case is resolved in the buyer’s favor, you can appeal by providing notes or documents. You can use the 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 value ACCELERATED_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: Create a transaction with one of the listed amounts, then use that transaction when creating the dispute to simulate the corresponding escalation day.

Applicable dispute reasons

Accelerated Response currently applies to these dispute reasons:
  • MERCHANDISE_OR_SERVICE_NOT_AS_DESCRIBED
  • MERCHANDISE_OR_SERVICE_NOT_RECEIVED
Once the dispute is created, you can perform any of the actions listed under the Inquiry stage section.

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 the CUSTOMER.DISPUTE.CREATED webhook in both the inquiry and claim stages.

Inquiry stage

You can test this webhook in the inquiry stage for these scenarios.
You can create a SNAD case for a transaction and test triggering the webhook.
You can create an INR case for a transaction and test triggering the webhook.

Claim stage

You can test this webhook in the claim stage for these scenarios.
If you have opted out of the dispute stage, you can create a SNAD case for a transaction and test triggering this webhook in the claim stage.
If you have opted out of the dispute stage, you can create an INR case for a transaction and test triggering this webhook in the claim stage.
You can create an unauthorized case for a transaction and test triggering the webhook.
For unauthorized disputes, the buyer and merchant receive different dispute IDs. For merchants, the format and identifiers of the notifications stay the same as those of other dispute types.
You can test triggering the webhook by creating a dispute for a transaction error using one of these dispute reasons: CREDIT_NOT_PROCESSED, DUPLICATE_TRANSACTION, INCORRECT_AMOUNT, PAYMENT_BY_OTHER_MEANS, CANCELED_RECURRING_BILLING, or OTHER.
For more information about the dispute reasons, see Dispute reasons.
You can test that a buyer cannot open a duplicate dispute on a transaction that already has an existing dispute. Even after the original dispute case is closed, the buyer cannot open a new dispute on the same transaction.

Test dispute updated webhook

You can test the CUSTOMER.DISPUTE.UPDATED webhook in both the inquiry and claim stages.

Inquiry stage

You can test this webhook in the inquiry stage for this scenario.
You can test this webhook by sending a message to the merchant as a buyer for the INR or SNAD case.

Claim stage

You can test this webhook in the claim stage for these scenarios.
If you have opted out of the dispute stage, you can accept a claim for a case and provide the buyer with the return shipping address. Then, test as a buyer by returning the item and providing the return tracking information.
You can test changing the dispute reason of the INR dispute to SNAD or unauthorized activity.

Test dispute resolved webhook

You can test the CUSTOMER.DISPUTE.RESOLVED webhook for these scenarios.
You can test cancelling the dispute in the Resolution Center as a buyer to trigger the webhook.
You can test settling the case in the buyer’s favor to trigger the webhook.
You can test settling the case in the merchant’s favor to trigger the webhook.

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.

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.
For more details, see the HTTP status codes and error messages.

Go live

  1. Set up live account.
  2. Set up webhooks to get real-time notifications about dispute events, such as created, updated, or resolved disputes.
  3. Go live with your app.