List CryptoOnrampSessions
GET / v1 / crypto / onramp_sessions
Returns a list of onramp sessions that match the filter criteria. The onramp sessions are returned in sorted order, with the most recent onramp sessions appearing first.
Parameters
- created object Only return onramp sessions that were created during the given date interval.
- destination _ currency enum The destination cryptocurrency to filter by. Possible enum values
avaxAvalanche (the related setting).btcBitcoin (BTC).ethEther (ETH).maticPolygon (the related setting).solSolana (SOL).usdcUSD Coin (the related setting).usdtTether (the related setting).wldWorldcoin (WLD).xlmStellar Lumen (XLM). - destination _ network enum The destination blockchain network to filter by. Possible enum values
avalancheAvalanche network.baseBase network.bitcoinBitcoin network.celoCelo network.ethereumEthereum network.optimismOptimism network.polygonPolygon network.solanaSolana network.stellarStellar network.suiSui network. Show 2 more - ending _ before string An object ID cursor for use in pagination.
- limit integer A limit ranging from 1 to 100 (defaults to 10).
- starting _ after string An object ID cursor for use in pagination.
- status enum The status of the Onramp Session. One of =
{initialized, rejected, requires_payment, fulfillment_processing, fulfillment_complete}Possible enum valuesfulfillment_completeCryptocurrency has been successfully delivered to the customer’s wallet.fulfillment_processingPayment has been received and cryptocurrency delivery is being processed.initializedThe onramp session has been created and is awaiting user interaction.rejectedThe onramp session has been rejected.requires_paymentThe onramp session is awaiting payment from the user.
Returns
A dictionary with a data property that contains an array of up to limit onramp sessions, starting after onramp session starting_after. Each entry in the array is a separate onramp session object. If no more onramp sessions are available, the resulting array will be empty.
cURL
Response
Checkout a CryptoOnrampSession
POST / v1 / crypto / onramp_sessions /:id / checkout
Completes a headless CryptoOnrampSession.
This method will attempt to confirm the payment and execute the quote to deliver the crypto to the customer.
Parameters
- mandate _ data object This hash contains details about the mandate to create
Returns
Returns a CryptoOnrampSession object
cURL
Response
{ "id": "cos_1NamBL2eZvKYlo2CP38sZVEW", "object": "crypto.onramp_session", "client_secret": "cos_1NamBL2eZvKYlo2CP38sZVEW_secret_B5faamUkzHbcpjy6NndGq1mMZGGCo8FhK2P", "created": 1691010131, "kyc_details_provided": false, "livemode": true, "metadata": {}, "redirect_url": null, "status": "fulfillment_processing", "transaction_details": { "destination_amount": "0.029133919178255537", "destination_currencies": [ "btc", "eth", "matic", "sol", "xlm", "avax", "usdc" ], "destination_currency": "eth", "destination_network": "base", "destination_networks": [ "bitcoin", "ethereum", "base", "polygon", "solana", "stellar", "avalanche" ], "fees": { "network_fee_monetary": "0.07", "transaction_fee_monetary": "4.04" }, "lock_wallet_address": false, "source_amount": "100.00", "source_currency": "usd", "transaction_id": "cxt_1ABC2DEF3ghi4jkl5", "wallet_address": null, "wallet_addresses": null }}
Refresh an executable quote
POST / v1 / crypto / onramp_sessions /:id / quote
Refreshes an executable quote for a CryptoOnrampSession.
Parameters
No parameters.
Returns
Returns a CryptoOnrampSession object
cURL
Response
{ "id": "cos_1NamBL2eZvKYlo2CP38sZVEW", "object": "crypto.onramp_session", "client_secret": "cos_1NamBL2eZvKYlo2CP38sZVEW_secret_B5faamUkzHbcpjy6NndGq1mMZGGCo8FhK2P", "created": 1691010131, "kyc_details_provided": false, "livemode": false, "metadata": {}, "redirect_url": null, "status": "quote_ready", "transaction_details": { "destination_amount": "0.029133919178255537", "destination_currencies": [ "btc", "eth", "matic", "sol", "xlm", "avax", "usdc" ], "destination_currency": "eth", "destination_network": "base", "destination_networks": [ "bitcoin", "ethereum", "base", "polygon", "solana", "stellar", "avalanche" ], "fees": { "network_fee_monetary": "0.07", "transaction_fee_monetary": "4.04" }, "lock_wallet_address": false, "source_amount": "100.00", "source_currency": "usd", "transaction_id": null, "wallet_address": null, "wallet_addresses": null }}
