Disputes Integration Guide

DocsCurrentLast updated: December 18th 2023, @ 4:31:51 am


PayPal merchants, partners, and external developers can use the PayPal Disputes API to manage disputes.

For concepts, see the Disputes Overview.

Integration steps

StepRequiredStageDescription
1.RequiredPrerequisiteSet up your development environment.
2.OptionalGather dispute informationYou can list disputes and show details for a single dispute.
3.OptionalInquiryYou can send message to the other party, make an offer to resolve the dispute, and escalate a dispute to a claim.
4.OptionalClaimYou can provide evidence, accept the claim, or appeal the dispute if it was resolved in favor of the counter party.
5.OptionalSettlementIn the sandbox, you can update the dispute status and settle the dispute. See Disputes and Integration Testing.

Set up your development environment

Before you can integrate Disputes, you must set up your development environment. After you get a token that lets you access protected REST API resources, you create sandbox accounts to test your web and mobile apps.

When you create an app, enable Disputes in the App feature options section.

For details, see Get Started.

Then, return to this page to integrate Disputes.

Gather dispute information

You can gather dispute information during any dispute lifecycle stage. You can list disputes and show details for a single dispute.

List disputes

Merchants can list disputes. When you list disputes, the response shows the dispute_id, reason, status, dispute_amount, create_time, and update_time fields for each dispute.

To filter the disputes in the response, specify one or more optional query parameters in the request URI.

For a full list of query parameters and additional information, see list disputes in the API reference.

Show dispute details

To show details for a dispute, you include the dispute ID in the request URI. The response shows dispute details and HATEOAS links that enable you to complete other actions for the dispute.

Note: The fields that appear in the response depend on whether you access this call through first- or third-party access. For example, if the merchant shows dispute details through third-party access, the customer's email ID does not appear.

For additional information, see show dispute details in the API reference.

Acknowledge returned item

At any stage in the dispute lifecycle, merchants can request that the customer return a MERCHANDISE_OR_SERVICE_NOT_AS_DESCRIBED item or service for a full refund. Until the merchant calls provide evidence to provide PROOF_OF_RETURN, the dispute has the WAITING_FOR_SELLER_RESPONSE status.

For additional information, see acknowledge returned item in the API reference.

Inquiry stage

In the inquiry stage, the dispute status must be INQUIRY.

In this stage, you can send a message to the other party, make an offer to resolve the dispute, and escalate a dispute to a claim.

Send message to other party

To send a message to the other party, you include the dispute ID in the request URI.

You must also include a message to the other party in the JSON request body.

A successful request returns the HTTP 200 OK status code and a JSON response body that includes a link to the dispute.

Make offer to resolve dispute

A merchant can make these types of offers to a customer:

Offer typeDescription
Refund onlyThe merchant agrees to refund a specific amount to the customer.
Refund with return from customerThe merchant agrees to refund the full dispute amount but expects the customer to return the item to a specific return address.
Refund with replacement to customerThe merchant agrees to refund a specific amount and agrees to send the customer a replacement item.

To make an offer to resolve a dispute, you include the dispute ID in the request URI.

You must also include a note about the offer and the offer amount. You can optionally include a return shipping address for the item and the ID of the invoice for the refund:

notestringRequiredThe notes about the offer.
offer_amountobjectRequiredThe amount proposed to resolve the dispute.
return_shipping_addressobjectOptionalThe return address for the item.
invoice_idstringOptionalThe ID of the invoice for the refund.

A successful request returns the HTTP 200 OK status code and a JSON response body that includes a link to the dispute.

Escalate dispute to claim

You can escalate a dispute by ID to a PayPal claim to resolve the dispute.

You specify the dispute ID in the URI and include a note about the escalation in the JSON request body:

curl "https://api-m.sandbox.paypal.com/v1/customer/disputes/PP-R-KPE-22563488/escalate" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ACCESS_TOKEN" \
  -d '{
  "note": "Escalating to PayPal claim for resolution."
}'

A successful request returns the HTTP 200 OK status code and a JSON response body that includes a link to the dispute:

{
  "links": [{
    "rel": "self",
    "method": "GET",
    "href": "https://api-m.sandbox.paypal.com/v1/customer/disputes/PP-R-KPE-22563488"
  }]
}

Claim stage

In the claim stage, you can provide evidence, accept a claim, and appeal a dispute.

Provide evidence

Customers and merchants can provide evidence for a dispute by ID. Merchants can provide evidence for disputes that have the WAITING_FOR_SELLER_RESPONSE status while customers can provide evidence for disputes that have the WAITING_FOR_BUYER_RESPONSE status.

Evidence can be a proof of delivery or proof of refund document or notes, which can include logs. A proof of delivery document includes a tracking number while a proof of refund document includes a refund ID.

  • The maximum length of notes can be 2000 characters.
  • For constraints and rules regarding documents, see documents.

Each dispute reason requires certain information for various evidence types. See dispute reasons.

