Modern Treasury API Documentation

Welcome to Modern Treasury. You'll find comprehensive guides and documentation to help you start working with Modern Treasury APIs as quickly as possible, as well as support if you get stuck.

Suggest Edits

Getting Started

 

Modern Treasury exposes a simple RESTful API to initiate ACH, wire, check, and RTP transactions with your bank. The API operates over HTTP and all requests/responses are JSON objects.

To get started, log-in to the web application and access your organization settings to see your API key.

You may also follow our Quickstart guide.

Suggest Edits

Authentication

 

You can retrieve both your production and sandbox API keys from the account settings page.

All requests must be made over HTTPS and will be authenticated over standard HTTP basic authentication. When providing credentials, the username will be your Organization ID and the password will be either the production or sandbox API key.

API keys must be kept secret. Do not put them in your client-side code or checked into your application's code.

curl --request GET \
  -u ORGANIZATION_ID:API_KEY \
  --url https://app.moderntreasury.com/api/ping
Suggest Edits

Development

 

Live vs Test

For ease of development, Modern Treasury provides both live and test environments for end-users. When using the web application, most pages will display a "Live/Test" toggle that allows you to switch between both environments in the same session. When using the API, your use of the Live or Test keys will determine which environment you interact with.

Some resources are environment-independent, meaning they have no Live/Test distinction and changes to these shared resources are visible across both environments. This is done in part to speed development and allow a cleaner experience when building your application. Currently the following resources are shared: Organizations, Users, and Groups.

Suggest Edits

Supported Banks

 

Our API connects directly to your bank's internal systems over a secure interface. We support the banks listed in the table below and are currently adding a number of banks, so if you don't see your corporate bank below, we're likely adding it. Please feel free to reach out and we can work together on prioritization of your bank.

Note that we only have to support your bank in order to support payments to and from your customers/vendors. As long as you have their bank account information on hand, we can transact with their accounts.

Bank Name
ACH
Wire
Check
Lockbox
RTP

Silicon Valley Bank

Yes

Yes

Yes

Yes

No

First Republic Bank

Yes

Yes

Coming Soon

No

No

Wells Fargo

Yes

Yes

Yes

No

No

JPMorgan Chase

Yes

Yes

Coming Soon

No

Yes

Silvergate Bank

Coming Soon

Coming Soon

No

No

No

Metropolitan Commercial Bank

Yes

Yes

No

No

No

Royal Bank of Canada

Coming Soon

Coming Soon

No

No

No

Suggest Edits

Status Codes

 

The Modern Treasury API uses standard HTTP response codes. Any 2xx response is successful. A 4xx means that there was an error with the data provided (like an invalid routing number). These errors can sometimes be handled programmatically by your application when we provide an error reason. A 5xx error means we encountered an error in our software, which will work to fix immediately.

A table of status codes and their meanings can be found below.

2xx Success

Status Code
Description

200 OK

The request succeeded.

201 Created

The request succeeded and the new resource was created.

202 Accepted

The request has been accepted for processing, but the processing has not been completed.

4xx Client Errors

Status Code
Description

400 Bad Request

Data was invalid or missing required parameters.

401 Unauthorized

The API key was invalid.

403 Forbidden

The account does not have access to the requested resource.

404 Not Found

The resource that was requested could not be found.

409 Conflict

The request conflicts with another request.

429 Too Many Requests

The account has issued too many requests.

5xx Server Errors

Status Code
Description

500 Internal Server Error

Our server encountered an error while processing your request. We will be notified and work on a fix immediately.

502 Bad Gateway

Our server encountered an error while processing your request. We will be notified and work on a fix immediately.

503 Service Unavailable

Our server encountered an error while processing your request. We will be notified and work on a fix immediately.

504 Gateway Timeout

Our server encountered an error while processing your request. We will be notified and work on a fix immediately.

When there is an error, Modern Treasury returns an object with as much descriptive information as we can. A list of common error codes can be found below.

Error Code
Description

parameter_invalid

The value provided for the parameter is invalid

parameter_missing

No value has been provided for the parameter

resource_not_found

The resource couldn't be found for the identifier

 

We support including metadata on most of our resources as a way to add internal information to our system. Metadata takes the form of free-form key-value pairs. This allows easier searching through both the API and web interfaces. Organizations can also add individual rules based on metadata values. You may write metadata both when you create an object and when updating the object.

If you would like to remove metadata that is already on an object, you can unset it by passing in the key-value pair with an empty string or null as the value, like this:

{
  "key-to-delete": ""
}

// OR

{
  "key-to-delete": null
}
{
  "Customer ID": "5584"
}
Suggest Edits

Idempotent Requests

 

We support idempotency in API requests to help prevent you from accidentally issuing the same API call twice. This can be helpful if you are instructing us to move money or create an entity. We would recommend taking advantage of this when issuing a request that isn't idempotent by nature.

To use this, you will include a header as a part of your request like Idempotency-Key: <your-key>. This key should be something unique, preferably something like an internal database UUID.

When a request is made with an idempotency key, we will save for 24 hours the result of that request. If you issue the same request within 24 hours, we will echo back to you the original response. Note that this will only happen if the request successfully executed. If there was a connection interruption or some other error that prevented us from completing the original request, we will execute the following request and cache its results.

curl --request GET \
  -u ORGANIZATION_ID:API_KEY \
  -H "Idempotency-Key: <your-key>" \
  --url https://app.moderntreasury.com/api/<endpoint>
Suggest Edits

Pagination

 

By default all "List" endpoints return paginated results. You may use the query params page and per_page to control the number of results you see. By default page will default to 1 unless a value is given. For per_page the default will be 25 but can optionally be increased to a maximum of 100.

When reading paginated responses from the API, the following response headers will also be sent:

Header
Description

X-Page

The current page

X-Per-Page

The current per_page

X-Total-Count

The total number of records available

 

A large number Modern Treasury's integrations are asynchronous in nature and do not take effect immediately. Primarily this is due to how the underlying systems operate (e.g. file-based messaging over FTP) but it also allows Modern Treasury to efficiently batch its communications to the bank. Fewer files often translates into lower costs and less operational overhead.

To make dealing with these systems easier, the Modern Treasury API is built around the idea of sending important updates over HTTP webhooks. These endpoints can be configured through the settings page inside the application and apply to the entire organization. If needed, separate URLs may be provided for live and test traffic.

Some resources allow the ability to pass a custom webhook_url during creation. This will override the organization-level settings for the created instance.

Technical Details

All endpoints must be configured to receive a HTTP POST with a JSON payload. The webhook system will wait a maximum 5 seconds for a 2XX HTTP status code in order to mark the payload as delivered. If the endpoint takes longer to respond or an error is returned, the webhook will be re-enqueued for delivery at a later time subject to an exponential backoff.

All endpoints are strongly encouraged to use HTTPS as this protects the payload in-transit.

Authentication

To verify that a webhook was actually sent by Modern Treasury, every payload is signed with a signature that is passed through as the HTTP header X-Signature. The signature is Hex encoded and can be replicated by applying HMAC-SHA-256 to the body of the webhook with your specific webhook key, which can be found in your webhook settings page.

Please contact support if your webhook key is accidentally made public. We will rotate the key and coordinate the change with you.

Webhook Idempotency

Each webhook has a unique ID. This is passed through as the HTTP header X-Webhook-ID. You can save these IDs as you process webhooks to ensure each webhook is only processed once. If a webhook is sent multiple times, its ID will remain the same between requests.

Live vs Test

When making API calls that invoke webhooks, the chosen endpoint used will depend on whether the live or test key was used. If you want to use the same URL for both live and test webhooks, you can still differentiate using the HTTP header X-Live-Mode which is true for live traffic and false for test traffic.

Topics

Each webhook payload contains a topic that describes which category the event belongs to. This is passed through as the HTTP header X-Topic.

Topic
Description

balance_report

Any balance report lifecycle event.

expected_payment

Any expected payment lifecycle event.

paper_item

Any paper item lifecycle event.

payment_order

Any payment order lifecycle event.

return

Any return lifecycle event.

transaction

Any transaction lifecycle event.

Suggest Edits

Balance Reports

 
Event
Description

created

A balance report has been created.

Suggest Edits

Expected Payments

 
Event
Description

reconciled

The expected payment has been reconciled to a transaction. The transaction ID will be included in the data provided.

overdue

The expected payment was not reconciled to a transaction. This will be sent when the date_upper_bound is passed, which indicates the payment was not received by the expected date.

Suggest Edits

Paper Items

 
Event
Description

created

A paper item has been created.

completed

A paper item has been reconciled with a transaction.

Suggest Edits

Payment Orders

 

As payment orders progress through their lifecycle, Modern Treasury will send webhooks to convey their latest statuses. The message body will include both an event and a data representation of the payment order. When there is an error, it will also be included. See the status codes section for additional details on how errors are presented.

These are the events you may receive

Event
Description

created

A payment order has been created. This happens when the Async Create Payment Order endpoint is used.

failed

A payment order failed to be created. This happens when the Async Create Payment Order endpoint is used.

approved

A payment order has been approved.

denied

A payment order has been denied.

cancelled

A payment order has been cancelled.

begin_processing

A payment order has begun processing. Payment orders will no longer be editable after this point.

finish_processing

A payment order has finished processing and been sent to the bank.

completed

A payment order has been reconciled with a transaction.

undo_completed

A payment order had mistakenly been marked as complete. This may happen when a user manually reconciles a transaction to different payment orders.

returned

A payment order has been reversed. You may redraft the payment order by using the Update Payment Order endpoint.

{
  "event": "created",
  "data": {
    "id": "fd3c1f59-6d5b-466c-9126-7f8c82ad6e1c",
    "type": "ach",
    ...
  }
}
{
  "event": "failed",
  "data": {
    "id": "fd3c1f59-6d5b-466c-9126-7f8c82ad6e1c"
  },
  "error": {
    "code": "parameter_invalid",
    "message": "amount is invalid",
    "parameter": "amount"
  }
}
 
Event
Description

created

A return has been created.

Suggest Edits

Transactions

 
Event
Description

created

A transaction has been created.

reconciled

A transaction has been reconciled.

Suggest Edits

