v1

latestOpenAPI 3.1.02026-07-241910582.8 KB

Create Ledger Account Settlement

post/ledger_account_settlements

Request body

descriptionstring
statusstring

It is set to pending by default. To post a ledger account settlement at creation, use posted. To have the ability to manually attach ledger entries to the settlement use drafting.

settled_ledger_account_idstring required

The ledger account whose ledger entries are queried against, and its balance is reduced as a result.

contra_ledger_account_idstring required

The ledger account that sends to or receives funds from the settled ledger account.

effective_at_upper_boundstring date

The maximum effective_at timestamp of the ledger entries to be included in the ledger account settlement. The default value is the created_at timestamp of the ledger account settlement.

allow_either_directionboolean

If true, the settlement amount and settlement_entry_direction will bring the settled ledger account’s balance closer to zero, even if the balance is negative.

metadatastring json

Metadata to be added to the ledger account settlement. Must be a JSON object.

skip_settlement_ledger_transactionboolean

It is set to false by default. It should be set to true when migrating existing settlements.

Response

201

idstring
objectstring
live_modeboolean
descriptionstring
settled_ledger_account_idstring
contra_ledger_account_idstring
effective_at_upper_boundstring
statusstring
{"stackTrail":"paths:/ledger_account_settlements:post:responses:201:content:application/json:schema:properties:amount","oasType":"schema","type":"unknown"}
currencystring
{"stackTrail":"paths:/ledger_account_settlements:post:responses:201:content:application/json:schema:properties:ledger_transaction_id","oasType":"schema","type":"unknown"}
created_atstring
updated_atstring

Example response

{
  "id": "dbdbbfe5-da56-4aaf-be36-3fbc415622dd",
  "object": "ledger_account_settlement",
  "live_mode": true,
  "description": "Alice's January settlement",
  "settled_ledger_account_id": "d44ad0d0-b3ea-4698-867d-09fe961e52a6",
  "contra_ledger_account_id": "3824af4d-4151-48f6-8e8b-bf859cbddbcd",
  "effective_at_upper_bound": "2023-01-01T00:00:00.000Z",
  "status": "processing",
  "currency": "USD",
  "metadata": {
    "foo": "bar"
  },
  "created_at": "2023-01-11T20:35:36Z",
  "updated_at": "2023-01-11T20:35:36Z"
}