> ## Documentation Index
> Fetch the complete documentation index at: https://docs.withflex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Close Dispute

> Closes a dispute, accepting it as lost and forfeiting the disputed funds.

Use this when you do not wish to contest the dispute. Closing is irreversible: it forfeits the disputed amount and the dispute fee, and no further evidence can be submitted. The dispute must be in a `needs_response` or `warning_needs_response` status.



## OpenAPI

````yaml /openapi.json post /v1/disputes/{dispute_id}/close
openapi: 3.1.0
info:
  title: Flex API
  description: >-
    The Flex API powers HSA/FSA payment processing for healthcare commerce:
    checkout sessions, payment intents, subscriptions, customers, refunds,
    disputes, and eligibility. Authenticate with your partner API key as a
    Bearer token. All endpoints are scoped to your partner account, and test
    mode is fully supported via test API keys.
  version: 0.1.0
servers:
  - url: https://api.withflex.com
security:
  - BearerAuth: []
tags:
  - name: Balance Transactions
  - name: Captures
  - name: Checkout Sessions
  - name: Coupons
  - name: Customers
  - name: Disputes
  - name: Events
  - name: Exports
  - name: Files
  - name: Invoices
  - name: Letters
  - name: Orders
  - name: Payment Intents
  - name: Payment Links
  - name: Payouts
  - name: Prices
  - name: Products
  - name: Promo Codes
  - name: Receipts
  - name: Refunds
  - name: Setup Intents
  - name: Shipping Rates
  - name: Subscriptions
paths:
  /v1/disputes/{dispute_id}/close:
    post:
      tags:
        - Disputes
      summary: Close Dispute
      description: >-
        Closes a dispute, accepting it as lost and forfeiting the disputed
        funds.


        Use this when you do not wish to contest the dispute. Closing is
        irreversible: it forfeits the disputed amount and the dispute fee, and
        no further evidence can be submitted. The dispute must be in a
        `needs_response` or `warning_needs_response` status.
      operationId: v1.disputes.close
      parameters:
        - in: path
          name: dispute_id
          required: true
          schema:
            examples:
              - fdp_01J9XR8M3K7VZ8N2YB4WJ6T0RA
            type: string
          style: simple
          example: fdp_01J9XR8M3K7VZ8N2YB4WJ6T0RA
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DisputeBody_for_Dispute'
              example:
                dispute:
                  dispute_id: fdp_01J9XR8M3K7VZ8N2YB4WJ6T0RA
                  payment_intent_id: fpi_01J9XR8M3K7VZ8N2YB4WJ6T0RA
                  amount: 2500
                  currency: usd
                  charge_id: fch_01J9XR8M3K7VZ8N2YB4WJ6T0RA
                  metadata:
                    order_id: '8842'
                    channel: shopify
                  created_at: '2026-06-15T14:30:00Z'
                  status: lost
                  reason: bank_cannot_process
                  is_charge_refundable: false
                  evidence: {}
                  evidence_details: {}
                  payment_method_details: {}
                  test_mode: false
                  client_reference_id: obj_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
              example:
                detail:
                  - loc:
                      - string
                    msg: string
                    type: string
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorOut'
              example:
                code: string
                detail: string
      security:
        - BearerAuth:
            - disputes:write