To make this request, specify the dispute ID in the URI and specify the evidence in the JSON request body. For information about dispute reasons that are associated with evidence types, see dispute reasons.

The response provides a HATEOAS links that enables you to get more information about the dispute.

For additional information, see provide evidence in the API reference.

Accept claim

When you accept a claim for a dispute, the dispute closes in the customer's favor and you refund the customer's money from your merchant's account.

In addition to specifying the ID of the dispute in the URI, specify one or more optional parameters in the JSON request body:

  • Your notes for acceptance of the customer's claim.
  • Your reason for acceptance of the customer's claim. See dispute reasons.
  • The ID of the invoice for the refund.

For additional information, see accept claim in the API reference.

Appeal dispute

You can appeal a lost dispute by ID.

To appeal a dispute, use the appeal link in the HATEOAS links from the show dispute details response. If this link does not appear, you cannot appeal the dispute.

Specify the dispute ID in the URI, and submit new evidence as a document or notes in the JSON request body. Evidence can be a proof of delivery or proof of refund document or notes, which can include logs. A proof of delivery document includes a tracking number while a proof of refund document includes a refund ID.

  • The maximum length of notes can be 2000 characters.
  • For constraints and rules regarding documents, see documents.

If the seller appeals after a dispute has been resolved in the buyer's favor, the dispute is open again. The DISPUTE.UPDATED webhook is sent. This type of appeal can result in a win or loss for the seller.

If the seller wins this appeal, the seller gets money from PayPal, and the CASE.RESOLVED webhook is sent. There is no payment webhook, but there is an entry in the settlement report with the code T0805.

If the seller loses this appeal, there is no money movement, and the case is closed. The CASE.RESOLVED webhook is sent.

For additional information about dispute reasons, see dispute reasons.

For additional information, see appeal dispute in the API reference.

Sandbox-only methods

In the sandbox, you can use create dispute, update dispute status, or settle dispute. To create a dispute in the sandbox, you must set up buyer-side credentials. To update the dispute status or settle a dispute, you do not need to set up the buyer-side credentials. Refer to API documentation for more information about update dispute status and settle dispute.

Set up buyer-side credentials to create a dispute in the sandbox

To create a dispute in the sandbox, you must set up buyer-side credentials using the following steps.

1. Configure your REST app

Set up your REST app with the following scope:

https://uri.paypal.com/services/disputes/create = DISPUTE_CREATE

2. Get permission from the buyer

To get permission from the buyer to create disputes on their behalf, complete the Log in with PayPal integration to create a Log in with PayPal button.

3. Generate access token

Use the following code to generate an access token. Use the CLIENT_ID and secret access token for the merchant to access the PayPal Dispute API.

curl -v -X POST "https://api-m.sandbox.paypal.com/v1/oauth2/token" \
    -u "CLIENT_ID:CLIENT_SECRET" \
    -H "Content-Type: application/x-www-form-urlencoded" \
    -d "grant_type=client_credentials"

4. Generate JSON web token for PayPal Authorization Assertion

Use the following code to generate the JSON web token. The CLIENT_ID is from the merchant's REST API. The email is the buyer's email address. The JSON web token is given as output.

<span id='cwppButton'></span>
<html>
  <script>
    function base64url(source) {
      var encodedSource = btoa(source);
      encodedSource = encodedSource.replace(/=+$/, '');
      encodedSource = encodedSource.replace(/\+/g, '-');
      encodedSource = encodedSource.replace(/\//g, '-');
      return encodedSource;
    }
    function generateJWT() {
      var header = {"alg": "none", "typ": "JWT"};
      var data = {"iss":"CLIENT_ID", "email" : "BUYER_EMAIL" };
      document.write(base64url(JSON.stringify(header)) + "." +
      base64url(JSON.stringify(data)) + ".");
    }
  </script>
  <body onload="generateJWT()"/>
<html>

5. Get the buyer transaction ID

Using the following code, pass the access token from step 2, the JSON web token from step 3, and the seller transaction ID from the transaction details of the transaction in dispute. This API returns the valid type of disputes that can be created for a given transaction. Also, the buyer transaction ID is returned.

curl -X POST "https://api-m.sandbox.paypal.com/v1/customer/disputes/validate-eligibility" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "PayPal-Auth-Assertion: JWT-TOKEN" \
-d '{
    "encrypted_transaction_id": "SELLER-TRANSACTION0D"
}'

6. Create the dispute

Using the following code, pass the access token from step 2, the JSON web token from step 3, and the buyer transaction ID from step 4 to create the dispute.

curl -X POST "https://api-m.sandbox.paypal.com/v1/customer/disputes" \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: multipart/related" \
-H "PayPal-Auth-Assertion: JWT-TOKEN" \
-F 'input={"disputed_transactions": [{
      "buyer_transaction_id": "BUYER-TRANSACTION-ID"
    }],
    "reason": "MERCHANDISE_OR_SERVICE_NOT_RECEIVED",
    "dispute_amount": { "currency_code":"USD", "value": "7.50" },
    "extensions": {
        "merchant_contacted": true,
        "merchant_contacted_outcome": "NO_RESPONSE",
        "merchandize_dispute_properties": {
          "issue_type": "PRODUCT"
        }
    }
};

