{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/affiliaterail-com/json-schema/affiliaterail-com-balance-list-schema.json",
  "title": "BalanceList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/affiliaterail-com-balances-api-openapi.yml#/components/schemas/BalanceList",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Balance"
      }
    },
    "has_more": {
      "type": "boolean",
      "description": "Pass the last object's id as `starting_after` to fetch the next page"
    },
    "total_count": {
      "type": "integer",
      "description": "Count of every object matching the filters, ignoring the cursor"
    }
  },
  "required": [
    "data",
    "has_more",
    "total_count"
  ],
  "$defs": {
    "Balance": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "`bal_<partner_id>_<currency>`"
        },
        "object": {
          "type": "string",
          "enum": [
            "balance"
          ]
        },
        "partner_id": {
          "type": "string",
          "pattern": "^(sample_)?part_",
          "description": "Prefixed id (`part_…`)"
        },
        "currency": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3,
          "description": "ISO-4217"
        },
        "pending_minor": {
          "type": "integer",
          "description": "Integer minor units (cents, pence). Never a float, never a string."
        },
        "due_minor": {
          "type": "integer",
          "description": "Integer minor units (cents, pence). Never a float, never a string."
        },
        "paid_minor": {
          "type": "integer",
          "description": "Integer minor units (cents, pence). Never a float, never a string."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "ISO-8601, UTC"
        }
      },
      "required": [
        "id",
        "object",
        "partner_id",
        "currency",
        "pending_minor",
        "due_minor",
        "paid_minor",
        "updated_at"
      ]
    }
  }
}