components:
  schemas:
    DisputeBody_for_Dispute:
      description: An envelope wrapping a single dispute object.
      type: object
      required:
        - dispute
      properties:
        dispute:
          $ref: '#/components/schemas/Dispute'
          description: The dispute.
      example:
        dispute:
          dispute_id: fdp_01J9XR8M3K7VZ8N2YB4WJ6T0RA
          payment_intent_id: fpi_01J9XR8M3K7VZ8N2YB4WJ6T0RA
          amount: 2500
          currency: usd
          charge_id: fch_01J9XR8M3K7VZ8N2YB4WJ6T0RA
          metadata:
            order_id: '8842'
            channel: shopify
          created_at: '2026-06-15T14:30:00Z'
          status: lost
          reason: bank_cannot_process
          is_charge_refundable: false
          evidence: {}
          evidence_details: {}
          payment_method_details: {}
          test_mode: false
          client_reference_id: obj_01J9XR8M3K7VZ8N2YB4WJ6T0RA
    HttpErrorOut:
      title: HttpError
      description: The error response returned when a request cannot be completed.
      type: object
      required:
        - code
        - detail
      properties:
        code:
          description: A short machine-readable error code identifying the type of error.
          type: string
        detail:
          description: A human-readable explanation of what went wrong.
          type: string
      example:
        code: string
        detail: string
    HTTPValidationError:
      description: The error response returned when request validation fails (HTTP 422).
      type: object
      required:
        - detail
      properties:
        detail:
          description: The list of validation errors, one entry per invalid field.
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
      example:
        detail:
          - loc:
              - string
            msg: string
            type: string
    Dispute:
      description: >-
        A Dispute object represents a customer's challenge to a payment, raised
        through their card issuer or bank (also known as a chargeback). Use it
        to track the dispute's status, review the reason it was filed, and
        submit evidence to contest it.
      type: object
      required:
        - amount
        - created_at
        - currency
        - dispute_id
        - is_charge_refundable
        - metadata
        - payment_intent_id
        - reason
        - status
        - test_mode
      properties:
        dispute_id:
          description: Unique identifier for the dispute, prefixed with `fdp_`.
          type: string
          example: fdp_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        payment_intent_id:
          description: ID of the PaymentIntent that was disputed.
          type: string
          example: fpi_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        amount:
          description: >-
            Disputed amount, in the smallest currency unit (e.g., `2500` =
            $25.00 USD). Usually the full amount of the disputed payment.
          type: integer
          format: int32
          example: 2500
        currency:
          description: Three-letter ISO currency code, in lowercase (e.g., `usd`).
          type: string
          example: usd
        charge_id:
          description: >-
            ID of the Charge that was disputed. `null` if the originating charge
            could not be resolved.
          type:
            - string
            - 'null'
          example: fch_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        metadata:
          description: >-
            Set of key-value pairs attached to the dispute for storing
            additional structured information.
          type: object
          example:
            order_id: '8842'
            channel: shopify
        created_at:
          $ref: '#/components/schemas/Timestamptz'
          description: >-
            Time at which the dispute was created, as an RFC 3339 date-time
            string.
          example: '2026-06-15T14:30:00Z'
        status:
          $ref: '#/components/schemas/DisputeStatus'
          description: >-
            The current status of the dispute. Evidence can only be submitted
            while the status is `needs_response` or `warning_needs_response`.
        reason:
          $ref: '#/components/schemas/DisputeReason'
          description: Reason the dispute was filed, as reported by the card network.
        is_charge_refundable:
          description: >-
            Whether the disputed charge can still be refunded. Once a payment is
            disputed, refunding it is typically no longer possible.
          type: boolean
          example: false
        evidence:
          description: >-
            Evidence collected to respond to the dispute. On the list endpoint
            this is included only when you pass `expand=evidence`; `null` when
            no evidence has been recorded.
          anyOf:
            - $ref: '#/components/schemas/DisputeEvidenceResponse'
            - type: 'null'
        evidence_details:
          description: >-
            Metadata about the evidence submission, including the response
            deadline and whether evidence has been submitted.
          anyOf:
            - $ref: '#/components/schemas/EvidenceDetails'
            - type: 'null'
        balance_transactions:
          description: >-
            Balance transactions that record the funds withdrawn and returned as
            the dispute progresses (e.g., the initial debit and any reversal).
            An empty array when there are none.
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/DisputeBalanceTransactionInfo'
        payment_method_details:
          description: >-
            Details of the payment method that was disputed, such as the card
            brand and network reason code. `null` when no payment method details
            are available.
          anyOf:
            - $ref: '#/components/schemas/DisputePaymentMethodDetails'
            - type: 'null'
        test_mode:
          description: >-
            Whether the dispute was created in test mode. `true` for disputes
            created with test API keys.
          type: boolean
          example: false
        client_reference_id:
          description: >-
            Your own identifier for the customer or payment this dispute relates
            to, copied from the originating payment.
          type:
            - string
            - 'null'
          example: obj_01J9XR8M3K7VZ8N2YB4WJ6T0RA
      example:
        dispute_id: fdp_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        payment_intent_id: fpi_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        amount: 2500
        currency: usd
        charge_id: fch_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        metadata:
          order_id: '8842'
          channel: shopify
        created_at: '2026-06-15T14:30:00Z'
        status: lost
        reason: bank_cannot_process
        is_charge_refundable: false
        evidence: {}
        evidence_details:
          due_by: '2026-06-15T14:30:00Z'
          has_evidence: false
          past_due: false
          submission_count: 3
        payment_method_details:
          type: string
        test_mode: false
        client_reference_id: obj_01J9XR8M3K7VZ8N2YB4WJ6T0RA
    ValidationErrorItem:
      description: >-
        Validation errors have their own schema to provide context for invalid
        requests eg. mismatched types and out of bounds values. There may be any
        number of these per 422 UNPROCESSABLE ENTITY error.
      type: object
      required:
        - loc
        - msg
        - type
      properties:
        loc:
          description: >-
            The location as a [`Vec`] of [`String`]s -- often in the form
            `["body", "field_name"]`, `["query", "field_name"]`, etc. They may,
            however, be arbitarily deep.
          type: array
          items:
            type: string
        msg:
          description: The message accompanying the validation error item.
          type: string
        type:
          description: >-
            The type of error, often "type_error" or "value_error", but
            sometimes with more context like as "value_error.number.not_ge"
          type: string
      example:
        loc:
          - string
        msg: string
        type: string
    Timestamptz:
      description: >-
        A timestamp encoded as an RFC 3339 / ISO 8601 string (e.g.
        `2026-06-15T14:30:00Z`).
      type: string
      example: string
    DisputeStatus:
      description: The current status of a dispute.
      oneOf:
        - type: string
          enum:
            - lost
            - needs_response
            - under_review
            - warning_closed
            - warning_needs_response
            - warning_under_review
            - won
        - description: The dispute was prevented before reaching the card network.
          type: string
          enum:
            - prevented
      example: lost
    DisputeReason:
      description: The reason for the dispute, as reported by the card network.
      type: string
      enum:
        - bank_cannot_process
        - check_returned
        - credit_not_processed
        - customer_initiated
        - debit_not_authorized
        - duplicate
        - fraudulent
        - general
        - incorrect_account_details
        - insufficient_funds
        - noncompliant
        - product_not_received
        - product_unacceptable
        - subscription_canceled
        - unrecognized
      example: bank_cannot_process
    DisputeEvidenceResponse:
      description: >-
        Evidence collected to respond to a dispute, with file references
        resolved to Flex file IDs.
      type: object
      properties:
        access_activity_log:
          description: >-
            A description of the activity on the customer's account or the
            order, showing that they accessed or used the product or service.
          type:
            - string
            - 'null'
        customer_name:
          description: The name of the customer.
          type:
            - string
            - 'null'
        customer_email_address:
          description: The email address of the customer.
          type:
            - string
            - 'null'
        customer_purchase_ip:
          description: The IP address from which the customer made the purchase.
          type:
            - string
            - 'null'
        billing_address:
          description: The billing address provided by the customer.
          type:
            - string
            - 'null'
        shipping_address:
          description: The address to which a physical product was shipped.
          type:
            - string
            - 'null'
        shipping_tracking_number:
          description: The tracking number for a physical product shipped to the customer.
          type:
            - string
            - 'null'
        shipping_carrier:
          description: >-
            The delivery service that shipped a physical product (e.g., `usps`,
            `fedex`).
          type:
            - string
            - 'null'
        shipping_date:
          description: The date on which a physical product was shipped to the customer.
          type:
            - string
            - 'null'
        service_date:
          description: The date on which the service was provided to the customer.
          type:
            - string
            - 'null'
        product_description:
          description: >-
            A description of the product or service purchased and an explanation
            of why the customer's claim is unwarranted.
          type:
            - string
            - 'null'
        refund_policy_disclosure:
          description: Your refund policy as shown to the customer.
          type:
            - string
            - 'null'
        refund_refusal_explanation:
          description: An explanation of why the customer is not entitled to a refund.
          type:
            - string
            - 'null'
        cancellation_policy_disclosure:
          description: Your cancellation policy as shown to the customer.
          type:
            - string
            - 'null'
        cancellation_rebuttal:
          description: >-
            An explanation of how the customer was shown that the subscription
            or service was not canceled.
          type:
            - string
            - 'null'
        duplicate_charge_explanation:
          description: >-
            An explanation of the difference between the disputed payment and
            the charge the customer believes is a duplicate.
          type:
            - string
            - 'null'
        duplicate_charge_id:
          description: >-
            The ID of the charge the customer claims is a duplicate of the
            disputed charge.
          type:
            - string
            - 'null'
        uncategorized_text:
          description: Any additional evidence as free-form text.
          type:
            - string
            - 'null'
        customer_communication:
          description: >-
            File evidence of any communication with the customer, such as emails
            proving they received the product or service.
          anyOf:
            - $ref: '#/components/schemas/EvidenceFileInfo'
            - type: 'null'
        customer_signature:
          description: >-
            File evidence of the customer's signature, such as a proof of
            delivery signed by the customer.
          anyOf:
            - $ref: '#/components/schemas/EvidenceFileInfo'
            - type: 'null'
        shipping_documentation:
          description: >-
            File documentation showing that a physical product was shipped to
            the customer (e.g., a shipping label or carrier receipt).
          anyOf:
            - $ref: '#/components/schemas/EvidenceFileInfo'
            - type: 'null'
        receipt:
          description: >-
            File evidence of the receipt or message sent to the customer
            notifying them of the charge.
          anyOf:
            - $ref: '#/components/schemas/EvidenceFileInfo'
            - type: 'null'
        duplicate_charge_documentation:
          description: >-
            File documentation for the prior charge the customer claims is a
            duplicate.
          anyOf:
            - $ref: '#/components/schemas/EvidenceFileInfo'
            - type: 'null'
        service_documentation:
          description: >-
            File documentation showing that a service was provided to the
            customer.
          anyOf:
            - $ref: '#/components/schemas/EvidenceFileInfo'
            - type: 'null'
        uncategorized_file:
          description: Any additional file evidence that does not fit another category.
          anyOf:
            - $ref: '#/components/schemas/EvidenceFileInfo'
            - type: 'null'
        cancellation_policy:
          description: File evidence of your cancellation policy as shown to the customer.
          anyOf:
            - $ref: '#/components/schemas/EvidenceFileInfo'
            - type: 'null'
        refund_policy:
          description: File evidence of your refund policy as shown to the customer.
          anyOf:
            - $ref: '#/components/schemas/EvidenceFileInfo'
            - type: 'null'
      example:
        customer_communication:
          file_id: ffile_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        customer_signature:
          file_id: ffile_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        shipping_documentation:
          file_id: ffile_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        receipt:
          file_id: ffile_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        duplicate_charge_documentation:
          file_id: ffile_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        service_documentation:
          file_id: ffile_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        uncategorized_file:
          file_id: ffile_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        cancellation_policy:
          file_id: ffile_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        refund_policy:
          file_id: ffile_01J9XR8M3K7VZ8N2YB4WJ6T0RA
    EvidenceDetails:
      description: Details about the evidence submission deadline and status.
      type: object
      required:
        - has_evidence
        - past_due
        - submission_count
      properties:
        due_by:
          description: Deadline for submitting evidence, as an RFC 3339 date-time string.
          anyOf:
            - $ref: '#/components/schemas/Timestamptz'
            - type: 'null'
          example: '2026-06-15T14:30:00Z'
        has_evidence:
          description: Whether evidence has been submitted
          type: boolean
          example: false
        past_due:
          description: Whether the evidence deadline has passed
          type: boolean
          example: false
        submission_count:
          description: Number of times evidence has been submitted
          type: integer
          format: int32
          example: 3
      example:
        due_by: '2026-06-15T14:30:00Z'
        has_evidence: false
        past_due: false
        submission_count: 3
    DisputeBalanceTransactionInfo:
      description: >-
        A summary of a balance transaction associated with a dispute, recording
        how funds moved on your balance as the dispute progressed (for example
        the initial debit when the dispute was filed, or the reversal if it was
        won).
      type: object
      required:
        - amount
        - balance_transaction_id
        - fee
        - net
        - status
      properties:
        balance_transaction_id:
          description: ID of the balance transaction, prefixed with `fbtxn_`.
          type: string
          example: fbtxn_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        amount:
          description: >-
            Gross amount of the transaction, in the smallest currency unit
            (e.g., `2500` = $25.00 USD). Negative when funds are withdrawn from
            your balance.
          type: integer
          format: int32
          example: 2500
        fee:
          description: >-
            Fee applied to the transaction, in the smallest currency unit (e.g.,
            `1500` = $15.00 USD). For a dispute, this is typically the dispute
            (chargeback) fee.
          type: integer
          format: int32
          example: 2500
        net:
          description: >-
            Net amount applied to your balance after fees, in the smallest
            currency unit (`net = amount - fee`).
          type: integer
          format: int32
          example: 2500
        status:
          $ref: '#/components/schemas/BalanceTransactionStatus'
          description: 'Status of the balance transaction: `available` or `pending`.'
        type:
          description: >-
            The type of balance transaction (e.g., `adjustment`). `null` when
            not classified.
          type:
            - string
            - 'null'
        reporting_category:
          description: >-
            The reporting category used to group the transaction in financial
            reports.
          type:
            - string
            - 'null'
          example: example_value
        category:
          description: >-
            The role this transaction plays within the dispute (e.g., the
            initial debit or a reversal). `null` when not categorized.
          type:
            - string
            - 'null'
          example: example_value
        created_at:
          description: >-
            Time at which the balance transaction was created, as an RFC 3339
            date-time string. `null` when unavailable.
          anyOf:
            - $ref: '#/components/schemas/Timestamptz'
            - type: 'null'
          example: '2026-06-15T14:30:00Z'
      example:
        balance_transaction_id: fbtxn_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        amount: 2500
        fee: 2500
        net: 2500
        status: available
        reporting_category: example_value
        category: example_value
        created_at: '2026-06-15T14:30:00Z'
    DisputePaymentMethodDetails:
      description: Details of the payment method that was disputed.
      type: object
      required:
        - type
      properties:
        type:
          description: The type of payment method that was disputed (e.g., `card`).
          type: string
        card:
          description: >-
            Card-specific details, present when `type` is `card`. `null` for
            other payment method types.
          anyOf:
            - $ref: '#/components/schemas/DisputePaymentMethodCard'
            - type: 'null'
      example:
        type: string
        card:
          brand: visa
          network_reason_code: example_value
    EvidenceFileInfo:
      description: A reference to a file attached as dispute evidence.
      type: object
      properties:
        file_id:
          description: The Flex file ID (e.g., `ffile_xxx`).
          type:
            - string
            - 'null'
          example: ffile_01J9XR8M3K7VZ8N2YB4WJ6T0RA
        filename:
          description: The original filename from upload.
          type:
            - string
            - 'null'
        stripe_file_id:
          description: >-
            Underlying card-network file ID, present when the file could not be
            matched to a Flex file ID.
          type:
            - string
            - 'null'
      example:
        file_id: ffile_01J9XR8M3K7VZ8N2YB4WJ6T0RA
    BalanceTransactionStatus:
      type: string
      enum:
        - available
        - pending
      x-ms-enum:
        name: BalanceTransactionStatus
        modelAsString: false
        values:
          - value: available
            name: Available
            description: Funds have settled and are available to be paid out.
          - value: pending
            name: Pending
            description: Funds are not yet available.
      description: |-
        Availability status of the funds in a balance transaction.

        - `available`: Funds have settled and are available to be paid out.
        - `pending`: Funds are not yet available.
      example: available
    DisputePaymentMethodCard:
      description: Card-specific details for a disputed payment made with a card.
      type: object
      properties:
        brand:
          description: The card brand. `null` when unknown.
          type:
            - string
            - 'null'
          example: visa
        network_reason_code:
          description: >-
            The reason code the card network assigned to the dispute, as
            reported by the issuer.
          type:
            - string
            - 'null'
          example: example_value
      example:
        brand: visa
        network_reason_code: example_value
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Use a Bearer token to access this API.

````