# OTC

## Create Quote

<mark style="color:green;">`POST`</mark> `https://api.vaultoro.com/v1/private/orders/otc`

This OTC endpoint allows you to fetch a BUY/SELL quote for a pair before committing to the purchase. Your quote price will be valid for 30 seconds from the time of request.\
\
You can send in a quantity or total with your request. The quantity represents the amount of the baseHandle you wish to buy or sell. And the total is the total to spend. \
\
For example, you want to buy GOLD with BTC. Sending in quantity 1 - you're getting 1 gram of Gold for BTC. However, if you send in the total value, your quote will assume you want to spend 1 BTC. &#x20;

#### Query Parameters

| Name     | Type   | Description                                                                                                                                                                      |
| -------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| match    | string | 'spend' or 'receive'                                                                                                                                                             |
| quantity | string | The quantity field represents the amount of the asset you wish to buy. For more information, please refer to the details above. This field is required unless the total is sent. |
| pair     | string | The pair you wish to retrieve a quote for. Currently supported pairs include GOLDBTC and GOLDDASH.                                                                               |
| type     | string | The type of quote you require pricing for. Either BUY or SELL.                                                                                                                   |

#### Headers

| Name   | Type   | Description        |
| ------ | ------ | ------------------ |
| VTOKEN | string | Vaultoro API token |

{% tabs %}
{% tab title="200 Quote successfully retrieved." %}

```
{
    "data":{
				"pair":"GOLDBTC",
				"quantity":"0.5",
				"quoteID":"e9b2d55e-f8b9-422f-b391-fb9287d9b171",
	      "type":"BUY",
	      "match":"spend",
	      "ticker":"0.00139808",
	      "expires":1629986181
    }
}

```

{% endtab %}
{% endtabs %}

## Create OTC Order

<mark style="color:green;">`POST`</mark> `https://api.vaultoro.com/v1/private/orders/otc`

Call the same endpoint with the quoteID returned in the previous call to confirm the order. Without the quoteID, a new quote will be created.

#### Headers

| Name   | Type   | Description        |
| ------ | ------ | ------------------ |
| VTOKEN | string | Vaultoro API Token |

#### Request Body

| Name     | Type   | Description                                                                                        |
| -------- | ------ | -------------------------------------------------------------------------------------------------- |
| quoteID  | string | Enter a quoteID for a previously created quote.                                                    |
| type     | string | The type of quote, BUY or SELL.                                                                    |
| quantity | string | The quantity field represents the amount of asset you wish to buy.                                 |
| match    | string | 'spend' or 'receive'                                                                               |
| pair     | string | The pair you wish to retrieve a quote for. Currently supported pairs include GOLDBTC and GOLDDASH. |

{% tabs %}
{% tab title="200 OTC order successfully placed" %}

```
{
    "data": {
        "result": {
						"referenceId":"7452336d-3567-4e10-b482-a1cec04897dc",
						"createdAt":1629986429,
						"matchType":"OTC",
						"price":"0.00139737",
						"quantity":"5",
						"type":"BUY",
						"pair":"GOLD:BTC"
	      }
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-docs.vaultoro.com/otc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
