Prerequisites
- An API key (service key) from the Switch dashboard.
- HTTP client (e.g. cURL, Postman, or your application).
Step 1: Get your API key
- Sign in to the Switch dashboard.
- Create or select a project and obtain your service key (API key).
- Use the sandbox key for testing; use the live key for production.
Step 2: Authenticate requests
Include your service key in every request using thex-service-key header:
Never expose your API key in client-side code or public repositories. Use environment variables or a secrets manager.
Step 3: Check coverage
Before building flows, see which countries and currencies are supported:direction=ONRAMP or direction=SWAP to see onramp or swap coverage.
Step 4: Get field requirements
For offramp or onramp, you must collect beneficiary details. Requirements depend on country, currency, and channel:bank_code, account_number, holder_name) and how to validate them.
Step 5: Get a quote and initiate (offramp example)
- Quote — Get rate and fees for an amount:
- Initiate — Create the transaction with beneficiary details (from the requirement response):
- The response includes a deposit object: amount, wallet address, and asset. Your user sends that amount of stablecoin to that address. After the deposit is detected, the payout to the beneficiary is processed.
- Use webhooks or the Status endpoint to track the transaction.
Next steps
- Authentication — Header and error handling details.
- Sandbox — Testing without moving real funds.
- API Reference — All endpoints and parameters.
- Webhooks — Receive status updates.