# Modern Treasury

> Run payment operations on Modern Treasury: create and track payment orders, keep counterparties and their bank accounts, tell Modern Treasury which payments to expect, read incoming payments, keep ledgers, and start a workflow when a payment is created, changes status or arrives.

App · 30 actions. Web page: https://docs.lodol.com/docs/integrations/modern-treasury

## Actions

### Cancel payment order

Cancel a payment order that has not started processing, such as one waiting for approval or held until a later time. Modern Treasury refuses once it is on its way.

**Inputs**

- Payment order ID (`payment_order_id`, text, required): The payment order's id, from 'List payment orders' or 'Create payment order'.

**Outputs**

- `payment_order` (object): The cancelled payment order

**Example output**

```json
{
  "payment_order": {
    "amount": 1500,
    "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
    "created_at": "2026-11-13T19:03:37Z",
    "currency": "USD",
    "description": "Invoice 1042",
    "direction": "credit",
    "effective_date": "2026-11-14",
    "id": "01a1d64b-3e2c-74b9-8851-fb972bc30f89",
    "live_mode": false,
    "metadata": {},
    "originating_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
    "priority": "normal",
    "process_after": null,
    "receiving_account": {
      "account_details": [
        {
          "account_number_safe": "6789",
          "account_number_type": "other",
          "created_at": "2026-11-13T19:03:27Z",
          "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
        }
      ],
      "account_type": "checking",
      "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
      "created_at": "2026-11-13T19:03:27Z",
      "discarded_at": null,
      "external_id": null,
      "id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
      "live_mode": false,
      "metadata": {},
      "name": "Operating account",
      "party_name": "Globex Ltd",
      "party_type": "business",
      "routing_details": [
        {
          "bank_name": "COLUMBIA BANK",
          "created_at": "2026-11-13T19:03:27Z",
          "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
          "payment_type": "ach",
          "routing_number": "121141819",
          "routing_number_type": "aba"
        }
      ],
      "updated_at": "2026-11-13T19:03:28Z",
      "verification_status": "unverified"
    },
    "receiving_account_id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
    "reconciliation_status": "unreconciled",
    "remittance_information": null,
    "statement_descriptor": null,
    "status": "cancelled",
    "subtype": "CCD",
    "transaction_ids": [],
    "type": "ach",
    "updated_at": "2026-11-13T19:03:38Z",
    "vendor_failure_reason": null
  }
}
```

### Create counterparty

Create a counterparty, a person or business you pay or are paid by. Add its bank account with 'Create external account'.

**Inputs**

- Name (`name`, text, required): The counterparty's name.
- Email (`email`, text): Where remittance advice is sent, if you turn it on.
- Email remittance advice (`send_remittance_advice`, true/false): Email the counterparty each time a payment to them is sent.
- Metadata (`metadata`, object): Your own labels on the record, as keys and values (for example an invoice number). Keys given here are added to or changed on the record.

**Outputs**

- `counterparty` (object): The new counterparty

**Example output**

```json
{
  "counterparty": {
    "accounts": [
      {
        "account_details": [
          {
            "account_number_safe": "6789",
            "account_number_type": "other",
            "created_at": "2026-11-13T19:03:27Z",
            "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
          }
        ],
        "account_type": "checking",
        "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
        "created_at": "2026-11-13T19:03:27Z",
        "discarded_at": null,
        "external_id": null,
        "id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
        "live_mode": false,
        "metadata": {},
        "name": "Operating account",
        "party_name": "Globex Ltd",
        "party_type": "business",
        "routing_details": [
          {
            "bank_name": "COLUMBIA BANK",
            "created_at": "2026-11-13T19:03:27Z",
            "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
            "payment_type": "ach",
            "routing_number": "121141819",
            "routing_number_type": "aba"
          }
        ],
        "updated_at": "2026-11-13T19:03:28Z",
        "verification_status": "unverified"
      }
    ],
    "created_at": "2026-11-13T19:03:27Z",
    "discarded_at": null,
    "email": "ap@globex.example",
    "external_id": null,
    "id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
    "live_mode": false,
    "metadata": {},
    "name": "Globex Ltd",
    "send_remittance_advice": false,
    "updated_at": "2026-11-13T19:03:27Z",
    "verification_status": "verified"
  }
}
```

### Create expected payment

Tell Modern Treasury a payment is due, with the amount range, dates and account, so it can match the real payment when it arrives.

**Inputs**

- Direction (`direction`, text, required): Credit for money coming in, debit for money going out. One of: `credit` (Credit (money in)), `debit` (Debit (money out)).
- Internal account (`internal_account_id`, text, required): Your own bank account in Modern Treasury. Pick one, or give its id.
- Smallest amount (`amount_lower_bound`, number, required): The least the payment may be. In the currency's smallest unit: for US dollars, 1500 is $15.00. At least 1.
- Largest amount (`amount_upper_bound`, number, required): The most the payment may be. Use the same number as the smallest amount for an exact payment. At least 1.
- Currency (`currency`, text): A currency code. Defaults to USD.
- Payment type (`payment_type`, text): Only match a payment that arrives this way. One of: `ach`, `wire`, `rtp`, `book` (Book transfer), `check`, `sepa`, `bacs`, `eft`, `interac`, `au_becs` (Australian BECS), and 9 more.
- Counterparty (`counterparty_id`, text): Only this counterparty's records. Pick one, or give its id.
- Earliest date (`date_lower_bound`, date): The earliest date the payment may arrive.
- Latest date (`date_upper_bound`, date): The latest date the payment may arrive.
- Description (`description`, text): A note for your team, shown in Modern Treasury.
- Remittance information (`remittance_information`, text): Text to match against the payment's remittance information.
- Metadata (`metadata`, object): Your own labels on the record, as keys and values (for example an invoice number). Keys given here are added to or changed on the record.

**Outputs**

- `expected_payment` (object): The new expected payment

**Example output**

```json
{
  "expected_payment": {
    "amount_lower_bound": 1000,
    "amount_reconciled": 0,
    "amount_unreconciled": 1000,
    "amount_upper_bound": 2000,
    "counterparty_id": null,
    "created_at": "2026-11-13T19:04:04Z",
    "currency": "USD",
    "date_lower_bound": "2026-11-14",
    "date_upper_bound": "2026-11-20",
    "description": "Invoice 1043",
    "direction": "credit",
    "id": "01a1d64b-a60a-7a3a-bcb8-b214990b56a3",
    "internal_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
    "live_mode": false,
    "metadata": {},
    "reconciliation_rule_variables": [
      {
        "amount_lower_bound": 1000,
        "amount_upper_bound": 2000,
        "counterparty_id": null,
        "currency": "USD",
        "date_lower_bound": "2026-11-14",
        "date_upper_bound": "2026-11-20",
        "direction": "credit",
        "internal_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
        "type": "ach"
      }
    ],
    "remittance_information": null,
    "status": "unreconciled",
    "transaction_id": null,
    "type": "ach",
    "updated_at": "2026-11-13T19:04:04Z"
  }
}
```

