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:| Parameter | Description | Action |
|---|---|---|
disputed_transactionsarray | Array of transaction details for which the dispute is created. | Pass the transaction ID retrieved after creating a transaction in the buyer_transaction_id parameter. |
reasonstring | Reason for the dispute. For more information, see Dispute reasons. | Pass the reason for which you are disputing the transaction. |
dispute_amountobject | Currency and value of the amount in dispute. The amount value must be less than or equal to the transaction amount of the created transaction. | Pass the currency and amount details. |
extensionsobject | Additional dispute details, including whether the merchant was contacted, the contact outcome, and the issue type. | Pass the additional dispute details as needed. |
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.Create chargeback
Create chargeback
POST call to the /v2/customer-support/process-chargeback endpoint. Include the following parameters:| Parameter | Description | Action |
|---|---|---|
adjacencyRequired, string | Payment method used for the transaction. | Set the value as PAYPAL for PayPal transactions. |
file_layoutRequired, string | Format or layout for the chargeback event. | Set the value as ATCK_CB for PayPal transactions. |
merchant_idRequired, string | Unique identifier for the merchant. | Pass the merchant ID associated with the PayPal account. |
financial_institution.processorRequired, string | Name of the payment processor. | Set the value as FDMS for PayPal transactions. |
transaction.id_encRequired, string | Encrypted transaction identifier of the transaction for which the chargeback is created. | Pass the SELLER-TRANSACTION-ID in this parameter. This is the transaction ID available when you log in using the business test account. |
transaction.amountRequired, object | Currency and amount for the transaction. | Pass the currency and amount details. |
instrumentRequired, object | Details about the payment instrument used for the transaction. | Pass the payment instrument details. |
instrument.instrument_typeRequired, string | Type of payment instrument used for the transaction. Possible values: CARD, BANK, CREDIT, and so on. | Set the value as CARD for card-funded transactions. |
disputeRequired, object | Details about the dispute. | Pass the dispute details. |
dispute.receive_datestring | Date and time when the chargeback was received. | Pass a current value for this parameter. |
dispute.money_movement_datestring | Date and time when the money movement happened. | Pass a current value for this parameter. |
dispute.response_datestring | Date and time when the response to the chargeback is due. | Pass a future value for this parameter. |
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:| Parameter name | Description | Action |
|---|---|---|
reasonstring | New reason for the dispute. | Set the value to the new dispute reason. For more information, see Dispute reasons. |
notestring | Note explaining the reason for the change. | Pass the reason for the change if needed. |
item_infoarray | Details about the disputed item if more than one item was available in the disputed transaction. | Pass the item details if needed. |
{id} is the dispute_id returned in the Create dispute response.200 OK response and an HATEOAS link for 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.| Scenario | Description | Test steps | Expected outcome |
|---|---|---|---|
| Dispute NO HOLD, MERCHANT WINS CASE |
|
|
|
| Dispute WITH HOLD, MERCHANT WINS CASE |
|
|
|
| Dispute NO HOLD, MERCHANT LOSES CASE (no data), NO SELLER PROTECTION, DISPUTE FEE is charged |
|
|
|
- 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.
| Scenario | Description | Test steps | Expected outcome |
|---|---|---|---|
| Chargeback WITH PROVISIONAL CREDIT, MERCHANT WINS CASE |
|
|
|
| Chargeback WITHOUT PROVISIONAL CREDIT, MERCHANT WINS CASE |
|
|
|
| Chargeback WITH PROVISIONAL CREDIT, MERCHANT LOSES CASE (no data) |
|
|
|
| Chargeback WITHOUT PROVISIONAL CREDIT, MERCHANT LOSES CASE (no data) |
|
|
|
| Chargeback WITH PROVISIONAL CREDIT, MERCHANT LOSES CASE (adjudication) |
|
|
|
- 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.| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. It includes status, seller_response_due_date, and links parameters that help you respond appropriately within the timeframe. |
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
| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check the messages array in the response. |
Make offer to resolve dispute
Make offer to resolve dispute
REFUND_WITH_RETURN - SNAD case
REFUND_WITH_RETURN - SNAD case
| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check the offer.seller_offered_amount and offer.offer_type parameters in the response. |
REFUND_WITH_REPLACEMENT - SNAD case
REFUND_WITH_REPLACEMENT - SNAD case
| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check the offer.seller_offered_amount and offer.offer_type parameters in the response. |
REPLACEMENT_WITHOUT_REFUND - SNAD case
REPLACEMENT_WITHOUT_REFUND - SNAD case
| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check the offer.offer_type parameter in the response. |
REFUND - INR case
REFUND - INR case
| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check the offer.seller_offered_amount and offer.offer_type parameters in the response. |
Acknowledge returned item
Acknowledge returned item
| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check the offer.seller_offered_amount, offer.offer_type, and acknowledgement_type parameters in the response. |
Provide evidence
Provide evidence
PROOF_OF_FULFILLMENT
PROOF_OF_FULFILLMENT
PROOF_OF_FULFILLMENT evidence type by providing tracking information for the INR cases.| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check the evidence_type, source, and evidence_info.tracking_info parameters within the evidences object in the response. |
PROOF_OF_REFUND
PROOF_OF_REFUND
PROOF_OF_REFUND evidence type by providing refund details for the INR or SNAD cases.| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check the evidence_type, source, and evidence_info.refund_ids parameters within the evidences object in the response. |
OTHER
OTHER
OTHER evidence type by providing notes or documents (including photos and files) for the INR or SNAD cases.
| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check the evidence_type, source, notes, and documents parameters within the evidences object in the response. |
Accept claim
Accept claim
| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check the dispute_outcome object in the response. The CUSTOMER.DISPUTE.RESOLVED webhook notification with the refund details is sent to the buyer. |
Escalate dispute to claim
Escalate dispute to claim
| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check the dispute_life_cycle_stage parameter value is updated from INQUIRY to CHARGEBACK. The system also triggers the CUSTOMER.DISPUTE.UPDATED webhook. |
Claim stage
You can use the procedures in this section to test dispute response handling during the claim stage.Provide evidence
Provide evidence
Accept claim
Accept claim
REFUND
REFUND
REFUND_WITH_RETURN
REFUND_WITH_RETURN
| Test steps | Expected outcome |
|---|---|
| The system triggers the CUSTOMER.DISPUTE.UPDATED webhook.You can retrieve the dispute details and check the response parameters to get the tracking information and update the case. |
PARTIAL_REFUND
PARTIAL_REFUND
| Test steps | Expected outcome |
|---|---|
|
|
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
| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check:
|
PROOF_OF_REFUND
PROOF_OF_REFUND
| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check:
|
OTHER
OTHER
OTHER evidence type if the requested evidence is not covered by the PROOF_OF_FULFILLMENT and PROOF_OF_REFUND evidence types.| Test steps | Expected outcome |
|---|---|
| The API returns a 200 OK response. You can retrieve the dispute details and check the evidences object in the response. |
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
| Test steps | Expected outcome |
|---|---|
| Buyer: Log in to your sandbox personal account and create a SNAD case. |
|
INR case
INR case
| Test steps | Expected outcome |
|---|---|
| Buyer: Log in to your sandbox personal account and create an INR case. |
|
Claim stage
You can test this webhook in the claim stage for these scenarios.SNAD case
SNAD case
| Test steps | Expected outcome |
|---|---|
| Buyer: Log in to your sandbox personal account and create a SNAD case. |
|
INR case
INR case
| Test steps | Expected outcome |
|---|---|
| Buyer: Log in to your sandbox personal account and create an INR case. |
|
Unauthorized case
Unauthorized case
Transaction error case
Transaction error case
CREDIT_NOT_PROCESSED, DUPLICATE_TRANSACTION, INCORRECT_AMOUNT, PAYMENT_BY_OTHER_MEANS, CANCELED_RECURRING_BILLING, or OTHER.| Test steps | Expected outcome |
|---|---|
| Buyer: Log in to your sandbox personal account and create a case with one of the dispute reasons. |
|
Duplicate dispute creation (negative testing)
Duplicate dispute creation (negative testing)
| Test steps | Expected outcome |
|---|---|
| You cannot open a duplicate dispute on the same transaction. |
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
| Test steps | Expected outcome |
|---|---|
Buyer:
|
|
Claim stage
You can test this webhook in the claim stage for these scenarios.Buyer provides return tracking information
Buyer provides return tracking information
| Test steps | Expected outcome |
|---|---|
|
|
Buyer changes reason
Buyer changes reason
| Test steps | Expected outcome |
|---|---|
Buyer:
|
|
Test dispute resolved webhook
You can test theCUSTOMER.DISPUTE.RESOLVED webhook for these scenarios.
Buyer cancels dispute
Buyer cancels dispute
| Test steps | Expected outcome |
|---|---|
Buyer:
| The system triggers CUSTOMER.DISPUTE.RESOLVED webhook. |
Settle dispute (buyer wins)
Settle dispute (buyer wins)
| Test steps | Expected outcome |
|---|---|
| The system triggers CUSTOMER.DISPUTE.RESOLVED webhook. |
Settle dispute (merchant wins)
Settle dispute (merchant wins)
| Test steps | Expected outcome |
|---|---|
| The system triggers CUSTOMER.DISPUTE.RESOLVED webhook. |
Identify unique webhook through webhook ID
You can test identifying a specific webhook using the webhook ID in the webhook payload.| Test steps | Expected outcome |
|---|---|
| The system triggers the CUSTOMER.DISPUTE.CREATED webhook notification. You can use the unique webhook ID in the payload to identify the webhook. |
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
| Path parameter | Simulated error response |
|---|---|
/v1/customer/disputes/ERRDIS015 | FORBIDDEN |
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.