---
updatedAt: 2026-05-01T21:11:12.000Z
agentTools:
  siteIndex: https://docs.affirm.com/llms.txt
  projectIndex: https://docs.affirm.com/developers/llms.txt
---

# Close dispute

# 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/v3"
    },
    {
      "url": "https://api.affirm.com/api/v3"
    }
  ],
  "paths": {
    "/disputes/{dispute_id}/close": {
      "post": {
        "tags": [
          "Disputes API"
        ],
        "summary": "Close dispute",
        "operationId": "close_dispute",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dispute_id",
            "in": "path",
            "description": "Unique identifier of the dispute",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "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/NotFoundError"
                }
              }
            }
          },
          "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 dispute"
          },
          "transaction_id": {
            "type": "string",
            "description": "ID of associated charge with the dispute"
          },
          "order_id": {
            "type": "string",
            "description": "Merchant reference for associated order with the dispute"
          },
          "open": {
            "type": "boolean",
            "description": "Indicates if dispute is open or not."
          },
          "transaction_amount": {
            "type": "integer",
            "description": "Total amount in cents of transaction which is being disputed"
          },
          "dispute_amount": {
            "type": "integer",
            "description": "Dispute amount in the smallest denomination of the currency, such as cents"
          },
          "currency": {
            "type": "string",
            "description": "The local currency of the dispute, must be a valid subset of the ISO 4217 currency code"
          },
          "dispute_reason": {
            "type": "string",
            "description": "Dispute reason",
            "enum": [
              "cancellation_or_return_not_processed",
              "incorrect_amount",
              "product_not_received",
              "product_unacceptable",
              "cancellation_not_processed",
              "return_not_processed"
            ]
          },
          "status": {
            "type": "string",
            "description": "Current dispute status",
            "enum": [
              "action_required_merchant",
              "no_merchant_action_needed",
              "closed_customer_favor",
              "closed_merchant_favor",
              "closed_customer_partial_favor"
            ]
          },
          "response_due_by": {
            "type": "string",
            "format": "date-time",
            "description": "Deadline by which merchant must respond to the dispute, in ISO 8601 UTC format"
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp indicating when the dispute was opened, in ISO 8601 UTC format"
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp indicating when the dispute was last updated, in ISO 8601 UTC format"
          },
          "comments": {
            "type": "array",
            "description": "Text blob from the customer describing the complaint reason for the dispute",
            "items": {
              "type": "string"
            }
          },
          "attached_files": {
            "type": "array",
            "description": "Array of attached files to dispute",
            "items": {
              "type": "object",
              "properties": {
                "file_name": {
                  "type": "string",
                  "description": "name of file"
                },
                "file_url": {
                  "type": "string",
                  "description": "presigned_url for file that expires after 60 minutes"
                }
              }
            }
          },
          "closed_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp indicating when the dispute was closed, in ISO 8601 UTC format"
          },
          "evidence_received_at": {
            "type": "string",
            "format": "date-time",
            "description": "Timestamp indicating when evidence was received for this dispute, in ISO 8601 UTC format"
          },
          "extra_evidence": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExtraEvidence"
            }
          },
          "transition_logs": {
            "type": "array",
            "description": "A list of all dispute events corresponding to the dispute",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "description": "Type of the dispute state transition denoted by the dispute event",
                  "enum": [
                    "created",
                    "customer_evidence_added",
                    "merchant_evidence_added",
                    "merchant_more_evidence_required",
                    "adjudicated_customer_fault",
                    "adjudicated_merchant_fault"
                  ]
                },
                "created": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Timestamp indicating when the dispute event was opened, in ISO 8601 UTC format"
                }
              }
            }
          }
        }
      },
      "ExtraEvidence": {
        "type": "object",
        "properties": {
          "shipping_info": {
            "type": "object",
            "properties": {
              "company_name": {
                "type": "string",
                "description": "Carrier company for shipment of order"
              },
              "tracking_number": {
                "type": "string",
                "description": "Carrier company tracking number for shipment of order"
              }
            }
          },
          "communication_info": {
            "type": "object",
            "properties": {
              "contact_type": {
                "type": "string",
                "enum": [
                  "already_contacted",
                  "no_contact",
                  "no_response"
                ],
                "description": "Type of contact between customer and merchant prior to dispute opening"
              },
              "merchant_contact_name": {
                "type": "string",
                "description": "Name of merchant contact that customer interacted with before opening the dispute"
              },
              "first_contact_date": {
                "type": "string",
                "format": "date",
                "description": "First time customer contacted merchant, as YYYY-MM-DD"
              },
              "last_contact_date": {
                "type": "string",
                "format": "date",
                "description": "Last time customer contacted merchant, as YYYY-MM-DD"
              }
            }
          },
          "return_info": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "all",
                  "partial",
                  "none",
                  "not_accepted"
                ],
                "description": "Type of return"
              },
              "return_date": {
                "type": "string",
                "format": "date",
                "description": "Date of return, as YYYY-MM-DD"
              },
              "method": {
                "type": "string",
                "enum": [
                  "mail",
                  "in_store"
                ],
                "description": "Method of return"
              },
              "shipping_delivery": {
                "type": "string",
                "format": "date",
                "description": "Date of shipment delivery as YYYY-MM-DD"
              }
            }
          },
          "cancellation_info": {
            "type": "object",
            "properties": {
              "cancellation_status": {
                "type": "string",
                "enum": [
                  "Customer_cancelled_entire_order",
                  "Customer_cancelled_part_of_order",
                  "Merchant_cancelled_entire_order",
                  "Merchant_cancelled_part_of_order",
                  "Attempted_cancellation_not_accepted",
                  "Not_cancelled"
                ]
              },
              "cancellation_date": {
                "type": "string",
                "format": "date",
                "description": "Date of cancellation, as YYYY-MM-DD"
              },
              "cancellation_method": {
                "type": "string",
                "enum": [
                  "Cancelled_online",
                  "Cancelled_in_store"
                ]
              },
              "company_name": {
                "type": "string",
                "description": "Carrier company for shipment of return"
              },
              "tracking_number": {
                "type": "string",
                "description": "Carrier company tracking number for shipment of order"
              },
              "shipping_delivery": {
                "type": "string",
                "format": "date",
                "description": "Date of shipment delivery, as YYYY-MM-DD"
              },
              "store_address": {
                "type": "string",
                "description": "Store address for cancelled order"
              }
            }
          }
        }
      },
      "UpdateDisputeResponse": {
        "type": "object",
        "properties": {
          "dispute": {
            "$ref": "#/components/schemas/Dispute"
          }
        }
      },
      "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"
          }
        }
      },
      "UnauthorizedError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "api-key-pair-invalid"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human readable message with details about the error"
          }
        }
      },
      "NotFoundError": {
        "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"
          }
        }
      },
      "InternalServerError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "internal_server_error"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human readable message with details about the error"
          }
        }
      }
    }
  }
}
```

# Sibling pages

* [List disputes](https://docs.affirm.com/developers/reference/listdisputes.md)
* [Get dispute](https://docs.affirm.com/developers/reference/get_dispute.md)
* [Submit dispute evidence](https://docs.affirm.com/developers/reference/submit_dispute_evidence.md)