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. If you have any issues or would like to request further support, please contact us.
Don't see your language?
Modern Treasury also maintains an OpenAPI specification.
If you'd like direct support for your language, please contact us letting us know which language you would like us to support next.
NodeJS
Our Node SDK is available as an npm package: https://www.npmjs.com/package/modern-treasury
You can also view the GitHub repo: 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
Our Python SDK is available through PyPI: https://pypi.org/project/modern-treasury/
You can also view the GitHub repo: 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
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
Our Java and Kotlin SDKs are available via Sonatype: Java / Kotlin
You can also view the Github repositories: Java / Kotlin