Raw schema
{
"type": "object",
"properties": {
"events": {
"minItems": 1,
"maxItems": 1000,
"type": "array",
"items": {
"type": "object",
"properties": {
"schemaVersion": {
"type": "string",
"const": "1"
},
"externalId": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"pattern": "^[\\w.:/-]+$"
},
"occurredAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
},
"kind": {
"type": "string",
"enum": [
"revenue",
"expense",
"refund",
"fee",
"transfer",
"capital",
"withdrawal",
"asset_purchase",
"asset_sale",
"adjustment"
]
},
"direction": {
"type": "string",
"enum": [
"inflow",
"outflow"
]
},
"amount": {
"type": "string",
"pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"
},
"currency": {
"type": "string",
"pattern": "^[A-Z][A-Z0-9]{1,11}$"
},
"source": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"type": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"verification": {
"type": "string",
"enum": [
"self_reported",
"receipt_supplied",
"receipt_verified",
"onchain_verified",
"system_observed"
]
},
"reference": {
"type": "string",
"maxLength": 500
}
},
"required": [
"name",
"type",
"verification"
]
},
"agentId": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"pattern": "^[\\w.:/-]+$"
},
"ventureId": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"pattern": "^[\\w.:/-]+$"
},
"experimentId": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"pattern": "^[\\w.:/-]+$"
},
"customerId": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"pattern": "^[\\w.:/-]+$"
},
"productId": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"pattern": "^[\\w.:/-]+$"
},
"category": {
"type": "string",
"minLength": 1,
"maxLength": 120
},
"relatedEventId": {
"type": "string",
"minLength": 1,
"maxLength": 160,
"pattern": "^[\\w.:/-]+$"
},
"transactionHash": {
"type": "string",
"maxLength": 160
},
"x402PaymentId": {
"type": "string",
"maxLength": 160
},
"metadata": {
"type": "object",
"propertyNames": {
"type": "string",
"maxLength": 80
},
"additionalProperties": {
"$ref": "#/definitions/__schema0"
}
},
"adjustment": {
"type": "object",
"properties": {
"reason": {
"type": "string",
"minLength": 3,
"maxLength": 500
},
"profitTreatment": {
"type": "string",
"enum": [
"revenue",
"cost",
"exclude"
]
}
},
"required": [
"reason",
"profitTreatment"
]
},
"assetPolicy": {
"type": "string",
"enum": [
"expense",
"exclude"
]
}
},
"required": [
"schemaVersion",
"externalId",
"occurredAt",
"kind",
"direction",
"amount",
"currency",
"source",
"category"
]
}
},
"baseCurrency": {
"type": "string",
"pattern": "^[A-Z][A-Z0-9]{1,11}$"
},
"exchangeRates": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"from": {
"type": "string",
"pattern": "^[A-Z][A-Z0-9]{1,11}$"
},
"to": {
"type": "string",
"pattern": "^[A-Z][A-Z0-9]{1,11}$"
},
"rate": {
"type": "string",
"pattern": "^(?:0|[1-9]\\d*)(?:\\.\\d+)?$"
},
"source": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"effectiveAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
}
},
"required": [
"from",
"to",
"rate",
"source",
"effectiveAt"
]
}
},
"currentCashBalance": {
"type": "string"
},
"currentCashBalances": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
}
}
},
"required": [
"events"
],
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"__schema0": {
"anyOf": [
{
"type": "string",
"maxLength": 500
},
{
"type": "boolean"
},
{
"type": "null"
},
{
"maxItems": 20,
"type": "array",
"items": {
"$ref": "#/definitions/__schema0"
}
},
{
"type": "object",
"propertyNames": {
"type": "string",
"maxLength": 80
},
"additionalProperties": {
"$ref": "#/definitions/__schema0"
}
}
]
}
}
}