### Create external account

Add a bank account to a counterparty, with its account number and routing number, so payment orders can pay it.

**Inputs**

- Counterparty (`counterparty_id`, text, required): The counterparty. Pick one, or give its id from an earlier step.
- Account name (`name`, text): A nickname for the account, shown in Modern Treasury.
- Account number (`account_number`, text): The bank account number, or the IBAN or wallet address.
- Account number type (`account_number_type`, text): What kind of number it is. Defaults to a plain account number. One of: `other` (Account number), `iban`, `clabe` (CLABE (Mexico)), `wallet_address` (Wallet address).
- Routing number (`routing_number`, text): The bank's routing number (ABA, SWIFT, sort code and so on).
- Routing number type (`routing_number_type`, text): What kind of routing number it is. Defaults to ABA. One of: `aba` (ABA (US)), `swift` (SWIFT / BIC), `sepa_bic` (SEPA BIC), `cpa_ca` (Canadian payments (CPA)), `au_bsb` (Australian BSB), `gb_sort_code` (UK sort code), `nz_national_clearing_code` (New Zealand clearing code).
- Payment type (`payment_type`, text): Limit the routing number to one payment type. Leave empty for all. One of: `ach`, `wire`, `rtp`, `book` (Book transfer), `check`, `sepa`, `bacs`, `eft`, `interac`, `au_becs` (Australian BECS), and 9 more.
- Account type (`account_type`, text): Checking, savings or other. One of: `checking`, `savings`, `other`.
- Account holder (`party_name`, text): The name on the account, if different from the counterparty's.
- Holder type (`party_type`, text): Whether the account holder is a business or an individual. One of: `business`, `individual`.
- Metadata (`metadata`, object): Your own labels on the record, as keys and values (for example an invoice number). Keys given here are added to or changed on the record.

**Outputs**

- `external_account` (object): The new external account

**Example output**

```json
{
  "external_account": {
    "account_details": [
      {
        "account_number_safe": "6789",
        "account_number_type": "other",
        "created_at": "2026-11-13T19:03:27Z",
        "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
      }
    ],
    "account_type": "checking",
    "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
    "created_at": "2026-11-13T19:03:27Z",
    "discarded_at": null,
    "external_id": null,
    "id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
    "live_mode": false,
    "metadata": {},
    "name": "Operating account",
    "party_name": "Globex Ltd",
    "party_type": "business",
    "routing_details": [
      {
        "bank_name": "COLUMBIA BANK",
        "created_at": "2026-11-13T19:03:27Z",
        "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
        "payment_type": "ach",
        "routing_number": "121141819",
        "routing_number_type": "aba"
      }
    ],
    "updated_at": "2026-11-13T19:03:28Z",
    "verification_status": "unverified"
  }
}
```

### Create ledger

Create a ledger, a set of accounts whose entries always balance. Modern Treasury keeps ledgers, so there is no way to delete one.

**Inputs**

- Name (`name`, text, required): The ledger's name.
- Currency (`currency`, text): A currency code. Defaults to USD.
- Description (`description`, text): What the ledger is for.
- Metadata (`metadata`, object): Your own labels on the record, as keys and values (for example an invoice number). Keys given here are added to or changed on the record.

**Outputs**

- `ledger` (object): The new ledger

**Example output**

```json
{
  "ledger": {
    "created_at": "2026-11-13T19:04:29Z",
    "currency": "USD",
    "currency_exponent": 2,
    "description": null,
    "id": "01a1d64c-06a6-7c25-92cc-7a137359ce14",
    "live_mode": false,
    "metadata": {},
    "name": "Customer funds",
    "updated_at": "2026-11-13T19:04:29Z"
  }
}
```

### Create ledger account

Create an account in a ledger. Its normal balance says whether debits (assets, expenses) or credits (liabilities, revenue) increase it.

**Inputs**

- Ledger (`ledger_id`, text, required): The ledger. Pick one, or give its id from an earlier step.
- Name (`name`, text, required): The account's name.
- Normal balance (`normal_balance`, text, required): Debit for assets and expenses, credit for liabilities and revenue. One of: `debit`, `credit`.
- Description (`description`, text): What the account is for.
- Metadata (`metadata`, object): Your own labels on the record, as keys and values (for example an invoice number). Keys given here are added to or changed on the record.

**Outputs**

- `ledger_account` (object): The new ledger account

**Example output**

```json
{
  "ledger_account": {
    "balances": {
      "available_balance": {
        "amount": 0,
        "currency": "USD"
      },
      "pending_balance": {
        "amount": 0,
        "currency": "USD"
      },
      "posted_balance": {
        "amount": 0,
        "currency": "USD"
      }
    },
    "created_at": "2026-11-13T19:04:29Z",
    "description": null,
    "id": "01a1d64c-08d3-75bf-9e3f-b98ac0ccbaf1",
    "ledger_id": "01a1d64c-06a6-7c25-92cc-7a137359ce14",
    "live_mode": false,
    "lock_version": 0,
    "metadata": {},
    "name": "Cash",
    "normal_balance": "debit",
    "updated_at": "2026-11-13T19:04:29Z"
  }
}
```

### Create ledger transaction

Move an amount between two ledger accounts: a debit on one and an equal credit on the other. Posted transactions can't be changed afterwards; make a pending one to review first.

**Inputs**

- Ledger (`ledger_id`, text, required): The ledger. Pick one, or give its id from an earlier step.
- Debit account (`debit_ledger_account_id`, text, required): The ledger account to debit. Pick one, or give its id.
- Credit account (`credit_ledger_account_id`, text, required): The ledger account to credit. Pick one, or give its id.
- Amount (`amount`, number, required): In the currency's smallest unit: for US dollars, 1500 is $15.00. At least 1.
- Status (`status`, text): Posted entries count at once; pending ones wait to be posted or archived. Defaults to posted. One of: `posted`, `pending`, `archived`.
- Description (`description`, text): What the transaction is for.
- Effective at (`effective_at`, date and time): When the transaction counts for balances. Defaults to now.
- Metadata (`metadata`, object): Your own labels on the record, as keys and values (for example an invoice number). Keys given here are added to or changed on the record.

**Outputs**

- `ledger_transaction` (object): The new ledger transaction

**Example output**

```json
{
  "ledger_transaction": {
    "created_at": "2026-11-13T19:04:37Z",
    "description": "Sale",
    "effective_at": "2026-11-13T00:00:00Z",
    "effective_date": "2026-11-13",
    "id": "01a1d64c-2841-7338-a665-fba41fec2758",
    "ledger_entries": [
      {
        "amount": 1000,
        "direction": "debit",
        "effective_at": "2026-11-13T00:00:00Z",
        "id": "01a1d64c-2871-720d-a818-46828207532f",
        "ledger_account_id": "01a1d64c-08d3-75bf-9e3f-b98ac0ccbaf1",
        "ledger_transaction_id": "01a1d64c-2841-7338-a665-fba41fec2758",
        "status": "posted"
      }
    ],
    "ledger_id": "01a1d64c-06a6-7c25-92cc-7a137359ce14",
    "live_mode": false,
    "metadata": {},
    "posted_at": "2026-11-13T19:04:37Z",
    "reversed_by_ledger_transaction_id": null,
    "reverses_ledger_transaction_id": null,
    "status": "posted",
    "updated_at": "2026-11-13T19:04:37Z"
  }
}
```

