{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/silverfin/main/json-schema/silverfin-action-payload-schema.json", "title": "ActionPayload", "description": "Represents an action that can either be an \"upsert\" or \"delete.\"", "x-generated": "2026-10-14", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/silverfin-syncapi-openapi.yml#/components/schemas/ActionPayload", "type": "object", "oneOf": [ { "type": "object", "required": [ "upsert" ], "properties": { "upsert": { "$ref": "#/$defs/UpsertActionPayload" } } }, { "type": "object", "required": [ "delete" ], "properties": { "delete": { "$ref": "#/$defs/DeleteActionPayload" } } } ], "$defs": { "DeleteActionPayload": { "type": "object", "required": [ "id" ], "properties": { "id": { "$ref": "#/$defs/TransactionId" } }, "description": "Payload for deleting an existing transaction by ID." }, "OpenTransactionPayload": { "type": [ "object", "null" ], "required": [ "value", "category" ], "properties": { "value": { "type": "number", "description": "The monetary value of the transaction." }, "category": { "type": "string", "enum": [ "payable", "receivable" ], "description": "The category of the transaction, either 'payable' or 'receivable.'" } } }, "TransactionId": { "type": "string", "description": "The unique ID referencing a single transaction (or booking)." }, "UpsertActionPayload": { "type": "object", "description": "Payload for an \"upsert\" action, meaning update the record if it exists, or insert it if it does not.", "required": [ "id", "account_number", "period_end_date", "value" ], "properties": { "id": { "$ref": "#/$defs/TransactionId" }, "account_number": { "type": "string", "description": "The account number from the request's \"accounts\" section." }, "period_end_date": { "type": "string", "format": "date", "description": "The end date for the period of the transaction." }, "value": { "type": "number", "description": "The value of the transaction." }, "transaction_id": { "type": "string", "description": "The unique ID referencing multiple transactions (or bookings) as a group." }, "journal_id": { "type": "string", "description": "A unique identifier from the source system for the journal used to record this transaction. Transactions sharing the same journal_id will be grouped and accessible via a link in the Silverfin UI." }, "journal_type": { "type": "string", "description": "The type of journal from the source system (e.g. \"Sales\", \"Purchases\", \"Bank\", \"General\")." }, "booking_date": { "type": "string", "format": "date", "description": "The date when the transaction was booked." }, "description": { "type": "string", "description": "A detailed description of the transaction." }, "relation": { "type": "string", "description": "The relation of the transaction, required if 'open_transaction' is provided." }, "document_id": { "type": "string", "description": "The ID of the associated document." }, "analytical_dimensions": { "type": "array", "minItems": 0, "maxItems": 6, "items": { "type": [ "string", "null" ] }, "description": "Array of analytical dimension labels, with a maximum of 6 items." }, "extra_fields": { "type": "array", "description": "Additional fields related to the transaction. Must have the same size as 'extra_field_labels' if provided.", "minItems": 0, "maxItems": 10, "items": { "type": [ "string", "null" ] } }, "open_transaction": { "$ref": "#/$defs/OpenTransactionPayload" } } } } }