External Accounts

 
Event
Description

verified

The external account has been verified. The verification_status is now verified.

failed_verification

The external account's verification was failed. A new verification may be started. The verification_status is now unverified.

cancelled

The verification of the external account was cancelled. The verification_status is now unverified.

expired

The verification of the external account has expired. The verification_status is now unverified.

Suggest Edits

ACH Return/NOC Codes

 

Return Codes

Code
Short Description

R01

Insufficient Funds

R02

Account Closed

R03

No Account/Unable to Locate Account

R04

Invalid Account Number Structure

R05

Unauthorized Debit to Consumer Account Using Corporate SEC Code

R06

Returned per ODFI's Request

R07

Authorization Revoked by Customer

R08

Payment Stopped

R09

Uncollected Funds

R10

Customer Advises Unauthorized, Improper, Ineligible, or Part of an Incomplete Transaction

R11

Check Truncation Early Return

R12

Account Sold to Another DFI

R13

Invalid ACH Routing Number

R14

Representative Payee Deceased or Unable to Continue in That Capacity

R15

Beneficiary or Account Holder (Other Than a Representative Payee) Deceased

R16

Account Frozen/Entry Returned per OFAC Instruction

R17

File Record Edit Criteria

R18

Improper Effective Entry Date

R19

Amount Field Error

R20

Non-Transaction Account

R21

Invalid Company Identification

R22

Invalid Individual ID Number

R23

Credit Entry Refused by Receiver

R24

Duplicate Entry

R25

Addenda Error

R26

Mandatory Field Error

R27

Trace Number Error

R28

Routing Number Check Digit Error

R29

Corporate Customer Advises Not Authorized

R30

RDFI Not Participant in Check Truncation Program

R31

Permissible Return Entry (CCD and CTX Only)

R32

RDFI Non-Settlement

R33

Return of XCK Entry

R34

Limited Participation DFI

R35

Return of Improper Debit Entry

R36

Return of Improper Credit Entry

R37

Source Document Presented for Payment

R38

Stop Payment on Source Document

R39

Improper Source Document/Source Document Presented for Payment

Notification of Change Codes

Code
Short Description

C01

Incorrect DFI Account Number

C02

Incorrect Routing Number

C03

Incorrect Routing Number and Incorrect DFI Account Number

C05

Incorrect Transaction Code

C06

Incorrect DFI Account Number and Incorrect Transaction Code

C07

Incorrect Routing Number, Incorrect DFI Account Number, and Incorrect Tranaction Code.

C08

Incorrect Receiving DFI Identification (IAT Only)

C09

Incorrect Individual Identification Number/Incorrect Receiver Identification Number

C13

Addenda Format Error

C14

Incorrect SEC Code for Outbound International Payment

Suggest Edits

ACH Timings

 

The settlement time for ACH payments may vary depending on where you bank. We publish our timings in the time zone of the bank.

Cutoff
Completion

SVB (Normal ACH)

6:50 PM PT

Opening of next business day

SVB (Same-Day ACH)

8:50 AM PT

Close of business

FRB (Normal ACH)

6:50 PM PT

Opening of 2 business days later

FRB (Same-Day ACH)

9:20 AM PT

Close of business

WF (Normal ACH)

5:20 PM PT

Opening of next business day

WF (Same-Day ACH)

8:50 AM PT

Close of business

The workflow of the payment order from creation to completion is as follows:

  • When the payment order is created, it will initially have a status of approved or needs_approval. Note that only payment orders that have been approved will be sent to the bank. If it is not approved by the cutoff, it will be sent before the next cutoff time.
  • At the cutoff time, the payment order's status will be updated to processing and you will receive the begin_processing webhook event.
  • When the batch is fully processed, the payment order's status will be updated to sent and you will receive the finish_processing webhook. This typically only takes under a minute.
  • When the transaction is complete, your payment order status will become completed and you will receive the completed webhook. The payment order will have the ID of transaction in its attributes. If you were pulling money from a counterparty, the funds are now in your account. If you were sending money, the funds have now left your account.
  • Sometimes you may experience ACH returns. These may occur up to 3 days after settlement for business transactions and 60 days after consumer transactions. However, we have seen these happen beyond those timeframes before. If a return happens, the payment order's status will be updated to returned and you will receive a returned webhook. A new return object will also be created, which you will be notified via webhook about as well. And a transaction representing the return will also be created.
Suggest Edits

Payment Order Object

 

A payment_order is an instruction to move money to or from your bank account as an ACH, wire, or check. When a new payment order is created on Modern Treasury, we communicate with your bank to move the amount of money you specified.

Attribute
Description

id
string

Unique identifier for the payment order

type
string

One of ach, wire, check, or rtp.

amount
int32

Value in specified currency's smallest unit. e.g. $10 would be represented as 1000.

direction
string

One of credit, debit

Describes the direction money is flowing in the transaction. A credit moves money from your account to someone else's. A debit pulls money from someone else's account to your own.

Note that wire and check payments will always be credit.

status
string

The current status of the payment order. See the webhooks section for more on the different statuses.

priority
string

Either normal or high. For ACH payments, high represents a same-day ACH transfer.

originating_account_id
string

The ID of one of your organization's internal accounts

receiving_account_id
string

The receiving account ID.

receiving_account_type
string

The receiving account type. Can be one of external_account or internal_account.

currency
string

Must conform to ISO 4217. Defaults to the currency of the originating account.

effective_date
date

Date transactions are to be posted to the participants’ account. Defaults to the current business day or the next business day if the current day is a bank holiday or weekend.

Format: yyyy-mm-dd

description
string

An optional description for internal use.

statement_descriptor
string

An optional descriptor which will appear in the receiver's statement. For check payments this field will be used as the memo line. For ach the maximum length is 10 characters. Note that for ACH payments, the name on your bank account will be included automatically by the bank, so you can use the characters for other useful information.

remittance_information
string

For ach, this field will be passed through on an addenda record. For wire payments the field will be passed through as the "Originator to Beneficiary Information", also known as OBI or Fedwire tag 6000.

metadata
object

Additional data represented as key-value pairs. Both the key and value must be strings or integers. See Metadata.

counterparty_id
string

If the payment order is tied to a specific Counterparty, their id will appear, otherwise null.

transaction_ids
array

The IDs of all the transactions associated to this payment order. Usually, you will only have a single transaction ID. However, if a payment order initially results in a Return, but gets redrafted and is later successfully completed, it can have many transactions.

charge_bearer
string

The party that will pay the fees for the payment order. Only applies to wire payment orders. Can be one of shared, sender, or receiver, which correspond respectively with the SWIFT 71A values SHA, OUR, BEN.

foreign_exchange_indicator
string

Indicates the type of FX transfer to initiate, can be either variable_to_fixed, fixed_to_variable, or nil if the payment order currency matches the originating account currency.

foreign_exchange_contract
string

If present, indicates a specific foreign exchange contract number that has been generated by your financial institution.

{
  "id": "c5f4009c-bdd6-4cc1-84b2-17974ac9e77a",
  "type": "ach",
  "amount": 20000,
  "direction": "credit",
  "originating_account_id": "0f8e3719-3dfd-4613-9bbf-c0333781b59f",
  "receiving_account_id": "5acec2ef-987b-4260-aa97-b719eeb0a8d5",
  "receiving_account_type": "external_account",
  "currency": "USD",
  "effective_date": "2018-11-08",
  "priority": "normal",
  "description": "Repellendus deleniti atque quod.",
  "statement_descriptor": "Rerum del.",
  "remittance_information": "Accusamus tempore molestiae laboriosam.",
  "metadata": {},
  "status": "approved",
  "counterparty_id": "37ba4454-dd33-4aa0-8906-0e2e4103e45c",
  "transactions_ids": [],
  "charge_bearer": nil,
  "foreign_exchange_indicator": nil,
  "foreign_exchange_contract": nil
}
Suggest Edits

Create Payment Order

Create a new Payment Order

 

Basic Auth

 Authentication is required for this endpoint.
posthttps://app.moderntreasury.com/api/payment_orders
curl --request POST \
  --url https://app.moderntreasury.com/api/payment_orders
var request = require("request");

var options = { method: 'POST',
  url: 'https://app.moderntreasury.com/api/payment_orders' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/payment_orders")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://app.moderntreasury.com/api/payment_orders");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/payment_orders"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "id": "c5f4009c-bdd6-4cc1-84b2-17974ac9e77a",
  "type": "ach",
  "amount": 20000,
  "direction": "credit",
  "originating_account_id": "0f8e3719-3dfd-4613-9bbf-c0333781b59f",
  "receiving_account": {
    "id": "5acec2ef-987b-4260-aa97-b719eeb0a8d5",
    "account_type": "checking",
    "party_name": "John Smith",
    "party_type": "business",
    "party_address": null,
    "account_details": [
      {
        "id": "81a7cd32-39f5-4f0c-873f-4d9137ec9cd9",
        "account_number": "1293291291",
        "account_number_type": null
      }
    ],
    "routing_details": [
      {
        "id": "5ceb251f-0235-48a2-81cb-0c668f5ee81b",
        "payment_type": null,
        "routing_number": "121141822",
        "routing_number_type": "aba"
      }
    ]
  },
  "currency": "USD",
  "effective_date": "2018-11-08",
  "priority": "normal",
  "description": "Repellendus deleniti atque quod.",
  "statement_descriptor": "Rerum del.",
  "remittance_information": "Accusamus tempore molestiae laboriosam.",
  "metadata": {},
  "status": "approved",
  "counterparty_id": "37ba4454-dd33-4aa0-8906-0e2e4103e45c",
  "transaction_ids": [],
  "charge_bearer": nil,
  "foreign_exchange_indicator": nil,
  "foreign_exchange_contract": nil
}

Body Params

type
string
required
amount
int32
required
direction
string
required
originating_account_id
string
required
receiving_account_id
string

Either receiving_account or receiving_account_id must be present. When using receiving_account_id, you may pass the id of an external account or an internal account.

receiving_account
object

Either receiving_account or receiving_account_id must be present. When using receiving_account_id, you may pass the id of an external account or an internal account.

 
receiving_account.account_type
string
receiving_account.party_name
string
receiving_account.party_type
string
receiving_account.party_address
object
 
