API Reference

Onramper has various endpoints available to facilitate the creation of custom UX flow for transactions.

Warning

The base URL for all requests is https://api.onramper.com. Requests require the Public API Key to be added in the Authorization header.

Supported

GET /supported

  • Supplies all available fiat and crypto currencies.
https://api.onramper.com/supported

Response

{
    "message": {
        "crypto": [
            {
                "id": "eth",
                "code": "ETH",
                "name": "Ethereum",
                "symbol": "Ξ",
                "network": "ethereum",
                "decimals": 18,
                "address": "0x0000000000000000000000000000000000000000",
                "chainId": 1,
                "icon": "https://cdn.onramper.com/icons/crypto/eth.png",
                "networkDisplayName": "Ethereum"
            }        
        ],
        "fiat": [
            {
                "id": "eur",
                "code": "EUR",
                "name": "Euro Member Countries",
                "symbol": "€",
                "icon": "https://cdn.onramper.com/icons/tokens/eur.svg"
            }
        ]
    }
}

GET /supported/payment-types

  • Supplies all available payment methods.
https://api.onramper.com/supported/payment-types

Response

{
    "message": {
        "creditcard": {
            "paymentTypeId": "creditcard",
            "name": "Credit Card",
            "icon": "https://cdn.onramper.com/icons/payments/creditcard.svg"
        },
        "applepay": {
            "paymentTypeId": "applepay",
            "name": "Apple Pay",
            "icon": "https://cdn.onramper.com/icons/payments/applepay.svg"
        },
        "googlepay": {
            "paymentTypeId": "googlepay",
            "name": "Google Pay",
            "icon": "https://cdn.onramper.com/icons/payments/googlepay.svg"
        }
    }
}

GET /supported/payment-types/{fiat}

  • Requires any available fiat currency and returns an array of available payment methods.
https://api.onramper.com/supported/payment-types/{fiat}

Response

{
    "message": [
        {
            "paymentTypeId": "creditcard",
            "name": "Credit Card",
            "icon": "https://cdn.onramper.com/icons/payments/creditcard.svg"
        },
        {
            "paymentTypeId": "applepay",
            "name": "Apple Pay",
            "icon": "https://cdn.onramper.com/icons/payments/applepay.svg"
        },
        {
            "paymentTypeId": "googlepay",
            "name": "Google Pay",
            "icon": "https://cdn.onramper.com/icons/payments/googlepay.svg"
        }
    ]
}

GET /supported/defaults/all

  • Supplies all default fiat, crypto, fiat amount and payment method per country.
  • Based on the detected country where the request originated a recommended option will be selected.
https://api.onramper.com/supported/defaults/all

Response

    "message": {
        "recommended": {
            "source": "EUR",
            "target": "BTC",
            "amount": 100,
            "paymentMethod": "ideal",
            "provider": "btcdirect"
        },
        "defaults": {
            "id": {
                "source": "IDR",
                "target": "ETH",
                "amount": 2000000,
                "paymentMethod": "dana",
                "provider": "transfi"
            }
        }
    }

GET /supported/assets

https://api.onramper.com/supported/assets?source=usd&country=us
ParameterDescriptionRequiredDefault
sourceSource currencyfalseData for all fiats will be added
countryCountry for the filtrationfalseCountry will be picked from the IP address of the request

Headers

'Authorization' : api-key

Response

{
    "message": {
        "assets": [
            {
                "fiat": "usd",
                "paymentMethods": [
                    "creditcard",
                    "debitcard",
                    ...      
                ],
                "crypto": [
                    "1inch_ethereum",
                    "aave_ethereum",    
                    ...     
                ]
            },            
        ],
        "country": "us"
    }
}

GET /supported/onramps

https://api.onramper.com/supported/onramps?source=usd&destination=btc&country=us
ParameterDescriptionRequiredDefault
sourceSource currencytrue-
destinationDestination currencytrue-
countryCountry for the filtrationfalseCountry will be picked from the IP address of the request

Headers

'Authorization' : api-key

Response

{
    "message": [
        {
            "onramp": "moonpay",
            "country": "US",
            "paymentMethods": [
                "creditcard",
                "applepay",
                "googlepay",
                "ach"
            ],
            "recommendedPaymentMethod": "creditcard",
        },
        {
            "onramp": "sardine",
            "country": "US",
            "paymentMethods": [
                "creditcard",
                "debitcard"
            ],
            "recommendedPaymentMethod": "creditcard",
        }, 
        ...      
    ]
}

Quotes

Buy: GET /quotes/{fiat}/{crypto}

  • Returns quotes for all available providers.
