> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.sqril.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sqril.io/_mcp/server.

# Preview Quotations

POST https://stg-api.sqril.io/previewQuotations
Content-Type: application/json

Stateless pricing preview across every corridor enabled on your account. Converts `amount` in `currency` to USD, then returns a quotation for each currency in your account `supported_currencies`.

**Use this instead of decodeQr + getQuotation when you only need a rate.** It creates no transaction, so it will not appear in `listTransactions` and nothing expires against your account. One call covers every corridor you have enabled.

**Authentication**

- **REQUIRED**: Basic Auth `Authorization: Basic base64(client_id:client_secret)`.

**Request validation (order)**

- `amount` (number, **required**): must be **\> 0**, else **400** `INVALID_AMOUNT`.

- `currency` (string, **required**): ISO 4217, case-insensitive, else **400** `MISSING_REQUIRED_FIELD`.

- **401** `AUTHENTICATION_REQUIRED` if authentication fails.

- **429** `RATE_LIMIT_EXCEEDED` when the per-app rate limit is hit.

- **400** `INVALID_CURRENCY` when no exchange rate is available for `currency`.

**Behaviour**

- Target currencies come from your account `supported_currencies` (falls back to `USD` when none are configured).

- A target currency is **omitted** from the response when it has no available FX rate, or when the converted local amount falls outside that corridor’s min/max limits.

- Responses are cached briefly; `expires_at` is always refreshed to **30 minutes** from the time of the response.

**Response (200 JSON)**

- `quotations`: array of per-corridor items, each with `amount` and `currency` (local), `exchange_rate`, `amount_usd`, `fee`, `percentage_fee`, `fixed_fee`, `expires_at`.

- Formatting matches the other pricing endpoints: `exchange_rate` at **10** decimal places, USD fields at **2**.

**Note:** these figures are indicative. Binding pricing for a specific payout still comes from `getQuotation` on a real transaction.

Reference: https://docs.sqril.io/sqril-saa-s-api/payout-endpoints/preview-quotations

## Authentication

- `Authorization` header (basic auth, required) — Basic Auth: base64(client_id:client_secret)

## Request

### Query parameters

- `dp` (integer, optional, default: 2) — Decimal places for monetary fields in the response (USD amounts, fees, exchange rates). Default 2, which rounds sub-cent fees to 0. Use dp=4 or higher to reconcile against exact deducted totals: at full precision amount_usd + percentage_fee + fixed_fee equals the amount deducted from your balance. Rounding is applied to the response only; all stored values and balance deductions always use full precision.

### Body (application/json)

- `amount` (double, required) — Amount in `currency`, must be greater than 0
- `currency` (string, required) — ISO 4217 code of the input amount, e.g. USD

## Response

### 200

OK

- `quotations` (list of object, optional)
  - `amount` (double, optional)
  - `currency` (string, optional)
  - `exchange_rate` (double, optional)
  - `amount_usd` (double, optional)
  - `fee` (double, optional)
  - `percentage_fee` (double, optional)
  - `fixed_fee` (double, optional)
  - `expires_at` (string, optional)

## Examples

**Request**

```json
{
  "amount": 100,
  "currency": "USD"
}
```

**Response**

```json
{
  "quotations": [
    {
      "amount": 1.1,
      "currency": "string",
      "exchange_rate": 1.1,
      "amount_usd": 1.1,
      "fee": 1.1,
      "percentage_fee": 1.1,
      "fixed_fee": 1.1,
      "expires_at": "string"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://stg-api.sqril.io/previewQuotations"

payload = {
    "amount": 100,
    "currency": "USD"
}
headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://stg-api.sqril.io/previewQuotations';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/json'
  },
  body: '{"amount":100,"currency":"USD"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://stg-api.sqril.io/previewQuotations"

	payload := strings.NewReader("{\n  \"amount\": 100,\n  \"currency\": \"USD\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.SetBasicAuth("<username>", "<password>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://stg-api.sqril.io/previewQuotations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.basic_auth("<username>", "<password>")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"amount\": 100,\n  \"currency\": \"USD\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://stg-api.sqril.io/previewQuotations")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": 100,\n  \"currency\": \"USD\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://stg-api.sqril.io/previewQuotations', [
  'body' => '{
  "amount": 100,
  "currency": "USD"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://stg-api.sqril.io/previewQuotations");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"amount\": 100,\n  \"currency\": \"USD\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/json"
]
let parameters = [
  "amount": 100,
  "currency": "USD"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://stg-api.sqril.io/previewQuotations")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```