Auth
Use an API key:Routes
Required fields
Every ramp request requires anenvironment. Options, quotes, and session
creation also require the organization’s MELD configuration id:
On options routes these values are query parameters. On quote and session
creation routes they are body fields. Session reads and off-ramp authorization
actions identify the session in the route path and require only
environment
from this table.
Quote requests additionally require externalCustomerId, swigConfigAddress,
and network.
Get options
GET /wallet/api/ramp/onramp/options
GET /wallet/api/ramp/offramp/options
Query parameters:
Both directions return
countries (each with countryCode, countryName, and
subdivisions), fiatCurrencyCodes, and paymentMethodTypes. On-ramp adds
cryptoCurrencyCodes; off-ramp adds cryptoCurrencies, each with
currencyCode, currencyName, iconUrl, and contractAddress.
Read options first so currency and payment-method codes come from the API
rather than from a hardcoded list.
Quote
On-ramp quote
POST /wallet/api/ramp/onramp/quote
Off-ramp quote
POST /wallet/api/ramp/offramp/quote
Off-ramp reverses the currency direction: the source is the crypto asset being
sold and the destination is fiat. It settles on mainnet even in the MELD sandbox
environment, so network must be NETWORK_MAINNET.
subdivision and paymentMethodType are optional. Take currency and payment
method values from the matching options response.
The response returns quotes, each with quoteId, serviceProvider,
paymentMethodType, sourceAmount, sourceCurrencyCode,
destinationAmount, destinationCurrencyCode, exchangeRate, and
totalFee.
Create a session
POST /wallet/api/ramp/onramp/session
POST /wallet/api/ramp/offramp/session
sessionId and launchUrl.
Read a session
GET /wallet/api/ramp/onramp/session/{session_id}
GET /wallet/api/ramp/offramp/session/{session_id}
Query parameters:
On-ramp sessions return
sessionId, status, createdAt, and updatedAt.
Status values are:
sourceAmount,
sourceCurrencyCode, destinationAmount, destinationCurrencyCode,
serviceProvider, and optional paymentMethodType, solanaSignature, and
providerDestinationAmount. Off-ramp adds three states:
Off-ramp authorization
Off-ramp requires an on-chain transfer from the Swig to the provider before the session can settle.Prepare
POST /wallet/api/ramp/offramp/session/{session_id}/prepare
authorizationId, a preparedTransaction, and a
display object describing the transfer: sourceWalletAddress,
destinationWalletAddress, sourceAmount, sourceCurrencyCode,
destinationAmount, destinationCurrencyCode, serviceProvider, and optional
paymentMethodType and providerDestinationAmount.
Show display to the customer before signing.
Submit
POST /wallet/api/ramp/offramp/session/{session_id}/submit
solanaSignature.
SDK equivalent
The Developer SDKs wrap these routes asswig.ramp.onramp and
swig.ramp.offramp, and accept sandbox / production as plain strings while
encoding the MELD enum for you. See
Add and Withdraw Funds.
