Make sure you’ve completed the installation before
proceeding.
Initialize the Client
Create an Align client instance with your API credentials:- TypeScript
- JavaScript
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | - | Your AlignLab API key (required) |
environment | "sandbox" | "production" | "production" | API environment |
timeout | number | 30000 | Request timeout in milliseconds |
maxRetries | number | 3 | Max retry attempts for failed requests |
enableLogging | boolean | false | Enable request/response logging |
Core Workflow
Here’s the typical integration flow for processing payments:1
Create a Customer
Register a new user in the Align system:
2
Complete KYC Verification
Generate a KYC verification link for your user:In Sandbox, you can simulate KYC approval:
3
Create a Virtual Account
Once KYC is approved, create a virtual bank account for deposits:
Deposit instructions vary by payment rails. ACH accounts have routing numbers, while IBAN accounts have BIC/SWIFT codes.
4
Process Deposits
When users deposit fiat to their virtual account, funds are automatically converted and sent to their crypto wallet.Simulate a deposit in sandbox:
Creating Transfers
For more control over conversions, use the Transfers API:Onramp (Fiat → Crypto)
Offramp (Crypto → Fiat)
Error Handling
Always wrap API calls in try-catch blocks:Error Handling Guide
Learn more about error types and handling strategies
Webhook Integration
Set up webhooks to receive real-time notifications:Webhook signatures are signed using your API Key. See the Webhook
Verification guide.