{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aifinpay-io/json-schema/aifinpay-io-reporting-snapshot-schema.json",
  "title": "ReportingSnapshot",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aifinpay-io-reporting-api-openapi.yml#/components/schemas/ReportingSnapshot",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "version": {
      "type": "integer",
      "const": 2
    },
    "contract": {
      "type": "string",
      "const": "reporting.v2.20261009"
    },
    "snapshot_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^[0-9a-f-]{36}$"
    },
    "as_of": {
      "type": "string",
      "format": "date-time",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
    },
    "filters": {
      "$ref": "#/$defs/ReportingFilters"
    },
    "summary": {
      "$ref": "#/$defs/ReportingSummary"
    },
    "stages": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReportingStage"
      },
      "maxItems": 13
    },
    "cohorts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReportingCohort"
      }
    },
    "coverage": {
      "$ref": "#/$defs/ReportingCoverage"
    },
    "rows": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReportingRow"
      },
      "maxItems": 200
    },
    "page": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "total_rows": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "exported_rows": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000
        },
        "truncated": {
          "type": "boolean"
        },
        "next_cursor": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2048
        }
      },
      "required": [
        "total_rows",
        "exported_rows",
        "truncated",
        "next_cursor"
      ]
    },
    "merchants": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "registered_sites": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "reported_sites": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "verified_sites": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "first_paid_sites": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        }
      },
      "required": [
        "registered_sites",
        "reported_sites",
        "verified_sites",
        "first_paid_sites"
      ]
    }
  },
  "required": [
    "version",
    "contract",
    "snapshot_id",
    "as_of",
    "expires_at",
    "filters",
    "summary",
    "stages",
    "cohorts",
    "coverage",
    "rows",
    "page"
  ],
  "$defs": {
    "ReportingCohort": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "pair": {
          "type": "string",
          "maxLength": 2048
        },
        "unit": {
          "type": "string",
          "enum": [
            "flow",
            "site"
          ]
        },
        "denominator": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "numerator": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "channel": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "browser",
            "api",
            "unknown",
            null
          ]
        },
        "rate": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 1
        },
        "window_seconds": {
          "type": "integer",
          "const": 604800
        },
        "maturity": {
          "type": "string",
          "enum": [
            "mature",
            "immature"
          ]
        },
        "quality": {
          "type": "string",
          "maxLength": 2048
        }
      },
      "required": [
        "pair",
        "unit",
        "denominator",
        "numerator",
        "channel",
        "rate",
        "window_seconds",
        "maturity",
        "quality"
      ]
    },
    "ReportingCoverage": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "raw_from": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "projection_lag_seconds": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "pending": {
          "anyOf": [
            {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|[1-9][0-9]*)$"
            },
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000
            }
          ]
        },
        "dropped": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "interruptions": {
          "type": "array",
          "items": {
            "type": "object",
            "description": "Bounded source coverage intervals; not request payloads."
          }
        },
        "integration_status": {
          "type": "string",
          "maxLength": 2048
        },
        "integration_reason": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2048
        },
        "stage_coverage": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "source_coverage": {
          "type": "array",
          "items": {
            "type": "object"
          }
        },
        "verifications": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "merchant_id": {
                "type": "string",
                "maxLength": 2048
              },
              "status": {
                "type": "string",
                "enum": [
                  "verified",
                  "incomplete"
                ]
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 2048
              },
              "last_checked_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
              },
              "current_revision": {
                "type": "string",
                "maxLength": 2048
              },
              "verified_at": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
              },
              "checks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "type": "string",
                      "maxLength": 2048
                    },
                    "passed": {
                      "type": "boolean"
                    },
                    "evidence_ref": {
                      "type": "string",
                      "maxLength": 2048
                    }
                  },
                  "required": [
                    "name",
                    "passed",
                    "evidence_ref"
                  ]
                },
                "maxItems": 6
              }
            },
            "required": [
              "merchant_id",
              "status",
              "reason",
              "last_checked_at",
              "current_revision",
              "verified_at",
              "checks"
            ]
          },
          "maxItems": 50
        },
        "supported_stages": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "access_challenged",
              "access_admitted",
              "resource_response_completed",
              "paywall_viewed",
              "payment_link_opened",
              "merchant_onboarding_opened",
              "quote_created",
              "payment_confirmed",
              "merchant_signup_completed",
              "merchant_site_created",
              "merchant_integration_reported",
              "merchant_integration_verified",
              "merchant_first_payment_confirmed"
            ]
          },
          "maxItems": 13
        },
        "last_received": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          }
        },
        "tracking_start": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
          }
        },
        "producer_status": {
          "type": "string",
          "enum": [
            "unknown",
            "gap",
            "reported"
          ]
        },
        "producers": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "producer_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^[0-9a-f-]{36}$"
              },
              "sequence": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "pending": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "dropped": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "retries": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^(0|[1-9][0-9]*)$"
              },
              "last_error": {
                "type": "string",
                "maxLength": 2048
              },
              "at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
              },
              "supported": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "access_challenged",
                    "access_admitted",
                    "resource_response_completed"
                  ]
                },
                "maxItems": 3
              }
            },
            "required": [
              "producer_id",
              "sequence",
              "pending",
              "dropped",
              "retries",
              "last_error",
              "at",
              "supported"
            ]
          }
        },
        "financial_status": {
          "type": "string",
          "enum": [
            "empty",
            "valued",
            "unpriced",
            "partial",
            "unsupported",
            "unavailable"
          ]
        },
        "attribution": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "linked": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|[1-9][0-9]*)$"
            },
            "eligible": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|[1-9][0-9]*)$"
            },
            "ratio": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0,
              "maximum": 1
            }
          },
          "required": [
            "linked",
            "eligible",
            "ratio"
          ]
        }
      },
      "required": [
        "raw_from",
        "projection_lag_seconds",
        "pending",
        "dropped",
        "interruptions",
        "integration_status",
        "integration_reason"
      ]
    },
    "ReportingFilters": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "funnel": {
          "type": "string",
          "enum": [
            "access",
            "onboarding",
            "sites"
          ]
        },
        "merchant_ids": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 2048
          },
          "maxItems": 50,
          "uniqueItems": true
        },
        "from": {
          "type": "string",
          "format": "date-time",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "to": {
          "type": "string",
          "format": "date-time",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "resource": {
          "type": "string",
          "maxLength": 512
        },
        "channel": {
          "type": "string",
          "enum": [
            "browser",
            "api",
            "unknown"
          ]
        },
        "source": {
          "type": "string",
          "enum": [
            "hosted",
            "partner",
            "browser"
          ]
        },
        "network": {
          "type": "string",
          "maxLength": 2048
        },
        "mode": {
          "type": "string",
          "enum": [
            "live",
            "test",
            "internal"
          ]
        }
      },
      "required": [
        "funnel",
        "merchant_ids",
        "from",
        "to"
      ]
    },
    "ReportingRow": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "row_id": {
          "type": "string",
          "maxLength": 2048
        },
        "identity_type": {
          "type": "string",
          "enum": [
            "unknown",
            "observed_client",
            "confirmed_payer",
            "merchant_owner"
          ]
        },
        "identity_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "pattern": "^[0-9a-f-]{36}$"
        },
        "flow_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "pattern": "^[0-9a-f-]{36}$"
        },
        "merchant_id": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2048
        },
        "resource": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2048
        },
        "stage": {
          "type": "string",
          "enum": [
            "access_challenged",
            "access_admitted",
            "resource_response_completed",
            "paywall_viewed",
            "payment_link_opened",
            "merchant_onboarding_opened",
            "quote_created",
            "payment_confirmed",
            "merchant_signup_completed",
            "merchant_site_created",
            "merchant_integration_reported",
            "merchant_integration_verified",
            "merchant_first_payment_confirmed"
          ]
        },
        "occurred_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "received_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "source": {
          "type": "string",
          "maxLength": 2048
        },
        "trust": {
          "type": "string",
          "enum": [
            "observed",
            "authoritative",
            "ledger"
          ]
        },
        "channel": {
          "type": "string",
          "enum": [
            "browser",
            "api",
            "unknown"
          ]
        },
        "mode": {
          "type": "string",
          "enum": [
            "live",
            "test",
            "internal"
          ]
        },
        "outcome": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "success",
            "redirect",
            "error",
            "abort",
            null
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2048
        },
        "evidence_ref": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2048
        },
        "quote_id": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2048
        },
        "settlement_ref": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2048
        },
        "asset": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2048
        },
        "base_units": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "decimals": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]{0,2})$"
        },
        "usd_micros": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        }
      },
      "required": [
        "row_id",
        "identity_type",
        "identity_id",
        "flow_id",
        "merchant_id",
        "resource",
        "stage",
        "occurred_at",
        "received_at",
        "source",
        "trust",
        "channel",
        "mode",
        "outcome",
        "reason",
        "evidence_ref",
        "quote_id",
        "settlement_ref",
        "asset",
        "base_units",
        "decimals",
        "usd_micros"
      ]
    },
    "ReportingStage": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "enum": [
            "access_challenged",
            "access_admitted",
            "resource_response_completed",
            "paywall_viewed",
            "payment_link_opened",
            "merchant_onboarding_opened",
            "quote_created",
            "payment_confirmed",
            "merchant_signup_completed",
            "merchant_site_created",
            "merchant_integration_reported",
            "merchant_integration_verified",
            "merchant_first_payment_confirmed"
          ]
        },
        "count": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "unit": {
          "type": "string",
          "enum": [
            "event",
            "flow",
            "site",
            "account",
            "quote",
            "settlement"
          ]
        },
        "trust": {
          "type": "string",
          "enum": [
            "observed",
            "authoritative",
            "ledger"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "supported",
            "partial",
            "not_instrumented",
            "not_applicable",
            "unavailable",
            "suppressed"
          ]
        },
        "tracking_start": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        },
        "source": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2048
        },
        "last_received": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
        }
      },
      "required": [
        "name",
        "count",
        "unit",
        "trust",
        "status",
        "tracking_start",
        "source"
      ]
    },
    "ReportingSummary": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "events": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "observed_unique_clients": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "unknown_identity_events": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "linked_payments": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "unlinked_payments": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "unique_paying_wallets": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "financial": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "assigned_payments": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|[1-9][0-9]*)$"
            },
            "valued_payments": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|[1-9][0-9]*)$"
            },
            "gross_usd_micros": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|[1-9][0-9]*)$"
            },
            "status": {
              "type": "string",
              "enum": [
                "empty",
                "valued",
                "unpriced",
                "partial",
                "unsupported",
                "unavailable"
              ]
            }
          },
          "required": [
            "assigned_payments",
            "valued_payments",
            "gross_usd_micros",
            "status"
          ]
        },
        "merchants": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "registered_sites": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|[1-9][0-9]*)$"
            },
            "reported_sites": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|[1-9][0-9]*)$"
            },
            "verified_sites": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|[1-9][0-9]*)$"
            },
            "first_paid_sites": {
              "type": [
                "string",
                "null"
              ],
              "pattern": "^(0|[1-9][0-9]*)$"
            }
          },
          "required": [
            "registered_sites",
            "reported_sites",
            "verified_sites",
            "first_paid_sites"
          ]
        }
      },
      "required": [
        "events",
        "observed_unique_clients",
        "unknown_identity_events",
        "linked_payments",
        "unlinked_payments",
        "unique_paying_wallets",
        "financial"
      ]
    }
  }
}