Create a Transaction using the v2 block model
Authorizations
JWT bearer token issued by the identity provider.
Headers
Idempotency key to safely retry the create; an identical retry returns the original transaction, a different request under the same key answers 409 (0084)
Idempotency slot TTL in seconds (default 300)
Body
Transaction request body. debits and credits are the two required, non-empty leg arrays of the transaction; one debit paired with many credits, or the reverse, is a valid request. Every leg names the organizationId and ledgerId its account belongs to. The direct and hold actions accept multiple enabled ledgers and return an atomic group; block and unblock still require every leg to name the same pair. asset, amount, description, code, routeId, operationRouteId and metadata sit alongside the two leg arrays, and amount is the transaction total that the legs' share expressions divide. Each leg array holds at most 500 legs.
1 - 500 elements1 - 500 elementsSingle-use account-block exception identifier. Authorizes one debit of an exact amount out of a blocked source account, and is consumed on use. Rejected on the hold action.
"00000000-0000-0000-0000-000000000000"
"00000000-0000-0000-0000-000000000000"
"00000000-0000-0000-0000-000000000000"
Response
Created
"1500"
2 - 10"BRL"
"2021-01-01T00:00:00Z"
"2021-01-01T00:00:00Z"
256"Transaction description"
false
"00000000-0000-0000-0000-000000000000"
"00000000-0000-0000-0000-000000000000"
"00000000-0000-0000-0000-000000000000"
false
"2021-01-01T00:00:00Z"
"00000000-0000-0000-0000-000000000000"
Additional custom attributes. The ledger writes six fee keys on this field itself and reserves them: feeApplied is the string true when the fee engine actually charged this transaction; packageAppliedID is the identifier of the fee package the engine applied, written when that package charged a fee or recorded an exemption, and absent when a package matched but priced nothing, for instance because the amount fell outside its bounds; feeExemption is a string holding a JSON object with exempt, reason and message, present when every account on one side of the transaction is exempt from fees, which is how a caller tells an exemption apart from no package having matched; feeExemption is also present, with reason cross_ledger_bridge, when the only account on one side that would have paid a fee is the @external/ bridge closing a part of a cross-ledger group, because that bridge never pays a fee; a transaction recorded before v4.1.1 may carry feeExemption as that object itself instead of the string, so a reader must accept both shapes; feeDebtOpenings and feeDebtSettlements are strings holding a JSON array, in the order the ledger applied them, of the fee debts this transaction opened because its payer could not fund a deferrable fee (debtId, debtorRef, creditRef, opened, seq) and of the fee debts it settled (debtId, debtorRef, creditRef, amount, opened, seq), each absent when there is none; feeDebtCollection is the string true on a standalone fee-debt collection, whose amount is what it settled and which cannot be reverted. A request body carrying feeApplied, packageAppliedID, feeExemption, feeDebtOpenings, feeDebtSettlements, feeDebtCollection or feeDeferPair is refused with 400 naming the offending key, on every body that carries transaction metadata: a create, a metadata update and a fee estimate. A metadata update, including one that clears the metadata, never changes them. So a value present here is always the ledger's own word about the charge and never one a caller supplied. feeLeg and feeDeferPair, on operation metadata, are reserved the same way. Transaction-level metadata is additive, so caller-supplied keys on this field are preserved alongside the ledger keys.
"00000000-0000-0000-0000-000000000000"
"00000000-0000-0000-0000-000000000000"

