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:Complete KYC Verification
Generate a KYC verification link for your user:In Sandbox, you can simulate KYC approval:
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.
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.
Next Steps
Customer API
Learn about customer management
Virtual Accounts
Deep dive into virtual accounts
Transfers API
Explore transfer options
Error Handling
Handle errors gracefully