# Create currency exchange quote

`POST https://api.strike.me/v1/currency-exchange-quotes`

Source: https://docs.strike.me/api/create-currency-exchange-quote/

---

Endpoint accepts `idempotency-key` header to prevent the same quote from being created twice. In case of a duplicate request, the error
code `DUPLICATE_CURRENCY_EXCHANGE_QUOTE` containing the id of the original quote (`currencyExchangeQuoteId`) will be returned.
The key should be a random v4 UUID to avoid false collisions.

Required scopes:

- partner.currency-exchange-quote.create

## Headers

- `idempotency-key` (uuid)

## Request body

`application/json`, required

- `sell` (string, required): Currency to sell. One of `BTC`, `USD`, `EUR`, `USDT`, `GBP`, `AUD`.
- `buy` (string, required): Currency to buy. One of `BTC`, `USD`, `EUR`, `USDT`, `GBP`, `AUD`.
- `amount` (object, required): Amount and currency to convert. The currency must match either `buy` or `sell`. FeePolicy defaults to EXCLUSIVE.
  - `amount` (string, required): Currency amount in decimal format.
  - `currency` (string, required): Currency code. One of `BTC`, `USD`, `EUR`, `USDT`, `GBP`, `AUD`.
  - `feePolicy` (string): Should the fee be included in the amount or added on top of it. One of `INCLUSIVE`, `EXCLUSIVE`.

Example:

```json
{
  "sell": "USD",
  "buy": "BTC",
  "amount": {
    "amount": "10.99",
    "currency": "USD",
    "feePolicy": "INCLUSIVE"
  }
}
```

## Responses

### 200 OK

`application/json`

- `id` (uuid, required): ID of the exchange quote.
- `created` (date-time, required): Date and time when the exchange quote was created.
- `validUntil` (date-time, required): Date and time when the exchange quote expires.
- `source` (object, required): Amount sold.
  - `amount` (string, required): Currency amount in decimal format.
  - `currency` (string, required): Currency code. One of `BTC`, `USD`, `EUR`, `USDT`, `GBP`, `AUD`.
- `target` (object, required): Amount bought.
  - `amount` (string, required): Currency amount in decimal format.
  - `currency` (string, required): Currency code. One of `BTC`, `USD`, `EUR`, `USDT`, `GBP`, `AUD`.
- `fee` (object, required): Service fee. The user will be charged this amount on top of what the `source` specifies.
  - `amount` (string, required): Currency amount in decimal format.
  - `currency` (string, required): Currency code. One of `BTC`, `USD`, `EUR`, `USDT`, `GBP`, `AUD`.
- `conversionRate` (object, required): Conversion rate used for the transaction.
  - `amount` (string, required): Currency amount in decimal format.
  - `sourceCurrency` (string, required): Source currency code. One of `BTC`, `USD`, `EUR`, `USDT`, `GBP`, `AUD`.
  - `targetCurrency` (string, required): Target currency code. One of `BTC`, `USD`, `EUR`, `USDT`, `GBP`, `AUD`.
- `state` (string, required): State of the currency exchange quote. One of `NEW`, `PENDING`, `COMPLETED`, `FAILED`.
- `completed` (date-time): Timestamp at which the exchange was completed.

### 401 Unauthorized

### 403 Forbidden

From the Strike API documentation — https://docs.strike.me
