> This page is for Afterpay.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.cash.app/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.cash.app/_mcp/server.

# Respond to Dispute

POST https://global-api-sandbox.afterpay.com/v2/disputes/{dispute_id}
Content-Type: application/json

The Respond to the Dispute endpoint allows a merchant to submit evidence for the dispute. This is only allowed if the dispute is the state `needs_response`.

A successful response submits the merchant's challenge immediately and changes the dispute status to `under_review`. There is no separate finalize step.

Merchants only have one opportunity to submit evidence. Once a 200 response is received, this information cannot be updated or changed.

Reference: https://developers.cash.app/afterpay/api-reference/reference/disputes/respond-to-dispute

## Authentication

- `Authorization` header (basic auth, required) — Basic authentication of the form `Basic <base64(username:password)>`.

## Servers

- `https://global-api-sandbox.afterpay.com` (Sandbox, default)
- `https://global-api.afterpay.com` (Production)

## Request

### Path parameters

- `dispute_id` (string, required)

### Headers

- `Accept` (string, optional) — application/json

### Body (application/json)

This endpoint expects an object.

- `id` (string, optional) — A unique ID given to a dispute.
- `evidence` (evidence, optional) — Evidence for the dispute. Note that there should be at least one valid field.

## Response

### 200

When successful, returns the updated dispute object

- `id` (string, required) — Dispute identifier
- `order` (string, required) — The token of the order that the dispute is for.
- `amount` (string, required) — The amount of the dispute
- `currency` (string, required) — The ISO 4217 currency code of the dispute.
- `reason` (enum, required) — The reason for the dispute.
  - Allowed values: `product_not_received`, `product_unacceptable`, `credit_not_processed`, `order_canceled`, `duplicate`, `incorrect_amount`, `paid_by_other_means`, `fraudulent`, `fraudulent_merchant`
- `status` (enum, required) — The current state of the dispute. Values depend on how the dispute state machine is modeled.
  - Allowed values: `needs_response`, `under_review`, `won`, `lost`, `merchant_refunded`, `merchant_voided`
- `open` (boolean, required, default: true) — `True` if a final decision on the dispute hasn't been made yet.
- `responseDueBy` (integer, required) — Deadline by which the merchant must respond to the dispute. (Epoch timestamp in seconds, timezone UTC +0.00)
- `createdAt` (integer, required) — A timestamp indicating when the dispute was created. (Epoch timestamp in seconds, timezone UTC +0.00)
- `openingNote` (string, required) — Text from the customer describing why the dispute was opened or the reason for the complaint. While dispute category codes are helpful at informing what a merchant should present, it doesn’t provide reasoning behind the customer’s complaint. In some cases, this can help merchants troubleshoot the dispute directly with their customers.
- `closingReason` (enum, required, nullable) — A reason indicating how the final decision on the dispute was reached. Recommended possible values listed in Closing Reasons.
  - Allowed values: `merchant_accepted`, `evidence_accepted`, `evidence_rejected`, `deadline_expired`, `customer_cancelled`
- `merchantOrderId` (string, required, nullable) — The identifier for the transaction on the merchant side.
- `transactionDate` (integer, required, nullable) — The timestamp of the order created by the customer. (Epoch timestamp in seconds, timezone UTC +0.00)
- `settlementAmount` (string, required, nullable) — The settlementAmount for audit usage.
- `openingNoteAttachments` (list of string, optional) — Attachments to supplement the `openingNote` if the customer provided photos or screenshots as part of their dispute description.
- `updatedAt` (integer, optional, nullable) — Timestamp when the dispute was updated. (Epoch timestamp in seconds, timezone UTC +0.00)
- `closingNote` (string, optional, nullable) — Text describing in detail how the final decision on the dispute was reached. This supplements the `closingReason`.
- `partialRefundAmount` (string, optional, nullable) — The amount partially refunded for the disputed order, if applicable.
- `meta` (meta, optional) — The extra information for merchants to match payment.

## Types

### evidence

- `productDescription` (string, optional) — A description of the product or service and any relevant details on how this was presented to the customer at the time of purchase.
- `refundPolicy` (string, optional) — Token of the file upload. The merchant’s refund policy, as shown or provided to the customer.
- `refundPolicyDisclosure` (string, optional) — An explanation of how and when the customer was shown or provided with the merchant’s refund policy prior to purchase.
- `refundRefusalExplanation` (string, optional) — The merchant’s explanation for why the customer is not entitled to a refund.
- `shippingDocumentation` (string, optional) — Token of the file upload. A shipping label or receipt for the disputed payment.
- `shippingAddress` (string, optional) — The address to which a physical product was shipped.
- `shippingDate` (string, optional) — In cases of physical products, the date that a physical product began its route to the shipping address in a clear human-readable format. This date should be prior to the date of the dispute.
- `shippingCarrier` (string, optional) — In cases of physical products, the delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. If multiple carriers were used for this purchase, separate them with commas.
- `shippingTrackingNumber` (string, optional) — The tracking number for a physical product, obtained from the delivery service.
- `uncategorizedFile` (string, optional) — Token of the file upload. Additional file that’s not in any of the categories above.
- `uncategorizedText` (string, optional) — Any additional text deemed relevant by the merchant.

### meta

- `transactionAmount` (string, required) — The transaction amount for the order.
- `orderType` (string, required) — The type of order. `ONLINE` or `INSTORE`
- `network` (string, optional) — The payment network used by the customer. (For example, `Visa` or `MasterCard`)
- `networkReferenceId` (string, optional) — The identifier for the payment.

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "dp_N64jYg4RC4ZBUsXjLzE3W5",
  "order": "123456789",
  "amount": "48.46",
  "currency": "USD",
  "reason": "product_not_received",
  "status": "under_review",
  "open": true,
  "responseDueBy": 1691884800,
  "createdAt": 1691880800,
  "openingNote": "Customer has no knowledge of the payment",
  "closingReason": null,
  "merchantOrderId": "order54321",
  "transactionDate": 1691882800,
  "settlementAmount": null,
  "openingNoteAttachments": [
    "fi_48vmw3sXdVqvtJGXbgKbAZ"
  ],
  "updatedAt": 1691884000,
  "meta": {
    "transactionAmount": "48.46",
    "orderType": "ONLINE",
    "network": "Visa",
    "networkReferenceId": "networkReferenceId"
  }
}
```

**SDK Code**

```python
import requests

url = "https://global-api-sandbox.afterpay.com/v2/disputes/dispute_id"

payload = {}
headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://global-api-sandbox.afterpay.com/v2/disputes/dispute_id';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://global-api-sandbox.afterpay.com/v2/disputes/dispute_id"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.SetBasicAuth("<username>", "<password>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://global-api-sandbox.afterpay.com/v2/disputes/dispute_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.basic_auth("<username>", "<password>")
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://global-api-sandbox.afterpay.com/v2/disputes/dispute_id")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://global-api-sandbox.afterpay.com/v2/disputes/dispute_id', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://global-api-sandbox.afterpay.com/v2/disputes/dispute_id");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://global-api-sandbox.afterpay.com/v2/disputes/dispute_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```