{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Platform Finance schema",
  "description": "Complete reference record shape. Nullable logical fields; see source documentation for report-specific availability.",
  "$comment": "https://netice.fi/product/documentation/platform-finance-schema/",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "platform",
    "source",
    "source_kind",
    "source_report",
    "derived_payout_legal_entity",
    "payout_entity_resolution_status",
    "source_file_name",
    "source_file_uri",
    "source_row_number",
    "source_row_hash",
    "source_vendor_hash",
    "apple_finance_region_code",
    "apple_finance_report_type",
    "source_schema_version",
    "is_final",
    "report_grain",
    "fiscal_period",
    "apple_fiscal_label",
    "calendar_period",
    "period_start",
    "period_end",
    "period_calendar_type",
    "transaction_date",
    "settlement_date",
    "effective_revenue_date",
    "effective_revenue_date_basis",
    "source_timezone",
    "app_id",
    "sku",
    "product_type",
    "country",
    "apple_buyer_subdivision",
    "event_type",
    "event_category",
    "event_subtype",
    "refund_type",
    "commission_disclosed",
    "quantity",
    "native_currency",
    "native_net_proceeds",
    "native_customer_charge",
    "report_currency",
    "report_net_proceeds",
    "report_customer_charge",
    "fx_rate",
    "reconciliation_group_key",
    "raw_metadata",
    "ingested_at",
    "source_available_at"
  ],
  "properties": {
    "platform": {
      "description": "IOS or ANDROID .",
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "description": "Provider source code.",
      "type": [
        "string",
        "null"
      ]
    },
    "source_kind": {
      "description": "FINANCE , keeping this output distinct from daily sales.",
      "type": [
        "string",
        "null"
      ]
    },
    "source_report": {
      "description": "Finance report family: APPLE_FINANCE_DETAIL , APPLE_FINANCIAL or GOOGLE_PLAY_EARNINGS , as applicable.",
      "type": [
        "string",
        "null"
      ]
    },
    "derived_payout_legal_entity": {
      "description": "Derived Apple entity classification from currency/country mapping; Google rows use the Google Play classification. It is not a raw Apple Finance Detail field or a bank receipt.",
      "type": [
        "string",
        "null"
      ]
    },
    "payout_entity_resolution_status": {
      "description": "Whether that classification was resolved. UNKNOWN_CURRENCY accompanies an unknown Apple entity mapping; inspect it before relying on entity breakdowns.",
      "type": [
        "string",
        "null"
      ]
    },
    "source_file_name": {
      "description": "Source report filename.",
      "type": [
        "string",
        "null"
      ]
    },
    "source_file_uri": {
      "description": "Source report artifact reference.",
      "type": [
        "string",
        "null"
      ]
    },
    "source_row_number": {
      "description": "One-based source row position.",
      "type": [
        "integer",
        "null"
      ]
    },
    "source_row_hash": {
      "description": "Source row fingerprint for lineage; not a transaction identifier.",
      "type": [
        "string",
        "null"
      ]
    },
    "source_vendor_hash": {
      "description": "Hashed Apple vendor scope identifier; null for Google.",
      "type": [
        "string",
        "null"
      ]
    },
    "apple_finance_region_code": {
      "description": "Apple finance report request scope, normally Z1 . Separate from buyer country or subdivision.",
      "type": [
        "string",
        "null"
      ]
    },
    "apple_finance_report_type": {
      "description": "Apple report type, such as FINANCE_DETAIL ; null for Google.",
      "type": [
        "string",
        "null"
      ]
    },
    "source_schema_version": {
      "description": "Output contract version, currently finance_unified_v3_event_grain .",
      "type": [
        "string",
        "null"
      ]
    },
    "is_final": {
      "description": "Status derived from finance period and data-stability policy. It does not mean bank-matched, audited or booked revenue.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "report_grain": {
      "description": "Source row grain, such as Apple finance detail, Google Earnings ledger line or an adjustment. This differs from event type.",
      "type": [
        "string",
        "null"
      ]
    },
    "fiscal_period": {
      "description": "First-of-month identifier for the requested provider report period. For Apple, use actual period_start / period_end to understand the fiscal boundaries; this identifier is not necessarily the period start date.",
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "apple_fiscal_label": {
      "description": "Apple fiscal label, such as FY26-M01 ; null for Google.",
      "type": [
        "string",
        "null"
      ]
    },
    "calendar_period": {
      "description": "Calendar month attribution. For Apple, the month containing the majority of the source period; for Google, the report month. Apple attribution is not a transaction-level calendar split.",
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "period_start": {
      "description": "First date of the source reporting period.",
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "period_end": {
      "description": "Last date of the source reporting period, inclusive.",
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "period_calendar_type": {
      "description": "APPLE_FISCAL_MONTH or GOOGLE_PLAY_EARNINGS_MONTH .",
      "type": [
        "string",
        "null"
      ]
    },
    "transaction_date": {
      "description": "Source transaction date where disclosed. Missing dates remain null.",
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "settlement_date": {
      "description": "Apple settlement date where supplied; for Google, the model uses report period end. This field does not establish a bank deposit date.",
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "effective_revenue_date": {
      "description": "Resolved attribution date, preferring transaction date, then settlement date, then period end.",
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "effective_revenue_date_basis": {
      "description": "Which input supplied the resolved date: TRANSACTION_DATE , SETTLEMENT_DATE_FALLBACK or PERIOD_END_FALLBACK .",
      "type": [
        "string",
        "null"
      ]
    },
    "source_timezone": {
      "description": "Source date/time context, America/Los_Angeles in this finance contract. Source dates are not rebucketed to the business headquarters timezone.",
      "type": [
        "string",
        "null"
      ]
    },
    "app_id": {
      "description": "Apple app identifier or Google package name where disclosed; may be absent on unattributed ledger rows.",
      "type": [
        "string",
        "null"
      ]
    },
    "sku": {
      "description": "Product or SKU identifier where available.",
      "type": [
        "string",
        "null"
      ]
    },
    "product_type": {
      "description": "Normalized product classification, such as auto-renewing subscription or one-time product.",
      "type": [
        "string",
        "null"
      ]
    },
    "country": {
      "description": "Buyer country where disclosed. Do not drop a valid finance row solely because this dimension is missing.",
      "type": [
        "string",
        "null"
      ]
    },
    "apple_buyer_subdivision": {
      "description": "Apple buyer state/province context where supplied; distinct from the finance report region code.",
      "type": [
        "string",
        "null"
      ]
    },
    "event_type": {
      "description": "SALE , REFUND , PLATFORM_FEE , PLATFORM_FEE_REVERSAL , TAX or ADJUSTMENT . Apple emits sale/refund events; Google retains its ledger contributions.",
      "type": [
        "string",
        "null"
      ]
    },
    "event_category": {
      "description": "Broad event classification, such as revenue, deduction or reversal.",
      "type": [
        "string",
        "null"
      ]
    },
    "event_subtype": {
      "description": "Commission or tax detail where applicable; not supplied for every event.",
      "type": [
        "string",
        "null"
      ]
    },
    "refund_type": {
      "description": "Refund subtype where available. Null does not establish a full refund.",
      "type": [
        "string",
        "null"
      ]
    },
    "commission_disclosed": {
      "description": "Whether the source discloses commission as separate ledger events. False for Apple; its fee/tax split is not invented.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "quantity": {
      "description": "Signed Apple quantity where available. Null for Google Earnings; do not infer it from ledger row count.",
      "type": [
        "integer",
        "null"
      ]
    },
    "native_currency": {
      "description": "Currency of the source proceeds or merchant-currency amount.",
      "type": [
        "string",
        "null"
      ]
    },
    "native_net_proceeds": {
      "description": "Signed contribution to proceeds in native currency. For Apple, extended partner share; for Google, each ledger line amount. Sum all relevant events and group by currency.",
      "type": [
        "number",
        "null"
      ]
    },
    "native_customer_charge": {
      "description": "Signed charge amount on sale/refund events where available. Null on fee/tax events. On Google sale/refund lines it equals that line’s merchant-currency amount.",
      "type": [
        "number",
        "null"
      ]
    },
    "report_currency": {
      "description": "Configured report currency; it is not fixed to EUR.",
      "type": [
        "string",
        "null"
      ]
    },
    "report_net_proceeds": {
      "description": "Native proceeds converted to report currency. The primary monthly proceeds measure, summed across event types.",
      "type": [
        "number",
        "null"
      ]
    },
    "report_customer_charge": {
      "description": "Customer-charge amount converted to report currency; remains null when the native charge is unavailable or inapplicable.",
      "type": [
        "number",
        "null"
      ]
    },
    "fx_rate": {
      "description": "Native-to-report conversion factor. Same currency uses 1. A missing cross-currency rate is not replaced with 1.",
      "type": [
        "number",
        "null"
      ]
    },
    "reconciliation_group_key": {
      "description": "Grouping key for source/product/currency/event context. Combine with the appropriate period; it is not a unique row or purchase key.",
      "type": [
        "string",
        "null"
      ]
    },
    "raw_metadata": {
      "description": "Additional report and parsing context, including available warnings and source fields.",
      "type": [
        "object",
        "array",
        "string",
        "number",
        "boolean",
        "null"
      ]
    },
    "ingested_at": {
      "description": "UTC materialization time, separate from source transaction/report dates.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "source_available_at": {
      "description": "Source artifact availability metadata when available; not a bank settlement timestamp.",
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  }
}
