## Create `client.transactions.create(TransactionCreateParamsbody, RequestOptionsoptions?): TransactionCreateResponse` **post** `/transactions` Syncs a transaction, optionally with allocations ### Parameters - `body: TransactionCreateParams` - `account: Account` Account reference. Provide id, external_id, or both. - `id?: string` User-facing encoded account ID. - `external_id?: string` External account reference ID. - `allocations: Array` Allocation entries for this transaction. Empty indicates unreconciled funds. - `amount: string` Amount to allocate in smallest currency unit as stringified bigint. - `invoice_id: string` The invoice to allocate against. - `type: "invoice_payin" | "invoice_payout"` The type of allocation. - `"invoice_payin"` - `"invoice_payout"` - `user: ID | ExternalID` User reference. Provide either id or external_id. - `ID` - `id: string` Internal user ID. - `ExternalID` - `external_id: string` External user ID. - `amount: string` Amount in smallest currency unit as stringified bigint (can be positive or negative). - `currency: "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: string` External transaction ID used for idempotent sync. - `posted: string` Posted timestamp in ISO 8601 format. ### Returns - `TransactionCreateResponse` - `data: Data` Transaction object. - `id: string` User-facing encoded transaction ID. - `account: Account` - `id: string` User-facing encoded account ID. - `external_id: string` External account reference ID. - `allocations: Array` - `amount: string` Amount to allocate in smallest currency unit as stringified bigint. - `invoice_id: string` The invoice to allocate against. - `type: "invoice_payin" | "invoice_payout"` The type of allocation. - `"invoice_payin"` - `"invoice_payout"` - `user: ID | ExternalID` User reference. Provide either id or external_id. - `ID` - `id: string` Internal user ID. - `ExternalID` - `external_id: string` External user ID. - `amount: string` Amount in smallest currency unit as stringified bigint (can be positive or negative). - `created: string` Creation timestamp. - `currency: "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: string` External idempotency key provided by the user. - `posted: string` Posted timestamp in ISO 8601 format. - `unallocated_amount: string` Read-only amount not yet allocated. - `modified?: string` Last modified timestamp. ### Example ```typescript import Fragment from '@fragment-dev/ts-node'; const client = new Fragment(); const transaction = await 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: '2026-02-12T00:00:00.000Z', }); console.log(transaction.data); ```