Onramp API Integration.
Crypto Token Quotation
Fetch Quotation
1 min
{ "tab" "examples", "url" "https //stg api onmeta in/v1/quote/buy", "name" "fetch quotation", "method" "post", "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[ { "kind" "required", "name" "x api key", "type" "string", "children" \[], "description" "api key from dashboard" } ], "bodydataparameters" \[ { "kind" "required", "name" "buytokensymbol", "type" "string", "description" "example \\"usdc\\"" }, { "kind" "required", "name" "chainid", "type" "number", "children" \[], "description" "example 80001 for polygon testnet" }, { "kind" "required", "name" "fiatcurrency", "type" "string", "children" \[], "description" "example \\"inr\\"" }, { "kind" "required", "name" "fiatamount", "type" "number", "children" \[], "description" "example 100" }, { "kind" "required", "name" "buytokenaddress", "type" "string", "children" \[], "description" "example \\"0x9c3c9283d3e44854697cd22d3faa240cfb032889\\"" } ], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "sdoxyhdser7cpc7e3j ae", "code" "{\n \\"success\\" true,\n \\"data\\" {\n \\"gaspricewei\\" \\"106000000000\\",\n \\"gasuseestimate\\" \\"70000\\",\n \\"quote\\" \\"876246692566721536\\",\n \\"orders\\" \[\n {\n \\"tokenin\\" {\n \\"isblacklist\\" false,\n \\"address\\" \\"0x9c3c9283d3e44854697cd22d3faa240cfb032889\\",\n \\"chainid\\" 80001,\n \\"decimals\\" 18,\n \\"name\\" \\"wrapped matic (wmatic)\\",\n \\"symbol\\" \\"wmatic\\",\n \\"logouri\\" \\"\\",\n \\"sources\\" null,\n \\"isvisible\\" false,\n \\"updatedat\\" \\"0001 01 01t00 00 00z\\"\n },\n \\"tokenout\\" {\n \\"isblacklist\\" false,\n \\"address\\" \\"0x9c3c9283d3e44854697cd22d3faa240cfb032889\\",\n \\"chainid\\" 80001,\n \\"decimals\\" 18,\n \\"name\\" \\"wrapped matic (wmatic)\\",\n \\"symbol\\" \\"wmatic\\",\n \\"logouri\\" \\"\\",\n \\"sources\\" null,\n \\"isvisible\\" false,\n \\"updatedat\\" \\"0001 01 01t00 00 00z\\"\n },\n \\"source\\" \\"stf\\",\n \\"amountin\\" \\"876246692566721536\\",\n \\"amountout\\" \\"876246692566721536\\"\n }\n ],\n \\"source\\" \\"stf\\",\n \\"gaspricenativetoken\\" \\"7420000000000000\\",\n \\"nativetokendecimals\\" 18,\n \\"estimateid\\" \\"06e28526 f5c4 46c4 9b59 3a199ce59c8f\\",\n \\"desiredorder\\" {\n \\"base\\" \\"gascharge\\" {\n \\"currency\\" \\"inr\\",\n \\"value\\" \\"0 18\\"\n },\n \\"transactionfee\\" 0\n },\n \\"receivedtokens\\" \\"0 8762466926\\",\n \\"conversionrate\\" \\"86 16198\\"\n },\n \\"error\\" {}\n}", "language" "200", "customlabel" "" }, { "id" "77wdordawj4qtplm1amof", "code" "{\n \\"success\\" false,\n \\"error\\" {\n \\"code\\" 400,\n \\"message\\" \\"bad request\\"\n }\n}", "language" "400", "customlabel" "" }, { "id" "ays7rffzbzk mfuk6haj8", "code" "{\n \\"success\\" false,\n \\"error\\" {\n \\"code\\" 401,\n \\"message\\" \\"unauthorized to access\\"\n }\n}", "language" "401", "customlabel" "" } ], "selectedlanguageid" "sdoxyhdser7cpc7e3j ae" }, "examples" { "languages" \[ { "id" "btzoudsqnwctnsxk0yozd", "code" "curl location request post 'https //stg api onmeta in/v1/quote/buy' \\\\\n header 'accept application/json' \\\\\n header 'x api key string' \\\\\n data raw '{\\"buytokensymbol\\" \\"string\\",\\"chainid\\" \\"number\\",\\"fiatcurrency\\" \\"string\\",\\"fiatamount\\" \\"number\\",\\"buytokenaddress\\" \\"string\\"}'", "language" "curl", "customlabel" "" }, { "id" "bihh 1rx6bpam7gi8wmox", "code" "var request = require('request');\nvar options = {\n 'method' 'post',\n 'url' 'https //stg api onmeta in/v1/quote/buy',\n 'headers' {\n 'accept' 'application/json',\n 'x api key' 'string'\n },\n body '{\\"buytokensymbol\\" \\"string\\",\\"chainid\\" \\"number\\",\\"fiatcurrency\\" \\"string\\",\\"fiatamount\\" \\"number\\",\\"buytokenaddress\\" \\"string\\"}'\n\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "language" "nodejs", "customlabel" "" }, { "id" "czkmhgrlg3rdx l2l8 er", "code" "var myheaders = new headers();\nmyheaders append(\\"accept\\", \\"application/json\\");\nmyheaders append(\\"x api key\\", \\"string\\");\n\nvar raw = \\"{\\\\\\"buytokensymbol\\\\\\" \\\\\\"string\\\\\\",\\\\\\"chainid\\\\\\" \\\\\\"number\\\\\\",\\\\\\"fiatcurrency\\\\\\" \\\\\\"string\\\\\\",\\\\\\"fiatamount\\\\\\" \\\\\\"number\\\\\\",\\\\\\"buytokenaddress\\\\\\" \\\\\\"string\\\\\\"}\\";\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n body raw,\n redirect 'follow'\n};\n\nfetch(\\"https //stg api onmeta in/v1/quote/buy\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "language" "javascript", "customlabel" "" }, { "id" "sfthnok8jdlxr6qfmsxwz", "code" "import requests\n\nurl = \\"https //stg api onmeta in/v1/quote/buy\\"\n\npayload = \\"{\\\\\\"buytokensymbol\\\\\\" \\\\\\"string\\\\\\",\\\\\\"chainid\\\\\\" \\\\\\"number\\\\\\",\\\\\\"fiatcurrency\\\\\\" \\\\\\"string\\\\\\",\\\\\\"fiatamount\\\\\\" \\\\\\"number\\\\\\",\\\\\\"buytokenaddress\\\\\\" \\\\\\"string\\\\\\"}\\"\nheaders = {\n 'accept' 'application/json',\n 'x api key' 'string'\n}\n\nresponse = requests request(\\"post\\", url, headers=headers, data=payload)\n\nprint(response text)\n", "language" "python", "customlabel" "" }, { "id" "mleqlpr ax5gisj5vrldz", "code" "require \\"uri\\"\nrequire \\"net/http\"\n\nurl = uri(\\"https //stg api onmeta in/v1/quote/buy\\")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http post new(url)\nrequest\[\\"accept\\"] = \\"application/json\\"\nrequest\[\\"x api key\\"] = \\"string\\"\nrequest body = \\"{\\\\\\"buytokensymbol\\\\\\" \\\\\\"string\\\\\\",\\\\\\"chainid\\\\\\" \\\\\\"number\\\\\\",\\\\\\"fiatcurrency\\\\\\" \\\\\\"string\\\\\\",\\\\\\"fiatamount\\\\\\" \\\\\\"number\\\\\\",\\\\\\"buytokenaddress\\\\\\" \\\\\\"string\\\\\\"}\\"\n\nresponse = https request(request)\nputs response read body\n", "language" "ruby", "customlabel" "" } ], "selectedlanguageid" "btzoudsqnwctnsxk0yozd" }, "description" "fetch quotation for the provided token and chainid combination \n", "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" } } sample request body { 	"buytokensymbol" "wmatic", 	"chainid" 80001, 	"fiatcurrency" "inr", 	"fiatamount" 100, 	"buytokenaddress" "0x9c3c9283d3e44854697cd22d3faa240cfb032889" }