Link ledger transaction to payment objects


Payment objects in Modern Treasury represent transfers of funds at your bank. Often, in addition to transferring these funds you will want to record these transfers in your internal ledger. For example, you may want an incoming payment from a user to increment their in-app funds available, represented in the ledger.

Ledger Transactions can be linked to other Modern Treasury objects using the fields ledgerable_type and ledgerable_id.

ledgerable_type can be one of payment_order, incoming_payment_detail, expected_payment, return, reversal, or paper_item. You can link an object to a ledger transaction if it is within the same environment as the ledger transaction and it is not already tied to a different ledger transaction.

Linked statuses

After a payment object is created, you can create a new ledger transaction linked to that object by specifying ledgerable_type and ledgerable_id.

If a ledger transaction is linked to another object, we will automatically update the ledger transaction's status based on the status of the linked object. The table below shows how different object statuses correspond to ledger transaction statuses.

Ledger transaction statusPayment order statusReturn statusIncoming payment detail statusExpected payment statusReversal statusPaper item status
pendingneeds approval, approved, processing, sentpending, processing, sentpending, returnedunreconciledpending, processing, sentpending
postedcompleted, returned, reversedcompleted, returnedcompleted, returnedreconciledcompleted, returnedcompleted, returned
archiveddenied, failed, cancelledfailedarchivedfailed

After you link a ledger transaction to another object, you will no longer be able to manually update the ledger transaction's status.