### Create payment order

Create a payment order: an instruction to send money from one of your accounts to a counterparty's bank account (or to pull it from there). It starts processing as soon as it is approved.

**Inputs**

- Payment type (`payment_type`, text, required): How the money moves. Your internal account and the receiving account must both support it. One of: `ach`, `wire`, `rtp`, `book` (Book transfer), `check`, `sepa`, `bacs`, `eft`, `interac`, `au_becs` (Australian BECS), and 9 more.
- Direction (`direction`, text, required): A credit pays the receiving account; a debit pulls money from it. One of: `credit` (Credit (pay the receiver)), `debit` (Debit (pull from the receiver)).
- Amount (`amount`, number, required): In the currency's smallest unit: for US dollars, 1500 is $15.00. At least 1.
- From account (`originating_account_id`, text, required): Your own account the money leaves (or lands in, for a debit). Pick one, or give its id.
- To account (`receiving_account_id`, text, required): The counterparty's bank account. Pick one, or give the id of an external account from an earlier step.
- ACH type (`subtype`, text): The ACH standard entry class, for ACH payments only. Leave empty for Modern Treasury's default. One of: `CCD` (CCD (corporate)), `PPD` (PPD (consumer)), `CTX` (CTX (corporate trade)), `WEB` (WEB (internet-initiated)), `TEL` (TEL (telephone-initiated)), `IAT` (IAT (international)).
- Currency (`currency`, text): A currency code such as USD. Leave empty to use the account's currency.
- Description (`description`, text): A note for your team, shown in Modern Treasury.
- Statement descriptor (`statement_descriptor`, text): What the receiver sees on their bank statement.
- Remittance information (`remittance_information`, text): Extra text that travels with the payment, such as an invoice number.
- Priority (`priority`, text): High asks for the fastest option the payment type offers. Defaults to normal. One of: `normal`, `high` (High (same-day where the rail offers it)).
- Send on (`effective_date`, date): The date the money should move. Leave empty for the next possible day.
- Hold until (`process_after`, date and time): Do not start processing before this time. Until then the order can be cancelled.
- Email the receiver (`send_remittance_advice`, true/false): Send the counterparty a remittance advice email when it is sent.
- Metadata (`metadata`, object): Your own labels on the record, as keys and values (for example an invoice number). Keys given here are added to or changed on the record.

**Outputs**

- `payment_order` (object): The new payment order

**Example output**

```json
{
  "payment_order": {
    "amount": 1500,
    "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
    "created_at": "2026-11-13T19:03:37Z",
    "currency": "USD",
    "description": "Invoice 1042",
    "direction": "credit",
    "effective_date": "2026-11-14",
    "id": "01a1d64b-3e2c-74b9-8851-fb972bc30f89",
    "live_mode": false,
    "metadata": {},
    "originating_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
    "priority": "normal",
    "process_after": null,
    "receiving_account": {
      "account_details": [
        {
          "account_number_safe": "6789",
          "account_number_type": "other",
          "created_at": "2026-11-13T19:03:27Z",
          "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
        }
      ],
      "account_type": "checking",
      "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
      "created_at": "2026-11-13T19:03:27Z",
      "discarded_at": null,
      "external_id": null,
      "id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
      "live_mode": false,
      "metadata": {},
      "name": "Operating account",
      "party_name": "Globex Ltd",
      "party_type": "business",
      "routing_details": [
        {
          "bank_name": "COLUMBIA BANK",
          "created_at": "2026-11-13T19:03:27Z",
          "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
          "payment_type": "ach",
          "routing_number": "121141819",
          "routing_number_type": "aba"
        }
      ],
      "updated_at": "2026-11-13T19:03:28Z",
      "verification_status": "unverified"
    },
    "receiving_account_id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
    "reconciliation_status": "unreconciled",
    "remittance_information": null,
    "statement_descriptor": null,
    "status": "processing",
    "subtype": "CCD",
    "transaction_ids": [],
    "type": "ach",
    "updated_at": "2026-11-13T19:03:38Z",
    "vendor_failure_reason": null
  }
}
```

### Delete counterparty

Delete a counterparty and its bank accounts so they can no longer be paid.

**Inputs**

- Counterparty (`counterparty_id`, text, required): The counterparty. Pick one, or give its id from an earlier step.

**Outputs**

- `counterparty_id` (text): The counterparty deleted
- `deleted` (true/false): Always true once deleted

**Example output**

```json
{
  "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
  "deleted": true
}
```

### Delete expected payment

Delete an expected payment so nothing is matched to it.

**Inputs**

- Expected payment ID (`expected_payment_id`, text, required): The expected payment's id, from 'List expected payments' or 'Create expected payment'.

**Outputs**

- `deleted` (true/false): Always true once deleted
- `expected_payment` (object): The expected payment, now archived
- `expected_payment_id` (text): The expected payment deleted

**Example output**

```json
{
  "deleted": true,
  "expected_payment": {
    "amount_lower_bound": 1000,
    "amount_reconciled": 0,
    "amount_unreconciled": 1000,
    "amount_upper_bound": 2000,
    "counterparty_id": null,
    "created_at": "2026-11-13T19:04:04Z",
    "currency": "USD",
    "date_lower_bound": "2026-11-14",
    "date_upper_bound": "2026-11-20",
    "description": "Invoice 1043",
    "direction": "credit",
    "id": "01a1d64b-a60a-7a3a-bcb8-b214990b56a3",
    "internal_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
    "live_mode": false,
    "metadata": {},
    "reconciliation_rule_variables": [
      {
        "amount_lower_bound": 1000,
        "amount_upper_bound": 2000,
        "counterparty_id": null,
        "currency": "USD",
        "date_lower_bound": "2026-11-14",
        "date_upper_bound": "2026-11-20",
        "direction": "credit",
        "internal_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
        "type": "ach"
      }
    ],
    "remittance_information": null,
    "status": "archived",
    "transaction_id": null,
    "type": "ach",
    "updated_at": "2026-11-13T19:04:04Z"
  },
  "expected_payment_id": "01a1d64b-a60a-7a3a-bcb8-b214990b56a3"
}
```

### Delete external account

Delete a counterparty's bank account so it can no longer be paid.

**Inputs**

- External account (`external_account_id`, text, required): The counterparty's bank account. Pick one, or give its id from an earlier step.

**Outputs**

- `deleted` (true/false): Always true once deleted
- `external_account_id` (text): The external account deleted

**Example output**

```json
{
  "deleted": true,
  "external_account_id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca"
}
```

### Get counterparty

