---
updatedAt: 2026-05-29T16:59:30.000Z
agentTools:
  siteIndex: https://docs.affirm.com/llms.txt
  projectIndex: https://docs.affirm.com/developers/llms.txt
---

# Close dispute

Close dispute and transition the dispute to the merchant lost state

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "description": "Disputes API",
    "version": "0.0.1",
    "title": "Affirm Disputes API",
    "termsOfService": "https://www.affirm.com/terms",
    "contact": {
      "name": "Merchant Interfaces",
      "url": "https://coda.io/d/Merchant-Interfaces_d8L8vZX7Cbt",
      "email": "mint-eng@affirm.com"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "servers": [
    {
      "url": "https://sandbox.affirm.com/api/v1/disputes"
    },
    {
      "url": "https://api.affirm.com/api/v1/disputes"
    }
  ],
  "paths": {
    "/{dispute_id}/close": {
      "post": {
        "tags": [
          "Disputes API"
        ],
        "summary": "Close dispute",
        "description": "Close dispute and transition the dispute to the merchant lost state",
        "x-openapi-router-controller": "affirm.partner_api.http.apis.disputes.v1.impl",
        "operationId": "close_dispute",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "description": "Key used to serve subsequent retries of a request",
            "example": "0ddb9813-e62d-4370",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dispute_id",
            "in": "path",
            "description": "ID of the dispute",
            "required": true,
            "schema": {
              "type": "string"
            },
            "style": "simple"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateDisputeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid Input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvalidInputError"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedAccess"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConflictError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalServerError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Dispute": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of the dispute"
          },
          "transaction_id": {
            "type": "string",
            "description": "ID of the charge associated with the dispute",
            "example": "AB1D-E2GH"
          },
          "amount": {
            "type": "integer",
            "description": "Dispute amount in the smallest denomination of the currency, such as cents",
            "example": 1000
          },
          "currency": {
            "type": "string",
            "description": "The local currency of the dispute, must be a valid subset of the ISO 4217 currency code",
            "example": "USD"
          },
          "reason": {
            "type": "string",
            "enum": [
              "affirm_fraud_review",
              "cancellation_or_return_not_processed",
              "cancellation_not_processed",
              "credit_not_processed",
              "duplicate",
              "fake_product",
              "fraudulent",
              "incorrect_amount",
              "other",
              "product_not_received",
              "product_unacceptable",
              "return_not_processed",
              "subscription_canceled",
              "technical_issue",
              "unrecognized"
            ],
            "description": "Dispute reason",
            "example": "duplicate"
          },
          "status": {
            "type": "string",
            "enum": [
              "lost",
              "needs_review",
              "partially_won",
              "under_review",
              "won"
            ],
            "description": "Current status of the dispute",
            "example": "won"
          },
          "open": {
            "type": "boolean",
            "description": "Boolean; False if final decision on the dispute has been made, otherwise True",
            "example": false
          },
          "response_due_by": {
            "type": "string",
            "description": "Deadline by which merchant must respond to the dispute, in ISO 8601 UTC format",
            "example": "2024-03-02T14:29:07Z",
            "format": "date-time"
          },
          "created": {
            "type": "string",
            "description": "Timestamp indicating when the dispute was opened, in ISO 8601 UTC format",
            "example": "2024-03-02T14:29:07Z",
            "format": "date-time"
          },
          "opening_note": {
            "type": "string",
            "description": "Text blob from the customer describing the complaint reason for the dispute"
          },
          "opening_note_attachments": {
            "type": "string",
            "description": "Attachments to supplement the opening_note",
            "example": "File-ID-123"
          },
          "closed_at": {
            "type": "string",
            "description": "Timestamp indicating when the dispute was closed, in ISO 8601 UTC format",
            "example": "2024-03-02T14:29:07Z",
            "format": "date-time"
          },
          "closing_reason": {
            "type": "string",
            "enum": [
              "customer_cancelled",
              "deadline_expired",
              "evidence_accepted",
              "evidence_rejected",
              "merchant_accepted"
            ],
            "description": "Reason indicating how final decision for the dispute was reached",
            "example": "merchant_accepted"
          },
          "closing_note": {
            "type": "string",
            "description": "Text blob describing how final decision on the dispute was reached. Supplements the closing_reason."
          },
          "evidence_received_at": {
            "type": "string",
            "description": "Timestamp indicating when evidence was received for this dispute, in ISO 8601 UTC format",
            "example": "2024-03-02T14:29:07Z",
            "format": "date-time"
          },
          "transition_logs": {
            "type": "array",
            "description": "A list of all dispute events corresponding to the dispute",
            "items": {
              "$ref": "#/components/schemas/DisputeEvent"
            }
          }
        },
        "required": [
          "amount",
          "id",
          "created",
          "currency",
          "open",
          "reason",
          "response_due_by",
          "status",
          "transaction_id"
        ]
      },
      "DisputeWithoutTransitionLogs": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of the dispute"
          },
          "transaction_id": {
            "type": "string",
            "description": "ID of the charge associated with the dispute",
            "example": "AB1D-E2GH"
          },
          "amount": {
            "type": "integer",
            "description": "Dispute amount in the smallest denomination of the currency, such as cents",
            "example": 1000
          },
          "currency": {
            "type": "string",
            "description": "The local currency of the dispute, must be a valid subset of the ISO 4217 currency code",
            "example": "USD"
          },
          "reason": {
            "type": "string",
            "enum": [
              "affirm_fraud_review",
              "cancellation_or_return_not_processed",
              "credit_not_processed",
              "duplicate",
              "fake_product",
              "fraudulent",
              "incorrect_amount",
              "other",
              "product_not_received",
              "product_unacceptable",
              "subscription_canceled",
              "technical_issue",
              "unrecognized"
            ],
            "description": "Dispute reason",
            "example": "duplicate"
          },
          "status": {
            "type": "string",
            "enum": [
              "lost",
              "needs_review",
              "partially_won",
              "under_review",
              "won"
            ],
            "description": "Current status of the dispute",
            "example": "won"
          },
          "open": {
            "type": "boolean",
            "description": "Boolean; False if final decision on the dispute has been made, otherwise True",
            "example": false
          },
          "response_due_by": {
            "type": "string",
            "description": "Deadline by which merchant must respond to the dispute, in ISO 8601 UTC format",
            "example": "2024-03-02T14:29:07Z",
            "format": "date-time"
          },
          "created": {
            "type": "string",
            "description": "Timestamp indicating when the dispute was opened, in ISO 8601 UTC format",
            "example": "2024-03-02T14:29:07Z",
            "format": "date-time"
          },
          "opening_note": {
            "type": "string",
            "description": "Text blob from the customer describing the complaint reason for the dispute"
          },
          "opening_note_attachments": {
            "type": "string",
            "description": "Attachments to supplement the opening_note",
            "example": "File-ID-123"
          },
          "closed_at": {
            "type": "string",
            "description": "Timestamp indicating when the dispute was closed, in ISO 8601 UTC format",
            "example": "2024-03-02T14:29:07Z",
            "format": "date-time"
          },
          "closing_reason": {
            "type": "string",
            "enum": [
              "customer_cancelled",
              "deadline_expired",
              "evidence_accepted",
              "evidence_rejected",
              "merchant_accepted"
            ],
            "description": "Reason indicating how final decision for the dispute was reached",
            "example": "merchant_accepted"
          },
          "closing_note": {
            "type": "string",
            "description": "Text blob describing how final decision on the dispute was reached. Supplements the closing_reason."
          },
          "evidence_received_at": {
            "type": "string",
            "description": "Timestamp indicating when evidence was received for this dispute, in ISO 8601 UTC format",
            "example": "2024-03-02T14:29:07Z",
            "format": "date-time"
          }
        },
        "required": [
          "amount",
          "id",
          "created",
          "currency",
          "open",
          "reason",
          "response_due_by",
          "status",
          "transaction_id"
        ]
      },
      "DisputeEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID of the dispute event",
            "example": "ABCD12345"
          },
          "dispute_id": {
            "type": "string",
            "description": "ID of the dispute that corresponds to this dispute event"
          },
          "type": {
            "type": "string",
            "enum": [
              "dispute_closed",
              "dispute_evidence_received",
              "dispute_opened"
            ],
            "description": "Type of the dispute state transition denoted by the dispute event",
            "example": "dispute_opened"
          },
          "created": {
            "type": "string",
            "description": "Timestamp indicating when the dispute event was opened, in ISO 8601 UTC format",
            "example": "2021-12-20T00:00:00Z"
          },
          "is_financial": {
            "type": "boolean",
            "description": "Boolean indicating whether the dispute state transition represented by the dispute event is financial",
            "example": true
          },
          "financial_amount": {
            "type": "integer",
            "description": "Amount to be settled if dispute event is financial in the smallest denomination of the currency, such as cents",
            "example": 1000
          },
          "financial_amount_currency": {
            "type": "string",
            "description": "Currency of the settlement amount if dispute event is financial, must be a valid subset of the ISO 4217 currency code",
            "example": "USD"
          },
          "financial_transaction_type": {
            "type": "string",
            "enum": [
              "credit",
              "debit"
            ],
            "description": "Type of settlement to be expected if dispute event is financial",
            "example": "debit"
          },
          "dispute_snapshot": {
            "$ref": "#/components/schemas/DisputeWithoutTransitionLogs"
          }
        },
        "required": [
          "id",
          "dispute_id",
          "type",
          "created",
          "is_financial"
        ]
      },
      "UpdateDisputeResponse": {
        "type": "object",
        "description": "Response object for dispute update actions such as dispute close and submit merchant dispute evidence",
        "properties": {
          "dispute": {
            "$ref": "#/components/schemas/Dispute"
          }
        }
      },
      "ConflictError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "idempotent_request_in_progress"
            ],
            "description": "Error Codes:\n  * `idempotent_request_in_progress` - Idempotent request currently in progress\n"
          },
          "message": {
            "type": "string",
            "description": "Human readable message with details about the error"
          }
        }
      },
      "InternalServerError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "internal_server_error"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human readable message with details about the error"
          }
        }
      },
      "InvalidInputError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "dispute_already_closed",
              "evidence_fields_not_found",
              "evidence_file_id_not_found",
              "evidence_past_dispute_window",
              "idempotency_data_conflict",
              "idempotency_key_invalid",
              "invalid_dispute_evidence_fields"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human readable message with details about the error"
          }
        }
      },
      "UnauthorizedAccess": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "not_found",
              "dispute_close_reason_not_found",
              "unauthorized_access"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human readable message with details about the error"
          }
        }
      },
      "UnauthorizedError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "api-key-pair-invalid"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human readable message with details about the error"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```