> ## Documentation Index
> Fetch the complete documentation index at: https://docs.juicyway.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Swap Rate

> Retrieve the current swap rate for a currency pair.

```json theme={null}
GET /exchange/quote/{id}}
```

**Parameters:**

* `source_currency` (string, required): Source currency (e.g., `USD`).
* `target_currency` (string, required): Target currency (e.g., `NGN`).

**Sample Request**

```bash theme={null}
curl --location 'https://api.spendjuice.com/exchange/quote?source_currency=NGN&target_currency=USD' \
--header 'Authorization: <API-KEY>'
```

**Sample Response**

```json theme={null}
{
  "data": {
    "id": "2f939fe5-fb7b-4234-8b73-761a848d13af",
    "locked": true,
    "rate": 1500,
    "symbol": "USD-NGN",
    "time_to_convert": 10,
    "time_to_lock": 30,
    "type": "buy"
  }
}
```

**Path Parameter**:

* `id` *(string, required)*: The unique identifier of the rate to retrieve. **Example**: `3f27a046-314d-457f-b39b-1ec30561353d`
* `.time_to_convert`
  * **Description**: The Time-To-Live (TTL) of the rate in seconds.
* `time_to_lock`
  * **Description**: The duration (in seconds) before the rate becomes available for locking while it is being unlocked.
* `locked`
  * **Description**:
    * A locked quote is available for use in a swap within the `time_to_convert` interval.
    * An unlocked rate will become unavailable after the `time_to_lock` interval.
    * By default, the quote is locked for authenticated requests.
    * To prevent locking, add `lock=false` to the quote endpoint parameters.
* `type`
  * **Description**: Specifies the conversion side from the provider's perspective. Possible values are `buy` or `sell`.

## Locking a Rate

Once you have fetched a quote, you can use the request below to lock it in.

```
curl --location --request POST 'https://api.spendjuice.com/exchange/quote/<quote_id>/lock' \
--header 'Authorization: <API-KEY>'
```
