API Integration
π§© API Integration Guide
Welcome! This guide will walk you through integrating with our API β from authentication and setup to placing orders and receiving updates.
π Table of Contents
- π§© API Integration Guide
- π Table of Contents
- 1. π‘οΈ Obtain Credentials
- 2. π Retrieve Supported Geo Coverage, Assets, and Payment Methods
- 3. π€ Onboard a User
- 4. π User Verification (KYC)
- 5. π± Fetch a Quote
- 6. π Execute an Order
- 7. π Get Status Updates via Webhooks
- 8. π Fetch the Order Status
- β Youβre All Set!
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_id
andclient_secret
for your use. - Store both the
client_id
andclient_secret
securely.
π 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.
Use this info to populate dropdowns and validate inputs client-side.
3. π€ Onboard a User
Before placing an order, the user must be onboarded and registered in the system.
π₯ Endpoint
π¦ Sample Payload
β Response
Returns a customerId
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
You may be asked to:
- Upload an ID document.
- Submit a selfie.
- Redirect to a hosted KYC flow.
π¦ Response
Returns a verification_status
:
pending
approved
rejected
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:
Includes order_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
β Youβre All Set!
Once these steps are implemented, youβll have full integration from onboarding to real-time tracking. For additional topics like error handling, retries, or sandbox mode, check out the Extended Developer Docs.