Skip to content
Get started

Create

client.transactions.create(TransactionCreateParams { account, allocations, amount, 3 more } body, RequestOptionsoptions?): TransactionCreateResponse { data }
POST/transactions

Syncs a transaction, optionally with allocations

ParametersExpand Collapse
body: TransactionCreateParams { account, allocations, amount, 3 more }
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>

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.

Accepts one of the following:
"invoice_payin"
"invoice_payout"
user: ID { id } | ExternalID { external_id }

User reference. Provide either id or external_id.

Accepts one of the following:
ID { id }
id: string

Internal user ID.

ExternalID { external_id }
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)

Accepts one of the following:
"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.

formatdate-time
ReturnsExpand Collapse
TransactionCreateResponse { data }
data: Data { id, account, allocations, 7 more }

Transaction object.

id: string

User-facing encoded transaction ID.

account: Account { id, external_id }
id: string

User-facing encoded account ID.

external_id: string

External account reference ID.

allocations: Array<Allocation>
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.

Accepts one of the following:
"invoice_payin"
"invoice_payout"
user: ID { id } | ExternalID { external_id }

User reference. Provide either id or external_id.

Accepts one of the following:
ID { id }
id: string

Internal user ID.

ExternalID { external_id }
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.

formatdate-time
currency: "ADA" | "BTC" | "DAI" | 176 more

Currency code (ISO 4217 or crypto)

Accepts one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CD"
"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.

formatdate-time
unallocated_amount: string

Read-only amount not yet allocated.

modified?: string

Last modified timestamp.

formatdate-time

Create

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);
{
  "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"
  }
}