Sandbox environment
Your Development environment is your sandbox. It connects to testnets (Sepolia and Base Sepolia) instead of mainnet, so you can run full settlement flows without real assets or funds. All API behavior is identical between Development and Production environments. The only difference is the underlying blockchain network and smart contract deployment.Test tokens
KeyStone provides two mintable ERC-20 tokens for testing:| Token | Description | Networks |
|---|---|---|
| KBOND | Test security token (tokenized bond) | Sepolia, Base Sepolia |
| TUSDC | Test stablecoin (USDC equivalent) | Sepolia, Base Sepolia |
mint() function, so you can mint as many as you need for testing. See testnet addresses for contract addresses.
End-to-end test flow
Walk through a complete settlement to verify your integration:1. Submit a seller instruction
Use the SDK or API to submit an instruction for the sell side. This returns atrade_reference that the buyer uses to match.
2. Submit a buyer instruction
Submit the counterparty instruction using the sametrade_reference. This triggers the matching process.
3. Verify the settlement was created
After both instructions match, a settlement is created. Query it to confirm:4. Check webhook delivery
Verify that your webhook endpoint received events for each state transition. You should see events likesettlement.created, settlement.compliance_checking, and so on.
5. Advance through states (optional)
If you have access to the integration testing endpoints, you can programmatically advance the settlement through its state machine. See the integration testing guide for details.CLI for local development
Use the KeyStone CLI to forward webhooks to your local development server:Postman collection
For manual API exploration, import the KeyStone Postman collection. It includes pre-configured requests for all endpoints with environment variables for authentication. See the Postman guide for setup instructions.Checklist before going to production
Before switching from your Development environment to Production, verify:This checklist covers the most common integration issues. Complete each item to avoid surprises in production.
- Webhook handler processes all settlement states - Your handler should gracefully handle every state in the settlement state machine, including error and rollback states.
- Signature verification is implemented - Validate the
X-Keystone-Signatureheader on every webhook delivery. See webhooks for details. - Idempotency keys on all create/submit calls - Every
POSTto/v1/instructionsshould include a uniqueidempotency_keyto prevent duplicates on retry. - Error handling covers all error codes - Handle
400,401,409,422, and5xxresponses appropriately. See error handling. - Rate limits accounted for - Implement exponential backoff for retries and respect
429responses.