{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/qualpay/json-schema/qualpay-statement-settlement-response-schema.json",
  "title": "StatementSettlementResponse",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/qualpay-reporting-api-openapi.yml#/components/schemas/StatementSettlementResponse",
  "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/StatementSettlementData"
    }
  },
  "$defs": {
    "StatementSettlementData": {
      "type": "object",
      "properties": {
        "rec_id_linked": {
          "type": "integer",
          "description": "INTERNAL USE ONLY.",
          "format": "int64"
        },
        "merchant_id": {
          "type": "integer",
          "description": "<strong>Format: </strong>Variable length, up to 16 N<br><strong>Description: </strong>The unique ID assigned to a merchant.",
          "format": "int64"
        },
        "billing_month": {
          "type": "string",
          "description": "Billing month of the statement in YYYY-MM-DD format."
        },
        "batch_date": {
          "type": "string",
          "description": "The date the batch was settled to us in YYYY-MM-DD format.",
          "format": "date-time"
        },
        "reference_number": {
          "type": "integer",
          "description": "An 11-digit number generated by the product initiating the transaction. The number is available when the transaction is settled and is a unique number that both the acquirer and the issuer can use to identify a transaction. This reference is used as the deposit reference number.",
          "format": "int64"
        },
        "cnt_purch": {
          "type": "number",
          "description": "The total funded count of transactions in a settled batch.",
          "format": "double"
        },
        "amt_purch": {
          "type": "number",
          "description": "The total funded value of each transaction in a settled batch.",
          "format": "double"
        },
        "amt_return": {
          "type": "number",
          "description": "The total amount of refund or credit transactions in a batch.",
          "format": "double"
        },
        "discount_paid": {
          "type": "number",
          "description": "The amount deducted from a settled batch prior to merchant funding. The discount paid amount represents fees that apply to accounts set up for net settlement. The fees are the discount percentage applied to each payment transaction, and they vary based on the type of payment and the type of the transaction.",
          "format": "double"
        },
        "amt_net": {
          "type": "number",
          "description": "The net amount funded to a deposit account.",
          "format": "double"
        },
        "source_id": {
          "type": "integer",
          "description": "INTERNAL USE ONLY.",
          "format": "int64"
        }
      }
    }
  }
}