SDKs
The official clients for the API. Every code example in these docs comes from their tested examples.
The SDKs
Each of the four SDKs (TypeScript, Python, Go and PHP) installs in one line and speaks the v2 API.
TypeScript
qbitflow-js-sdk · v3.1.1
npm install qbitflowRequires Node.js 20 or later.
Repository (opens in a new tab)Changelog (opens in a new tab)Migrating from 2.x (opens in a new tab)
Python
qbitflow-python-sdk · v3.1.1
pip install "qbitflow>=3,<4"Requires Python 3.10 or later.
Repository (opens in a new tab)Changelog (opens in a new tab)Migrating from 2.x (opens in a new tab)
Go
qbitflow-go-sdk · v3.1.1
go get github.com/QBitFlow/ qbitflow-go-sdk/ v3 Requires Go 1.27 or later.
Repository (opens in a new tab)Changelog (opens in a new tab)Migrating from 2.x (opens in a new tab)
PHP
qbitflow-php-sdk · v3.1.1
composer require qbitflow/qbitflow-php:^3.0 Requires PHP 8.2.35, 8.3.36, 8.4.27, 8.5.12 or later in its branch.
Repository (opens in a new tab)Changelog (opens in a new tab)Migrating from 2.x (opens in a new tab)
Create a client
Every example assumes a client named client ($client in PHP), built once from
QBITFLOW_API_KEY.
client-init.sh
# Every request sends your API key. The start-up check: what is this key, and which mode is it in?curl https://api.qbitflow.app/v2/me \ -H "X-API-Key: $QBITFLOW_API_KEY"# 200: { "credential": "apiKey", "role": "admin", "space": { "test": true, … }, … }// One client per API key, shared by the whole program. A blank key, one not starting with// sk_, or one with a space or a control character, throws a ValidationError (nothing is sent).const client = new QBitFlow( process. env. QBITFLOW_API_KEY ?? ''); // The recommended start-up check: what is this key, and which mode is it in? An// AuthenticationError for an unknown or revoked key.const me = await client.me();console.log(`${me.role} key, test mode: ${me.space?.test}`);# One client per API key, shared by the whole program. ValidationError: not an sk_… key.client = qbitflow. QBitFlow( os. environ["QBITFLOW_API_KEY"]) # The recommended start-up check: what is this key, and which mode is it in?me = client.me() # AuthenticationError for an unknown or revoked keyif me.space is not None: print( f"{me. space. organization_name}, role {me.role}, test mode {me.space.test}")// One client per API key, shared by the whole program: it is safe for concurrent use.client, err := qbitflow. NewClient( os. Getenv( "QBITFLOW_API_KEY"))if err != nil { log.Fatal(err) // a *qbitflow.ValidationError: no key, or not an sk_… key} // The recommended start-up check: what is this key, and which mode is it in?me, err := client.Me(ctx)if err != nil { log.Fatal(err) // a *qbitflow.AuthenticationError for an unknown or revoked key}if me.Space != nil { fmt.Printf("%s, role %s, test mode %v\n", me.Space.OrganizationName, me.Role, me.Space.Test)}// One client per API key, shared by the whole application.$client = new \QBitFlow\QBitFlow(apiKey: (string) getenv('QBITFLOW_API_KEY')); // The recommended start-up check: which space and mode is this key in?$me = $client->me(); // an AuthenticationException for an unknown or revoked keyprintf("%s, role %s, %s mode\n", $me->space?->organizationName ?? '?', $me->role ?? '?', $me->space?->test ? 'test' : 'live');The client does the API's chores for you:
- Safe retries: an
Idempotency-Keyon every create, retried for you (idempotency). - Lists walked: paginated lists iterate page by page (pagination).
- Webhooks verified: signatures checked locally, with no call (verify a signature).
- Typed errors: each carries the
codeand therequestId(errors).
Moving from 2.x
The 3.x SDKs speak the v2 API. Each repository's migration guide (above) lists what changed, method by method; the API reference has the shapes.
WooCommerce
QBitFlow for WooCommerce takes crypto payments in a store, with no code: what it does on WooCommerce, and how to install and test it in the WooCommerce how-to.