Get one counterparty with its bank accounts.

**Inputs**

- Counterparty (`counterparty_id`, text, required): The counterparty. Pick one, or give its id from an earlier step.

**Outputs**

- `counterparty` (object): The counterparty

**Example output**

```json
{
  "counterparty": {
    "accounts": [
      {
        "account_details": [
          {
            "account_number_safe": "6789",
            "account_number_type": "other",
            "created_at": "2026-11-13T19:03:27Z",
            "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
          }
        ],
        "account_type": "checking",
        "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
        "created_at": "2026-11-13T19:03:27Z",
        "discarded_at": null,
        "external_id": null,
        "id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
        "live_mode": false,
        "metadata": {},
        "name": "Operating account",
        "party_name": "Globex Ltd",
        "party_type": "business",
        "routing_details": [
          {
            "bank_name": "COLUMBIA BANK",
            "created_at": "2026-11-13T19:03:27Z",
            "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
            "payment_type": "ach",
            "routing_number": "121141819",
            "routing_number_type": "aba"
          }
        ],
        "updated_at": "2026-11-13T19:03:28Z",
        "verification_status": "unverified"
      }
    ],
    "created_at": "2026-11-13T19:03:27Z",
    "discarded_at": null,
    "email": "ap@globex.example",
    "external_id": null,
    "id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
    "live_mode": false,
    "metadata": {},
    "name": "Globex Ltd",
    "send_remittance_advice": false,
    "updated_at": "2026-11-13T19:03:27Z",
    "verification_status": "verified"
  }
}
```

### Get expected payment

Get one expected payment with its matching rule and how much of it has been reconciled.

**Inputs**

- Expected payment ID (`expected_payment_id`, text, required): The expected payment's id, from 'List expected payments' or 'Create expected payment'.

**Outputs**

- `expected_payment` (object): The expected payment

**Example output**

```json
{
  "expected_payment": {
    "amount_lower_bound": 1000,
    "amount_reconciled": 0,
    "amount_unreconciled": 1000,
    "amount_upper_bound": 2000,
    "counterparty_id": null,
    "created_at": "2026-11-13T19:04:04Z",
    "currency": "USD",
    "date_lower_bound": "2026-11-14",
    "date_upper_bound": "2026-11-20",
    "description": "Invoice 1043",
    "direction": "credit",
    "id": "01a1d64b-a60a-7a3a-bcb8-b214990b56a3",
    "internal_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
    "live_mode": false,
    "metadata": {},
    "reconciliation_rule_variables": [
      {
        "amount_lower_bound": 1000,
        "amount_upper_bound": 2000,
        "counterparty_id": null,
        "currency": "USD",
        "date_lower_bound": "2026-11-14",
        "date_upper_bound": "2026-11-20",
        "direction": "credit",
        "internal_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
        "type": "ach"
      }
    ],
    "remittance_information": null,
    "status": "unreconciled",
    "transaction_id": null,
    "type": "ach",
    "updated_at": "2026-11-13T19:04:04Z"
  }
}
```

### Get external account

Get one counterparty bank account with its routing and account details (account numbers are shown by their last digits).

**Inputs**

- External account (`external_account_id`, text, required): The counterparty's bank account. Pick one, or give its id from an earlier step.

**Outputs**

- `external_account` (object): The external account

**Example output**

```json
{
  "external_account": {
    "account_details": [
      {
        "account_number_safe": "6789",
        "account_number_type": "other",
        "created_at": "2026-11-13T19:03:27Z",
        "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
      }
    ],
    "account_type": "checking",
    "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
    "created_at": "2026-11-13T19:03:27Z",
    "discarded_at": null,
    "external_id": null,
    "id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
    "live_mode": false,
    "metadata": {},
    "name": "Operating account",
    "party_name": "Globex Ltd",
    "party_type": "business",
    "routing_details": [
      {
        "bank_name": "COLUMBIA BANK",
        "created_at": "2026-11-13T19:03:27Z",
        "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
        "payment_type": "ach",
        "routing_number": "121141819",
        "routing_number_type": "aba"
      }
    ],
    "updated_at": "2026-11-13T19:03:28Z",
    "verification_status": "unverified"
  }
}
```

### Get incoming payment

Get one incoming payment with its amount, sender and status.

**Inputs**

- Incoming payment ID (`incoming_payment_detail_id`, text, required): The incoming payment's id, from 'List incoming payments'.

**Outputs**

- `incoming_payment_detail` (object): The incoming payment

**Example output**

```json
{
  "incoming_payment_detail": {
    "amount": 50000,
    "as_of_date": "2026-11-13",
    "created_at": "2026-11-13T19:04:17Z",
    "currency": "USD",
    "direction": "credit",
    "failure_reason": null,
    "id": "01a1d64b-d9a3-7d69-b6d5-7eae60687ca4",
    "internal_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
    "live_mode": false,
    "metadata": {},
    "originating_account_number_safe": "4321",
    "originating_party_name": "Initech",
    "originating_routing_number": "021000021",
    "reconciliation_status": "tentatively_reconciled",
    "status": "pending",
    "transaction_id": "01a1d64b-d9b5-7cd0-8943-ee631acd8d34",
    "transaction_line_item_id": "01a1d64b-db15-7a03-967f-fed7ba07279f",
    "type": "ach",
    "updated_at": "2026-11-13T19:04:17Z"
  }
}
```

### Get internal account

Get one of your bank accounts with its routing and account details and latest balances.

**Inputs**

- Internal account (`internal_account_id`, text, required): Your own bank account in Modern Treasury. Pick one, or give its id.

**Outputs**

- `internal_account` (object): The internal account

**Example output**

```json
{
  "internal_account": {
    "account_details": [
      {
        "account_number_safe": "6789",
        "account_number_type": "other",
        "created_at": "2026-11-13T19:03:27Z",
        "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
      }
    ],
    "account_type": "checking",
    "connection": {
      "id": "f523324b",
      "vendor_name": "Modern Treasury"
    },
    "counterparty_id": null,
    "created_at": "2026-11-13T18:50:39Z",
    "currency": "USD",
    "debitable": true,
    "external_id": null,
    "id": "01a1d63f-2223-7f0e-b320-acf19d900455",
    "latest_balances": [],
    "ledger_account_id": null,
    "live_mode": false,
    "metadata": {},
    "name": "Operating",
    "parent_account_id": null,
    "party_name": "Acme Inc",
    "party_type": "business",
    "routing_details": [
      {
        "bank_name": "COLUMBIA BANK",
        "created_at": "2026-11-13T19:03:27Z",
        "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
        "payment_type": "ach",
        "routing_number": "121141819",
        "routing_number_type": "aba"
      }
    ],
    "status": "active",
    "updated_at": "2026-11-13T18:50:39Z"
  }
}
```

### Get payment order

Get one payment order with its status, amount, the account it pays and why it failed, if it did.

**Inputs**

- Payment order ID (`payment_order_id`, text, required): The payment order's id, from 'List payment orders' or 'Create payment order'.