ParameterDescriptionRequiredDefault
amountAmount for the transactiontrue-
paymentMethodPayment method for the transactionfalsecreditcard
uuidUnique user id for Onramper widgetfalsenull
clientNameClient Name if applicable for client preferred recommendationfalsenull
https://api.onramper.com/quotes/{fiat}/{crypto}
https://api.onramper.com/quotes/eur/btc?amount=100&paymentMethod=creditcard

Response

[
    {
        "rate": 23118.760136,
        "networkFee": 0.8843,
        "transactionFee": 2,
        "payout": 0.004201,
        "availablePaymentMethods": [
            {
                "paymentTypeId": "creditcard",
                "name": "Credit Card",
                "icon": "https://cdn.onramper.com/icons/payments/creditcard.svg"
            }
        ],
        "ramp": "payfura",
        "quoteId": "01H985NH79FW951SKERQ45JMYXpayfura",
        "paymentMethod": "creditcard",
        "recommendations": [
            "LowKyc",           
        ]
    },
    {
        "rate": 23207.07363091033,
        "networkFee": 0,
        "transactionFee": 0,
        "payout": 0.00512,
        "availablePaymentMethods": [
            {
                "paymentTypeId": "creditcard",
                "name": "Credit Card",
                "icon": "https://cdn.onramper.com/icons/payments/creditcard.svg"
            },
            {
                "paymentTypeId": "applepay",
                "name": "Apple Pay",
                "icon": "https://cdn.onramper.com/icons/payments/applepay.svg"
            },
            {
                "paymentTypeId": "googlepay",
                "name": "Google Pay",
                "icon": "https://cdn.onramper.com/icons/payments/googlepay.svg"
            }
        ],
        "ramp": "moonpay",
        "quoteId": "01H985NH79FW951SKERQ45JMYXmoonpay",
        "paymentMethod": "creditcard"
        "recommendations": [
            "BestPrice",
            "SuccessRate"
        ]
    }
]

Sell: GET /quotes/{crypto}/{fiat}

  • Retrieves quotes for selling crypto from all available providers based on the provided parameters.
ParameterDescriptionRequiredDefault
amountAmount for the transactiontrue-
paymentMethodPayment method for the transactionfalsecreditcard
uuidUnique user id for Onramper widgetfalsenull
clientNameClient Name if applicable for client preferred recommendationfalsenull
typeTransaction type buy | selltruebuy
https://api.onramper.com/quotes/{crypto}/{fiat}
https://api.onramper.com/quotes/btc/usd?amount=1&paymentMethod=creditcard&type=sell

Response

[
  {
    "rate": 26690.62,
    "networkFee": 0,
    "transactionFee": 201.1797,
    "payout": 26489.4403,
    "ramp": "alchemypay",
    "paymentMethod": "creditcard",
    "quoteId": "01HAKJQTP9EJ2ASXP5RDFNDK4Calchemypay",
    "recommendations": [
      "BestPrice"
    ]
  },
  {
    "rate": 25891.24,
    "networkFee": 0,
    "transactionFee": 1165.11,
    "payout": 24467.22,
    "ramp": "moonpay",
    "paymentMethod": "creditcard",
    "quoteId": "01HAKJQTP9EJ2ASXP5RDFNDK4Cmoonpay",
    "recommendations": []
  }
]

Transactions

POST /checkout/intent

  • Requires the payload object as shown below.
https://api.onramper.com/checkout/intent

Payload

{
    "onramp": "payfura",
    "source": "eur",
    "destination": "btc",
    "amount": 100,
    "type": "buy",
    "paymentMethod": "creditcard",
    "network": "bitcoin",
    "uuid": "6756256e-d07f-42f0-a873-4d992eec8a2e",
    "partnerContext": "123-CLIENT-ORDER-ID-456"
    "originatingHost": "buy.onramper.com",
    "metaData": {
        "quoteId": "01H985NH79FW951SKERQ45JMYXpayfura",
    },
    "wallet": {
        "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
    },
    "supportedParams": {
        "theme": {
            "isDark": false,
            "themeName": "light-theme",
            "primaryColor": "#241D1C",
            "secondaryColor": "#FFFFFF",
            "primaryTextColor": "#141519",
            "secondaryTextColor": "#6B6F80",
            "cardColor": "#F6F7F9",
            "borderRadius": null
        },
        "partnerData": {
            "redirectUrl": {
                "success":"http%3A%2F%2Fredirecturl.com%2F"
            }
        }
    },
    
}

Response