7. Creating a chargeback

Using the following code, pass the access token from step 2, and the seller transaction ID to create a chargeback. Note: update the receive_date and money_movement_date to the current value, and response_date to a future value.

curl -X POST "https://api-m.sandbox.paypal.com/v2/customer-support/process-chargeback" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
--data-raw '{
    "adjacency": "PAYPAL",
    "file_layout": "ATCK_CB",
    "financial_institution": {
        "processor": "FDMS"
    },
    "transaction": {
        "id_enc": "<SELLER_TRANSACTION_ID>",
        "amount": {
            "currency_code": "EUR",
            "value": "100"
        }
    },
    "instrument": {
        "card_brand": "VISA",
        "credit_card_transaction_id": "",
        "external": false
    },
    "dispute": {
        "id": null,
        "stage": "CHARGEBACK",
        "response_date": "2023-07-16T12:05:22.544Z",
        "status": "2",
        "amount": {
            "currency_code": "EUR",
            "value": "15"
        },
        "receive_date": "2023-06-16T12:05:22.544Z",
        "event_code": "CHARGEBACK_INITIATED",
        "money_movement_date": "2023-06-16T12:05:22.544Z",
        "event_type": "DEBIT",
        "chargeback_type": "REPORTED_TO_PROCESSOR",
        "processor_info": {
            "reference_number": "31639435342702423793399",
            "reason_code": "4853",
            "notes": "TEST_MEMO",
            "additional_info": []
        }
    },
    "processor_auxiliary_info": {}
}'

Negative testing for disputes

You can use simulation to test your disputes. For more information, see Disputes and Integration Testing.

Dispute reasons

The information required from the seller to contest a dispute or chargeback varies depending on the dispute reason. While the tables below offer a broad overview of the information typically sought initially, it's crucial to confirm the specific evidence_type under evidence requested by PayPal before submission. Kindly review the evidences with source as REQUESTED_FROM_SELLER to identify the evidences that have been requested from the seller.

It's important to note that PayPal may request for additional information from the seller multiple times throughout the disputes lifecycle. In instances where further clarification is required, the case status will transition to WAITING_FOR_SELLER_RESPONSE and details about the sought after information will be communicated through the evidence_type with the source being REQUESTED_FROM_SELLER. See evidence.

MERCHANDISE_OR_SERVICE_NOT_RECEIVED

The customer did not receive the merchandise or service.

Evidence typeRequired
PROOF_OF_FULFILLMENT

tracking_info

  • tracking_number
  • carrier_name
or note or document. For example, a document can be a proof of delivery signature or a proof of receipt copy.

PROOF_OF_REFUND

refund_ids

MERCHANDISE_OR_SERVICE_NOT_AS_DESCRIBED

The customer reports that the merchandise or service was not as described.

Evidence typeRequired
OTHER

A note or document. For example, a document can be a description, item URL, return policy, or a copy of a contract or an affidavit.

PROOF_OF_REFUND

A set of refund_ids.

UNAUTHORISED

The customer did not authorize purchase of the merchandise or service.

Evidence typeRequired
PROOF_OF_FULFILLMENT
  • tracking_number
  • carrier_name
PROOF_OF_REFUND

The refund ID.

OTHER

A note or document. For example, a document can be a proof of delivery signature or a proof of receipt copy.

CREDIT_NOT_PROCESSED

The credit transaction was not processed for the customer.

Evidence typeRequired
PROOF_OF_REFUND

The refund ID.

OTHER

A note or document. For example, a document can be a credit due reason.

DUPLICATE_TRANSACTION

The transaction was a duplicate.

Evidence typeRequired
PROOF_OF_REFUND

The refund ID.

OTHER

A note or document.

INCORRECT_AMOUNT

The customer was charged an incorrect amount.

Evidence typeRequired
PROOF_OF_REFUND

The refund ID, for the difference in amount.

OTHER

A note or document. For example, a document can be a price difference reason.

PAYMENT_BY_OTHER_MEANS

The customer paid for the transaction through other means.

Evidence typeRequired
PROOF_OF_REFUND

The refund ID, for the difference in amount.

OTHER

A note or document.

CANCELED_RECURRING_BILLING

The customer was incorrectly charged because he or she canceled recurring billing.

Evidence typeRequired
PROOF_OF_REFUND

The refund ID, for the difference in amount.

OTHER

A note or document. For example, a document can be a subscription agreement.

OTHER

Evidence typeRequired
PROOF_OF_REFUND

The refund ID.

OTHER

A note or document.

Documents

The following rules apply to document file types and sizes:

  1. The party can upload up to 50 MB of files per request.
  2. Individual files must be smaller than 10 MB.
  3. The supported file formats are JPG, JPEG, GIF, PNG, and PDF.

Additional information