Link a Ledger Account Settlement and Payment Order
Creating and linking LAS and PO
- Create a
pendingLedger Account Settlement through the Create Ledger Account Settlement API. The settlement object is inprocessingstatus initially; - Once the Ledger Account Settlement is processed successfully, Modern Treasury sends a
ledger_account_settlement.finished_processingwebhook, which containsstatus,amount,direction,ledger_transaction_idamong other fields; - Create a Payment Order through the Create Payment Order API and set the
ledger_transaction_idparameter to the LAS'sledger_transaction_id. The LAS and the PO are now linked together through a common Ledger Transaction.
Status updates
When the Payment Order is completed: Modern Treasury updates the Ledger Account Settlement and the Ledger Transaction to posted and sends ledger_account_settlement.posted and ledger_transaction.posted webhooks.
When the Payment Order is cancelled, denied, or failed: The Ledger Account Settlement stays in pending and continues to reserve its Ledger Entries. To settle all outstanding balances including new Ledger Entries written since the original Settlement was created, you can explicitly archive the Settlement so that the Ledger Entries are released and create a new Settlement and Payment Order. To maintain the original settled amount, you can fix and redraft the Payment Order, assuming it is denied or failed (cancelled Payment Orders cannot be redrafted). Alternatively, from any of these states, you can create a new Payment Order of the same amount linked to the original Settlement Ledger Transaction.
When the Payment Order is returned or reversed: The Ledger Account Settlement is updated to pending, and its ledger_transaction is updated to the latest pending ledger_transaction given that Ledger Transactions are immutable once posted.
| Payment Order status | Ledger Transaction status | Settlement status |
|---|---|---|
needs approval, approved, processing, sent | pending | pending |
completed | posted | posted |
cancelled, denied, failed | archived | pending |
returned, reversed | posted | pending |
Look up an LAS's linked PO
A Ledger Account Settlement and a Payment Order are linked together through their common Ledger Transaction. In order to look up the linked PO from an LAS, you would:
- Get the
ledger_transaction_idof the Ledger Account Settlement; - Retrieve the Ledger Transaction by calling the Get Ledger Transaction API with its ID. The Ledger Transaction's
ledgerable_typeispayment_order, theledgerable_idis the Payment Order ID.
Look up a PO's linked LAS
A Ledger Account Settlement and a Payment Order are linked together through their common Ledger Transaction. In order to look up the linked LAS from a PO, you would:
- Get the
ledger_transaction_idof the Payment Order; - Query the Ledger Account Settlements by passing in the
ledger_transaction_idparameter. There should only be one LAS returned.
Updated 19 days ago