Integration Flow
The typical integration follows this pattern:- Onboard Customer
- Get Assets
- Create Quote
- Create Order
- Monitor Order via Webhooks
1. Onboard Customer
Generate a presigned URL and have your customer complete KYC verification.presignedUrl to complete identity verification and link their bank account. You’ll receive a customer_updated webhook when verification is complete.
2. Get Available Assets
Call/ramp/assets to show your user which assets they can buy or sell.
identifier field when creating quotes.
3. Create Quote
Get pricing for the conversion. Quotes expire after 2 minutes.4. Create Order
Execute the order using the quote. The order inherits the direction and amounts from the quote.depositClabe. For offramps, the customer signs the burnTransaction returned in the webhook to send their crypto.
5. Monitor Order via Webhooks
After creating an order, monitor its progress via webhooks. Onramp:- The customer must send MXN to the
depositClabereturned in the create order response - Once we confirm receipt of the fiat, you receive
order_funded - We mint/transfer crypto and send it to the customer’s wallet
- You receive
order_completedwithconfirmedTxSignaturecontaining the blockchain transaction hash
- You receive
order_createdwithburnTransactioncontaining an encoded transaction - Have the customer sign and submit the transaction to the blockchain
- Once confirmed on-chain, you receive
order_funded - We send MXN to the customer’s bank account
- You receive
order_completed
- Create a quote with
type: "swap"specifying source and target crypto assets - Call
/ramp/swapwith thequoteIdto initiate the swap - You receive
swap_updatedwebhook with transaction to sign - Have the customer sign and submit the transaction
- You receive
swap_updatedwhen completed
/ramp/order/{order_id}/regenerate_tx or /ramp/swap/{order_id}/regenerate_tx to get a new transaction.
See the Webhooks section below for detailed payload examples.
Fees
Fees for onramps and offramps are based on your rolling 30-day transaction volume. Higher volume means lower fees.| 30-Day Volume (USD) | Fee |
|---|---|
| 0 - 5 million | 20 bps (0.20%) |
| 5 - 10 million | 15 bps (0.15%) |
| 10 - 50 million | 10 bps (0.10%) |
| 50 - 100 million | 8 bps (0.08%) |
| 100 million+ | 5 bps (0.05%) |
feeBps, feeAmount, destinationAmountAfterFee). Your current fee tier is applied automatically when you create a quote.
Quote Types
| Type | Source | Target | Use Case |
|---|---|---|---|
onramp | Fiat (MXN) | Crypto (USDC, CETES) | Customer buys crypto |
offramp | Crypto (USDC, CETES) | Fiat (MXN) | Customer sells crypto |
swap | Crypto | Crypto | Customer exchanges one crypto for another |
Webhooks
Subscribe to webhooks to receive real-time updates. Webhook payloads are signed with HMAC-SHA256 using your webhook secret. The signature is in theX-Signature header as sha256={hex_signature}.
Event Types
| Event Type | Description |
|---|---|
customer_updated | KYC verification status changed |
bank_account_updated | Bank account verification status changed |
order_updated | Order status changed |
swap_updated | Swap transaction status changed |
Webhook Status Values
Each webhook includes astatus field indicating what triggered the event:
Order statuses (order_updated):
order_created- Order has been createdorder_funded- Order has been funded (fiat received for onramp, crypto confirmed for offramp)order_completed- Order completed successfullyorder_failed- Order failedorder_refunded- Order was refunded (onramp only)order_canceled- Order was canceled
customer_updated):
customer_pending- Customer verification in progresscustomer_verified- Customer successfully verifiedcustomer_failed- Customer verification failed
bank_account_updated):
bank_account_pending- Bank account verification pendingbank_account_awaiting_deposit_verification- Waiting for deposit verificationbank_account_active- Bank account is active and ready to usebank_account_inactive- Bank account is inactive
swap_updated):
swap_created- Swap has been createdswap_completed- Swap completed successfullyswap_failed- Swap failed
Order Status Flow
Orders progress through different statuses. You’ll receive anorder_updated webhook at each transition.
Onramp Order Flow (customer buys crypto with MXN):
created- Order created, waiting for customer to deposit MXN to thedepositClabefunded- MXN deposit received and confirmedcompleted- Crypto sent to customer’s wallet (confirmedTxSignaturecontains the tx hash)
created- Order created,burnTransactioncontains the transaction for the customer to signfunded- Customer’s crypto transaction confirmed on-chaincompleted- MXN sent to customer’s bank account
created- Swap created, transaction ready for customer to signfunded- Customer’s crypto transaction confirmed on-chaincompleted- Target crypto sent to customer’s wallet
failed- Order/swap failed (timeout, error, etc.)refunded- Funds returned to customer (onramp only)canceled- Order canceled before funding
Webhook Payload Examples
Order Created (Onramp):Resources
The API manages these resources:- Customers - Your end users who complete KYC
- Bank Accounts - Mexican bank accounts linked to customers
- Wallets - Crypto wallets associated with customers
- Orders - Onramp and offramp transactions
- Webhooks - Event notification subscriptions