**Outputs**

- `payment_order` (object): The payment order

**Example output**

```json
{
  "payment_order": {
    "amount": 1500,
    "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
    "created_at": "2026-11-13T19:03:37Z",
    "currency": "USD",
    "description": "Invoice 1042",
    "direction": "credit",
    "effective_date": "2026-11-14",
    "id": "01a1d64b-3e2c-74b9-8851-fb972bc30f89",
    "live_mode": false,
    "metadata": {},
    "originating_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
    "priority": "normal",
    "process_after": null,
    "receiving_account": {
      "account_details": [
        {
          "account_number_safe": "6789",
          "account_number_type": "other",
          "created_at": "2026-11-13T19:03:27Z",
          "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
        }
      ],
      "account_type": "checking",
      "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
      "created_at": "2026-11-13T19:03:27Z",
      "discarded_at": null,
      "external_id": null,
      "id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
      "live_mode": false,
      "metadata": {},
      "name": "Operating account",
      "party_name": "Globex Ltd",
      "party_type": "business",
      "routing_details": [
        {
          "bank_name": "COLUMBIA BANK",
          "created_at": "2026-11-13T19:03:27Z",
          "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
          "payment_type": "ach",
          "routing_number": "121141819",
          "routing_number_type": "aba"
        }
      ],
      "updated_at": "2026-11-13T19:03:28Z",
      "verification_status": "unverified"
    },
    "receiving_account_id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
    "reconciliation_status": "unreconciled",
    "remittance_information": null,
    "statement_descriptor": null,
    "status": "processing",
    "subtype": "CCD",
    "transaction_ids": [],
    "type": "ach",
    "updated_at": "2026-11-13T19:03:38Z",
    "vendor_failure_reason": null
  }
}
```

### List counterparties

