{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/qualpay/json-schema/qualpay-transaction-request-response-schema.json",
  "title": "TransactionRequestResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/qualpay-reporting-api-openapi.yml#/components/schemas/TransactionRequestResponse",
  "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",
      "readOnly": true
    },
    "message": {
      "type": "string",
      "description": "<strong>Format: </strong>Variable length AN<br><strong>Description: </strong>A short description of the API response code.",
      "readOnly": true
    },
    "totalPages": {
      "type": "integer",
      "description": "<strong>Format: </strong>Variable length N<br><strong>Description: </strong>Total number of pages. ",
      "format": "int32",
      "readOnly": true
    },
    "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",
      "readOnly": true
    },
    "data": {
      "description": "An array of the resource object.",
      "readOnly": true,
      "$ref": "#/$defs/TransactionRequestData"
    }
  },
  "$defs": {
    "TransactionRequestData": {
      "type": "object",
      "properties": {
        "rec_id": {
          "type": "integer",
          "description": "<strong>Format: </strong>Variable length, up to 18 N<br><strong>Description: </strong>The unique ID assigned to this request.",
          "format": "int64",
          "readOnly": true
        },
        "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"
        },
        "merchant_id": {
          "type": "integer",
          "description": "<strong>Format: </strong>Variable length, up to 16 AN<br><strong>Description: </strong>Identifies the merchant to which this transaction belongs.",
          "format": "int64"
        },
        "tran_time": {
          "type": "string",
          "description": "<strong>Format: </strong>Variable length,  in YYYY-MM-DD HH:MM:ss format<br><strong>Description: </strong>The transaction time. All times are in PST (U.S.). "
        },
        "tran_date": {
          "type": "string",
          "description": "<strong>Format: </strong>Fixed length, 10 AN, YYYY-MM-DD format<br><strong>Description: </strong>The date the transaction was captured by the merchant."
        },
        "request_type": {
          "type": "string",
          "description": "<strong>Format: </strong>Variable length, up to 32 AN<br><strong>Description: </strong>The request type of the transaction."
        },
        "tran_status": {
          "type": "string",
          "description": "<strong>Format: </strong>Fixed length, 1 A<br><strong>Description: </strong>Transaction status:<ul><li>`A` - Transaction is approved</li><li>`H` - Transaction is held</li><li>`C` - Transaction is captured</li><li>`V` - Transaction is voided by merchant</li><li>`v` - Transaction is voided by system</li><li>`K` - Transaction is canceled</li><li>`D` - Transaction is declined by issuer</li><li>`F` - Transaction failures other than issuer declines</li><li>`S` - Transaction settled</li><li>`P` - Deposit sent</li><li>`N` - Transaction settled but will be funded directly by issuer</li><li>`R` - Transaction rejected</li></ul>"
        },
        "dispute_flag": {
          "type": "boolean",
          "description": "<strong>Description: </strong>This will be set to `true` if the transaction is disputed."
        },
        "amt_refunded": {
          "type": "number",
          "description": "<strong>Format: </strong>Variable length, up to 12,2 N<br><strong>Description: </strong>Amount refunded if there are any refunds.",
          "format": "double"
        },
        "pg_id": {
          "type": "string",
          "description": "<strong>Format: </strong>Fixed length, 32 AN<br><strong>Description: </strong>The generated Payment Gateway ID for the transaction."
        },
        "pg_id_linked": {
          "type": "string",
          "description": "<strong>Format: </strong>Fixed length, 32 AN<br><strong>Description: </strong>If this is a refund request, this field will provide the Payment Gateway ID of the original transaction."
        },
        "amt_tran": {
          "type": "number",
          "description": "<strong>Format: </strong>Variable length, up to 12,2 N<br><strong>Description: </strong>The transaction amount.",
          "format": "double"
        },
        "tran_currency": {
          "type": "string",
          "description": "<strong>Format: </strong>Fixed length, 3 AN<br><strong>Description: </strong>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. Refer to <a href=\"/docs/references#currency-codes\" target=\"_blank\">Currency Codes</a> for a list of currency codes. "
        },
        "purchase_id": {
          "type": "string",
          "description": "<strong>Format: </strong>Variable length, up to 25 AN<br><strong>Description: </strong>The purchase ID of the transaction."
        },
        "cardholder_first_name": {
          "type": "string",
          "description": "<strong>Format: </strong>Variable length, up to 32 AN<br><strong>Description: </strong>First name of card holder."
        },
        "cardholder_last_name": {
          "type": "string",
          "description": "<strong>Format: </strong>Variable length, up to 32 AN<br><strong>Description: </strong>Last name of card holder."
        },
        "card_number": {
          "type": "string",
          "description": "<strong>Format: </strong>Fixed length, 16 AN<br><strong>Description: </strong>Masked card number. "
        },
        "card_type": {
          "type": "string",
          "description": "<strong>Format: </strong>Fixed length, 2 AN<br><strong>Description: </strong>The type of billing card used for the transaction. Refer to <a href=\"/docs/api-conventions#card-types\" target=\"_blank\">Card Types</a> for possible values. ",
          "enum": [
            "VS",
            "MC",
            "AM",
            "DS",
            "JC",
            "PP",
            "AP"
          ]
        },
        "auth_code": {
          "type": "string",
          "description": "<strong>Format: </strong>Variable length, up to 6 AN<br><strong>Description: </strong>The authorization code from the issuer."
        },
        "acq_reference_number": {
          "type": "string",
          "description": "<strong>Format: </strong>Variable length, up to 11 N<br><strong>Description: </strong>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, this number is used as the deposit reference number.",
          "readOnly": true
        },
        "merch_ref_num": {
          "type": "string",
          "description": "<strong>Format: </strong>Variable length, up to 128 AN<br><strong>Description: </strong>A merchant-provided reference value that will be stored with the transaction and included with the transaction data reported in Merchant Manager. This value will also be attached to any lifecycle transactions (e.g. retrieval requests and chargebacks) that may occur."
        },
        "amt_convenience_fee": {
          "type": "number",
          "description": "<strong>Format: </strong>Variable length, up to 8,2 N<br><strong>Description: </strong>Amount of convenience fee. A convenience fee is a flat/fixed fee charged to your customer for the privilege of paying for a product or service using a non-standard method of payment. ",
          "format": "double"
        },
        "amt_tran_fee": {
          "type": "number",
          "description": "<strong>Format: </strong>Variable length, up to 8,2 N<br><strong>Description: </strong>Amount of transaction surcharge fee. A surcharge is a fee added to the cost of a purchase for the privilege of using a credit card instead of another form of payment.",
          "format": "double"
        },
        "dba_name": {
          "type": "string",
          "description": "<strong>Format: </strong>Variable length, up to 25 AN<br><strong>Description: </strong>The 'Doing Business As' (DBA) name used in the transaction."
        },
        "amt_funded": {
          "type": "number",
          "description": "<strong>Format: </strong>Variable length, up to 10,2 N<br><strong>Description: </strong>The amount funded to the merchant in the funded currency (`funded_currency`).",
          "format": "double"
        },
        "funded_currency": {
          "type": "string",
          "description": "<strong>Format: </strong>Fixed length, 3 AN<br><strong>Description: </strong>The numeric currency code of the funded amount (`amt_funded`). Refer to <a href=\"/docs/references#currency-codes\" target=\"_blank\">Currency Codes</a> for possible values. "
        },
        "rcode": {
          "type": "string",
          "description": "<strong>Format: </strong>Fixed length, 3 AN<br><strong>Description: </strong>The response code from the payment gateway. Refer to <a href=\"/docs/api-conventions#payment-gateway-api-response-codes\" target=\"_blank\">Payment Gateway Response Codes</a> for possible values."
        },
        "auth_avs_result": {
          "type": "string",
          "description": "<strong>Format: </strong>Fixed length, 1 AN<br><strong>Description: </strong>The AVS result from the card issuer (if `avs_zip` and optionally `avs_address` were provided in the request). Refer to <a href=\"/docs/api-conventions#payment-result-codes-for-avs\" target=\"_blank\">Payment Result Codes for AVS</a> for possible values.",
          "readOnly": true
        },
        "auth_cvv2_result": {
          "type": "string",
          "description": "<strong>Format: </strong>Fixed length, 1 AN<br><strong>Description: </strong>The CVV2 result from the card issuer (if CVV2 data was sent in the request). Refer to <a href=\"/docs/api-conventions#payment-result-codes-for-cvv2\" target=\"_blank\">Payment Result Codes for CVV2</a> for possible values.",
          "readOnly": true
        },
        "auth_tran_id": {
          "type": "string",
          "description": "<strong>Format: </strong>Variable length, up to 15 AN<br><strong>Description: </strong>The authorization transaction ID, a unique identifier returned by the issuing bank for an electronically authorized transaction.",
          "readOnly": true
        }
      }
    }
  }
}