Create
transactions.create(TransactionCreateParams**kwargs) -> TransactionCreateResponse
POST/transactions
Syncs a transaction, optionally with allocations
Parameters
amount: str
Amount in smallest currency unit as stringified bigint (can be positive or negative).
external_id: str
External transaction ID used for idempotent sync.
posted: Union[str, datetime]
Posted timestamp in ISO 8601 format.
formatdate-time
Returns
Create
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){
"data": {
"id": "txn_dHhuX2ZyYWdfMDAx",
"account": {
"id": "ext_account_YWJjMTIz",
"external_id": "acct_external_123"
},
"allocations": [
{
"amount": "1000",
"invoice_id": "inv_abc123",
"type": "invoice_payin",
"user": {
"id": "user_abc123"
}
}
],
"amount": "-1000",
"created": "2026-02-12T00:00:00.000Z",
"currency": "USD",
"external_id": "bank_txn_123",
"posted": "2026-02-12T00:00:00.000Z",
"unallocated_amount": "-1000",
"modified": "2026-02-12T01:00:00.000Z"
}
}Returns Examples
{
"data": {
"id": "txn_dHhuX2ZyYWdfMDAx",
"account": {
"id": "ext_account_YWJjMTIz",
"external_id": "acct_external_123"
},
"allocations": [
{
"amount": "1000",
"invoice_id": "inv_abc123",
"type": "invoice_payin",
"user": {
"id": "user_abc123"
}
}
],
"amount": "-1000",
"created": "2026-02-12T00:00:00.000Z",
"currency": "USD",
"external_id": "bank_txn_123",
"posted": "2026-02-12T00:00:00.000Z",
"unallocated_amount": "-1000",
"modified": "2026-02-12T01:00:00.000Z"
}
}