Prerequisites
- A KeyStone OS platform account with API credentials (M2M client ID and secret) - find these in the KeyStone Dashboard under Settings > General
- An active environment (sandbox or production)
- At least one settlement template configured
Step 1: Authenticate
KeyStone uses Auth0 M2M (client credentials) tokens for platform API access.access_token is a JWT valid for 24 hours. Include it in all API requests:
Step 2: Initiate a settlement
Send a settlement instruction with parties, legs, and a template reference. Party details are provided inline - no separate registration step is needed.Step 3: Monitor progress
The settlement engine automatically advances through the template’s state machine. Track progress via: Polling:What happens next
The engine processes each state in your template:- INSTRUCTED - Settlement created, engine starts
- COMPLIANCE_CHECKING - Dual-layer compliance screening
- COMPLIANCE_CLEARED - All parties cleared
- REGISTERING_ESCROW - Escrow contract registration
- AWAITING_DEPOSITS - Waiting for on-chain deposits
- EXECUTING_SWAP - Atomic swap execution
- SETTLED - Assets exchanged
- FINALIZED - Settlement complete
ROLLED_BACK and deposits are returned.
Next: Authentication
Learn about M2M tokens, user tokens, scopes, and environment resolution.