> For a complete page index, fetch https://docs.transak.com/llms.txt # Get Quote GET https://api-stg.transak.com/ledger/v1/quote Fetch a temporary price quote for a cryptocurrency sell transaction based on the selected fiat currency, cryptocurrency, payment method, and transaction amount. Because crypto prices are volatile, the returned quote is temporary and should be refreshed before order creation. ![Quote](https://assets.transak.com/doc/quote.png) Reference: https://docs.transak.com/api/ledger-off-ramp/get-quote ## Servers - `https://api-stg.transak.com/ledger/v1` (Staging, default) - `https://api.transak.com/ledger/v1` (Production) ## Request ### Query parameters - `to` (string, required) — Fiat currency. - `from` (string, required) — Crypto currency in Ledger format (`ledgerId`). - `payment-method` (string, required) — Selected payment method in Ledger format. - `amount` (string, required) — Crypto currency amount. ### Headers - `x-api-key` (string, required) — Transak API key available from the Transak Dashboard. ## Response ### 200 Quote generated successfully. - `quoteId` (string, required) — Temporary quote identifier returned by the wrapper. - `amountFrom` (string, required) — Source crypto amount submitted for quote generation. - `amountTo` (string, required) — Expected fiat payout amount. - `providerFees` (string, required) — Provider fee applied to the quote. - `referralFees` (string, required) — Referral fee applied to the quote. - `expiry` (datetime, required) — Quote expiry timestamp. Quotes should be refreshed regularly because pricing is volatile. ## Errors ### 400 Bad Request Error Missing or invalid request. - `error` (ErrorResponseError, required) ### 500 Internal Server Error Internal server error. - `error` (ErrorResponseError, required) ## Types ### ErrorResponseError - `messageKey` (string, required) - `message` (string, required) ## Examples **Response** ```json { "quoteId": "e8720a2a-2b19-4674-a68f-f4fc3d065c64", "amountFrom": "4", "amountTo": "5549.21", "providerFees": "57.23", "referralFees": "173.42", "expiry": "2025-03-13T10:31:12+00:00" } ``` **SDK Code** ```python success import requests url = "https://api-stg.transak.com/ledger/v1/quote" querystring = {"amount":"","from":"","payment-method":"","to":""} headers = {"x-api-key": ""} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript success const url = 'https://api-stg.transak.com/ledger/v1/quote?amount=&from=&payment-method=&to='; const options = {method: 'GET', headers: {'x-api-key': ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go success package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api-stg.transak.com/ledger/v1/quote?amount=&from=&payment-method=&to=" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-api-key", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby success require 'uri' require 'net/http' url = URI("https://api-stg.transak.com/ledger/v1/quote?amount=&from=&payment-method=&to=") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["x-api-key"] = '' response = http.request(request) puts response.read_body ``` ```java success import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api-stg.transak.com/ledger/v1/quote?amount=&from=&payment-method=&to=") .header("x-api-key", "") .asString(); ``` ```php success request('GET', 'https://api-stg.transak.com/ledger/v1/quote?amount=&from=&payment-method=&to=', [ 'headers' => [ 'x-api-key' => '', ], ]); echo $response->getBody(); ``` ```csharp success using RestSharp; var client = new RestClient("https://api-stg.transak.com/ledger/v1/quote?amount=&from=&payment-method=&to="); var request = new RestRequest(Method.GET); request.AddHeader("x-api-key", ""); IRestResponse response = client.Execute(request); ``` ```swift success import Foundation let headers = ["x-api-key": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-stg.transak.com/ledger/v1/quote?amount=&from=&payment-method=&to=")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```