v1

latestOpenAPI 3.1.02026-07-241910582.8 KB

Create Ledger Transaction

post/ledger_transactions

Request body

statusstring

To post a ledger transaction at creation, use posted

descriptionstring

An optional free-form description for internal use. Maximum of 1000 characters allowed.

effective_atstring date

Format: ISO8601 to 6 decimal places. Defaults to time of insertion in the DB if not provided

external_idstring

An optional user-defined unique identifier. Only one pending or posted ledger transaction may have this ID in the ledger.

ledgerable_typestring

If the ledger transaction can be reconciled to another object in Modern Treasury, add the ledgerable type here, otherwise null. See possible types at Ledger Transactions

ledgerable_idstring

If the ledger transaction can be reconciled to another object in Modern Treasury, add the id of that object here, otherwise null.

archive_on_balance_lock_failureboolean

When true, creates an archived ledger transaction with archived_reason 'balance_lock_failure' instead of returning a 422 error if balance lock constraints are violated.

metadatastring json

Metadata to be added to the ledger transaction. Must be a JSON object.

Response

201

idstring
objectstring
live_modeboolean
external_idstring
{"stackTrail":"paths:/ledger_transactions:post:responses:201:content:application/json:schema:properties:ledgerable_type","oasType":"schema","type":"unknown"}
{"stackTrail":"paths:/ledger_transactions:post:responses:201:content:application/json:schema:properties:ledgerable_id","oasType":"schema","type":"unknown"}
ledger_idstring
{"stackTrail":"paths:/ledger_transactions:post:responses:201:content:application/json:schema:properties:description","oasType":"schema","type":"unknown"}
statusstring
{"stackTrail":"paths:/ledger_transactions:post:responses:201:content:application/json:schema:properties:archived_reason","oasType":"schema","type":"unknown"}
posted_atstring
effective_atstring
effective_datestring
metadataobject
created_atstring
updated_atstring

Example response

{
  "id": "53769ada-5ae4-4184-bb39-a3632daa88f9",
  "object": "ledger_transaction",
  "external_id": "1590aa8d-24e0-491b-bc06-d4e5843a212c",
  "ledger_id": "fe96565f-4b9c-4871-8fb0-e6f02683458e",
  "status": "posted",
  "ledger_entries": [
    {
      "id": "afd72914-6014-46a8-997b-3a862aed6375",
      "object": "ledger_entry",
      "amount": 100,
      "direction": "debit",
      "status": "posted",
      "ledger_account_id": "6168628a-05a6-4d30-80ca-4080ea699179",
      "ledger_account_currency": "USD",
      "ledger_account_currency_exponent": 2,
      "ledger_account_lock_version": 1,
      "ledger_transaction_id": "53769ada-5ae4-4184-bb39-a3632daa88f9",
      "resulting_ledger_account_balances": {
        "pending_balance": {
          "currency": "USD",
          "currency_exponent": 2
        },
        "posted_balance": {
          "currency": "USD",
          "currency_exponent": 2
        },
        "available_balance": {
          "currency": "USD",
          "currency_exponent": 2
        }
      },
      "created_at": "2022-11-01T21:24:45Z",
      "updated_at": "2022-11-01T21:24:45Z"
    }
  ],
  "posted_at": "2022-11-01T21:24:45Z",
  "effective_at": "2022-11-01T00:00:00.000000Z",
  "effective_date": "2022-11-01",
  "created_at": "2022-11-01T21:24:45Z",
  "updated_at": "2022-11-01T21:24:45Z"
}