API Libraries & SDKs

Client SDKs

Modern Treasury provides official libraries and SDKs for our API that are maintained by Modern Treasury and the community.

🚧

API Coverage

The current version of our server-side libraries support only a portion of our API routes. The current coverage is for core Payments and Ledgers workflows. We are actively adding support for Compliance. If you have any issues or would like to request further support, please contact us.

NodeJS

You can find installation instructions and documentation for our Node library on GitHub: https://github.com/Modern-Treasury/modern-treasury-node

import ModernTreasury from 'modern-treasury';

const modernTreasury = new ModernTreasury({
  apiKey: 'my api key', // defaults to process.env["MODERN_TREASURY_API_KEY"]
  organizationId: 'my-organization-ID',
});

async function main() {
  const counterparty = await modernTreasury.counterparties.create({
    name: 'my first counterparty',
  });

  console.log(counterparty.id);
}
main().catch(console.error);

Python

You can find installation instructions and documentation for our Python library on GitHub: https://github.com/Modern-Treasury/modern-treasury-python

from modern_treasury import ModernTreasury

modern_treasury = ModernTreasury(
    # defaults to os.environ.get("MODERN_TREASURY_API_KEY")
    api_key="my api key",
    organization_id="my-organization-ID",
)

counterparty = modern_treasury.counterparties.create({
    "name": "my first counterparty",
})

print(counterparty.id)

Go

🚧

Our Go SDK is currently in beta and is subject to breaking changes.

You can find installation instructions and documentation for our Go library on GitHub: https://github.com/Modern-Treasury/modern-treasury-go

package main

import (
    "context"
    "fmt"
    "github.com/Modern-Treasury/modern-treasury-go"
    "github.com/Modern-Treasury/modern-treasury-go/option"
)

func main() {
    client := moderntreasury.NewClient(
        option.WithOrganizationID("my-organization-ID"), // defaults to os.LookupEnv("MODERN_TREASURY_ORGANIZATION_ID")
        option.WithAPIKey("my api key"),                 // defaults to os.LookupEnv("MODERN_TREASURY_API_KEY")
    )
    externalAccount, err := client.ExternalAccounts.New(context.TODO(), moderntreasury.ExternalAccountNewParams{
        CounterpartyID: moderntreasury.F("9eba513a-53fd-4d6d-ad52-ccce122ab92a"),
        Name:           moderntreasury.F("my bank"),
    })
    if err != nil {
        panic(err.Error())
    }
    fmt.Printf("%+v\n", externalAccount)
}

Java/Kotlin

Modern Treasury has a private beta available for Java and Kotlin. For more information and to try out the private beta, please reach out to [email protected]

πŸ“˜

Looking for more languages?

Please contact us letting us know which language you would like us to support next.