{
    "message": {
        "validationInformation": true,
        "status": "in_progress",
        "sessionInformation": {
            "onramp": "payfura",
            "source": "eur",
            "destination": "btc",
            "amount": 100,
            "type": "buy",
            "paymentMethod": "creditcard",
            "network": "bitcoin",
            "uuid": "6756256e-d07f-42f0-a873-4d992eec8a2e",
            "originatingHost": "buy.onramper.com",
            "wallet": {
                "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
            },
            "supportedParams": {
                "theme": {
                    "isDark": false,
                    "themeName": "light-theme",
                    "primaryColor": "#241D1C",
                    "secondaryColor": "#FFFFFF",
                    "primaryTextColor": "#141519",
                    "secondaryTextColor": "#6B6F80",
                    "cardColor": "#F6F7F9",
                    "borderRadius": null
                }
            },
            "country": "ES",
            "expiringTime": 1686819150,
            "sessionId": "01H2Z3GW7QRW9N5BNDQE7CAWA1"
        },
        "transactionInformation": {
            "transactionId": "01H7D547TESTV2RQJ52ZAB7WF7",
            "url": "https://exchange.payfura.com?orderId=66fe06aa70df3ac35b1de4dd1286a781&apiKey=2e18c0ad-0406-4e98-b74d-85f13c81cd60",
            "type": "iframe",
            "params": {
                "permissions": "accelerometer; autoplay; camera; gyroscope; payment;"
            }
        }
    }
}

GET /transactions/{transactionId}

https://api.onramper.com/transactions/{transactionId}

Headers

'Authorization' : api-key
'x-onramper-secret' : secret

Response

{
    "country": "us",
    "inAmount": 100,
    "onramp": "gatefi",
    "onrampTransactionId": "8bf94c80-test-aabb-851-143835984d1d",
    "outAmount": 3.83527521,
    "paymentMethod": "creditcard",
    "sourceCurrency": "usd",
    "status": "pending",
    "statusDate": "2023-08-09T13:15:18.725Z",
    "targetCurrency": "sol",
    "transactionId": "01H7D547TESTV2RQJ52ZAB7WF7",
    "transactionType": "onramp",
    "transactionHash": "",
    "walletAddress": "testG15oy66q7cU6aNige54PxLLEfGZvRsAADjbF7D4"
}

GET /transactions

  • Returns a list of transactions.
http://api.onramper.com/transactions?startDateTime=2023-02-01T23:57:57.432Z&endDateTime=2023-02-02T00:35:30.790Z

Headers

'Authorization' : api-key
'x-onramper-secret' : secret
ParameterDescriptionExampleDefault
startDateTimeStart time in ISO 8601 standard2023-02-01T23:57:57.432Znull
endDateTimeEnd time in ISO 8601 standard2023-02-02T00:35:30.790Znull
limitAmount of transactions. Maximum limit is 50, if not provided will default to 501250
transactionIdsA comma separated list of onramper transaction ids, maximum number of transaction IDs is 5001GTEQ1ZM4TNF31BK5CH37BNJ6,01GTF97H0J9TQF4NZZ7A48WKYMnull
cursorNeed to provide if required to fetch next page of resultseyJzayI6IjIwMjMtMDMtMDFUMTg6MDM6MzcuMDQyWiIsIknull

Response

{
    "transactions": [
        {
            "targetCurrency": "eth",
            "onramp": "moonpay",
            "statusDate": "2023-01-20T15:15:33.922Z",
            "txType": "onramp",
            "txHash": "",
            "status": "pending",
            "ApiKey": "pk_prod_01GTC8JT9MDSW8G11HPPKSVBTJ",
            "sourceCurrency": "eur",
            "country": "lk",
            "info": "response-pulling-event-testing",
            "inAmount": 100,
            "outAmount": 0,
            "TxId": "Wwl5Hom-CW-qCjdZIB97Xg--",
            "externalTransactionId": "4a28307f-0cc8-47ec-aaf9-278b2ac2f2e4",
            "sk": "2023-01-20T15:15:33.922Z",
            "wallet": "0x29bd7d9bed3028e72208f94e696b526d32b20efe",
            "paymentMethod": "credit_debit_card"
        },
        {
            "targetCurrency": "btc",
            "onramp": "stripe",
            "statusDate": "2023-03-01T13:53:13.541Z",
            "txType": "onramp",
            "status": "paid",
            "ApiKey": "pk_prod_01GTC8JT9MDSW8G11HPPKSVBTJ",
            "sourceCurrency": "usd",
            "country": "us",
            "inAmount": 100,
            "TxId": "01GTEQ1ZM4TNF31BK5CH37BNJ6",
            "sk": "2023-03-01T13:53:13.541Z",
            "paymentMethod": "creditcard"
        },
       ...
       
    ],
    "limit": 12
}