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

# Approve disputes

> Approve disputes (refund money to the customer). Only 20 disputes can be approved within a single request.



## OpenAPI

````yaml post /api/v1/disputes/approve
openapi: 3.1.0
info:
  title: Tabby API Reference
  version: 1.0.0
  x-logo:
    url: assets/tabby-new.png
    altText: tabby Logo
  description: |
    Tabby Documentation:  **[docs.tabby.ai](https://docs.tabby.ai/)**
servers:
  - url: https://api.tabby.ai/
    description: Production (UAE, Kuwait)
  - url: https://api.tabby.sa/
    description: Production (KSA)
security: []
tags:
  - name: Checkout
    description: >-
      Checkout is a whole process of customer data collection and payment
      authorization.
  - name: Payments
    description: >-
      The core of tabby is a payments flow enabling you to handle payments at
      your webstore.
  - name: Webhooks
    description: Manage webhook endpoints.
  - name: Disputes
    description: >-
      The Disputes API is designed to simplify the process of handling disputes
      and help merchants resolve issues with customer orders more efficiently.
      Merchants can use this API to retrieve a list of disputes, view details
      about a specific dispute, and approve or challenge a bunch of disputes. It
      mirrors the functionality available in Tabby Merchant Dashboard and
      operates exclusively with live payments using live credentials. A secret
      key is required for using the Disputes API. <SchemaDefinition
      schemaRef="#/components/schemas/Webhook" />
paths:
  /api/v1/disputes/approve:
    post:
      tags:
        - Disputes
      summary: Approve disputes
      description: >-
        Approve disputes (refund money to the customer). Only 20 disputes can be
        approved within a single request.
      operationId: postDisputesApprove
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                dispute_ids:
                  type: array
                  items:
                    type: string
                    format: uuid
                    example: dispute id, uuid format
                  description: >-
                    Array of dispute ids. Only 20 disputes can be approved
                    within a single request.
              required:
                - dispute_ids
      responses:
        '200':
          $ref: '#/components/responses/DisputesApprove'
        '400':
          $ref: '#/components/responses/BadRequestError_bad_request'
        '401':
          $ref: '#/components/responses/AuthenticationError_invalid_secret_key'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/UnexpectedError'
      security:
        - bearerAuth:
            - secret_key
components:
  responses:
    DisputesApprove:
      description: Success. Disputes were approved.
      content:
        application/json:
          schema:
            type: object
            properties:
              disputes:
                type: array
                items:
                  $ref: '#/components/schemas/DisputeNoHistory'
    BadRequestError_bad_request:
      description: >-
        One of the required fields is missing or request is not formatted
        correctly.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_400_bad_request'
    AuthenticationError_invalid_secret_key:
      description: The request cannot be authorized.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_401_invalid_secret_key'
    NotFoundError:
      description: You are using an incorrect ID.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_404'
    UnexpectedError:
      description: Something bad happened. We're notified.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_500'
  schemas:
    DisputeNoHistory:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/DisputeID'
        attachments:
          $ref: '#/components/schemas/DisputeAttachments'
        payment_id:
          $ref: '#/components/schemas/PaymentID'
          description: ID of the payment.
        amount:
          type: string
          example: '100.00'
          description: Total disputed amount.
        currency:
          $ref: '#/components/schemas/Currency'
          description: >-
            The currency of the dispute. It's always equal to the currency of
            the payment.
        created_at:
          $ref: '#/components/schemas/DisputeCreatedAt'
        expired_at:
          $ref: '#/components/schemas/DisputeExpiredAt'
        status:
          $ref: '#/components/schemas/DisputeStatus'
        reason:
          $ref: '#/components/schemas/DisputeReason'
        days_left:
          $ref: '#/components/schemas/DisputeDaysLeft'
        items:
          type: array
          items:
            $ref: '#/components/schemas/DisputeOrderItem'
        order_number:
          type: string
          example: '#1234'
          description: Merchant-assigned order number.
        comment:
          $ref: '#/components/schemas/DisputeComment'
      required:
        - id
        - attachments
        - payment_id
        - amount
        - currency
        - created_at
        - expired_at
        - status
        - reason
        - days_left
        - items
        - order_number
        - comment
    Error_400_bad_request:
      type: object
      properties:
        status:
          type: string
          example: error
        errorType:
          type: string
          example: bad_data
        error:
          type: string
          example: bad_request
    Error_401_invalid_secret_key:
      type: object
      properties:
        status:
          type: string
          example: error
        errorType:
          type: string
          example: not_authorized
        error:
          type: string
          example: invalid secret key
    Error_404:
      type: string
      example: 404 page not found
    Error_500:
      type: string
      example: Internal Server error
    DisputeID:
      type: string
      format: uuid
      example: dispute id, uuid format
      readOnly: true
      description: ID of the dispute.
    DisputeAttachments:
      type: array
      nullable: true
      items:
        type: string
        example: attachment_1
      readOnly: true
      description: Array of links to images which were uploaded by customer.
    PaymentID:
      type: string
      format: uuid
      example: payment id, uuid format
      readOnly: true
      description: >-
        Unique identifier for the payment (UUID), assigned by Tabby. Save it on
        your side!
    Currency:
      type: string
      enum:
        - AED
        - SAR
        - KWD
      example: AED
      description: >
        ISO 4217 currency code for the payment amount. Currently there are 3
        possible currency options - depending on the country where the store is
        located:
          - `AED` - United Arab Emirates Dirham
          - `SAR` - Saudi Riyal
          - `KWD` - Kuwaiti Dinar
    DisputeCreatedAt:
      type: string
      readOnly: true
      example: '2018-10-17T00:00:00.000Z'
      description: >-
        Date and time the Dispute was created, in UTC, and displayed in ISO 8601
        datetime format.
    DisputeExpiredAt:
      type: string
      readOnly: true
      example: '2018-10-17T00:00:00.000Z'
      description: >-
        Date and time of the expiration of the Dispute, in UTC, and displayed in
        ISO 8601 datetime format.
    DisputeStatus:
      type: string
      readOnly: true
      enum:
        - new
        - declined
        - cancelled
        - refunded
        - in_progress
        - evidence_merchant
        - evidence_customer
      example: new
      description: |
        The current status of the dispute:
          - `new` - dispute pending merchant approval for refund or initiate a challenge
          - `declined` - dispute was declined by Tabby support
          - `cancelled` - dispute was canceled by customer
          - `refunded` - dispute was approved or the order was refunded via Payments API
          - `in_progress` - merchant challenged dispute and need a response from Tabby support
          - `evidence_merchant` - waiting for evidence from the merchant
          - `evidence_customer` - waiting for evidence from the customer
    DisputeReason:
      type: string
      readOnly: true
      enum:
        - unreceived_refund
        - identity_theft
        - product_issue
        - not_delivered
      example: unreceived_refund
      description: >
        Cause of the dispute was created (selected by customer). There are only
        four reasons:
          - `unreceived_refund` - a refund not received
          - `identity_theft` - I did not place this order (also known as identity theft)
          - `product_issue` - there was a problem with the product
          - `not_delivered` - the order was not delivered
    DisputeDaysLeft:
      type: integer
      format: uint16
      description: How many days left before dispute will be automatically approved.
    DisputeOrderItem:
      type: object
      properties:
        reference_id:
          type: string
          example: payment id
          description: Reference id from payment.
        title:
          type: string
          example: Order item title
          description: Order item title.
        unit_price:
          type: string
          example: '100.00'
          description: Order item unit price.
      required:
        - reference_id
        - title
        - unit_price
    DisputeComment:
      type: string
      example: additional comments
      description: The customer additional comments on the causes of the dispute.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer authentication header of the form `Bearer <secret_key>`, where
        `<secret_key>` is your `secret_key`.

````