Ledger Transactions

A ledger_transaction is a transaction between two or more ledger accounts. To create a ledger transaction, there must be at least one credit ledger entry and one debit ledger entry. Additionally, the sum of all credit entry amounts must equal the sum of all debit entry amounts. The ledger transaction is immutable once it has posted.

Attribute

Description

id
string

Unique identifier for the ledger transaction.

description
string

An optional free-form description for internal use.

status
string

One of pending, posted, or archived.

metadata
object

Additional data represented as key-value pairs. Both the key and value must be strings. See Metadata.

ledger_entries
array object

An array of ledger entry objects.

posted_at
time

The time on which the ledger transaction posted. This is null if the ledger transaction is pending.

effective_date
date

The date on which the ledger transaction happened for reporting purposes.

ledger_id
string

The ID of the ledger this ledger transaction belongs to.

ledgerable_type
string

If the ledger transaction can be reconciled to another object in Modern Treasury, the type will be populated here, otherwise null.
This can be one of payment_order, incoming_payment_detail, expected_payment, return, or reversal.
See Linking to other Modern Treasury objects.

ledgerable_id
string

If the ledger transaction can be reconciled to another object in Modern Treasury, the id will be populated here, otherwise null.

external_id
string

A unique string to represent the ledger transaction. Only one pending or posted ledger transaction may have this ID in the ledger.

live_mode
boolean

This field will be true if this object was created with a production API key or false if created with a test API key.

{
    "id": "d376dd4e-1c4f-4ba2-9b13-db63c04471e0",
    "object": "ledger_transaction",
    "ledgerable_type": null,
    "ledgerable_id": null,
    "ledger_id": "a9d970da-207e-43da-b4d6-6e9ae01ba2cc",
    "description": "Louisiana Purchase",
    "status": "pending",
    "ledger_entries": [
        {
            "id": "45067a63-6e4d-48f6-8aed-872cb3ee9c72",
            "object": "ledger_entry",
            "amount": 1500000000,
            "direction": "credit",
            "ledger_account_id": "f1c7e474-e6d5-4741-9f76-04510c8b6d7a",
            "ledger_transaction_id": "d376dd4e-1c4f-4ba2-9b13-db63c04471e0",
            "live_mode": true,
            "created_at": "2020-08-04T16:58:51Z",
            "updated_at": "2020-08-04T16:58:51Z"
        },
        {
            "id": "2a9b522e-5be3-49bc-b607-a09f9786dc3c",
            "object": "ledger_entry",
            "amount": 1500000000,
            "direction": "debit",
            "ledger_account_id": "063da2e3-4a37-4abf-8626-57d25bd6d441",
            "ledger_transaction_id": "d376dd4e-1c4f-4ba2-9b13-db63c04471e0",
            "live_mode": true,
            "created_at": "2020-08-04T16:58:51Z",
            "updated_at": "2020-08-04T16:58:51Z"
        }
    ],
    "posted_at": null,
    "effective_date": "1803-04-30",
    "metadata": {},
    "live_mode": true,
    "created_at": "2020-08-04T16:58:51Z",
    "updated_at": "2020-08-04T16:58:51Z"
}