Official Client SDKs & Tools
Integrate Rook financial APIs seamlessly using official SDKs with built-in retries, automatic token renewal, typed request/response models, and multi-tenant program scoping.
Language Ecosystem
| Language / Tool | Target Version | Package / Repository | Features |
|---|---|---|---|
| TypeScript | Node 18+, Edge, Browsers | @rookpayments/sdk |
Zero dependencies, full TypeScript declarations, isomorphic fetch. |
| Python | Python 3.10+ | rook-python-sdk |
Modern Pydantic v2 schemas, sync & async HTTPX clients. |
| Go | Go 1.22+ | github.com/rookpayments/rook-go |
Context propagation, automatic retries with exponential backoff. |
| Java | Java 17+ | com.rookpayments:rook-java-sdk |
Enterprise Spring Boot & Quarkus support, Jackson models. |
| cURL | Any CLI / HTTP client | REST / JSON | Standard Bearer authentication, idempotency headers. |
1. TypeScript / JavaScript
Install via NPM, Yarn, or PNPM:
npm install @rookpayments/sdk
import { RookClient } from '@rookpayments/sdk';
const rook = new RookClient({
apiKey: process.env.ROOK_API_KEY!,
programId: '7c9e6679-7425-40de-944b-e07fc1f90ae7',
environment: 'sandbox', // 'sandbox' | 'production'
});
// Issue a commercial virtual card
const card = await rook.cards.create({
walletId: '4d8f2a10-6c3e-4b91-9e5a-2f7c8d1e0b44',
walletEntityId: 'ent_992a7c81-4b10-4c8e-a719-882d9f10a823',
formFactor: 'VIRTUAL',
displayName: 'Cloud Services Card',
spendingControls: {
limitAmount: 500000, // $5,000.00 USD in cents
limitCurrency: 'USD',
limitPeriod: 'MONTHLY',
allowedMccCodes: ['5734', '7372'],
},
});
console.log('Issued Card ID:', card.id, 'Last 4:', card.lastFour);
2. Python 3.10+
Modern typed client using Pydantic v2 and HTTPX:
pip install rook-python-sdk
from rook import RookClient
import os
client = RookClient(
api_key=os.environ["ROOK_API_KEY"],
program_id="7c9e6679-7425-40de-944b-e07fc1f90ae7",
environment="sandbox",
)
# Originate an instant 24/7 FedNow payment
transfer = client.transfers.create(
source_wallet_id="4d8f2a10-6c3e-4b91-9e5a-2f7c8d1e0b44",
destination_routing_number="121000358",
destination_account_number="449102941",
recipient_name="Apex Capital Group",
amount=1500000, # $15,000.00 USD in minor units
payment_rail="FEDNOW",
idempotency_key="tx_sync_92fa8b30e4c194bb10842f"
)
print(f"Transfer ID: {transfer.id} - Status: {transfer.status}")
3. Go 1.22+
High-throughput idiomatic Go client with context cancellation and automatic retries:
go get github.com/rookpayments/rook-go
package main
import (
"context"
"fmt"
"os"
"github.com/rookpayments/rook-go"
)
func main() {
client := rook.NewClient(
rook.WithAPIKey(os.Getenv("ROOK_API_KEY")),
rook.WithProgramID("7c9e6679-7425-40de-944b-e07fc1f90ae7"),
rook.WithEnvironment(rook.EnvSandbox),
)
card, err := client.Cards.Create(context.Background(), &rook.CreateCardParams{
WalletID: "4d8f2a10-6c3e-4b91-9e5a-2f7c8d1e0b44",
WalletEntityID: "ent_992a7c81-4b10-4c8e-a719-882d9f10a823",
FormFactor: rook.FormFactorVirtual,
DisplayName: "Engineering Cloud Expenses",
})
if err != nil {
panic(err)
}
fmt.Printf("Created Card %s (**** %s)\n", card.ID, card.LastFour)
}
4. Java 17+ (Maven & Gradle)
Enterprise client for Spring Boot, Quarkus, or standalone JVM services:
<dependency>
<groupId>com.rookpayments</groupId>
<artifactId>rook-java-sdk</artifactId>
<version>2.1.0</version>
</dependency>
import com.rookpayments.RookClient;
import com.rookpayments.models.Card;
import com.rookpayments.models.CreateCardRequest;
public class Application {
public static void main(String[] args) {
RookClient client = RookClient.builder()
.apiKey(System.getenv("ROOK_API_KEY"))
.programId("7c9e6679-7425-40de-944b-e07fc1f90ae7")
.sandbox()
.build();
Card card = client.cards().create(CreateCardRequest.builder()
.walletId("4d8f2a10-6c3e-4b91-9e5a-2f7c8d1e0b44")
.walletEntityId("ent_992a7c81-4b10-4c8e-a719-882d9f10a823")
.formFactor("VIRTUAL")
.displayName("Executive Operations")
.build());
System.out.println("Card Active: " + card.getId());
}
}
5. cURL / Raw HTTP
Direct HTTP invocation with JSON payloads and standard headers:
curl -X GET "https://api.sandbox.rookpayments.com/v1/cards" \
-H "Authorization: Bearer rk_test_..." \
-H "X-Program-ID: 7c9e6679-7425-40de-944b-e07fc1f90ae7" \
-H "Accept: application/json"