PostTransactionCommand (v1.0.0)
Command to post a financial transaction to a merchant account
PostTransactionCommand
Posts a financial transaction to a merchant account using configured posting rules and double-entry bookkeeping principles.
Schema
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "title": "PostTransactionCommand", "description": "Command to post a financial transaction to a merchant account", "properties": { "accountId": { "type": "object", "description": "Account identifier", "properties": { "value": { "type": "string", "format": "uuid", "description": "The unique account UUID" } }, "required": ["value"] }, "transactionId": { "type": "object", "description": "Transaction identifier", "properties": { "value": { "type": "string", "format": "uuid", "description": "The unique transaction UUID" } }, "required": ["value"] }, "transactionType": { "type": "string", "enum": ["CHARGE", "REFUND", "FEE_ADDED", "CHARGEBACK", "TOPUP", "REMITTANCE", "ADJUSTMENT_CREDIT", "ADJUSTMENT_DEBIT"], "description": "Type of transaction to post", "example": "CHARGE" }, "amount": { "type": "integer", "minimum": 0, "description": "Transaction amount (in smallest currency unit, e.g., 10050 = 100.50)", "example": 10050 }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "Currency of the transaction (ISO 4217)", "example": "EUR" }, "reference": { "type": "string", "description": "External reference for the transaction", "example": "order-12345" }, "description": { "type": "string", "description": "Description of the transaction", "example": "Payment for order #12345" } }, "required": ["accountId", "transactionId", "transactionType", "amount", "currency"], "additionalProperties": false}Purpose
This command processes financial transactions by applying the appropriate posting rules to update account balances while maintaining accounting integrity.
Key Attributes
- ID: Merchant account aggregate identifier
- Transaction ID: Unique identifier for the transaction
- Transaction Type: Type of transaction (CHARGE, REFUND, FEE_ADDED, etc.)
- Amount: Transaction amount
- Currency: Transaction currency
- Value Date: Date when the transaction takes effect
- Timestamp: When the transaction occurred
- Reference: Transaction reference information
- Provider: Payment provider information
- Ledger/Sub: Hierarchy identifiers
Business Rules
- Transaction must be supported by configured posting rules
- Currency must match the account currency
- Sufficient balance checks for liability accounts
- IPSP booking types are ignored
- Automatically releases any reservations for the transaction
- Sets remittance order dates for applicable transaction types
Result
Produces a TransactionPostedEvent and may trigger balance notifications.