### Onramp User Guides Source: https://docs.onramp.money/onramp/onramp-widget-integration/overlay-mode/overlay-mode-guide Guides for users on how to perform various actions within the Onramp Money platform, including resuming transactions and buying/selling crypto. ```APIDOC GET /onramp/user-guides/resume-transaction-onramp Description: Guide on how to resume an onramp transaction. Parameters: None specified in the link. Returns: Step-by-step instructions. GET /onramp/user-guides/resume-transaction-offramp Description: Guide on how to resume an offramp transaction. Parameters: None specified in the link. Returns: Step-by-step instructions. GET /onramp/user-guides/resume-transaction-offramp-alternate-bank-account Description: Guide on resuming offramp transactions with an alternate bank account. Parameters: None specified in the link. Returns: Specific instructions for alternate bank accounts. GET /onramp/user-guides/buy-crypto Description: User guide for purchasing cryptocurrency. Parameters: None specified in the link. Returns: Instructions for buying crypto. GET /onramp/user-guides/sell-crypto Description: User guide for selling cryptocurrency. Parameters: None specified in the link. Returns: Instructions for selling crypto. GET /onramp/user-guides/sell-crypto-binance-flow Description: Specific guide for selling crypto using the Binance flow. Parameters: None specified in the link. Returns: Binance-specific selling instructions. ``` -------------------------------- ### Node.js GET Endpoints Examples Source: https://docs.onramp.money/onramp/logs Provides Node.js code examples for all GET endpoints within the Onramp Money API documentation. These examples are intended to help developers integrate with the API efficiently. ```Node.js // Example for fetching coin details (V3 Endpoints) // GET /api/v3/coins async function getCoinDetails() { const response = await fetch('/api/v3/coins'); const data = await response.json(); console.log(data); } // Example for fetching quotes API (Offramp) // GET /api/quotes/sell async function getSellQuotes(params) { const queryString = new URLSearchParams(params).toString(); const response = await fetch(`/api/quotes/sell?${queryString}`); const data = await response.json(); console.log(data); } // Example for fetching merchant transaction history // GET /api/merchant/transactions async function getMerchantHistory(params) { const queryString = new URLSearchParams(params).toString(); const response = await fetch(`/api/merchant/transactions?${queryString}`); const data = await response.json(); console.log(data); } ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/merchant-onboarding-flow This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/offramp-widget-integration/sandbox-mode/sandbox-quick-guide This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Node.js GET Endpoints Examples Source: https://docs.onramp.money/onramp/logs/change-logs Provides Node.js code examples for all GET endpoints within the Onramp Money API documentation. These examples are intended to help developers integrate with the API efficiently. ```Node.js // Example for fetching coin details (V3 Endpoints) // GET /api/v3/coins async function getCoinDetails() { const response = await fetch('/api/v3/coins'); const data = await response.json(); console.log(data); } // Example for fetching quotes API (Offramp) // GET /api/quotes/sell async function getSellQuotes(params) { const queryString = new URLSearchParams(params).toString(); const response = await fetch(`/api/quotes/sell?${queryString}`); const data = await response.json(); console.log(data); } // Example for fetching merchant transaction history // GET /api/merchant/transactions async function getMerchantHistory(params) { const queryString = new URLSearchParams(params).toString(); const response = await fetch(`/api/merchant/transactions?${queryString}`); const data = await response.json(); console.log(data); } ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/onramp-widget-integration/sandbox-mode/sandbox-quick-guide This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Node.js Code Examples for API Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/logs Node.js examples have been added for all GET endpoints in the API documentation, aiding developers using Node.js. ```apidoc Node.js API Examples: Scope: All GET endpoints. Purpose: Provide practical code examples for Node.js developers. Content: Demonstrations of how to call various GET endpoints using Node.js. Example (Conceptual for GET /coins/details/v2): const axios = require('axios'); async function getCoinDetails() { try { const response = await axios.get('https://api.onramp.money/v1/coins/details/v2'); console.log(response.data); } catch (error) { console.error('Error fetching coin details:', error); } } getCoinDetails(); ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/onramp-widget-integration/hosted-mode/hosted-mode-guide This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Node.js Code Examples for API Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/logs/change-logs Node.js examples have been added for all GET endpoints in the API documentation, aiding developers using Node.js. ```apidoc Node.js API Examples: Scope: All GET endpoints. Purpose: Provide practical code examples for Node.js developers. Content: Demonstrations of how to call various GET endpoints using Node.js. Example (Conceptual for GET /coins/details/v2): const axios = require('axios'); async function getCoinDetails() { try { const response = await axios.get('https://api.onramp.money/v1/coins/details/v2'); console.log(response.data); } catch (error) { console.error('Error fetching coin details:', error); } } getCoinDetails(); ``` -------------------------------- ### Onramp Project User Guides Overview Source: https://docs.onramp.money/onramp/logs Contains links to user guides for various functionalities within the Onramp project, such as resuming transactions, buying/selling crypto, and specific flows like Binance. ```APIDOC User Guides: - Resume Transaction - onramp: /onramp/user-guides/resume-transaction-onramp - Resume Transaction - offramp: /onramp/user-guides/resume-transaction-offramp - Resume Transaction - offramp (Alternate Bank account): /onramp/user-guides/resume-transaction-offramp-alternate-bank-account - Buy Crypto: /onramp/user-guides/buy-crypto - Sell Crypto: /onramp/user-guides/sell-crypto - Sell Crypto - Binance flow: /onramp/user-guides/sell-crypto-binance-flow ``` -------------------------------- ### Onramp Widget Overlay Mode Guide Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/logs A guide for developers on integrating the Onramp widget using overlay mode, including practical examples for hands-on experience. ```APIDOC Onramp Widget Integration - Overlay Mode Description: Details on how to implement the Onramp widget in an overlay mode, allowing it to be displayed on top of existing web content. Key Features: - Seamless integration into existing user interfaces. - Customizable display options. - Embedded CodePen for live testing and demonstration. Usage: Refer to the guide for specific JavaScript snippets and configuration options to enable overlay mode. Dependencies: - Onramp Widget SDK Related: - Webhook Updates for Onramp ``` -------------------------------- ### Onramp Widget Overlay Mode Guide Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/logs/change-logs A guide for developers on integrating the Onramp widget using overlay mode, including practical examples for hands-on experience. ```APIDOC Onramp Widget Integration - Overlay Mode Description: Details on how to implement the Onramp widget in an overlay mode, allowing it to be displayed on top of existing web content. Key Features: - Seamless integration into existing user interfaces. - Customizable display options. - Embedded CodePen for live testing and demonstration. Usage: Refer to the guide for specific JavaScript snippets and configuration options to enable overlay mode. Dependencies: - Onramp Widget SDK Related: - Webhook Updates for Onramp ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/onramp-widget-integration/allconfig-all-coin-details/coinnetwork-get-all-supported-networks This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Get Order Request Example (Node.js) Source: https://docs.onramp.money/onramp/crypto-merchant-widget/get-order Demonstrates how to construct and send a request to the Get Order API using Node.js, including payload signing with HMAC-SHA512. ```javascript const CryptoJS = require('crypto-js'); const axios = require('axios'); async function getOrder(apiKey, apiSecret, orderId, hash) { try { let body = { orderId, // Provide either orderId or hash hash }; let payload = { timestamp: new Date().getTime(), body }; payload = Buffer.from(JSON.stringify(payload)).toString('base64'); let signature = CryptoJS.enc.Hex.stringify(CryptoJS.HmacSHA512(payload, apiSecret)); let options = { url: 'https://api.onramp.money/onramp-merchants/widget/getOrder', method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json;charset=UTF-8', 'X-ONRAMP-SIGNATURE': signature, 'X-ONRAMP-APIKEY': apiKey, 'X-ONRAMP-PAYLOAD': payload }, data: body }; let response = await axios(options); console.log(response?.data); } catch (error) { console.log(error?.response?.data); } } // Example usage (replace with your actual keys and values): // const apiKey = 'YOUR_API_KEY'; // const apiSecret = 'YOUR_API_SECRET'; // const orderId = 'some_order_id'; // const hash = 'some_hash'; // getOrder(apiKey, apiSecret, orderId, hash); ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/onramp-widget-integration/overlay-mode/overlay-mode-guide This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Get Order Request Example (Python) Source: https://docs.onramp.money/onramp/crypto-merchant-widget/get-order Provides the necessary imports for constructing and sending a request to the Get Order API using Python, including base64 encoding and HMAC-SHA512 hashing. ```python import base64 import json import time import hmac import hashlib import requests # The Python code snippet is incomplete in the provided text, only imports are shown. # A full implementation would involve similar logic to the Node.js example for payload creation, signing, and making the request. ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/frequently-asked-questions-faqs This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Onramp.money Hosted Integration Example URL Source: https://docs.onramp.money/onramp/swap-widget-integration An example URL demonstrating how to pre-fill transaction parameters for the Onramp.money hosted payment flow. This allows users to be directed straight to the confirmation page. ```APIDOC Example URL: https://onramp.money/main/swap/?appId=1&sellAmount=12&sellCoinCode=usdt&receiveCoinCode=usdc&sellNetwork=bep20&receiveNetwork=matic20 ``` -------------------------------- ### Onramp Project User Guides Overview Source: https://docs.onramp.money/onramp/logs/change-logs Contains links to user guides for various functionalities within the Onramp project, such as resuming transactions, buying/selling crypto, and specific flows like Binance. ```APIDOC User Guides: - Resume Transaction - onramp: /onramp/user-guides/resume-transaction-onramp - Resume Transaction - offramp: /onramp/user-guides/resume-transaction-offramp - Resume Transaction - offramp (Alternate Bank account): /onramp/user-guides/resume-transaction-offramp-alternate-bank-account - Buy Crypto: /onramp/user-guides/buy-crypto - Sell Crypto: /onramp/user-guides/sell-crypto - Sell Crypto - Binance flow: /onramp/user-guides/sell-crypto-binance-flow ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/merchant-checkout-widget/token-sale-live-widget-guide This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Onramp.money Hosted Integration Example URL Source: https://docs.onramp.money/onramp/swap-widget-integration/hosted-mode An example URL demonstrating how to pre-fill transaction parameters for the Onramp.money hosted payment flow. This allows users to be directed straight to the confirmation page. ```APIDOC Example URL: https://onramp.money/main/swap/?appId=1&sellAmount=12&sellCoinCode=usdt&receiveCoinCode=usdc&sellNetwork=bep20&receiveNetwork=matic20 ``` -------------------------------- ### Get Coin Details using Python Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/onramp-widget-integration/allconfig-all-coin-details/coindetails-price-details-for-desired-amount Provides a Python example for integrating with the Onramp API to retrieve coin details. It uses the requests library to make a GET request and prints the JSON response if successful. ```python import requests def coin_details(coinCode, chainId, fiatAmount, fiatType): url = f'https://api.onramp.money/onramp/api/v3/buy/public/coinDetails?coinCode={coinCode}&chainId={chainId}&fiatAmount={fiatAmount}&fiatType={fiatType}' response = requests.get(url) if response.status_code == 200: print(response.json()) else: print(f"Request failed with status code {response.status_code}") coin_details('usdt', 3, 100, 1) ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/user-guides This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Get Coin Details API Source: https://docs.onramp.money/onramp/onramp-widget-integration/allconfig-all-coin-details/coindetails-price-details-for-desired-amount Retrieves price details for a specific cryptocurrency and a desired amount. It requires specifying the coin and amount to get relevant pricing information. Users can refer to supported fiat currencies and payment methods via provided links. ```APIDOC GET https://api.onramp.money/onramp/api/v3/buy/public/coinDetails Description: Get details for a specific coin and desired amount. Notes: - Supported Currencies: To view the list of all the fiat currencies supported by Onramp, click here: /onramp/supported-assets-and-fiat/fiat-currencies. - Supported Payment Methods: To view the list of all the supported payment methods for various currencies supported by Onramp, click here: /onramp/supported-assets-and-fiat/payment-methods. Parameters: (Implicitly passed in request, e.g., query parameters or body) - coin: The cryptocurrency for which to fetch details. - amount: The desired amount for which to fetch price details. Returns: Price details for the specified coin and amount. ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/onramp-widget-integration/allconfig-all-coin-details This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/sdk-integration This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Python: Fetch Coin Details Source: https://docs.onramp.money/onramp/onramp-widget-integration/allconfig-all-coin-details/coindetails-price-details-for-desired-amount Example using Python with the requests library to call the coinDetails API endpoint and print the JSON response. ```python import requests def coin_details(coinCode, chainId, fiatAmount, fiatType): url = f'https://api.onramp.money/onramp/api/v3/buy/public/coinDetails?coinCode={coinCode}&chainId={chainId}&fiatAmount={fiatAmount}&fiatType={fiatType}' response = requests.get(url) if response.status_code == 200: print(response.json()) else: print(f"Request failed with status code {response.status_code}") coin_details('usdt', 3, 100, 1) ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/merchant-checkout-widget/domain-live-widget-guide This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Node.js: Fetch Coin Details Source: https://docs.onramp.money/onramp/onramp-widget-integration/allconfig-all-coin-details/coindetails-price-details-for-desired-amount Example using Node.js with the axios library to call the coinDetails API endpoint and log the response data. ```javascript const axios = require('axios'); const coinDetails = async (coinCode, chainId, fiatAmount, fiatType) => { try { const response = await axios.get( `https://api.onramp.money/onramp/api/v3/buy/public/coinDetails?coinCode=${coinCode}&chainId=${chainId}&fiatAmount=${fiatAmount}&fiatType=${fiatType}` ); console.log(JSON.stringify(response.data, null, 2)); } catch (error) { console.error(`Error: ${error}`); } }; coinDetails('usdt', '3', '100', '1'); ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/offramp-widget-integration/get-all-coin-details-v2/parse-coin-and-network-details This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Node.js Example: Fetch Timestamp and Merchant History Source: https://docs.onramp.money/onramp/rest-api-endpoints/current-timestamp/synchronisation-troubleshooting-guide This Node.js script demonstrates how to authenticate and interact with the Onramp Money API. It includes fetching a server timestamp to ensure request freshness and then making a POST request to the merchantHistory endpoint. The example utilizes the 'axios' library for HTTP requests and 'crypto-js' for generating the HMAC-SHA512 signature required for authentication. ```javascript var CryptoJS = require('crypto-js'); const axios = require('axios'); const currentTimestamp = async () => { try { const response = await axios.get(`https://api.onramp.money/onramp/api/v2/common/public/currentTimestamp`); // console.log("Timestamp API Response:", JSON.stringify(response.data.data, null, 2)); return response.data.data; } catch (error) { console.error("Timestamp API Error:", error); return null; } }; async function main() { try { const API_KEY = "API_KEY"; const API_SECRET = "API_SECRET"; let body = { page: 2, pageSize: 50, order: "ASC" }; let current_timestamp = await currentTimestamp(); //let current_timestamp = new Date().getTime(); // local timestamp if (!current_timestamp) { current_timestamp = new Date().getTime(); } console.log("Current Timestamp:", current_timestamp); let payload = { timestamp: current_timestamp, body: body }; payload = Buffer.from(JSON.stringify(payload)).toString('base64'); let signature = CryptoJS.enc.Hex.stringify(CryptoJS.HmacSHA512(payload, API_SECRET)); let options = { url: 'https://api.onramp.money/onramp/api/v1/transaction/merchantHistory', method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json;charset=UTF-8', 'X-RECON-SIGNATURE': signature, 'X-RECON-APIKEY': API_KEY, 'X-RECON-PAYLOAD': payload }, data: body }; console.log("API Request Options:", options); let data = await axios(options); console.log("API Response:", data?.data); } catch (error) { console.log("Error Details:", error); } } main(); ``` -------------------------------- ### Onramp.money Redirect Response Handling Source: https://docs.onramp.money/onramp/swap-widget-integration Illustrates how the `redirectUrl` parameter works by showing example URLs that Onramp.money redirects to after a transaction is completed, pending, or failed. This enables applications to track transaction status. ```APIDOC // After successful transaction http://onramp-example.com?orderId=123&status=success // In case transaction is pending http://onramp-example.com?orderId=123&status=pending ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/onramp-widget-integration/quick-start This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Onramp.money Redirect Response Handling Source: https://docs.onramp.money/onramp/swap-widget-integration/hosted-mode Illustrates how the `redirectUrl` parameter works by showing example URLs that Onramp.money redirects to after a transaction is completed, pending, or failed. This enables applications to track transaction status. ```APIDOC // After successful transaction http://onramp-example.com?orderId=123&status=success // In case transaction is pending http://onramp-example.com?orderId=123&status=pending ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/offramp-widget-integration/sandbox-mode This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Onramp Money API Endpoints Source: https://docs.onramp.money/onramp/rest-api-endpoints/current-timestamp/synchronisation-troubleshooting-guide Documentation for key Onramp Money API endpoints used in the integration example. This includes the endpoint for retrieving the current server timestamp and the endpoint for fetching merchant transaction history. ```APIDOC GET /onramp/api/v2/common/public/currentTimestamp Description: Retrieves the current server timestamp in milliseconds. This is crucial for generating accurate request signatures. Parameters: None Returns: object: An object containing the server timestamp. data: number - The current server timestamp in milliseconds. Example: { "code": 200, "message": "Success", "data": 1678886400000 } POST /onramp/api/v1/transaction/merchantHistory Description: Fetches a history of merchant transactions. Requires authentication via API Key, Payload, and Signature. Authentication: - X-RECON-APIKEY: Your API key. - X-RECON-PAYLOAD: Base64 encoded JSON string containing 'timestamp' and 'body'. - X-RECON-SIGNATURE: HMAC-SHA512 hash of the payload, keyed by your API secret. Parameters (in request body): page: integer - The page number for pagination. pageSize: integer - The number of items per page. order: string - The order of results ('ASC' or 'DESC'). Returns: object: An object containing transaction history and pagination details. data: array - List of transaction objects. total: integer - Total number of transactions. page: integer - Current page number. pageSize: integer - Items per page. Example Request Body: { "page": 2, "pageSize": 50, "order": "ASC" } Example Response: { "code": 200, "message": "Success", "data": [ { "transactionId": "txn_12345", "amount": 100.50, "currency": "USD", "timestamp": 1678886400000 } ], "total": 100, "page": 2, "pageSize": 50 } Error Conditions: - 401: Unauthorized (invalid API key or signature). - 400: Bad Request (invalid payload or parameters). ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/merchant-checkout-widget/ticket-sale-live-widget-guide This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Get Merchant Transaction History API Source: https://docs.onramp.money/onramp/offramp-widget-integration/sandbox-mode/sandbox-quick-guide This API endpoint allows users, partners, or merchants to check their transaction history. It provides access to all transactions placed by the user or associated with the merchant account. ```APIDOC Merchant Transaction History API: Endpoint: /onramp/rest-api-endpoints/merchant-transaction-history Description: Retrieves transaction history for merchants and partners. Usage: - Users can find all transactions placed by them. - Partners or merchants can check transaction details. Sample Request: Refer to the documentation for specific request formats and parameters, including anchors like #sample-request for detailed examples. ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/metamask This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/onramp-widget-integration/sandbox-mode This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Get Coin Networks (Python) Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/onramp-widget-integration/allconfig-all-coin-details/coinnetwork-get-all-supported-networks Provides a Python example using the requests library to call the OnRamp Money API for coin network details. It handles successful responses and prints JSON data, or reports request failures. ```python import requests def coin_networks(coinCode, fiatType): url = f'https://api.onramp.money/onramp/api/v3/buy/public/coinNetworks?coinCode={coinCode}&fiatType={fiatType}' response = requests.get(url) if response.status_code == 200: print(response.json()) else: print(f"Request failed with status code {response.status_code}") coin_networks('usdt', '1') ``` -------------------------------- ### Get Quotes API - Node.js Example Source: https://docs.onramp.money/onramp/rest-api-endpoints/quotes-api-onramp Demonstrates how to fetch transaction quotes using the Onramp Money API with Node.js. It shows how to construct the request payload, generate a signature using CryptoJS, and make a POST request using Axios. ```javascript var CryptoJS = require('crypto-js'); var axios = require('axios'); async function getQuotes() { try { let body = { coinId: 54, coinCode: "usdt", // (if both coinId and coinCode are passed -> coinCode takes precedence) chainId: 3, network: "bep20", //(if both chainId and network are passed -> network takes precedence) fiatAmount: 200, fiatType: 1, // Fiat Type from config file 1 for INR || 2 for TRY || 3 for AED || 4 for MXN etc type: 1 // 1 -> onramp || 2 -> offramp } let payload = { timestamp: new Date().getTime(), body } let apiKey = 'API_KEY', apiSecret = 'API_SECRET'; payload = Buffer.from(JSON.stringify(payload)).toString('base64'); let signature = CryptoJS.enc.Hex.stringify(CryptoJS.HmacSHA512(payload, apiSecret)); let options = { url: 'https://api.onramp.money/onramp/api/v2/common/transaction/quotes', method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json;charset=UTF-8', 'X-ONRAMP-SIGNATURE': signature, 'X-ONRAMP-APIKEY': apiKey, 'X-ONRAMP-PAYLOAD': payload }, data: body }; let data = await axios(options) console.log(data?.data); } catch (error) { console.log(error?.response?.data) } } getQuotes(); ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/logs This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/offramp-widget-integration This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Get Coin Networks (Python) Source: https://docs.onramp.money/onramp/onramp-widget-integration/allconfig-all-coin-details/coinnetwork-get-all-supported-networks Provides a Python example using the requests library to call the OnRamp Money API for coin network details. It handles successful responses and prints JSON data, or reports request failures. ```python import requests def coin_networks(coinCode, fiatType): url = f'https://api.onramp.money/onramp/api/v3/buy/public/coinNetworks?coinCode={coinCode}&fiatType={fiatType}' response = requests.get(url) if response.status_code == 200: print(response.json()) else: print(f"Request failed with status code {response.status_code}") coin_networks('usdt', '1') ``` -------------------------------- ### User Guides Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/rest-api-endpoints/current-timestamp/synchronisation-troubleshooting-guide This section contains user guides for various operations within the Money Onramp platform. It covers resuming transactions, buying and selling crypto, and specific flows like the Binance integration. ```APIDOC User Guides: - Resume Transaction - onramp: Guide on how to resume an onramp transaction. - Resume Transaction - offramp: Guide on how to resume an offramp transaction. - Resume Transaction - offramp (Alternate Bank account): Specific guide for resuming offramp transactions with alternate bank accounts. - Buy Crypto: Instructions for purchasing cryptocurrency. - Sell Crypto: Instructions for selling cryptocurrency. - Sell Crypto - Binance flow: Specific guide for selling crypto using the Binance integration. ``` -------------------------------- ### Get Coin Details API Endpoint Source: https://docs.onramp.money/onramp/onramp-widget-integration/allconfig-all-coin-details/coindetails-price-details-for-desired-amount Retrieves detailed information about a specific cryptocurrency, including its current price and gas fee information, based on provided coin code, chain ID, fiat amount, and fiat type. ```APIDOC GET /onramp/api/v3/buy/public/coinDetails Description: Retrieves details for a specific cryptocurrency. Parameters: Path Parameters: coinCode (string, required): The name or key of the coin. Supported values include 'usdt', 'usdc', 'busd', 'eth', 'bnb', 'matic', 'sol'. chainId (integer, required): The chain ID from the configuration file. fiatAmount (number, required): The fiat amount for the transaction. fiatType (integer, required): The fiat type from the configuration file, indicating the localized region and currency. 1: India (Default) INR 2: Turkey (TRY) 3: Arab Emirates Dirham (AED) 4: Mexican Peso (MXN) 5: Vietnamese dong (VND) 6: Nigerian Naira (NGN) Example Request: https://api.onramp.money/onramp/api/v3/buy/public/coinDetails?coinCode=usdt&chainId=3&fiatAmount=100&fiatType=1 Response (200 OK): { "status": 1, "code": 200, "data": { "price": 91.5, "gasFee": { "withdrawalFee": "0.14", "minimumWithdrawal": "0.15", "nodeInSync": 1 } } } Response Field Explanations: status (integer): 0 for unsuccessful request, 1 for successful. code (integer): HTTP status code. data.price (number): The current price of the cryptocurrency for the requested amount. data.gasFee.withdrawalFee (string): Transaction fee for on-chain withdrawal. data.gasFee.minimumWithdrawal (string): Minimum amount that can be withdrawn on-chain in a single transaction. data.gasFee.nodeInSync (integer): Indicates if the node is in sync with the network (1 for in sync, 0 otherwise). ``` -------------------------------- ### Onramp Project Metamask User Guide Overview Source: https://docs.onramp.money/onramp/logs Provides links to user guides specifically for Metamask users interacting with the Onramp project, covering general usage and troubleshooting common issues. ```APIDOC Metamask User Guide: - User Guide for Metamask Users: /onramp/metamask/user-guide-for-metamask-users - Payment done but transaction not showing: /onramp/metamask/user-guide-for-metamask-users/payment-done-but-transaction-not-showing - How to check transaction history: /onramp/metamask/user-guide-for-metamask-users/how-to-check-transaction-history ``` -------------------------------- ### Get Order Status - Node.js Example Source: https://docs.onramp.money/onramp/~/changes/XH0ZLTglNU6NMYVKybvm/rest-api-endpoints/order-status This Node.js code snippet demonstrates how to call the Onramp Money API to retrieve the order status of a transaction. It includes setting up the request payload, generating the signature using HMAC-SHA512, and making the POST request with Axios. ```javascript var CryptoJS = require('crypto-js'); var axios = require('axios'); async function orderStatus() { try { let body = { orderId: '89912', type: 1 // 1 -> onramp, 2 -> offramp } let payload = { timestamp: new Date().getTime(), body } let apiKey = 'API_KEY', apiSecret = 'API_SECRET'; payload = Buffer.from(JSON.stringify(payload)).toString('base64'); let signature = CryptoJS.enc.Hex.stringify(CryptoJS.HmacSHA512(payload, apiSecret)); let options = { url: 'https://api.onramp.money/onramp/api/v2/common/transaction/orderStatus', method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json;charset=UTF-8', 'X-ONRAMP-SIGNATURE': signature, 'X-ONRAMP-APIKEY': apiKey, 'X-ONRAMP-PAYLOAD': payload }, data: body }; let data = await axios(options) console.log(data?.data); } catch (error) { console.log(error?.response?.data) } } orderStatus(); ```