# 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. Reference: https://docs.transak.com/api/ledger-off-ramp/get-quote ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: ledger-off-ramp-api version: 1.0.0 paths: /quote: get: operationId: get-quote summary: Get Quote description: >- 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. tags: - '' parameters: - name: to in: query description: Fiat currency. required: true schema: type: string - name: from in: query description: Crypto currency in Ledger format (`ledgerId`). required: true schema: type: string - name: payment-method in: query description: Selected payment method in Ledger format. required: true schema: type: string - name: amount in: query description: Crypto currency amount. required: true schema: type: string - name: x-api-key in: header description: Transak API key available from the Transak Dashboard. required: true schema: type: string responses: '200': description: Quote generated successfully. content: application/json: schema: $ref: '#/components/schemas/QuoteResponse' '400': description: Missing or invalid request. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '500': description: Internal server error. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' servers: - url: https://api-stg.transak.com/ledger/v1 - url: https://api.transak.com/ledger/v1 components: schemas: QuoteResponse: type: object properties: quoteId: type: string format: uuid description: Temporary quote identifier returned by the wrapper. amountFrom: type: string description: Source crypto amount submitted for quote generation. amountTo: type: string description: Expected fiat payout amount. providerFees: type: string description: Provider fee applied to the quote. referralFees: type: string description: Referral fee applied to the quote. expiry: type: string format: date-time description: >- Quote expiry timestamp. Quotes should be refreshed regularly because pricing is volatile. required: - quoteId - amountFrom - amountTo - providerFees - referralFees - expiry title: QuoteResponse ErrorResponseError: type: object properties: messageKey: type: string message: type: string required: - messageKey - message title: ErrorResponseError ErrorResponse: type: object properties: error: $ref: '#/components/schemas/ErrorResponseError' required: - error title: ErrorResponse securitySchemes: ApiKeyAuth: type: apiKey in: header name: x-api-key description: Transak API key available from the Transak Dashboard. ``` ## SDK Code Examples ```python success import requests url = "https://api-stg.transak.com/ledger/v1/quote" querystring = {"to":"EUR","from":"bitcoin_testnet","payment-method":"card","amount":"4"} 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?to=EUR&from=bitcoin_testnet&payment-method=card&amount=4'; 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?to=EUR&from=bitcoin_testnet&payment-method=card&amount=4" 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?to=EUR&from=bitcoin_testnet&payment-method=card&amount=4") 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?to=EUR&from=bitcoin_testnet&payment-method=card&amount=4") .header("x-api-key", "") .asString(); ``` ```php success request('GET', 'https://api-stg.transak.com/ledger/v1/quote?to=EUR&from=bitcoin_testnet&payment-method=card&amount=4', [ 'headers' => [ 'x-api-key' => '', ], ]); echo $response->getBody(); ``` ```csharp success using RestSharp; var client = new RestClient("https://api-stg.transak.com/ledger/v1/quote?to=EUR&from=bitcoin_testnet&payment-method=card&amount=4"); 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?to=EUR&from=bitcoin_testnet&payment-method=card&amount=4")! 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() ```