{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/qualpay/json-schema/qualpay-dispute-detail-schema.json",
  "title": "DisputeDetail",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/qualpay-disputes-v1-0-api-openapi.yml#/components/schemas/DisputeDetail",
  "type": "object",
  "properties": {
    "code": {
      "type": "integer",
      "description": "<strong>Format: </strong>Fixed length, 1 N<br/><strong>Description: </strong>Response code from the API. `0` indicates success. Refer to <a href=\"/docs/api-conventions#platform-api-response-codes\" target=\"_blank\">Platform API Response Codes</a> for the entire list of return codes.",
      "format": "int32"
    },
    "message": {
      "type": "string",
      "description": "<strong>Format: </strong>Variable length AN<br/><strong>Description: </strong>A short description of the API response code."
    },
    "totalPages": {
      "type": "integer",
      "description": "<strong>Format: </strong>Variable length N<br/><strong>Description: </strong>Total number of pages. ",
      "format": "int32"
    },
    "totalRecords": {
      "type": "integer",
      "description": "<strong>Format: </strong>Variable length, up to 3 N<br/><strong>Description: </strong>Total number of records up to a maximum of 100.",
      "format": "int32"
    },
    "data": {
      "type": "array",
      "description": "An array of the resource object. See <a href=\"/docs/dispute-conventions\" target=\"_blank\">Dispute Conventions</a> for more information.",
      "items": {
        "$ref": "#/$defs/DisputeData"
      }
    }
  },
  "$defs": {
    "DisputeData": {
      "type": "object",
      "properties": {
        "rec_id": {
          "type": "integer",
          "description": "Control number - The control number for the dispute, a unique number associated with each dispute case received.",
          "format": "int64"
        },
        "merchant_id": {
          "type": "integer",
          "description": "Merchant ID (MID) - The ID assigned to the merchant account.",
          "format": "int64"
        },
        "incoming_date": {
          "type": "string",
          "description": "Incoming date - The date the card issuer initiated the dispute, in YYYY-MM-DD HH:MM:ss format."
        },
        "amt_tran": {
          "type": "number",
          "description": "Transaction amount - The amount of the original settled transaction in USD.",
          "format": "double"
        },
        "amt_dispute": {
          "type": "number",
          "description": "Disputed amount - The amount being disputed. This is equal to or less than the original transaction amount (`amt_tran`).",
          "format": "double"
        },
        "auth_code": {
          "type": "string",
          "description": "The 6-character code generated by the issuing bank during authorization."
        },
        "reason_code": {
          "type": "string",
          "description": "Reason code - The code providing the reason for the dispute. See <a href=\"/docs/dispute-conventions\" target=\"_blank\">Dispute Conventions</a> for more information."
        },
        "reason_desc": {
          "type": "string",
          "description": "Reason description - Describes why the dispute was issued, per the dispute reason code (`reason_code`)."
        },
        "data_type": {
          "type": "string",
          "description": "Dispute type - The type of dispute. See <a href=\"/docs/dispute-conventions#dispute-types\" target=\"_blank\">Dispute Types</a> for more information."
        },
        "type_label": {
          "type": "string",
          "description": "The label for the dispute data type."
        },
        "cbr_workflow": {
          "type": "string",
          "description": "Dispute workflow - The type of workflow assigned to the dispute. Possible values are `C` (Collaboration) and `A` (Allocation). See <a href=\"/docs/dispute-conventions#dispute-workflows\" target=\"_blank\">Dispute Workflows</a> for more information."
        },
        "workflow_label": {
          "type": "string",
          "description": "The label for the dispute workflow."
        },
        "status": {
          "type": "string",
          "description": "Dispute status - The current status of the dispute."
        },
        "status_label": {
          "type": "string",
          "description": "The label for the status of the dispute."
        },
        "date_status_change": {
          "type": "string",
          "description": "Dispute status date - The date the dispute's status most recently changed, in YYYY-MM-DD HH:MM:ss format."
        },
        "card_number": {
          "type": "string",
          "description": "Card number - The masked number of the card associated with the dispute, formatted as 123456xxxxxx1234."
        },
        "tran_date": {
          "type": "string",
          "description": "Transaction date - The date the original transaction was authorized, in YYYY-MM-DD HH:MM:ss format."
        },
        "reference_number": {
          "type": "string",
          "description": "Transaction reference number - A 23-digit number associated with the original transaction data. It is used by Qualpay and the issuer to identify the original transaction."
        },
        "cb_ref_num": {
          "type": "string",
          "description": "Issuer reference number - A reference number assigned by the issuing bank to identify a unique dispute."
        },
        "cb_ref_num_assoc": {
          "type": "integer",
          "description": "Card Brand reference number - A reference number assigned by the card brand to identify a unique dispute."
        },
        "vendor_id": {
          "type": "integer",
          "description": "Vendor ID - A unique number assigned to integrator.",
          "format": "int64"
        },
        "purchase_id": {
          "type": "string",
          "description": "Purchase Identifier - The invoice number generated by the merchant."
        },
        "rec_id_list": {
          "type": "array",
          "description": "An array of related disputes.",
          "items": {
            "type": "integer",
            "format": "int64"
          }
        },
        "response": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "reason_code",
                "response_code",
                "ce_code",
                "ce_ind",
                "id_code",
                "field"
              ],
              "description": "The type of this dispute attribute."
            },
            "value": {
              "type": "string",
              "description": "The value of this dispute attribute."
            },
            "label": {
              "type": "string",
              "description": "The label for this dispute attribute."
            },
            "actions": {
              "type": "string",
              "enum": [
                "accept",
                "respond",
                "edit",
                "challenge",
                "arbitration",
                "withdraw",
                "retry",
                "block"
              ],
              "description": "An array of all actions available for this dispute in its current state. Possible values: * `accept` - Accept the dispute as validated. * `respond` - Respond to the dispute with evidence. * `edit` - Edit the dispute response previously submitted. * `challenge` - [todo]. * `arbitration` - Send the dispute to arbitration. * `withdraw` - Withdraw from pre-arbitration.\n",
              "items": {
                "type": "string"
              }
            },
            "related_trans": {
              "type": "array",
              "description": "An array of the resource object. See <a href=\"/docs/dispute-conventions\" target=\"_blank\">Dispute Conventions</a> for more information.",
              "items": {
                "$ref": "#/$defs/RelatedTransaction"
              }
            }
          }
        }
      }
    },
    "RelatedTransaction": {
      "type": "object",
      "properties": {
        "acq_reference_number": {
          "type": "string",
          "description": "The acquirer reference number, an 11-digit number generated by the product initiating the transaction. This is a unique number that both the acquirer and the issuer can use to identify a transaction. For chargeback adjustments, the acquirer reference number is used as the deposit reference number."
        },
        "pg_id": {
          "type": "string",
          "description": "The Payment Gateway ID (PG ID), a 32-byte unique identifier generated by the payment gateway, returned in all valid responses to Payment Gateway transactions."
        },
        "amt_auth": {
          "type": "string",
          "description": "The amount of the authorization."
        },
        "amt_tran": {
          "type": "string",
          "description": "The amount of the settled transaction."
        },
        "auth_code": {
          "type": "string",
          "description": "The 6-character code generated by the issuing bank during authorization."
        },
        "tran_status": {
          "type": "string",
          "description": "The transaction status for `CARD` payments."
        },
        "amt_funded": {
          "type": "string",
          "description": "The amount of this transaction funded to the merchant, displayed in the currency denoted in the `funded_currency` field."
        },
        "tran_date": {
          "type": "string",
          "description": "The date the transaction was captured by the merchant."
        },
        "auth_date": {
          "type": "string",
          "description": "The date the transaction was authorized by the merchant."
        },
        "auth_tran_id": {
          "type": "string",
          "description": "The authorization transaction ID, a unique identifier returned by the issuing bank for an electronically authorized transaction."
        },
        "batch_date": {
          "type": "string",
          "description": "The ISO date the batch was settled."
        },
        "card_number": {
          "type": "string",
          "description": "The masked card number of the transaction."
        },
        "card_type": {
          "type": "string",
          "description": "The card brand of this transaction.",
          "enum": [
            "VS",
            "MC",
            "AM",
            "DS",
            "JC",
            "PP",
            "AP"
          ]
        },
        "dba_name": {
          "type": "string",
          "description": "The 'Doing Business As' (DBA) name used in the transaction."
        },
        "tran_currency": {
          "type": "string",
          "description": "The ISO numeric currency code of the transaction. This must be a currency code associated with one of your payment profiles; contact Qualpay to add currencies."
        },
        "purchase_id": {
          "type": "string",
          "description": "<strong>Format: </strong>Variable length, up to 25 AN<br><strong>Description: </strong>The purchase ID of the transaction."
        },
        "qp_id": {
          "type": "integer",
          "description": "<strong>Format: </strong>Fixed length, 10 N<br><strong>Description: </strong>An internal number generated to identify a transaction. Requests belonging to the same transaction will have the same `qp_id`. ",
          "format": "int64"
        },
        "reference_number": {
          "type": "string",
          "description": "Transaction reference number - A 23-digit number associated with the original transaction data. It is used by Qualpay and the issuer to identify the original transaction."
        },
        "dispute_flag": {
          "type": "boolean",
          "description": "A flag indicating whether the transaction is currently disputed."
        }
      }
    }
  }
}