## Create `transactions.create(TransactionCreateParams**kwargs) -> TransactionCreateResponse` **post** `/transactions` Syncs a transaction, optionally with allocations ### Parameters - `account: Account` Account reference. Provide id, external_id, or both. - `id: Optional[str]` User-facing encoded account ID. - `external_id: Optional[str]` External account reference ID. - `allocations: Iterable[Allocation]` Allocation entries for this transaction. Empty indicates unreconciled funds. - `amount: str` Amount to allocate in smallest currency unit as stringified bigint. - `invoice_id: str` The invoice to allocate against. - `type: Literal["invoice_payin", "invoice_payout"]` The type of allocation. - `"invoice_payin"` - `"invoice_payout"` - `user: AllocationUser` User reference. Provide either id or external_id. - `class AllocationUserID: …` - `id: str` Internal user ID. - `class AllocationUserExternalID: …` - `external_id: str` External user ID. - `amount: str` Amount in smallest currency unit as stringified bigint (can be positive or negative). - `currency: Literal["ADA", "BTC", "DAI", 176 more]` Currency code (ISO 4217 or crypto) - `"ADA"` - `"BTC"` - `"DAI"` - `"ETH"` - `"SOL"` - `"USDC"` - `"USDT"` - `"USDG"` - `"EURC"` - `"CADC"` - `"CADT"` - `"XLM"` - `"UNI"` - `"BCH"` - `"LTC"` - `"AAVE"` - `"LINK"` - `"MATIC"` - `"PTS"` - `"AED"` - `"AFN"` - `"ALL"` - `"AMD"` - `"ANG"` - `"AOA"` - `"ARS"` - `"AUD"` - `"AWG"` - `"AZN"` - `"BAM"` - `"BBD"` - `"BDT"` - `"BGN"` - `"BHD"` - `"BIF"` - `"BMD"` - `"BND"` - `"BOB"` - `"BRL"` - `"BSD"` - `"BTN"` - `"BWP"` - `"BYR"` - `"BZD"` - `"CAD"` - `"CDF"` - `"CHF"` - `"CLP"` - `"CNY"` - `"COP"` - `"CRC"` - `"CUC"` - `"CUP"` - `"CVE"` - `"CZK"` - `"DJF"` - `"DKK"` - `"DOP"` - `"DZD"` - `"EGP"` - `"ERN"` - `"ETB"` - `"EUR"` - `"FJD"` - `"FKP"` - `"GBP"` - `"GEL"` - `"GGP"` - `"GHS"` - `"GIP"` - `"GMD"` - `"GNF"` - `"GTQ"` - `"GYD"` - `"HKD"` - `"HNL"` - `"HRK"` - `"HTG"` - `"HUF"` - `"IDR"` - `"ILS"` - `"IMP"` - `"INR"` - `"IQD"` - `"IRR"` - `"ISK"` - `"JMD"` - `"JOD"` - `"JPY"` - `"KES"` - `"KGS"` - `"KHR"` - `"KMF"` - `"KPW"` - `"KRW"` - `"KWD"` - `"KYD"` - `"KZT"` - `"LAK"` - `"LBP"` - `"LKR"` - `"LRD"` - `"LSL"` - `"LYD"` - `"MAD"` - `"MDL"` - `"MGA"` - `"MKD"` - `"MMK"` - `"MNT"` - `"MOP"` - `"MUR"` - `"MVR"` - `"MWK"` - `"MXN"` - `"MYR"` - `"MZN"` - `"NAD"` - `"NGN"` - `"NIO"` - `"NOK"` - `"NPR"` - `"NZD"` - `"OMR"` - `"PAB"` - `"PEN"` - `"PGK"` - `"PHP"` - `"PKR"` - `"PLN"` - `"PYG"` - `"QAR"` - `"RON"` - `"RSD"` - `"RUB"` - `"RWF"` - `"SAR"` - `"SBD"` - `"SCR"` - `"SDG"` - `"SEK"` - `"SGD"` - `"SHP"` - `"SLL"` - `"SOS"` - `"SPL"` - `"SRD"` - `"SVC"` - `"SYP"` - `"STN"` - `"SZL"` - `"THB"` - `"TJS"` - `"TMT"` - `"TND"` - `"TOP"` - `"TRY"` - `"TTD"` - `"TVD"` - `"TWD"` - `"TZS"` - `"UAH"` - `"UGX"` - `"USD"` - `"UYU"` - `"UZS"` - `"VEF"` - `"VND"` - `"VUV"` - `"WST"` - `"XAF"` - `"XCD"` - `"XOF"` - `"XPF"` - `"YER"` - `"ZAR"` - `"ZMW"` - `"LOGICAL"` - `"CUSTOM"` - `external_id: str` External transaction ID used for idempotent sync. - `posted: Union[str, datetime]` Posted timestamp in ISO 8601 format. ### Returns - `class TransactionCreateResponse: …` - `data: Data` Transaction object. - `id: str` User-facing encoded transaction ID. - `account: DataAccount` - `id: str` User-facing encoded account ID. - `external_id: str` External account reference ID. - `allocations: List[DataAllocation]` - `amount: str` Amount to allocate in smallest currency unit as stringified bigint. - `invoice_id: str` The invoice to allocate against. - `type: Literal["invoice_payin", "invoice_payout"]` The type of allocation. - `"invoice_payin"` - `"invoice_payout"` - `user: DataAllocationUser` User reference. Provide either id or external_id. - `class DataAllocationUserID: …` - `id: str` Internal user ID. - `class DataAllocationUserExternalID: …` - `external_id: str` External user ID. - `amount: str` Amount in smallest currency unit as stringified bigint (can be positive or negative). - `created: datetime` Creation timestamp. - `currency: Literal["ADA", "BTC", "DAI", 176 more]` Currency code (ISO 4217 or crypto) - `"ADA"` - `"BTC"` - `"DAI"` - `"ETH"` - `"SOL"` - `"USDC"` - `"USDT"` - `"USDG"` - `"EURC"` - `"CADC"` - `"CADT"` - `"XLM"` - `"UNI"` - `"BCH"` - `"LTC"` - `"AAVE"` - `"LINK"` - `"MATIC"` - `"PTS"` - `"AED"` - `"AFN"` - `"ALL"` - `"AMD"` - `"ANG"` - `"AOA"` - `"ARS"` - `"AUD"` - `"AWG"` - `"AZN"` - `"BAM"` - `"BBD"` - `"BDT"` - `"BGN"` - `"BHD"` - `"BIF"` - `"BMD"` - `"BND"` - `"BOB"` - `"BRL"` - `"BSD"` - `"BTN"` - `"BWP"` - `"BYR"` - `"BZD"` - `"CAD"` - `"CDF"` - `"CHF"` - `"CLP"` - `"CNY"` - `"COP"` - `"CRC"` - `"CUC"` - `"CUP"` - `"CVE"` - `"CZK"` - `"DJF"` - `"DKK"` - `"DOP"` - `"DZD"` - `"EGP"` - `"ERN"` - `"ETB"` - `"EUR"` - `"FJD"` - `"FKP"` - `"GBP"` - `"GEL"` - `"GGP"` - `"GHS"` - `"GIP"` - `"GMD"` - `"GNF"` - `"GTQ"` - `"GYD"` - `"HKD"` - `"HNL"` - `"HRK"` - `"HTG"` - `"HUF"` - `"IDR"` - `"ILS"` - `"IMP"` - `"INR"` - `"IQD"` - `"IRR"` - `"ISK"` - `"JMD"` - `"JOD"` - `"JPY"` - `"KES"` - `"KGS"` - `"KHR"` - `"KMF"` - `"KPW"` - `"KRW"` - `"KWD"` - `"KYD"` - `"KZT"` - `"LAK"` - `"LBP"` - `"LKR"` - `"LRD"` - `"LSL"` - `"LYD"` - `"MAD"` - `"MDL"` - `"MGA"` - `"MKD"` - `"MMK"` - `"MNT"` - `"MOP"` - `"MUR"` - `"MVR"` - `"MWK"` - `"MXN"` - `"MYR"` - `"MZN"` - `"NAD"` - `"NGN"` - `"NIO"` - `"NOK"` - `"NPR"` - `"NZD"` - `"OMR"` - `"PAB"` - `"PEN"` - `"PGK"` - `"PHP"` - `"PKR"` - `"PLN"` - `"PYG"` - `"QAR"` - `"RON"` - `"RSD"` - `"RUB"` - `"RWF"` - `"SAR"` - `"SBD"` - `"SCR"` - `"SDG"` - `"SEK"` - `"SGD"` - `"SHP"` - `"SLL"` - `"SOS"` - `"SPL"` - `"SRD"` - `"SVC"` - `"SYP"` - `"STN"` - `"SZL"` - `"THB"` - `"TJS"` - `"TMT"` - `"TND"` - `"TOP"` - `"TRY"` - `"TTD"` - `"TVD"` - `"TWD"` - `"TZS"` - `"UAH"` - `"UGX"` - `"USD"` - `"UYU"` - `"UZS"` - `"VEF"` - `"VND"` - `"VUV"` - `"WST"` - `"XAF"` - `"XCD"` - `"XOF"` - `"XPF"` - `"YER"` - `"ZAR"` - `"ZMW"` - `"LOGICAL"` - `"CUSTOM"` - `external_id: str` External idempotency key provided by the user. - `posted: datetime` Posted timestamp in ISO 8601 format. - `unallocated_amount: str` Read-only amount not yet allocated. - `modified: Optional[datetime]` Last modified timestamp. ### Example ```python from datetime import datetime from fragment import Fragment client = Fragment() transaction = client.transactions.create( account={}, allocations=[{ "amount": "1000", "invoice_id": "inv_abc123", "type": "invoice_payin", "user": { "id": "user_abc123" }, }], amount="-1000", currency="USD", external_id="bank_txn_123", posted=datetime.fromisoformat("2026-02-12T00:00:00.000"), ) print(transaction.data) ```