List the people and businesses you pay, optionally by name or email. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Name (`name`, text): Only counterparties with this name.
- Email (`email`, text): Only counterparties with this email address.
- Page size (`per_page`, number): How many to return, 1 to 100. Modern Treasury's default is 25. From 1 to 100.
- Next page cursor (`after_cursor`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many came back on this page
- `counterparties` (list): The counterparties
- `next_cursor` (text): Give this as 'Next page cursor' to get the next page; empty on the last page

**Example output**

```json
{
  "count": 1,
  "counterparties": [
    {
      "accounts": [
        {
          "account_details": [
            {
              "account_number_safe": "6789",
              "account_number_type": "other",
              "created_at": "2026-11-13T19:03:27Z",
              "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
            }
          ],
          "account_type": "checking",
          "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
          "created_at": "2026-11-13T19:03:27Z",
          "discarded_at": null,
          "external_id": null,
          "id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
          "live_mode": false,
          "metadata": {},
          "name": "Operating account",
          "party_name": "Globex Ltd",
          "party_type": "business",
          "routing_details": [
            {
              "bank_name": "COLUMBIA BANK",
              "created_at": "2026-11-13T19:03:27Z",
              "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
              "payment_type": "ach",
              "routing_number": "121141819",
              "routing_number_type": "aba"
            }
          ],
          "updated_at": "2026-11-13T19:03:28Z",
          "verification_status": "unverified"
        }
      ],
      "created_at": "2026-11-13T19:03:27Z",
      "discarded_at": null,
      "email": "ap@globex.example",
      "external_id": null,
      "id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
      "live_mode": false,
      "metadata": {},
      "name": "Globex Ltd",
      "send_remittance_advice": false,
      "updated_at": "2026-11-13T19:03:27Z",
      "verification_status": "verified"
    }
  ],
  "next_cursor": ""
}
```

### List events

List what happened in the account, newest first: payment orders completed or failed, incoming payments arriving and so on. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Kind of record (`resource`, text): Only events about this kind of record. One of: `payment_order` (Payment orders), `incoming_payment_detail` (Incoming payments), `expected_payment` (Expected payments), `transaction` (Bank transactions), `counterparty` (Counterparties), `external_account` (External accounts), `internal_account` (Internal accounts), `ledger_transaction` (Ledger transactions), `ledger_account` (Ledger accounts), `return` (Returns), `reversal` (Reversals), `balance_report` (Balance reports).
- Event (`event_name`, text): Only this event, such as completed, failed, created or approved.
- Page size (`per_page`, number): How many to return, 1 to 100. Modern Treasury's default is 25. From 1 to 100.
- Next page cursor (`after_cursor`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many came back on this page
- `events` (list): The events
- `next_cursor` (text): Give this as 'Next page cursor' to get the next page; empty on the last page

**Example output**

```json
{
  "count": 1,
  "events": [
    {
      "created_at": "2026-11-13T19:05:36Z",
      "data": {
        "id": "01a1d64b-3e2c-74b9-8851-fb972bc30f89",
        "status": "completed"
      },
      "entity_id": "01a1d64b-3e2c-74b9-8851-fb972bc30f89",
      "event_name": "completed",
      "event_time": "2026-11-13T19:05:36Z",
      "id": "01a1d64d-0c95-725a-bbda-1eb49c625a2d",
      "live_mode": false,
      "resource": "payment_order"
    }
  ],
  "next_cursor": ""
}
```

### List expected payments

List payments you expect to arrive or leave, filtered by status, direction, account or counterparty. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Status (`status`, text): Only expected payments in this status. One of: `unreconciled`, `reconciled`, `partially_reconciled` (Partially reconciled), `archived`.
- Direction (`direction`, text): Only credits or only debits. One of: `credit` (Credit (money in)), `debit` (Debit (money out)).
- Internal account (`internal_account_id`, text): Only this account of yours. Pick one, or give its id.
- Counterparty (`counterparty_id`, text): Only this counterparty's records. Pick one, or give its id.
- Page size (`per_page`, number): How many to return, 1 to 100. Modern Treasury's default is 25. From 1 to 100.
- Next page cursor (`after_cursor`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many came back on this page
- `expected_payments` (list): The expected payments
- `next_cursor` (text): Give this as 'Next page cursor' to get the next page; empty on the last page

**Example output**

```json
{
  "count": 1,
  "expected_payments": [
    {
      "amount_lower_bound": 1000,
      "amount_reconciled": 0,
      "amount_unreconciled": 1000,
      "amount_upper_bound": 2000,
      "counterparty_id": null,
      "created_at": "2026-11-13T19:04:04Z",
      "currency": "USD",
      "date_lower_bound": "2026-11-14",
      "date_upper_bound": "2026-11-20",
      "description": "Invoice 1043",
      "direction": "credit",
      "id": "01a1d64b-a60a-7a3a-bcb8-b214990b56a3",
      "internal_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
      "live_mode": false,
      "metadata": {},
      "reconciliation_rule_variables": [
        {
          "amount_lower_bound": 1000,
          "amount_upper_bound": 2000,
          "counterparty_id": null,
          "currency": "USD",
          "date_lower_bound": "2026-11-14",
          "date_upper_bound": "2026-11-20",
          "direction": "credit",
          "internal_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
          "type": "ach"
        }
      ],
      "remittance_information": null,
      "status": "unreconciled",
      "transaction_id": null,
      "type": "ach",
      "updated_at": "2026-11-13T19:04:04Z"
    }
  ],
  "next_cursor": ""
}
```

### List external accounts

List counterparties' bank accounts, optionally for one counterparty. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Counterparty (`counterparty_id`, text): Only this counterparty's records. Pick one, or give its id.
- Page size (`per_page`, number): How many to return, 1 to 100. Modern Treasury's default is 25. From 1 to 100.
- Next page cursor (`after_cursor`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many came back on this page
- `external_accounts` (list): The external accounts
- `next_cursor` (text): Give this as 'Next page cursor' to get the next page; empty on the last page

**Example output**

```json
{
  "count": 1,
  "external_accounts": [
    {
      "account_details": [
        {
          "account_number_safe": "6789",
          "account_number_type": "other",
          "created_at": "2026-11-13T19:03:27Z",
          "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
        }
      ],
      "account_type": "checking",
      "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
      "created_at": "2026-11-13T19:03:27Z",
      "discarded_at": null,
      "external_id": null,
      "id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
      "live_mode": false,
      "metadata": {},
      "name": "Operating account",
      "party_name": "Globex Ltd",
      "party_type": "business",
      "routing_details": [
        {
          "bank_name": "COLUMBIA BANK",
          "created_at": "2026-11-13T19:03:27Z",
          "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
          "payment_type": "ach",
          "routing_number": "121141819",
          "routing_number_type": "aba"
        }
      ],
      "updated_at": "2026-11-13T19:03:28Z",
      "verification_status": "unverified"
    }
  ],
  "next_cursor": ""
}
```

### List incoming payments

List money that has arrived in your accounts, newest first, filtered by status, type, account or date. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Status (`status`, text): Only incoming payments in this status. One of: `pending`, `completed`, `returned`.
- Direction (`direction`, text): Only credits or only debits. One of: `credit` (Credit (money in)), `debit` (Debit (money out)).
- Payment type (`payment_type`, text): Only payments sent this way. One of: `ach`, `wire`, `rtp`, `book` (Book transfer), `check`, `sepa`, `bacs`, `eft`, `interac`, `au_becs` (Australian BECS), and 9 more.
- Internal account (`internal_account_id`, text): Only this account of yours. Pick one, or give its id.
- On or after (`as_of_date_start`, date): Only payments dated on or after this date.
- On or before (`as_of_date_end`, date): Only payments dated on or before this date.
- Page size (`per_page`, number): How many to return, 1 to 100. Modern Treasury's default is 25. From 1 to 100.
- Next page cursor (`after_cursor`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many came back on this page
- `incoming_payment_details` (list): The incoming payments
- `next_cursor` (text): Give this as 'Next page cursor' to get the next page; empty on the last page

**Example output**

```json
{
  "count": 1,
  "incoming_payment_details": [
    {
      "amount": 50000,
      "as_of_date": "2026-11-13",
      "created_at": "2026-11-13T19:04:17Z",
      "currency": "USD",
      "direction": "credit",
      "failure_reason": null,
      "id": "01a1d64b-d9a3-7d69-b6d5-7eae60687ca4",
      "internal_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
      "live_mode": false,
      "metadata": {},
      "originating_account_number_safe": "4321",
      "originating_party_name": "Initech",
      "originating_routing_number": "021000021",
      "reconciliation_status": "tentatively_reconciled",
      "status": "pending",
      "transaction_id": "01a1d64b-d9b5-7cd0-8943-ee631acd8d34",
      "transaction_line_item_id": "01a1d64b-db15-7a03-967f-fed7ba07279f",
      "type": "ach",
      "updated_at": "2026-11-13T19:04:17Z"
    }
  ],
  "next_cursor": ""
}
```

### List internal accounts

List your own bank accounts in Modern Treasury with their currency, status and account details. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Currency (`currency`, text): Only accounts in this currency, such as USD.
- Payment type (`payment_type`, text): Only payments sent this way. One of: `ach`, `wire`, `rtp`, `book` (Book transfer), `check`, `sepa`, `bacs`, `eft`, `interac`, `au_becs` (Australian BECS), and 9 more.
- Page size (`per_page`, number): How many to return, 1 to 100. Modern Treasury's default is 25. From 1 to 100.
- Next page cursor (`after_cursor`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many came back on this page
- `internal_accounts` (list): Your internal accounts
- `next_cursor` (text): Give this as 'Next page cursor' to get the next page; empty on the last page

**Example output**

```json
{
  "count": 1,
  "internal_accounts": [
    {
      "account_details": [
        {
          "account_number_safe": "6789",
          "account_number_type": "other",
          "created_at": "2026-11-13T19:03:27Z",
          "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
        }
      ],
      "account_type": "checking",
      "connection": {
        "id": "f523324b",
        "vendor_name": "Modern Treasury"
      },
      "counterparty_id": null,
      "created_at": "2026-11-13T18:50:39Z",
      "currency": "USD",
      "debitable": true,
      "external_id": null,
      "id": "01a1d63f-2223-7f0e-b320-acf19d900455",
      "latest_balances": [],
      "ledger_account_id": null,
      "live_mode": false,
      "metadata": {},
      "name": "Operating",
      "parent_account_id": null,
      "party_name": "Acme Inc",
      "party_type": "business",
      "routing_details": [
        {
          "bank_name": "COLUMBIA BANK",
          "created_at": "2026-11-13T19:03:27Z",
          "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
          "payment_type": "ach",
          "routing_number": "121141819",
          "routing_number_type": "aba"
        }
      ],
      "status": "active",
      "updated_at": "2026-11-13T18:50:39Z"
    }
  ],
  "next_cursor": ""
}
```

### List ledger accounts

List ledger accounts with their pending, posted and available balances, optionally for one ledger or by name. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Ledger (`ledger_id`, text): Only this ledger's records. Pick one, or give its id.
- Name (`name`, text): Only records with this name.
- Page size (`per_page`, number): How many to return, 1 to 100. Modern Treasury's default is 25. From 1 to 100.
- Next page cursor (`after_cursor`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many came back on this page
- `ledger_accounts` (list): The ledger accounts
- `next_cursor` (text): Give this as 'Next page cursor' to get the next page; empty on the last page

**Example output**

```json
{
  "count": 1,
  "ledger_accounts": [
    {
      "balances": {
        "available_balance": {
          "amount": 0,
          "currency": "USD"
        },
        "pending_balance": {
          "amount": 0,
          "currency": "USD"
        },
        "posted_balance": {
          "amount": 0,
          "currency": "USD"
        }
      },
      "created_at": "2026-11-13T19:04:29Z",
      "description": null,
      "id": "01a1d64c-08d3-75bf-9e3f-b98ac0ccbaf1",
      "ledger_id": "01a1d64c-06a6-7c25-92cc-7a137359ce14",
      "live_mode": false,
      "lock_version": 0,
      "metadata": {},
      "name": "Cash",
      "normal_balance": "debit",
      "updated_at": "2026-11-13T19:04:29Z"
    }
  ],
  "next_cursor": ""
}
```

### List ledger transactions

List ledger transactions with their entries, newest first, optionally for one ledger or status. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Ledger (`ledger_id`, text): Only this ledger's records. Pick one, or give its id.
- Status (`status`, text): Only transactions in this status. One of: `posted`, `pending`, `archived`.
- Page size (`per_page`, number): How many to return, 1 to 100. Modern Treasury's default is 25. From 1 to 100.
- Next page cursor (`after_cursor`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many came back on this page
- `ledger_transactions` (list): The ledger transactions
- `next_cursor` (text): Give this as 'Next page cursor' to get the next page; empty on the last page

**Example output**

```json
{
  "count": 1,
  "ledger_transactions": [
    {
      "created_at": "2026-11-13T19:04:37Z",
      "description": "Sale",
      "effective_at": "2026-11-13T00:00:00Z",
      "effective_date": "2026-11-13",
      "id": "01a1d64c-2841-7338-a665-fba41fec2758",
      "ledger_entries": [
        {
          "amount": 1000,
          "direction": "debit",
          "effective_at": "2026-11-13T00:00:00Z",
          "id": "01a1d64c-2871-720d-a818-46828207532f",
          "ledger_account_id": "01a1d64c-08d3-75bf-9e3f-b98ac0ccbaf1",
          "ledger_transaction_id": "01a1d64c-2841-7338-a665-fba41fec2758",
          "status": "posted"
        }
      ],
      "ledger_id": "01a1d64c-06a6-7c25-92cc-7a137359ce14",
      "live_mode": false,
      "metadata": {},
      "posted_at": "2026-11-13T19:04:37Z",
      "reversed_by_ledger_transaction_id": null,
      "reverses_ledger_transaction_id": null,
      "status": "posted",
      "updated_at": "2026-11-13T19:04:37Z"
    }
  ],
  "next_cursor": ""
}
```

### List payment orders

List payment orders, newest first, filtered by status, direction, payment type, counterparty, account or date. Gets one page; to see more, run it again with the next page it gives.

**Inputs**

- Status (`status`, text): Only payment orders in this status. One of: `approved`, `cancelled`, `completed`, `denied`, `failed`, `needs_approval` (Needs approval), `pending`, `processing`, `returned`, `reversed`, `sent`.
- Direction (`direction`, text): Only credits or only debits. One of: `credit` (Credit (money in)), `debit` (Debit (money out)).
- Payment type (`payment_type`, text): Only payments sent this way. One of: `ach`, `wire`, `rtp`, `book` (Book transfer), `check`, `sepa`, `bacs`, `eft`, `interac`, `au_becs` (Australian BECS), and 9 more.
- Counterparty (`counterparty_id`, text): Only this counterparty's records. Pick one, or give its id.
- From account (`originating_account_id`, text): Only payment orders from this internal account.
- Sent on or after (`effective_date_start`, date): Only payment orders sent on or after this date.
- Sent on or before (`effective_date_end`, date): Only payment orders sent on or before this date.
- Page size (`per_page`, number): How many to return, 1 to 100. Modern Treasury's default is 25. From 1 to 100.
- Next page cursor (`after_cursor`, text): The 'next_cursor' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many came back on this page
- `next_cursor` (text): Give this as 'Next page cursor' to get the next page; empty on the last page
- `payment_orders` (list): The payment orders

**Example output**

```json
{
  "count": 1,
  "next_cursor": "",
  "payment_orders": [
    {
      "amount": 1500,
      "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
      "created_at": "2026-11-13T19:03:37Z",
      "currency": "USD",
      "description": "Invoice 1042",
      "direction": "credit",
      "effective_date": "2026-11-14",
      "id": "01a1d64b-3e2c-74b9-8851-fb972bc30f89",
      "live_mode": false,
      "metadata": {},
      "originating_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
      "priority": "normal",
      "process_after": null,
      "receiving_account": {
        "account_details": [
          {
            "account_number_safe": "6789",
            "account_number_type": "other",
            "created_at": "2026-11-13T19:03:27Z",
            "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
          }
        ],
        "account_type": "checking",
        "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
        "created_at": "2026-11-13T19:03:27Z",
        "discarded_at": null,
        "external_id": null,
        "id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
        "live_mode": false,
        "metadata": {},
        "name": "Operating account",
        "party_name": "Globex Ltd",
        "party_type": "business",
        "routing_details": [
          {
            "bank_name": "COLUMBIA BANK",
            "created_at": "2026-11-13T19:03:27Z",
            "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
            "payment_type": "ach",
            "routing_number": "121141819",
            "routing_number_type": "aba"
          }
        ],
        "updated_at": "2026-11-13T19:03:28Z",
        "verification_status": "unverified"
      },
      "receiving_account_id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
      "reconciliation_status": "unreconciled",
      "remittance_information": null,
      "statement_descriptor": null,
      "status": "processing",
      "subtype": "CCD",
      "transaction_ids": [],
      "type": "ach",
      "updated_at": "2026-11-13T19:03:38Z",
      "vendor_failure_reason": null
    }
  ]
}
```

### Update counterparty

Change a counterparty's name, email, remittance setting or metadata. Only the fields given change.

**Inputs**

- Counterparty (`counterparty_id`, text, required): The counterparty. Pick one, or give its id from an earlier step.
- Name (`name`, text): A new name. Leave empty to keep it.
- Email (`email`, text): A new email address. Leave empty to keep it.
- Email remittance advice (`send_remittance_advice`, true/false): Turn remittance emails on or off. Leave unset to keep it.
- Metadata (`metadata`, object): Your own labels on the record, as keys and values (for example an invoice number). Keys given here are added to or changed on the record.

**Outputs**

- `counterparty` (object): The updated counterparty

**Example output**

```json
{
  "counterparty": {
    "accounts": [
      {
        "account_details": [
          {
            "account_number_safe": "6789",
            "account_number_type": "other",
            "created_at": "2026-11-13T19:03:27Z",
            "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
          }
        ],
        "account_type": "checking",
        "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
        "created_at": "2026-11-13T19:03:27Z",
        "discarded_at": null,
        "external_id": null,
        "id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
        "live_mode": false,
        "metadata": {},
        "name": "Operating account",
        "party_name": "Globex Ltd",
        "party_type": "business",
        "routing_details": [
          {
            "bank_name": "COLUMBIA BANK",
            "created_at": "2026-11-13T19:03:27Z",
            "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
            "payment_type": "ach",
            "routing_number": "121141819",
            "routing_number_type": "aba"
          }
        ],
        "updated_at": "2026-11-13T19:03:28Z",
        "verification_status": "unverified"
      }
    ],
    "created_at": "2026-11-13T19:03:27Z",
    "discarded_at": null,
    "email": "ap@globex.example",
    "external_id": null,
    "id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
    "live_mode": false,
    "metadata": {},
    "name": "Globex Corporation",
    "send_remittance_advice": false,
    "updated_at": "2026-11-13T19:03:27Z",
    "verification_status": "verified"
  }
}
```

### Update expected payment

Change an expected payment's description, remittance text or metadata. Only the fields given change.

**Inputs**

- Expected payment ID (`expected_payment_id`, text, required): The expected payment's id, from 'List expected payments' or 'Create expected payment'.
- Description (`description`, text): A new description. Leave empty to keep it.
- Remittance information (`remittance_information`, text): New remittance text. Leave empty to keep it.
- Metadata (`metadata`, object): Your own labels on the record, as keys and values (for example an invoice number). Keys given here are added to or changed on the record.

**Outputs**

- `expected_payment` (object): The updated expected payment

**Example output**

```json
{
  "expected_payment": {
    "amount_lower_bound": 1000,
    "amount_reconciled": 0,
    "amount_unreconciled": 1000,
    "amount_upper_bound": 2000,
    "counterparty_id": null,
    "created_at": "2026-11-13T19:04:04Z",
    "currency": "USD",
    "date_lower_bound": "2026-11-14",
    "date_upper_bound": "2026-11-20",
    "description": "Invoice 1043 (late)",
    "direction": "credit",
    "id": "01a1d64b-a60a-7a3a-bcb8-b214990b56a3",
    "internal_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
    "live_mode": false,
    "metadata": {},
    "reconciliation_rule_variables": [
      {
        "amount_lower_bound": 1000,
        "amount_upper_bound": 2000,
        "counterparty_id": null,
        "currency": "USD",
        "date_lower_bound": "2026-11-14",
        "date_upper_bound": "2026-11-20",
        "direction": "credit",
        "internal_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
        "type": "ach"
      }
    ],
    "remittance_information": null,
    "status": "unreconciled",
    "transaction_id": null,
    "type": "ach",
    "updated_at": "2026-11-13T19:04:04Z"
  }
}
```

### Update ledger transaction

Post or archive a pending ledger transaction, or change its description or metadata. Modern Treasury refuses to change one that is already posted.

**Inputs**

- Ledger transaction ID (`ledger_transaction_id`, text, required): The transaction's id, from 'List ledger transactions' or 'Create ledger transaction'.
- Status (`status`, text): Post the pending transaction so it counts, or archive it. Leave empty to keep it pending. One of: `posted` (Post it), `archived` (Archive it).
- Description (`description`, text): A new description. Leave empty to keep it.
- Metadata (`metadata`, object): Your own labels on the record, as keys and values (for example an invoice number). Keys given here are added to or changed on the record.

**Outputs**

- `ledger_transaction` (object): The updated ledger transaction

**Example output**

```json
{
  "ledger_transaction": {
    "created_at": "2026-11-13T19:04:37Z",
    "description": "Sale",
    "effective_at": "2026-11-13T00:00:00Z",
    "effective_date": "2026-11-13",
    "id": "01a1d64c-2841-7338-a665-fba41fec2758",
    "ledger_entries": [
      {
        "amount": 1000,
        "direction": "debit",
        "effective_at": "2026-11-13T00:00:00Z",
        "id": "01a1d64c-2871-720d-a818-46828207532f",
        "ledger_account_id": "01a1d64c-08d3-75bf-9e3f-b98ac0ccbaf1",
        "ledger_transaction_id": "01a1d64c-2841-7338-a665-fba41fec2758",
        "status": "posted"
      }
    ],
    "ledger_id": "01a1d64c-06a6-7c25-92cc-7a137359ce14",
    "live_mode": false,
    "metadata": {},
    "posted_at": "2026-11-13T19:04:37Z",
    "reversed_by_ledger_transaction_id": null,
    "reverses_ledger_transaction_id": null,
    "status": "posted",
    "updated_at": "2026-11-13T19:04:37Z"
  }
}
```

### Update payment order

Change a payment order's description, statement descriptor, remittance text, priority, dates or metadata. Only the fields given change. Which fields can still change depends on how far the order has got.

**Inputs**

- Payment order ID (`payment_order_id`, text, required): The payment order's id, from 'List payment orders' or 'Create payment order'.
- Description (`description`, text): A new description. Leave empty to keep it.
- Statement descriptor (`statement_descriptor`, text): A new statement descriptor. Leave empty to keep it.
- Remittance information (`remittance_information`, text): New remittance text. Leave empty to keep it.
- Priority (`priority`, text): A new priority. Leave empty to keep it. One of: `normal`, `high` (High (same-day where the rail offers it)).
- Send on (`effective_date`, date): A new date for the money to move.
- Hold until (`process_after`, date and time): A new time to hold the order until.
- Metadata (`metadata`, object): Your own labels on the record, as keys and values (for example an invoice number). Keys given here are added to or changed on the record.

**Outputs**

- `payment_order` (object): The updated payment order

**Example output**

```json
{
  "payment_order": {
    "amount": 1500,
    "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
    "created_at": "2026-11-13T19:03:37Z",
    "currency": "USD",
    "description": "Invoice 1042 (paid)",
    "direction": "credit",
    "effective_date": "2026-11-14",
    "id": "01a1d64b-3e2c-74b9-8851-fb972bc30f89",
    "live_mode": false,
    "metadata": {},
    "originating_account_id": "01a1d63f-2223-7f0e-b320-acf19d900455",
    "priority": "normal",
    "process_after": null,
    "receiving_account": {
      "account_details": [
        {
          "account_number_safe": "6789",
          "account_number_type": "other",
          "created_at": "2026-11-13T19:03:27Z",
          "id": "7f1c2f0e-1111-4c1a-9a53-0a8f6d1f0a01"
        }
      ],
      "account_type": "checking",
      "counterparty_id": "fa1fa56a-2981-430a-85a2-ad8bf8010ea9",
      "created_at": "2026-11-13T19:03:27Z",
      "discarded_at": null,
      "external_id": null,
      "id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
      "live_mode": false,
      "metadata": {},
      "name": "Operating account",
      "party_name": "Globex Ltd",
      "party_type": "business",
      "routing_details": [
        {
          "bank_name": "COLUMBIA BANK",
          "created_at": "2026-11-13T19:03:27Z",
          "id": "7f1c2f0e-2222-4c1a-9a53-0a8f6d1f0a02",
          "payment_type": "ach",
          "routing_number": "121141819",
          "routing_number_type": "aba"
        }
      ],
      "updated_at": "2026-11-13T19:03:28Z",
      "verification_status": "unverified"
    },
    "receiving_account_id": "01a1d64b-17ab-73ba-b5a9-28f2a4267bca",
    "reconciliation_status": "unreconciled",
    "remittance_information": null,
    "statement_descriptor": null,
    "status": "processing",
    "subtype": "CCD",
    "transaction_ids": [],
    "type": "ach",
    "updated_at": "2026-11-13T19:03:38Z",
    "vendor_failure_reason": null
  }
}
```
