API Integration Guide
Welcome! This guide will walk you through integrating with our API — from authentication and setup to placing orders and receiving updates.1. Obtain Credentials
To access the API, you must first obtain your API key and secret. These authenticate your requests and track usage.Steps:
- Contact the Sardine integration team. They will generate a
client_idandclient_secretfor your use. - Store both the
client_idandclient_secretsecurely.
Security Tip: Never expose your secret in frontend apps. Use a backend service to interact with the API.
2. Retrieve Supported Geo Coverage, Assets, and Payment Methods
Use the following endpoints to fetch dynamic metadata for your UI:GET /v1/geo-coverage— Supported countries/regions.GET /v1/supported-tokens— Available cryptocurrencies and fiat currencies.
3. Onboard a User
Before placing an order, the user must be onboarded and registered in the system.Endpoint
Sample Payload
Response
Returns acustomerId which must be used in all user-specific operations.
4. User Verification (KYC)
Depending on jurisdiction or transaction volume, KYC verification may be required.Endpoint
- Upload an ID document.
- Submit a selfie.
- Redirect to a hosted KYC flow.
Response
Returns averification_status:
pendingapprovedrejected
5. Fetch a Quote
Before placing an order, fetch a quote to show the user a guaranteed rate and fee breakdown.Endpoint
Sample Payload
Response Includes:
- Exchange rate
- Fees
- Quote expiry
quote_id(used when placing an order)
6. Execute an Order
Place an order based on an approved quote.Endpoint
Sample Payload
Response:
Includesorder_id and the initial status.
7. Get Status Updates via Webhooks
Set up webhooks to get real-time updates on order progress and compliance events.Steps:
- Register your webhook URL in the Developer Portal.
- Your endpoint should be HTTPS and respond with
2xx.
Sample Webhook Payload:
Validate webhook signatures and implement retry logic for maximum reliability.
8. Fetch the Order Status
Poll this endpoint for order updates if webhooks aren’t available or for manual checks.Endpoint
Response Includes:
- Current status:
pending,processing,completed,failed - Timestamps
- Payment and asset transfer details