receiving_account.account_details
array of objects
receiving_account.routing_details
array of objects
currency
string

Defaults to the currency of the originating account

effective_date
date
priority
string
description
string
statement_descriptor
string
remittance_information
string
line_items
array of objects
amount
metadata
description
metadata
json
charge_bearer
string
foreign_exchange_indicator
string
foreign_exchange_contract
string
 

See Payment Order for detailed information on each field.

Field Deprecation

In previous versions of the API originating_account_id was aliased as originating_account and internal_account_id. Both of these aliases still function for backwards compatibility but new implementations are encouraged to use originating_account_id.

Suggest Edits

Example Requests

 

Initiating an ACH Credit

The following request will push $10 from the originating account to the receiving account.

{
  "type": "ach",
  "amount": 1000,
  "direction": "credit",
  "currency": "USD",
  "originating_account_id": "<Internal Account ID>",
  "receiving_account": {
    "party_name": "Bob Loblaw",
    "account_type": "checking",
    "routing_details": [
      {
        "routing_number_type": "aba",
        "routing_number": "121141822"
      }
    ],
    "account_details": [
      {
        "account_number": "123456789"
      }
    ]
  }
}

Initiating an ACH Debit

The following request will pull $10 from the receiving account and place it into the originating account.

{
  "type": "ach",
  "amount": 1000,
  "direction": "debit",
  "currency": "USD",
  "originating_account_id": "<Internal Account ID>",
  "receiving_account": {
    "party_name": "Bob Loblaw",
    "account_type": "checking",
    "routing_details": [
      {
        "routing_number_type": "aba",
        "routing_number": "121141822"
      }
    ],
    "account_details": [
      {
        "account_number": "123456789"
      }
    ]
  }
}

Initiating an RTP Credit

The following request will initiate an RTP payment of $50.00 from the originating internal account and send it to the receiving account.

Note

Only RTP credits are supported at this time. In order to originate an RTP payment from an internal account, you'll need a bank account at an institution that supports RTP.

{
  "type": "rtp",
  "amount": 5000,
  "direction": "credit",
  "currency": "USD",
  "originating_account_id": "<Internal Account ID>",
  "receiving_account": {
    "party_name": "Renata Realtime",
    "account_type": "checking",
    "routing_details": [
      {
        "routing_number_type": "aba",
        "routing_number": "021000021"
      }
    ],
    "account_details": [
      {
        "account_number": "123456789"
      }
    ]
  }
}

Working with Counterparties

Counterparties allow you to save account information to avoid repeating it across multiple transfers to the same recipient. See the Counterparty documentation for more details.

{
  "type": "ach",
  "amount": 1000,
  "direction": "credit",
  "currency": "USD",
  "originating_account_id": "<Internal Account ID>",
  "receiving_account_id": "<External Account ID>",
  "counterparty_id": "<Counterparty ID>"
}

Working with Line Items

Line items allow you to save a detailed breakdown of the individual amounts contained in a Payment Order. For Example, the following $10 transfer is actually composed of 2 individual $5 payments, each with their own description and/or metadata.

{
  "type": "ach",
  "amount": 1000,
  "direction": "credit",
  "currency": "USD",
  "originating_account_id": "<Internal Account ID>",
  "receiving_account": {
    "party_name": "Bob Loblaw",
    "account_type": "checking",
    "routing_details": [
      {
        "routing_number_type": "aba",
        "routing_number": "121141822"
      }
    ],
    "account_details": [
      {
        "account_number": "123456789"
      }
    ]
  },
  "line_items": [
    {
      "amount": 500,
      "description": "Payment #1",
      "metadata": {
        "Payment Type": "One time fee"
      }
    },
    {
      "amount": 500,
      "description": "Payment #2",
      "metadata": {
        "Payment Type": "Recurring Fee"
      }
    }
  ]
}

Working with Metadata

Metadata are key/value pairs that can be assigned to a Payment Order. For example, the following $10 transfer is for a specific User that we have keep track of using the "User ID" metadata key.

{
  "type": "ach",
  "amount": 1000,
  "direction": "credit",
  "currency": "USD",
  "originating_account_id": "<Internal Account ID>",
  "receiving_account": {
    "party_name": "Bob Loblaw",
    "account_type": "checking",
    "routing_details": [
      {
        "routing_number_type": "aba",
        "routing_number": "121141822"
      }
    ],
    "account_details": [
      {
        "account_number": "123456789"
      }
    ]
  },
  "metadata": {
    "User ID": "123"
  }
}
Suggest Edits

Async Create Payment Order

Create a new payment order asynchronously

 

Basic Auth

 Authentication is required for this endpoint.
posthttps://app.moderntreasury.com/api/payment_orders/create_async
curl --request POST \
  --url https://app.moderntreasury.com/api/payment_orders/create_async
var request = require("request");

var options = { method: 'POST',
  url:
   'https://app.moderntreasury.com/api/payment_orders/create_async' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/payment_orders/create_async")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://app.moderntreasury.com/api/payment_orders/create_async");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/payment_orders/create_async"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "id": "c5f4009c-bdd6-4cc1-84b2-17974ac9e77a"
}
 

Takes the same arguments as Create Payment Order.

Suggest Edits

List Payment Orders

Get a list of all payment orders

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/payment_orders
curl --request GET \
  --url https://app.moderntreasury.com/api/payment_orders
var request = require("request");

var options = { method: 'GET',
  url: 'https://app.moderntreasury.com/api/payment_orders' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/payment_orders")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/payment_orders");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/payment_orders"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Query Params

page
int32
per_page
int32
type
string
 
Suggest Edits

Get Payment Order

Get details on a single payment order

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/payment_orders/id
curl --request GET \
  --url https://app.moderntreasury.com/api/payment_orders/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/payment_orders/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/payment_orders/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/payment_orders/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/payment_orders/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required
 
Suggest Edits

Update Payment Order

Update a payment order

 

Basic Auth

 Authentication is required for this endpoint.
patchhttps://app.moderntreasury.com/api/payment_orders/id
curl --request PATCH \
  --url https://app.moderntreasury.com/api/payment_orders/id
var request = require("request");

