# Dispute

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


This resource represents a [dispute](https://www.chargebee.com/docs/payments/2.0/others/chargeback) raised against a payment collected on your site. A dispute is created when a cardholder questions a payment with their card issuer, either as a formal `chargeback` or as a pre-chargeback `inquiry`.

Chargebee records each dispute against the [transaction](/docs/api/transactions/transaction-object) that was disputed, the [customer](/docs/api/customers/customer-object) who made the payment, and the gateway account that processed it. As the payment gateway moves the dispute toward a resolution, Chargebee updates the dispute [`status`](/docs/api/disputes/dispute-object#status).

Disputes are read-only through the API. Chargebee creates and updates them from the notifications it receives from the payment gateway, so there are no operations to create, update, or delete a dispute.

## Sample Dispute

```json
{
  "id": "dspt___test__KyVnHhSBWmDspt1",
  "customer_id": "__test__KyVnHhSBWlwxY2qJ",
  "transaction_id": "txn___test__KyVnHhSBWlxBX2qV",
  "gateway_account_id": "gw___test__KyVnGlSBWltEk29Z",
  "id_at_gateway": "cb___test__KyVnHhSBWlv4q2pU",
  "currency_code": "USD",
  "amount": 1200,
  "reason": "fraudulent",
  "status": "initiated",
  "type": "chargeback",
  "is_partial_dispute": false,
  "created_at": 1517505929,
  "resource_version": 1517505929000,
  "updated_at": 1517505929,
  "object": "dispute"
}
```

## Dispute attributes

## Input Parameters

- `id` (required, string, max chars=150)
  Uniquely identifies the dispute.

- `customer_id` (required, string, max chars=50)
  Identifier of the [customer](/docs/api/customers/customer-object) whose payment was disputed.

- `transaction_id` (required, string, max chars=40)
  Identifier of the [transaction](/docs/api/transactions/transaction-object) that was disputed.

- `gateway_account_id` (required, string, max chars=50)
  Identifier of the gateway account that processed the disputed payment.

- `id_at_gateway` (optional, string, max chars=200)
  The id with which this dispute is referred in the gateway. Use this value to reconcile the dispute with the corresponding record in the gateway.

- `currency_code` (required, string, max chars=3)
  The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html)) of the disputed amount.

- `amount` (required, in cents, min=0)
  The amount under dispute. The unit depends on the [type of currency](/docs/api/getting-started) . When `is_partial_dispute` is `true`, this is only the disputed part of the transaction amount.

- `reason` (optional, string, max chars=250)
  The reason for which the payment was disputed, as reported by the gateway. The set of values depends on the gateway and the card network.

- `status` (required, enumerated string)
  The current state of the dispute.
  Possible enum values:
    - `initiated`
      The dispute has been raised by the cardholder and the funds are yet to be withdrawn.
    - `funds_withdrawn`
      The gateway has withdrawn the disputed amount pending resolution.
    - `in_review`
      Evidence has been submitted and the dispute is being reviewed.
    - `cancelled`
      The dispute was withdrawn before it was resolved.
    - `lost`
      The dispute was resolved in the cardholder's favor.
    - `won`
      The dispute was resolved in the merchant's favor.

- `type` (required, enumerated string)
  The nature of the dispute raised against the payment.
  Possible enum values:
    - `chargeback`
      A formal reversal of the payment raised through the card network.
    - `inquiry`
      A pre-dispute inquiry raised by the issuer before a chargeback.

- `is_partial_dispute` (required, boolean, default=false)
  Indicates that only a part of the transaction amount is under dispute.

- `created_at` (required, timestamp(UTC) in seconds)
  Timestamp indicating when the dispute was created.

- `resource_version` (optional, long)
  Version number of this resource. The `resource_version` is updated with a new timestamp in milliseconds for every change made to the resource.

- `updated_at` (optional, timestamp(UTC) in seconds)
  Timestamp indicating when this dispute was last updated.

