Set Up Your Chart Structure

Setting up your chart structure includes the following steps:

When to use APIs/CLIs

  • APIs:

    • Ideal for bulk account creation or integration with other tools and workflows.

    • Enables automated updates and setup for multiple accounts.

  • CLI: Suitable for manual configuration or quick additions during testing and development.

1. Create a Chart

You can create a chart using either APIs for programmatic setup or the luca CLI for manual or scripted operations.

a) Using APIs: The Chart Management API allows you to create charts programmatically, making it ideal for automation and integration into workflows.

Refer to the Chart Management API Reference to create a chart.

b) Using the luca CLI: The luca CLI provides a straightforward way to create charts manually or through shell scripts.

Command

./luca write-chart <chart_name>

Example

./luca write-chart CHART_US

2. Add Accounts to a Chart

Accounts are essential components of a chart, representing specific financial entities or groups, such as operational accounts or customer accounts. Learn more about accounts in detail, besides the summary provided below.

a) Using APIs: Refer to the Account Management API Reference guide here.

b) Using the luca CLI: Use the following command to add accounts to charts manually or through shell scripts.

Command

./luca write-chart-account <chart_name> <account_ref> --create-parent

Example

./luca write-chart-account CHART_US MAIN_ACCOUNT --create-parent

Accounts are initialized in a "suspended state," meaning they cannot move money until they are opened. Wallets do not require activation and are valid by default. They open and close with the account.

Learn more about creating accounts, types, features, states, and metadata.

3. Add Wallets to Accounts

Associate wallets with accounts to handle specific currencies or assets.

a) Using APIs: The Wallet Management API allows you to create wallets programmatically, making it ideal for automation and integration into workflows.

Refer to the Wallet Management API Reference guide to create a chart.

b) Using the luca CLI: Use the following command to add wallets to accounts manually or through shell scripts.

Command

./luca write-chart-wallet <chart_name> <account_ref> <wallet_name> <currency> <type> --create-parent

Example

./luca write-chart-wallet CHART_US MAIN_ACCOUNT DEFAULT USD ASSET --create-parent

Learn more about wallets and its attributes.

Summary of APIs for Chart Management

Here’s a quick reference for the key API endpoints:

Action

Endpoint

Purpose

Create a Chart

POST /ledger/charts

Add a new chart

Add an Account

POST /ledger/charts/{chart_id}/accounts

Add an account to a chart

Add a Wallet

POST /ledger/charts/{chart_id}/accounts/{account_id}/wallets

Associate a wallet with an account

For more details, refer to our Chart Management APIs.

Last updated