var options = { method: 'PATCH',
  url:
   'https://app.moderntreasury.com/api/payment_orders/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/payment_orders/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://app.moderntreasury.com/api/payment_orders/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/payment_orders/id"

response = requests.request("PATCH", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required

Body Params

status
string

To cancel a payment order, use cancelled. To redraft a returned payment order, use approved.

metadata
json

Additional data in the form of key-value pairs. Pairs can be removed by passing an empty string or null as the value.

receiving_account_id
string

When using receiving_account_id, you may pass the id of an external account or an internal account. If an external account is passed, you must pass a value for counterparty_id.

counterparty_id
string

Required when receiving_account_id is passed the ID of an external account.

type
string
amount
int32
direction
string
originating_account
string
currency
string
effective_date
date
priority
string
description
string
statement_descriptor
string
remittance_information
string
line_items
array of objects
amount
metadata
description
 

Cancellations

Note that cancellations will only work if status is one of pending, needs_approval, or approved. Payment orders can not be deleted through the API after they've been sent to the bank. Please contact Modern Treasury support for more information.

Updates

Certain attributes on the payment order are protected. They may only be updated when the payment order's status is needs_approval and it has not been approved by anyone yet inside the app. This is because these attributes affect the mechanics of the payment itself. If you want to update an already approved payment order, our recommendation would be to cancel it and create a new one.
If you attempt to update a protected attribute when it may not be updated, the request will still respond with a 200 status code, but the response body will contain the original data. This indicates that the attribute was not updated.
The following are the protected attributes: type, direction, originating_account, receiving_account_id, counterparty_id, amount, currency, effective_date, statement_descriptor, remittance_information.

Suggest Edits

Expected Payment Object

 

An expected_payment is information about a payment you expect to occur in your bank account. Unlike payment orders, these are payments that are not initiated by the Modern Treasury system. Instead, you may be receiving money or could be charged by someone else. Some examples are receiving funding from a capital call via a wire or being debited by a vendor.
The Modern Treasury system attempts to connect expected payments to transactions to enable reconciliation even when you didn't initiate a payment. Some fields are required, as you will see below. For example, we need to know the direction and internal_account. Other fields, such as the counterparty and statement_descriptor help us to be more accurate in our automatic reconciliation.
You will notice the use of ranges for both the amount and date on the expected payment. This is because sometimes you aren't quite sure about these values. For example, you may expect a $10-15 charge between Monday and Wednesday. You would specify this using the lower and upper bound fields for each. If you know the values precisely, you can simply make the bounds equal.

Attribute
Description

id
string

Unique identifier for the expected payment.

type
string

One of ach, wire, or check.

amount_upper_bound
int32

The highest amount this expected payment may be equal to.
Value in specified currency's smallest unit. e.g. $10 would be represented as 1000.

amount_lower_bound
int32

The lowest amount this expected payment may be equal to.
Value in specified currency's smallest unit. e.g. $10 would be represented as 1000.

currency
string

Must conform to ISO 4217. Defaults to USD.

direction
string

One of credit, debit

When you are receiving money, use credit.

When you are being charged, use debit.

internal_account_id
string

The ID of one of your organization's List Internal Accounts.

date_upper_bound
date

The latest date the payment may come in.
Format: yyyy-mm-dd

date_lower_bound
date

The earliest date the payment may come in.
Format: yyyy-mm-dd

statement_descriptor
string

The statement description you expect to see on the transaction.

For ACH payments, this will be the full line item passed from the bank.

For wire payments, this will be the OBI field on the wire.

For check payments, this will be the memo field.

metadata
object

Additional data represented as key-value pairs. Both the key and value must be strings or integers. See Metadata.

counterparty_id
string

The ID of the counterparty you expect for this payment.

transaction_id
string

The ID of the Transaction this expected payment object has been matched to.

transaction_line_item_id
string

The ID of the Transaction Line Item this expected payment has been matched to.

status
string

One of unreconciled, reconciled, or archived.

{
  "id": "afc256b0-dab8-4b9a-98c1-735fc23204ce",
  "object": "expected_payment",
  "type": "wire",
  "amount_upper_bound": 20000,
  "amount_lower_bound": 20000,
  "direction": "credit",
  "internal_account_id": "0f8e3719-3dfd-4613-9bbf-c0333781b59f",
  "currency": "USD",
  "date_upper_bound": "2018-11-08",
  "date_lower_bound": "2018-11-08",
  "statement_descriptor": "PMT1234",
  "metadata": {},
  "counterparty_id": "37ba4454-dd33-4aa0-8906-0e2e4103e45c",
  "transaction_id": null,
  "transaction_line_item_id": null,
  "status": "unreconciled"
}
Suggest Edits

Create Expected Payment

 

Basic Auth

 Authentication is required for this endpoint.
posthttps://app.moderntreasury.com/api/expected_payments
curl --request POST \
  --url https://app.moderntreasury.com/api/expected_payments
var request = require("request");

var options = { method: 'POST',
  url: 'https://app.moderntreasury.com/api/expected_payments' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/expected_payments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://app.moderntreasury.com/api/expected_payments");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/expected_payments"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Body Params

amount_upper_bound
int32
required
amount_lower_bound
int32
required
direction
string
required
internal_account_id
string
required
type
string
currency
string
date_upper_bound
date
date_lower_bound
date
statement_descriptor
string
metadata
json
line_items
array of objects
amount
metadata
description
counterparty_id
string
 
Suggest Edits

Example Requests

 

Expecting to be charged

The following request will indicate that you are expecting to be charged $10.

{
  "direction": "debit",
  "amount_lower_bound": 1000,
  "amount_upper_bound": 1000,
  "internal_account_id": "<Internal Account ID>"
}

Expecting to receive money

The following request will indicate that you're expecting to receive $200,000

{
  "direction": "credit",
  "amount_lower_bound": 20000000,
  "amount_upper_bound": 20000000,
  "internal_account_id": "<Internal Account ID>"
}

Using Ranges

The following request uses ranges to show that you're expecting to receive between $100-$110, somewhere on the dates 1/28/2019-1/30/2019. If a transaction doesn't match these criteria, it wouldn't be reconciled to the expected payment

{
  "direction": "credit",
  "amount_lower_bound": 10000,
  "amount_upper_bound": 11000,
  "internal_account_id": "<Internal Account ID>",
  "date_lower_bound": "2019-01-28",
  "date_upper_bound": "2019-01-29"
}

Using counterparties

You may attach counterparty information to help us match the expected payment to transactions. This may be helpful. Often in bank transfers, your counterparty's name and/or bank details will be attached.

You may use either details from an existing counterparty or new information not attached to any counterparty. If you provide both, we will use the existing counterparty's data

{
  "direction": "credit",
  "amount_lower_bound": 20000000,
  "amount_upper_bound": 20000000,
  "internal_account_id": "<Internal Account ID>",
  "counterparty_id": "a009f8e7-11f4-43f7-b46d-024b951cf930"
}
{
  "direction": "credit",
  "amount_lower_bound": 20000000,
  "amount_upper_bound": 20000000,
  "internal_account_id": "<Internal Account ID>",
  "counterparty_name": "James Potter",
  "counterparty_bank_routing_number": "021000021"
}
Suggest Edits

List Expected Payments

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/expected_payments
curl --request GET \
  --url https://app.moderntreasury.com/api/expected_payments
var request = require("request");

var options = { method: 'GET',
  url: 'https://app.moderntreasury.com/api/expected_payments' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/expected_payments")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/expected_payments");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/expected_payments"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Query Params

page
int32
per_page
int32
status
string
internal_account_id
string
direction
string
type
string
counterparty_id
string
 
Suggest Edits

Get Expected Payment

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/expected_payments/id
curl --request GET \
  --url https://app.moderntreasury.com/api/expected_payments/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/expected_payments/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/expected_payments/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/expected_payments/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/expected_payments/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required
 
Suggest Edits

Line Item Object

 

A line_item is additional information that can be included on a payment order or an expected payment that represents a specific sub-amount. Line items will always sum to the total of the parent payment order or expected payment. Metadata is internal to Modern Treasury and will never be sent to your bank or be seen by your counterparties.

As an example, Company A is sending $100 to Company B to pay an invoice for two $50 widgets. Company A wants to track this information and creates a $100 Payment Order with two line items for $50 each and a unique description for each.

Attribute
Description

id
string

Unique identifier for the line item.

amount
int32

Value in specified currency's smallest unit. e.g. $10 would be represented as 1000.

description
string

A free-form description of the line item.

metadata
object

Additional data represented as key-value pairs. Both the key and value must be strings or integers. See Metadata.

{
  "id": "ca12b3ec-884f-41f7-bde8-43e813dab5fa",
  "amount": 20000,
  "description": "Principal For Loan #123",
  "metadata": {
    "Type": "Principal"
  }
}
Suggest Edits

List Line Items

Get a list of line items

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items
curl --request GET \
  --url https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

[
  {
    "id": "ca12b3ec-884f-41f7-bde8-43e813dab5fa",
    "amount": 20000,
    "description": "Principal For Loan #123",
    "metadata": {
      "Type": "Principal"
    }
  },
  {
    "id": "79517340-38bc-4bca-bd43-156c1333bb6b",
    "amount": 200,
    "description": "Interest For Loan #123",
    "metadata": {
      "Type": "Interest"
    }
  }
]

Path Params

itemizable_type
string
required

One of payment_orders or expected_payments

itemizable_id
string
required

The ID of the payment order or expected payment

Query Params

page
int32
per_page
int32
 
Suggest Edits

Get Line Item

Get a single line item

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items/id
curl --request GET \
  --url https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "id": "ca12b3ec-884f-41f7-bde8-43e813dab5fa",
  "amount": 20000,
  "description": "Principal For Loan #123",
  "metadata": {
    "Type": "Principal"
  }
}

Path Params

itemizable_type
string
required

One of payment_orders or expected_payments

itemizable_id
string
required

The ID of the payment order or expected payment

id
string
required

The ID of the line item.

 
Suggest Edits

Update Line Item

Update a single line item

 

Basic Auth

 Authentication is required for this endpoint.
patchhttps://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items/id
curl --request PATCH \
  --url https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items/id
var request = require("request");

var options = { method: 'PATCH',
  url:
   'https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/itemizable_type/itemizable_id/line_items/id"

response = requests.request("PATCH", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "id": "ca12b3ec-884f-41f7-bde8-43e813dab5fa",
  "amount": 20000,
  "description": "Principal For Loan #123",
  "metadata": {
    "Type": "Principal"
  }
}

Path Params

itemizable_type
string
required

One of payment_orders or expected_payments

itemizable_id
string
required

The ID of the payment order or expected payment

id
string
required

The ID of the line item.

Body Params

metadata
json
 
Suggest Edits

Counterparty Object

 

A counterparty is an entity outside of your organization that you want to send or receive money from. They can be an individual or a business.

Attribute
Description

id
string

Unique identifier for the counterparty.

name
string

A human friendly name for this counterparty.

accounts
array

The accounts for this counterparty.
See Account for additional details.

email
string

The counterparty's email.

metadata
object

Additional data represented as key-value pairs. Both the key and value must be strings or integers. See Metadata.

send_remittance_advice
boolean

Send an email to the counterparty whenever an associated payment order is sent to the bank.

{
  "id": "928db55e-6552-4aaf-96d7-10c693922b1f",
  "name": "John Smith",
  "email": "abby@marquardtschuppe.net",
  "send_remittance_advice": true,
  "metadata": {},
  "accounts": [
    {
      "id": "c8d059bc-e781-4528-9359-d46eaaa7f953",
      "account_type": null,
      "party_name": "John Smith",
      "party_type": "business",
      "party_address": null,
      "account_details": [
        {
          "id": "3036a533-53ad-4e58-ba30-33c4d75c0c57",
          "account_number": "1293291291",
          "account_number_type": null
        }
      ],
      "routing_details": [
        {
          "id": "e8626e0b-2687-4b0d-9f2c-68a4c29ee5f1",
          "payment_type": null,
          "routing_number": "121141822",
          "routing_number_type": "aba"
        }
      ]
    }
  ]
}
Suggest Edits

Create Counterparty

Create a new counterparty

 

Basic Auth

 Authentication is required for this endpoint.
posthttps://app.moderntreasury.com/api/counterparties
curl --request POST \
  --url https://app.moderntreasury.com/api/counterparties
var request = require("request");

var options = { method: 'POST',
  url: 'https://app.moderntreasury.com/api/counterparties' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/counterparties")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://app.moderntreasury.com/api/counterparties");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/counterparties"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "id": "928db55e-6552-4aaf-96d7-10c693922b1f",
  "name": "John Smith",
  "email": "abby@marquardtschuppe.net",
  "metadata": {},
  "accounts": [
    {
      "id": "c8d059bc-e781-4528-9359-d46eaaa7f953",
      "account_type": null,
      "party_name": "John Smith",
      "party_type": "business",
      "party_address": null,
      "account_details": [
        {
          "id": "3036a533-53ad-4e58-ba30-33c4d75c0c57",
          "account_number": "1293291291",
          "account_number_type": null
        }
      ],
      "routing_details": [
        {
          "id": "e8626e0b-2687-4b0d-9f2c-68a4c29ee5f1",
          "payment_type": null,
          "routing_number": "121141822",
          "routing_number_type": "aba"
        }
      ]
    }
  ]
}

Body Params

name
string
required

A human friendly name for this counterparty.

accounts
array of objects

The accounts for this counterparty.

account_type
party_name
party_type
party_address 
account_details
routing_details
email
string

An optional email to assign to the counterparty.

metadata
json

Metadata to be added to the counterparty. Must be a JSON object.

send_remittance_advice
boolean
 
Suggest Edits

Example Requests

 

Creating a simple Counterparty

The following request will create a counterparty with just a name and a single account.

{
  "name": "Kenner, Bach & Ledeen",
  "accounts": [
    {
      "account_type": "checking",
      "routing_details": [
        {
          "routing_number_type": "aba",
          "routing_number": "026009593"
        }
      ],
      "account_details": [
        {
          "account_number": "123456789"
        }
      ]
    }
  ]
}

If your counterparty has two different routing numbers (e.g. separate wire/ACH routing instructions), multiple routing_details can be specified with different payment_type values.

{
  "name": "Kenner, Bach & Ledeen",
  "accounts": [
    {
      "account_type": "checking",
      "routing_details": [
        {
          "routing_number_type": "aba",
          "routing_number": "026009593",
          "payment_type": "wire"
        },
        {
          "routing_number_type": "aba",
          "routing_number": "011400495",
          "payment_type": "ach"
        }
      ],
      "account_details": [
        {
          "account_number": "123456789"
        }
      ]
    }
  ]
}

If you are trying to wire money to a counterparty, you'll need an address, you which you can include with their account information.

{
  "name": "John Smith",
  "accounts": [
    {
      "account_type": "checking",
      "party_type": "individual",
      "routing_details": [
        {
          "routing_number_type": "aba",
          "routing_number": "026009593",
          "payment_type": "wire"
        }
      ],
      "account_details": [
        {
          "account_number": "123456789"
        }
      ],
      "party_address": {
          "line1": "3rd Floor",
          "locality": "Tampa",
          "region": "FL",
          "postal_code": "33610",
          "country": "USA"
      }
    }
  ]
}

Creating a Counterparty without an account

If you do not know your Counterparty's account information, you can still create a counterparty record and add an account later.

{
  "name": "Kenner, Bach & Ledeen",
  "email": "kbl@example.com"
}
Suggest Edits

List Counterparties

Get a paginated list of all counterparties

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/counterparties
curl --request GET \
  --url https://app.moderntreasury.com/api/counterparties
var request = require("request");

var options = { method: 'GET',
  url: 'https://app.moderntreasury.com/api/counterparties' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/counterparties")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/counterparties");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/counterparties"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Query Params

page
int32
per_page
int32
 
Suggest Edits

Get Counterparty

Get details on a single counterparty

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/counterparties/id
curl --request GET \
  --url https://app.moderntreasury.com/api/counterparties/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/counterparties/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/counterparties/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/counterparties/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/counterparties/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required
 
Suggest Edits

Update Counterparty

Updates a given counterparty with new information

 

Basic Auth

 Authentication is required for this endpoint.
patchhttps://app.moderntreasury.com/api/counterparties/id
curl --request PATCH \
  --url https://app.moderntreasury.com/api/counterparties/id
var request = require("request");

var options = { method: 'PATCH',
  url:
   'https://app.moderntreasury.com/api/counterparties/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/counterparties/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://app.moderntreasury.com/api/counterparties/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/counterparties/id"

response = requests.request("PATCH", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required

The ID of the counterparty.

Body Params

name
string

A new name for the counterparty. Will only update if passed.

email
string

A new email for the counterparty

metadata
json

Additional data in the form of key-value pairs. Pairs can be removed by passing an empty string or null as the value

send_remittance_advice
boolean
 

Partial Updates

Only top-level fields that are passed will be updated, if you wish to keep a value unchanged, simply omit the information from the body of your request.

Suggest Edits

Collect Account Details

 

Basic Auth

 Authentication is required for this endpoint.
posthttps://app.moderntreasury.com/api/counterparties/id/collect_account
curl --request POST \
  --url https://app.moderntreasury.com/api/counterparties/id/collect_account
var request = require("request");

var options = { method: 'POST',
  url:
   'https://app.moderntreasury.com/api/counterparties/id/collect_account' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/counterparties/id/collect_account")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://app.moderntreasury.com/api/counterparties/id/collect_account");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/counterparties/id/collect_account"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "id": "928db55e-6552-4aaf-96d7-10c693922b1f",
  "is_resend": false
}

Path Params

id
string
required

The id of the counterparty

Body Params

direction
string
required

One of credit or debit. Use credit when you want to pay a counterparty. Use debit when you need to charge a counterparty. This field helps us send a more tailored email to your counterparties.

 

Resending the collect email

If you are still waiting on the counterparty's account information, you may resend them the email by calling this endpoint again. If you do that, the is_resend field will be true.

Suggest Edits

Delete Counterparty

 

Basic Auth

 Authentication is required for this endpoint.
deletehttps://app.moderntreasury.com/api/counterparties/id
curl --request DELETE \
  --url https://app.moderntreasury.com/api/counterparties/id
var request = require("request");

var options = { method: 'DELETE',
  url:
   'https://app.moderntreasury.com/api/counterparties/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/counterparties/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://app.moderntreasury.com/api/counterparties/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/counterparties/id"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required
 
Suggest Edits

Account Object

 

An account is a bank account that either belongs to you or belongs to a counterparty. We refer to these respectively as internal accounts and external accounts. Accounts contain the relevant name, address, entity type information necessary for making payments.

Occasionally banks have different routing numbers for ACH and wire payments. Modern Treasury makes it simple to capture this information in the form of routing details.

Attribute
Description

id
string

Unique identifier for the account.

account_type
string

Can be checking, savings or other.

party_name
string

The legal name of the entity which owns the account.

party_type
string

Either individual or business.

party_address
object

The address associated with the owner or null.

account_details
array object

An array of account detail objects.

routing_details
array object

An array of routing detail objects.

The following attributes are only present on Internal Accounts:

Attribute
Description

connection
object

Specifies which financial institution the accounts belong to.

currency
string

The currency of the account.

name
string

A nickname for the internal account

The following attributes are only present on External Accounts:

Attribute
Description

counterparty_id
string

The ID of the Counterparty.

intermediate_account_id
string

The ID of the External Account which is the intermediate account for payments. Most commonly null.

verification_status
string

The verification status of the external account. Can be one of unverified, pending_verification, or verified.

{
  "id": "f7b2fc7a-3f22-4f82-b651-fa9e2f8d2653",
  "object": "internal_account",
  "account_type": null,
  "party_name": "Your Company",
  "party_type": null,
  "party_address": {
    "id": "ad326417-4270-4156-8652-dfe1b2ec3ae8",
    "object": "address",
    "line1": "100 Universal City Plaza",
    "line2": null,
    "locality": "Universal City",
    "region": "CA",
    "postal_code": "91608",
    "country": "US"
  },
  "account_details": [
    {
      "id": "f3552822-38f5-4dd5-aa10-a5a2fce00ed6",
      "object": "account_detail",
      "account_number": "934",
      "account_number_type": "other"
    }
  ],
  "routing_details": [
    {
      "id": "2e90da60-405c-44bc-8b33-2bdb9419afe3",
      "object": "routing_detail",
      "payment_type": null,
      "routing_number": "021000021",
      "routing_number_type": "aba",
      "bank_name": "Gringotts Wizarding Bank",
      "bank_address": {
        "id": "fcf5ebe1-b990-4684-880f-f69c277106bb",
        "object": "address",
        "line1": "6000 Universal Boulevard",
        "line2": null,
        "locality": "Orlando",
        "region": "FL",
        "postal_code": "32819",
        "country": "US"
      }
    }
  ],
  "connection": {
    "id": "e680b151-c8a2-4b36-aa6b-059f9f2a969c",
    "object": "connection",
    "vendor_id": "example1",
    "vendor_name": "Gringotts Wizarding Bank"
  },
  "currency": "USD"
}
{
  "id": "22c19f2f-14cf-4a17-b5d0-c6838e3eaeb3",
  "object": "external_account",
  "account_type": "checking",
  "party_name": "Mitchell LLC",
  "party_type": "business",
  "party_address": {
    "id": "4076977f-aa24-4273-b18f-a5e9f585550a",
    "object": "address",
    "line1": "680 Darron Flats",
    "line2": null,
    "locality": "Lake Boville",
    "region": "WV",
    "postal_code": "36045-2227",
    "country": "US"
  },
  "account_details": [
    {
      "id": "5668c0cf-972d-49c6-970f-b32591f3e8a6",
      "object": "account_detail",
      "account_number": "444444445",
      "account_number_type": "other"
    }
  ],
  "routing_details": [
    {
      "id": "a2d0e5c4-3058-4c04-9e75-d691a967305f",
      "object": "routing_detail",
      "payment_type": "wire",
      "routing_number": "021000021",
      "routing_number_type": "aba",
      "bank_name": "JPMORGAN CHASE BANK, NA",
      "bank_address": {
        "id": "29024065-ebd1-4a72-97b8-814108f14511",
        "object": "address",
        "line1": "14249 Stewart Ranch",
        "line2": null,
        "locality": "East Graham",
        "region": "IL",
        "postal_code": "75520",
        "country": "US"
      }
    },
    {
      "id": "ec6d8ad5-6bf6-4861-b748-0f2d3cf35191",
      "object": "routing_detail",
      "payment_type": "ach",
      "routing_number": "021000021",
      "routing_number_type": "aba",
      "bank_name": "JPMORGAN CHASE BANK, NA",
      "bank_address": {
        "id": "16b7e236-6170-4fa9-9fb7-706edf7d3ff1",
        "object": "address",
        "line1": "504 Jakubowski Lodge",
        "line2": null,
        "locality": "South Jamee",
        "region": "AZ",
        "postal_code": "27953-3448",
        "country": "US"
      }
    }
  ],
  "counterparty_id": "60df9366-c98e-4be9-a1af-163e792331cd",
  "intermediate_account_id": null,
  "verification_status": "unverified"
}
Suggest Edits

List Internal Accounts

Get a list of all internal accounts

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/internal_accounts
curl --request GET \
  --url https://app.moderntreasury.com/api/internal_accounts
var request = require("request");

var options = { method: 'GET',
  url: 'https://app.moderntreasury.com/api/internal_accounts' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/internal_accounts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/internal_accounts");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/internal_accounts"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Query Params

page
int32
per_page
int32
 
Suggest Edits

Get Internal Account

Get details on a single internal account

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/internal_accounts/id
curl --request GET \
  --url https://app.moderntreasury.com/api/internal_accounts/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/internal_accounts/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/internal_accounts/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/internal_accounts/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/internal_accounts/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required

The ID of the internal account.

 
Suggest Edits

Update Internal Account

 

Basic Auth

 Authentication is required for this endpoint.
patchhttps://app.moderntreasury.com/api/internal_accounts/id
curl --request PATCH \
  --url https://app.moderntreasury.com/api/internal_accounts/id
var request = require("request");

var options = { method: 'PATCH',
  url:
   'https://app.moderntreasury.com/api/internal_accounts/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/internal_accounts/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://app.moderntreasury.com/api/internal_accounts/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/internal_accounts/id"

response = requests.request("PATCH", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required

Body Params

name
string

A nickname for the internal account

 
Suggest Edits

List External Accounts

Get a list of all external accounts

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/external_accounts
curl --request GET \
  --url https://app.moderntreasury.com/api/external_accounts
var request = require("request");

var options = { method: 'GET',
  url: 'https://app.moderntreasury.com/api/external_accounts' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/external_accounts");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Create External Account

Create a new external account

 

Basic Auth

 Authentication is required for this endpoint.
posthttps://app.moderntreasury.com/api/external_accounts
curl --request POST \
  --url https://app.moderntreasury.com/api/external_accounts
var request = require("request");

var options = { method: 'POST',
  url: 'https://app.moderntreasury.com/api/external_accounts' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://app.moderntreasury.com/api/external_accounts");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Body Params

party_name
string

If this value isn't provided, it will be inherited from the counterparty's name

account_type
string
counterparty_id
string
required
party_type
string
party_identifier
string
party_address
object
 
party_address.line1
string
party_address.line2
string
party_address.locality
string
party_address.region
string
party_address.postal_code
string
party_address.country
string
routing_details
array of objects
routing_number
routing_number_type
payment_type
account_details
array of objects
account_number
account_number_type
intermediate_account
object
 
intermediate_account.account_type
string
intermediate_account.party_name
string
intermediate_account.party_type
string
intermediate_account.party_address
object
 
intermediate_account.account_details
array of objects
intermediate_account.routing_details
array of objects
 
Suggest Edits

Get External Account

Get a single external account

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/external_accounts/id
curl --request GET \
  --url https://app.moderntreasury.com/api/external_accounts/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/external_accounts/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/external_accounts/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required

The ID of the external account.

 
Suggest Edits

Update External Account

 

Basic Auth

 Authentication is required for this endpoint.
patchhttps://app.moderntreasury.com/api/external_accounts/id
curl --request PATCH \
  --url https://app.moderntreasury.com/api/external_accounts/id
var request = require("request");

var options = { method: 'PATCH',
  url:
   'https://app.moderntreasury.com/api/external_accounts/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://app.moderntreasury.com/api/external_accounts/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts/id"

response = requests.request("PATCH", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required

Body Params

party_address
object
 
party_address.line1
string
party_address.line2
string
party_address.locality
string
party_address.region
string
party_address.postal_code
string
party_address.country
string
party_name
string
party_type
string

Either individual or business

account_type
string

Can be checking, savings or other

counterparty_id
string
 

Partial Updates

Only top-level fields that are passed will be updated, if you wish to keep a value unchanged, simply omit the information from the body of your request.

Counterparties

You may only add counterparties to external accounts which do not already have an assigned counterparty. You may not update the counterparty of an external account that has a pre-existing counterparty.

Suggest Edits

Delete External Account

 

Basic Auth

 Authentication is required for this endpoint.
deletehttps://app.moderntreasury.com/api/external_accounts/id
curl --request DELETE \
  --url https://app.moderntreasury.com/api/external_accounts/id
var request = require("request");

var options = { method: 'DELETE',
  url:
   'https://app.moderntreasury.com/api/external_accounts/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://app.moderntreasury.com/api/external_accounts/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts/id"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required
 
Suggest Edits

Verifying External Accounts

Micro-deposit Verification for External Accounts

 

Modern Treasury supports micro-deposit verification for its customers. This is a form of authenticating bank account ownership. There are two steps to using Modern Treasury micro-deposits.

  1. The first API call will deposit two small sums in the external account via ACH.

  2. The second API call is used to verify the amounts provided to you by your counterparty are correct.

These micro-deposits occur via payment orders. The payment orders will be created by Modern Treasury automatically. Fields that are used for internal usage, such as the internal description and metadata, may be edited on these payment orders. The fields that dictate the mechanics of the payment itself, such as the amount, counterparty, and payment type, may not be changed. The payment orders will also adhere to the rules system, which means a user may have to approve the micro-deposits before they are sent. If you want to bypass this, add into your rule that the amount must be greater than $1, as all micro-deposits are less than $1.

Rule Condition that will bypass micro-deposits

Rule Condition that will bypass micro-deposits

Suggest Edits

Initiate Verification

 

Basic Auth

 Authentication is required for this endpoint.
posthttps://app.moderntreasury.com/api/external_accounts/id/verify
curl --request POST \
  --url https://app.moderntreasury.com/api/external_accounts/id/verify
var request = require("request");

var options = { method: 'POST',
  url:
   'https://app.moderntreasury.com/api/external_accounts/id/verify' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts/id/verify")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://app.moderntreasury.com/api/external_accounts/id/verify");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts/id/verify"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "id": "0f8e3719-3dfd-4613-9bbf-c0333781b59f",
  "account_type": null,
  "party_name": "Modern Treasury",
  "party_type": null,
  "party_address": null,
  "account_details": [
    {
      "id": "aaf74f7e-d697-4a73-95a3-05bede2edce6",
      "account_number": "1293291291",
      "account_number_type": null
    }
  ],
  "routing_details": [
    {
      "id": "a3649136-f8d2-46e8-8b41-327bd7da3110",
      "payment_type": null,
      "routing_number": "121141822",
      "routing_number_type": "aba"
    }
  ],
  "verification_status": "pending_verification"
}
{
  "errors": {
    "code": "parameter_invalid",
    "message": "The external account is already verified",
    "parameter": "external_account"
  }
}
{
  "errors": {
    "code": "parameter_invalid",
    "message": "The internal account does not have both credit and debit capabilities, which are required to do micro-deposits",
    "parameter": "originating_account_id"
  }
}

Path Params

id
string
required

Body Params

originating_account_id
string
required

The ID of the internal account where the micro-deposits originate from. Both credit and debit capabilities must be enabled.

 

Valid Statuses

A new verification may only be started when the external account's verification_status is unverified. If a verification is in progress or has already been completed, a 422 response will be returned.

Debit capabilities must be enabled

In order to perform micro-deposit verification, the internal account that is used must have both credit and debit capabilities enabled. This allows the money to be pulled back after the account has been verified or when the verification fails. If the internal account has no debit capabilities, a 422 will be returned.

Suggest Edits

Complete Verification

 

Basic Auth

 Authentication is required for this endpoint.
posthttps://app.moderntreasury.com/api/external_accounts/id/complete_verification
curl --request POST \
  --url https://app.moderntreasury.com/api/external_accounts/id/complete_verification
var request = require("request");

var options = { method: 'POST',
  url:
   'https://app.moderntreasury.com/api/external_accounts/id/complete_verification' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts/id/complete_verification")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://app.moderntreasury.com/api/external_accounts/id/complete_verification");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts/id/complete_verification"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
  "id": "0f8e3719-3dfd-4613-9bbf-c0333781b59f",
  "account_type": null,
  "party_name": "Modern Treasury",
  "party_type": null,
  "party_address": null,
  "account_details": [
    {
      "id": "aaf74f7e-d697-4a73-95a3-05bede2edce6",
      "account_number": "1293291291",
      "account_number_type": null
    }
  ],
  "routing_details": [
    {
      "id": "a3649136-f8d2-46e8-8b41-327bd7da3110",
      "payment_type": null,
      "routing_number": "121141822",
      "routing_number_type": "aba"
    }
  ],
  "verification_status": "verified"
}
{
  "errors": {
    "code": "parameter_invalid",
    "message": "The entered amounts are invalid",
    "parameter": "amounts"
  }
}
{
  "errors": {
    "code": "parameter_invalid",
    "message": "The verification has had too many failures. In order to verify this account, begin a new verification.",
    "parameter": "amounts"
  }
}

Path Params

id
string
required

Body Params

amounts
array of integers

Two integer amounts

 

Limit on failed verifications

This endpoint can only be called unsuccessfully 5 times. After that, this verification attempt will fail and a new verification process must be started.

Expiration Window

If the verification attempt is not verified within 2 months of the micro-deposits, it will be considered expired. The money will be pulled back and the field external_account.verification_status will become unverified. An expired webhook event will be sent.

Suggest Edits

Routing Detail Object

 

A routing_detail object represents the specific routing information required to transact with someone's bank account. A single bank account in the United States often has different instructions for ACH, domestic wires, and international wires. Using routing details we can encapsulate all these different routing instructions and assign them to a single account.

Attribute
Description

id
string

The ID of the routing detail.

payment_type
string

If the routing detail is to be used for a specific payment type this field will be populated, otherwise null.

routing_number
string

The routing number of the bank.

routing_number_type
string

Either aba or swift.

bank_name
string

The name of the bank.

bank_address
object

The address of the bank.

{
  "id": "2e90da60-405c-44bc-8b33-2bdb9419afe3",
  "object": "routing_detail",
  "payment_type": null,
  "routing_number": "021000021",
  "routing_number_type": "aba",
  "bank_name": "Gringotts Wizarding Bank",
  "bank_address": {
    "id": "fcf5ebe1-b990-4684-880f-f69c277106bb",
    "object": "address",
    "line1": "6000 Universal Boulevard",
    "line2": null,
    "locality": "Orlando",
    "region": "FL",
    "postal_code": "32819",
    "country": "US"
  }
}
Suggest Edits

List Routing Details

Get a list of routing details for a single external account

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details
curl --request GET \
  --url https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

external_account_id
string
required

The ID of the external account.

 
Suggest Edits

Create Routing Detail

Create a routing detail for a single external account

 

Basic Auth

 Authentication is required for this endpoint.
posthttps://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details
curl --request POST \
  --url https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details
var request = require("request");

var options = { method: 'POST',
  url:
   'https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

external_account_id
string
required

The ID for the external account.

Body Params

routing_number
string
required
routing_number_type
string
required
payment_type
string
bank_name
string

Required if routing_number_type is swift.

bank_address
object

Required if routing_number_type is swift.

 
bank_address.line1
string
bank_address.line2
string
bank_address.locality
string
bank_address.region
string
bank_address.postal_code
string
bank_address.country
string
 
Suggest Edits

Get Routing Detail

Get a single routing detail

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details/id
curl --request GET \
  --url https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

external_account_id
string
required

The ID of the external account.

id
string
required

The ID of the routing detail.

 
Suggest Edits

Delete Routing Detail

 

Basic Auth

 Authentication is required for this endpoint.
deletehttps://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details/id
curl --request DELETE \
  --url https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details/id
var request = require("request");

var options = { method: 'DELETE',
  url:
   'https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts/external_account_id/routing_details/id"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

external_account_id
string
required
id
string
required
 
Suggest Edits

Account Detail Object

 

An account_detail object represents all account numbers related to a specific bank account. Often bank accounts will only have a single number but having multiple is more common outside the United States. For example in some countries, the IBAN is used for international routing but domestic payments will use a separate unformatted account number. Modern Treasury allows you to provide both account numbers and our software will choose the correct one in all cases.

Attribute
Description

account_number
string

The account number for the bank account.

account_number_type
string

Supports iban and clabe, otherwise null if the bank account number is in a generic format.

{
  "id": "f3552822-38f5-4dd5-aa10-a5a2fce00ed6",
  "object": "account_detail",
  "account_number": "934",
  "account_number_type": "other"
}
Suggest Edits

List Account Details

Get a list of account details for a single external account

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/external_accounts/external_account_id/account_details
curl --request GET \
  --url https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

external_account_id
string
required

The ID of the external account.

 
Suggest Edits

Create Account Detail

Create an account detail for an external account

 

Basic Auth

 Authentication is required for this endpoint.
posthttps://app.moderntreasury.com/api/external_accounts/external_account_id/account_details
curl --request POST \
  --url https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details
var request = require("request");

var options = { method: 'POST',
  url:
   'https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

external_account_id
string
required

The ID of the external account.

Body Params

account_number
string
required
account_number_type
string
 
Suggest Edits

Get Account Detail

Get a single account detail for an external account

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/external_accounts/external_account_id/account_details/id
curl --request GET \
  --url https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

external_account_id
string
required

The ID of the external account.

id
string
required

the ID of the account detail.

 
Suggest Edits

Delete Account Detail

 

Basic Auth

 Authentication is required for this endpoint.
deletehttps://app.moderntreasury.com/api/external_accounts/external_account_id/account_details/id
curl --request DELETE \
  --url https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details/id
var request = require("request");

var options = { method: 'DELETE',
  url:
   'https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/external_accounts/external_account_id/account_details/id"

response = requests.request("DELETE", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

external_account_id
string
required
id
string
required
 
Suggest Edits

Transaction Object

 

A transaction is an individual entry as it would appear in your bank's portal or statement. Throughout a given business day the bank may send you "pending" transactions which are notifications of activity that will post by the end of the business day. Pending transactions will have a posted value of false and are deleted at the end of the business day. In their place, will be posted transactions that are the final record of activity for that given business day.

Given the immutability of posted transactions, none of attributes outside of metadata are editable.

Attribute
Description

id
string

Unique identifier for the transaction.

amount
int32

Value in specified currency's smallest unit. e.g. $10 would represented as 1000.

currency
string

Currency that this transaction is denominated in.

direction
string

Either credit or debit.

vendor_description
string

The transaction detail text that often appears in on your bank statement and in your banking portal.

vendor_code
string

When applicable, the bank-given code that determines the transaction's category. For most banks this is the BAI2/BTRS transaction code.

vendor_id
string

An identifier given to this transaction by the bank.

as_of_date
date

The date on which the transaction occurred.

as_of_time
time

The time on which the transaction occurred. Depending on the granularity of the timestamp information received from the bank, it may be null.

internal_account_id
string

The ID of the account for this transaction.

metadata
object

Additional data represented as key-value pairs. Both the key and value must be strings or integers. See Metadata

posted
boolean

This field will be true if the transaction has posted to the account.

vendor_customer_id
string

An identifier given to this transaction by the bank, often null.

reconciled
boolean

This field will be true if a transaction is reconciled by the Modern Treasury system. This means that it has transaction line items that sum up to the transaction's amount.

{
  "id": "7fb6c79f-5100-4929-8622-a62c247187d8",
  "amount": 20000,
  "currency": "USD",
  "direction": "debit",
  "vendor_description": "Generic Money Transfer",
  "vendor_code": "495",
  "vendor_id": null,
  "as_of_date": "2018-11-07",
  "as_of_time": null,
  "internal_account_id": "dcac4afe-41b5-4963-a1e5-9abc06e99c00",
  "metadata": {},
  "posted": true,
  "vendor_customer_id": null,
  "reconciled": false
}
Suggest Edits

List Transactions

Get a list of all transactions

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/transactions
curl --request GET \
  --url https://app.moderntreasury.com/api/transactions
var request = require("request");

var options = { method: 'GET',
  url: 'https://app.moderntreasury.com/api/transactions' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/transactions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/transactions");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/transactions"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Query Params

page
int32
per_page
int32
internal_account_id
string

Specify internal_account_id if you wish to see transactions to/from a specific account.

posted
boolean

Either true or false

as_of_date_start
date

Filters transactions with a as_of_date starting on or after the specified date (YYYY-MM-DD).

as_of_date_end
date

Filters transactions with a as_of_date starting on or before the specified date (YYYY-MM-DD).

 
Suggest Edits

Get Transaction

Get details on a single transaction

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/transactions/id
curl --request GET \
  --url https://app.moderntreasury.com/api/transactions/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/transactions/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/transactions/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/transactions/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/transactions/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required
 
Suggest Edits

Update Transaction

Update a single transaction

 

Basic Auth

 Authentication is required for this endpoint.
patchhttps://app.moderntreasury.com/api/transactions/id
curl --request PATCH \
  --url https://app.moderntreasury.com/api/transactions/id
var request = require("request");

var options = { method: 'PATCH',
  url:
   'https://app.moderntreasury.com/api/transactions/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/transactions/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PATCH", "https://app.moderntreasury.com/api/transactions/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/transactions/id"

response = requests.request("PATCH", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required

The ID of the transaction.

Body Params

metadata
json
 

Only posted transactions are editable.

Suggest Edits

Transaction Line Item Object

 

A transaction_line_item represents a subset of a transaction. This often occurs for ACH transactions where a single bulk transaction is comprised of multiple individual line items. For example, if 100 Payment Orders are sent to the bank on a single day and each payment order is a $5 credit, the next day you will receive only a single transaction for the activity. While this could be the full $500 debit, oftentimes banks will hold individual payment orders for longer processing and some items might have been returned. This leads to cases where the full breakdown of a transaction is unclear or requires manual work to reconcile.

Modern Treasury removes the guesswork of figuring out these cases by automatically creating line items for these transactions using information from the bank. We automatically reconcile all activity for Payment Orders created through the system, allowing you full visibility into your bank statements. Modern Treasury will only link the payment orders to transaction line items when we are 100% sure of the match. If we are not, the transactable association will remain null.

Attribute
Description

id
string

Unique identifier for the line item.

transactable_type
string

If a matching object exists in Modern Treasury, the type will be populated here, otherwise null.
This can be one of payment_order, expected_payment, paper_item, or return.

transactable_id
string

If a matching object exists in Modern Treasury, the id will be populated here, otherwise null.

amount
int32

If no matching object is found, amount will be populated. Value in specified currency's (taken from parent Transaction) smallest unit.

description
string

If no matching object is found, description will be a free-form text field describing the line item.

counterparty_id
string

The ID for the counterparty for this transaction line item.

expected_payment_id
string

The ID of the reconciled Expected Payment otherwise null.

{
  "id": "21bfd337-5d13-4c9a-8f9e-2409023d9627",
  "transactable_type": null,
  "transactable_id": null,
  "amount": 1000,
  "description": "Generic Line Item"
}
Suggest Edits

List Transaction Line Items

Get a list of transaction line items for a specific transaction

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/transactions/transaction_id/line_items
curl --request GET \
  --url https://app.moderntreasury.com/api/transactions/transaction_id/line_items
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/transactions/transaction_id/line_items' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/transactions/transaction_id/line_items")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/transactions/transaction_id/line_items");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/transactions/transaction_id/line_items"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

transaction_id
string
required

The ID of the parent Transaction.

Query Params

page
int32
per_page
int32
 
Suggest Edits

Return Object

 

A return represents a rejection of a single payment order. This can occur for a variety of reasons and often results in your originating bank returning your funds as well as issuing a notification with additional details. These additional details result in a return being generated in the Modern Treasury system.

Note that sometimes, banks will process a return prior to recording a transaction. This is why both transaction_id and transaction_line_item_id below may be null.

Attribute
Description

id
string

Unique identifier for the return.

amount
int32

Value in specified currency's smallest unit. e.g. $10 would be represented as 1000.

currency
string

Currency that this transaction is denominated in.

return_type
string

The payment method which is being returned, often ach and wire.

code
string

The return code. For ach returns, see ACH Return Reason Codes.

reason
string

Often the bank will provide an explanation for the return, which is a short human readable string.

transaction_line_item_id
string

The ID of the relevant Transaction Line Item or null.

transaction_id
string

The ID of the relevant Transaction or null.

returnable_id
string

The ID of the object being returned or null.

returnable_type
string

The type of object being returned or null.

{
  "id": "08c251e1-4cba-4706-8faa-9c2df2682aa3",
  "object": "return",
  "returnable_id": "641f5b0d-c92b-4952-82b2-097c00217d05",
  "returnable_type": "payment_order",
  "transaction_line_item_id": "c3e5412c-6e70-4df6-8c90-a7c9dad7dc72",
  "transaction_id": "4f898a70-6aeb-41f8-9b98-82e42f54cad8",
  "return_type": "ach",
  "amount": 20000,
  "currency": "USD",
  "code": "R01",
  "reason": "Insufficient Funds"
}
Suggest Edits

List Returns

Get a list of returns

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/returns
curl --request GET \
  --url https://app.moderntreasury.com/api/returns
var request = require("request");

var options = { method: 'GET',
  url: 'https://app.moderntreasury.com/api/returns' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/returns")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/returns");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/returns"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results
 
Suggest Edits

Get Return

Get a single return

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/returns/id
curl --request GET \
  --url https://app.moderntreasury.com/api/returns/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/returns/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/returns/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/returns/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/returns/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required
 
Suggest Edits

Address Object

 

An address object contains the necessary data fields for a mailing address and can be attached to many different objects in the platform.

Attribute
Description

id
string

A unique identifier for the address.

line1
string

Line 1.

line2
string

Line 2.

locality
string

Locality or City.

region
string

Region or State.

postal_code
string

Postal Code.

country
string

Country code conforms to ISO 3166-1 alpha-3.

{
  "id": "4b0f10be-a84b-42e0-b59b-e3026c408212",
  "line1": "84 Beacon St.",
  "line2": null,
  "locality": "Boston",
  "region": "MA",
  "postal_code": "02108",
  "country": "USA"
}
Suggest Edits

Paper Item Object

 

A paper_item represents a check, money order, etc. that has been received at your lockbox through the bank.

Attribute
Description

id
string

A unique identifier for the paper item.

transaction_line_item_id
string

The ID of the relevant Transaction Line Item or null.

transaction_id
string

The ID of the relevant Transaction or null.

status
string

The current status of the paper item. One of pending, completed, or returned.

lockbox_number
string

The identifier for the lockbox assigned by the bank.

deposit_date
date

The date the paper item was deposited into your organization's bank account.

amount
int

The amount of the paper item.

currency
string

The currency of the paper item.

routing_number
string

The routing number on the paper item.

account_number
string

The account number on the paper item.

check_number
string

The check number on the paper item.

remitter_name
string

The name of the remitter on the paper item.

memo_field
string

The memo field on the paper item.

{
  "id": "95dd2b4e-ead2-4167-a8c8-dc6cfcf20214",
  "object": "paper_item",
  "status": "pending",
  "lockbox_number": "6789",
  "deposit_date": "2018-11-29",
  "amount": 100000000,
  "currency": "USD",
  "routing_number": "021000021",
  "account_number": "12345",
  "check_number": "5000",
  "remitter_name": "Carl Quigley",
  "memo_field": "New Bike"
}
Suggest Edits

List Paper Items

Get a list of all paper items

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/paper_items
curl --request GET \
  --url https://app.moderntreasury.com/api/paper_items
var request = require("request");

var options = { method: 'GET',
  url: 'https://app.moderntreasury.com/api/paper_items' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/paper_items")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/paper_items");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/paper_items"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Query Params

lockbox_number
string

Specify a value to filter by lockbox_number

deposit_date_start
date

Specify a start date (YYYY-MM-DD) when filtering by deposit_date

deposit_date_end
date

Specify an end date (YYYY-MM-DD) when filtering by deposit_date

 
Suggest Edits

Get Paper Item

Get a single paper item

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/paper_items/id
curl --request GET \
  --url https://app.moderntreasury.com/api/paper_items/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/paper_items/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/paper_items/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/paper_items/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/paper_items/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

id
string
required
 
Suggest Edits

Balance Report Object

 

A balance_report is a collection of balances at a specific point in time. intraday balance reports come throughout the business day and indicate the intra-business-day activity within the account. previous_day reports come at the end of the business day and will often indicate the final opening and closing balances.

Attribute
Description

id
string

The unique identifier for the balance report.

balance_report_type
string

The specific type of balance report. One of intraday, previous_day, or other.

as_of_date
date

The date of the balance report in local time.

as_of_time
string

The time (24-hour clock) of the balance report in local time.

balances
array of balance objects

An array of Balance objects.

{
  "id": "c570ac34-cade-48d2-87ff-28d7216a8af5",
  "object": "balance_report",
  "balance_report_type": "previous_day",
  "as_of_date": "2018-11-28",
  "as_of_time": "23:46",
  "balances": [
    {
      "id": "1f4b0995-338e-41ed-93c4-a41ed8312312",
      "object": "balance",
      "amount": 1033236,
      "currency": "USD",
      "balance_type": "opening_ledger",
      "vendor_code": "010"
    },
    {
      "id": "98326522-b74d-4332-a78a-68991d737015",
      "object": "balance",
      "amount": 1033236,
      "currency": "USD",
      "balance_type": "closing_ledger",
      "vendor_code": "015"
    },
    {
      "id": "70bee3ea-6f2f-4764-ac1d-4e6b9fe4563a",
      "object": "balance",
      "amount": 1033236,
      "currency": "USD",
      "balance_type": "opening_available_next_business_day",
      "vendor_code": "040"
    },
    {
      "id": "e8e7676a-05db-49b3-a82f-0368e4aed4ba",
      "object": "balance",
      "amount": 1033236,
      "currency": "USD",
      "balance_type": "closing_available",
      "vendor_code": "045"
    },
    {
      "id": "156495cc-5483-4654-b4f2-863b6892c823",
      "object": "balance",
      "amount": 1032161,
      "currency": "USD",
      "balance_type": "other",
      "vendor_code": "050"
    }
  ]
}
Suggest Edits

Balance Object

 

A balance object is a specific number reported by your bank regarding your bank account balance. Often this is split up into many different categories depending on on how the bank handles its reporting.

Attribute
Description

id
string

The unique identifier for the balance.

amount
int

The balance amount.

currency
string

The currency of the balance.

balance_type
string

The specific type of balance reported. One of opening_ledger, closing_ledger, current_ledger, opening_available, opening_available_next_business_day, closing_available, current_available, or other.

vendor_code
string

The code used by the bank when reporting this specific balance.

{
  "id": "1f4b0995-338e-41ed-93c4-a41ed8312312",
  "object": "balance",
  "amount": 1033236,
  "currency": "USD",
  "balance_type": "opening_ledger",
  "vendor_code": "010"
}
Suggest Edits

List Balance Reports

Get all balance reports for a given internal account

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/internal_accounts/internal_account_id/balance_reports
curl --request GET \
  --url https://app.moderntreasury.com/api/internal_accounts/internal_account_id/balance_reports
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/internal_accounts/internal_account_id/balance_reports' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/internal_accounts/internal_account_id/balance_reports")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/internal_accounts/internal_account_id/balance_reports");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/internal_accounts/internal_account_id/balance_reports"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

internal_account_id
string
required
 
Suggest Edits

Get Balance Report

Get a single balance report for a given internal account

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/internal_accounts/internal_account_id/balance_reports/id
curl --request GET \
  --url https://app.moderntreasury.com/api/internal_accounts/internal_account_id/balance_reports/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/internal_accounts/internal_account_id/balance_reports/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/internal_accounts/internal_account_id/balance_reports/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/internal_accounts/internal_account_id/balance_reports/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/internal_accounts/internal_account_id/balance_reports/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

internal_account_id
string
required
id
string
required

Either the unique identifier of the balance report or latest for the latest balance report.

 
Suggest Edits

Document Object

 

A document represents a single file attached to a given resource. Often these are documents attached to payment orders to provide further context or image files for incoming checks.

Attribute
Description

id
string

The unique identifier for the document.

document_type
string

A category given to the document, can be null.

documentable_id
string

The unique identifier for the associated object.

documentable_type
string

The type of the associated object. Currently can be one of payment_order, transaction, or paper_item.

file.size
int32

The size of the document in bytes.

file.filename
string

The original filename of the document.

file.content_type
string

The MIME content type of the document.

{
  "id": "b05dd054-6eea-4cdd-9096-cf3fa8eb6fb7",
  "object": "document",
  "document_type": "Invoice",
  "documentable_id": "00ddb900-317f-4436-8b79-6329c924ef27",
  "documentable_type": "payment_order",
  "file": {
    "size": 1558074,
    "filename": "invoice-6000.pdf",
    "content_type": "application/pdf"
  }
}
Suggest Edits

List Documents

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/documentable_type/documentable_id/documents
curl --request GET \
  --url https://app.moderntreasury.com/api/documentable_type/documentable_id/documents
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/documentable_type/documentable_id/documents' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/documentable_type/documentable_id/documents")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/documentable_type/documentable_id/documents");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/documentable_type/documentable_id/documents"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

documentable_id
string
required
documentable_type
string
required
 
Suggest Edits

Get Document

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/documentable_type/documentable_id/documents/id
curl --request GET \
  --url https://app.moderntreasury.com/api/documentable_type/documentable_id/documents/id
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/documentable_type/documentable_id/documents/id' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/documentable_type/documentable_id/documents/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/documentable_type/documentable_id/documents/id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/documentable_type/documentable_id/documents/id"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

documentable_type
string
required
documentable_id
string
required
id
string
required
 
Suggest Edits

Create Document

 

Basic Auth

 Authentication is required for this endpoint.
posthttps://app.moderntreasury.com/api/documentable_type/documentable_id/documents
curl --request POST \
  --url https://app.moderntreasury.com/api/documentable_type/documentable_id/documents
var request = require("request");

var options = { method: 'POST',
  url:
   'https://app.moderntreasury.com/api/documentable_type/documentable_id/documents' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/documentable_type/documentable_id/documents")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://app.moderntreasury.com/api/documentable_type/documentable_id/documents");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/documentable_type/documentable_id/documents"

response = requests.request("POST", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

documentable_id
string
required
documentable_type
string
required

Body Params

file
file
document_type
string
 
Suggest Edits

Download Document

 

Basic Auth

 Authentication is required for this endpoint.
gethttps://app.moderntreasury.com/api/documentable_type/documentable_id/documents/id/download
curl --request GET \
  --url https://app.moderntreasury.com/api/documentable_type/documentable_id/documents/id/download
var request = require("request");

var options = { method: 'GET',
  url:
   'https://app.moderntreasury.com/api/documentable_type/documentable_id/documents/id/download' };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://app.moderntreasury.com/api/documentable_type/documentable_id/documents/id/download")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://app.moderntreasury.com/api/documentable_type/documentable_id/documents/id/download");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/documentable_type/documentable_id/documents/id/download"

response = requests.request("GET", url)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Path Params

documentable_type
string
required
documentable_id
string
required
id
string
required
 

This endpoint will respond with an HTTP redirect to our file hosting service. The redirected URL contains temporary credentials so do not store this final location in your system.