How to Create a Formance Stack Programmatically

Last updated: July 30, 2025

While it's not possible to create stacks directly through the SDK, you can automate stack creation using the Formance Command Line Interface (fctl). This guide explains how to programmatically create and configure Formance stacks, which is particularly useful for CI environments or automated testing.

Prerequisites

  • Latest version of fctl installed

Steps to Create a Stack

1. Create an Organization Token

First, generate an organization token using the following command:

fctl cloud org oauth create

2. Automate Stack Creation

Use a script to create your stack. Here's an example structure of what your script should include:

  • Authentication with your organization token

  • Stack creation command

  • Waiting for stack to be ready

3. Create Stack Client

After creating your stack, you'll need to create a client to interact with it. This will generate the necessary client ID and secret for API access.

Note: The organization token authentication method is a recent addition. Make sure you're using the latest version of fctl to access this functionality.

Next Steps

Once you have created your stack and generated client credentials, you can use these credentials with the SDK to make API requests to your stack.