{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://britishnoble.com/assets/specs/british-noble-royalty-erp-webhook-schema.json",
  "title": "BritishNobleRoyaltyJournalBatch",
  "description": "Signed webhook payload emitted to Oracle NetSuite, SAP S/4HANA, Xero, and Stripe Connect upon period royalty settlement.",
  "type": "object",
  "required": ["eventId", "eventType", "period", "workspaceId", "currency", "totalNetPayable", "journalLines", "hmacSha256"],
  "properties": {
    "eventId": { "type": "string", "example": "evt_roy_2026Q4_9921a" },
    "eventType": { "type": "string", "const": "royalty.settlement.approved" },
    "period": { "type": "string", "example": "2026-Q4" },
    "workspaceId": { "type": "string", "example": "ws_meridian_enterprise" },
    "currency": { "type": "string", "enum": ["USD", "GBP", "EUR", "AED"] },
    "totalNetPayable": { "type": "number", "example": 184920.45 },
    "journalLines": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["isbn13", "contributorId", "grossEarned", "advanceRecouped", "reserveHeld", "netPayout"],
        "properties": {
          "isbn13": { "type": "string" },
          "contributorId": { "type": "string" },
          "grossEarned": { "type": "number" },
          "advanceRecouped": { "type": "number" },
          "reserveHeld": { "type": "number" },
          "netPayout": { "type": "number" }
        }
      }
    },
    "hmacSha256": { "type": "string" }
  }
}
