The Modern Treasury Developer Hub

Welcome to the Modern Treasury developer hub. You'll find comprehensive guides and documentation to help you start working with Modern Treasury as quickly as possible, as well as support if you get stuck. Let's jump right in!

Getting Started

 

Modern Treasury exposes a simple RESTful API to initiate ACH and wire 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.

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

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.

Supported Banks

 

Our API connects directly to your bank's internal systems over a secure interface. Currently we support Silicon Valley Bank (SVB), but we intend to add support for other banks soon. If you have a bank that we currently do not support, please feel free to reach out and we can work together on prioritization.

Bank Name
ACH?
Wire?
Check?
Lockbox?

Silicon Valley Bank

Yes1

Yes

Yes

Yes

1 Does not support IAT outside of payments to Canada

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.

Errors

 

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

Metadata

 

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"
}

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>

Overview

 

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 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.

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.

paper_item

Any paper item lifecycle event.

payment_order

Any payment order lifecycle event.

transaction

Any transaction lifecycle event.

Balance Reports

 
Event
Description

created

A balance report has been created.

Paper Items

 
Event
Description

created

A paper item has been created.

completed

A paper item has been reconciled with a transaction.

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.

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"
  }
}

Transactions

 
Event
Description

created

A transaction has been created.

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

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, or check.

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
object

The receiving account.

currency
string

Must conform to ISO 4217. Defaults to USD.

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.

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.

{
  "id": "c2c24b50-2c70-4c48-a481-617d74059e27",
  "type": "ach",
  "amount": 20000,
  "direction": "credit",
  "originating_account_id": "dcac4afe-41b5-4963-a1e5-9abc06e99c00",
  "receiving_account": {
    "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": "021000021",
        "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": "928db55e-6552-4aaf-96d7-10c693922b1f"
}

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": "c2c24b50-2c70-4c48-a481-617d74059e27",
  "type": "ach",
  "amount": 20000,
  "direction": "credit",
  "originating_account_id": "dcac4afe-41b5-4963-a1e5-9abc06e99c00",
  "receiving_account": {
    "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": "021000021",
        "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": "928db55e-6552-4aaf-96d7-10c693922b1f"
}

Body Params

type
string
required
amount
int32
required
direction
string
required
originating_account
string
required
receiving_entity
string

Either receiving_account or receiving_entity must be present. When using receiving_entity, 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.

receiving_account
object

Either receiving_account or receiving_entity must be present. If receiving_account is present then you can pass the required information inline.

 
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
effective_date
date
priority
string
description
string
statement_descriptor
string
remittance_information
string
line_items
array of objects
amount
metadata
description
metadata
json
counterparty
string

Required when receiving_entity is the id of an external account.

 

See Payment Order for detailed information on each field.

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": "<Internal Account ID>",
  "receiving_account": {
    "party_name": "Bob Loblaw",
    "account_type": "checking",
    "routing_details": [
      {
        "routing_number_type": "aba",
        "routing_number": "021000021"
      }
    ],
    "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": "<Internal Account ID>",
  "receiving_account": {
    "party_name": "Bob Loblaw",
    "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": "<Internal Account ID>",
  "receiving_entity": "<External Account ID>",
  "counterparty": "<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": "<Internal Account ID>",
  "receiving_account": {
    "party_name": "Bob Loblaw",
    "account_type": "checking",
    "routing_details": [
      {
        "routing_number_type": "aba",
        "routing_number": "021000021"
      }
    ],
    "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": "<Internal Account ID>",
  "receiving_account": {
    "party_name": "Bob Loblaw",
    "account_type": "checking",
    "routing_details": [
      {
        "routing_number_type": "aba",
        "routing_number": "021000021"
      }
    ],
    "account_details": [
      {
        "account_number": "123456789"
      }
    ]
  },
  "metadata": {
    "User ID": "123"
  }
}

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": "b0021e26-8709-4fdf-94a3-3625104a84a9"
}
 

Takes the same arguments as POST /payment_orders.

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
 

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
 

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.

 

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.

Line Item Object

 

A line_item is additional information that can be included on a payment order that represents a specific sub-amount. Line items will always sum to the total of the parent Payment Order. 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"
  }
}

List Line Items

Get a list of line items for a payment order

 

Basic Auth

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

var options = { method: 'GET',
  url: 'https://app.moderntreasury.com/api/payment_orders/payment_order_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/payment_orders/payment_order_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/payment_orders/payment_order_id/line_items");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/payment_orders/payment_order_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

payment_order_id
string
required

Query Params

page
int32
per_page
int32
 

Get Line Item

Get a single line item for a payment order

 

Basic Auth

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

var options = { method: 'GET',
  url: 'https://app.moderntreasury.com/api/payment_orders/id/line_items/line_item_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/line_items/line_item_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/line_items/line_item_id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/payment_orders/id/line_items/line_item_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

id
string
required

The ID of the payment order.

line_item_id
string
required

The ID of the line item.

 

Update Line Item

Update a single line item for a payment order

 

Basic Auth

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

var options = { method: 'PATCH',
  url: 'https://app.moderntreasury.com/api/payment_orders/id/line_items/line_item_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/line_items/line_item_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/line_items/line_item_id");

xhr.send(data);
import requests

url = "https://app.moderntreasury.com/api/payment_orders/id/line_items/line_item_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

id
string
required

The ID of the payment order.

line_item_id
string
required

The ID of the line item.

Body Params

metadata
json
 

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.

{
  "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": "021000021",
          "routing_number_type": "aba"
        }
      ]
    }
  ]
}

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": "021000021",
          "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.

 

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": "021000021"
        }
      ],
      "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": "021000021",
          "payment_type": "wire"
        },
        {
          "routing_number_type": "aba",
          "routing_number": "011401533",
          "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": "021000021",
          "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"
}

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
 

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
 

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

 

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.

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.

{
  "id": "dcac4afe-41b5-4963-a1e5-9abc06e99c00",
  "account_type": null,
  "party_name": "Modern Treasury",
  "party_type": null,
  "party_address": null,
  "account_details": [
    {
      "id": "74516645-8036-431e-9297-ecefabef18c3",
      "account_number": "1293291291",
      "account_number_type": null
    }
  ],
  "routing_details": [
    {
      "id": "13d529ab-2a61-42bf-9d1d-eeb02114900a",
      "payment_type": null,
      "routing_number": "021000021",
      "routing_number_type": "aba"
    }
  ]
}

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
 

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.

 

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

 

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
 

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
required
account_type
string
counterparty
string
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
 

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.

 

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
 

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": "13d529ab-2a61-42bf-9d1d-eeb02114900a",
  "payment_type": null,
  "routing_number": "021000021",
  "routing_number_type": "aba",
  "bank_name": "JPMORGAN CHASE BANK, NA"
}

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.

 

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
 

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.

 

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
 

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": "74516645-8036-431e-9297-ecefabef18c3",
  "account_number": "1293291291",
  "account_number_type": null
}

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.

 

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
 

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.

 

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
 

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.

{
  "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
}

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.

 

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
 

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.

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 either payment_order 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.

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

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
 

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.

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
 

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
 

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"
}

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.

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"
}

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
string

Specify a value to filter by deposit_date

 

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
 

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"
    }
  ]
}

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"
}

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
 

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.