Create quotes

Create a quote for a given currency pair. This can be for either an internal currency exchange or an outbound payment. Once you've created a quote, you'll be able to create an order.

Create a currency quote

Post/v2/orders/quote

Request

Use this request to create a quote for a given currency pair. All quotes expire after 12 seconds.

info

By default, in production, you can only use this request during trading hours and you'll receive live rates. In sandbox, you can use this request 24/7. However, the rates may be a couple of minutes behind current live rates.

Sample requestPayload structure
Copy
Copied
curl -i -X POST \
  'https://api.equalsmoney.com/v2/orders/quote?accountId=F12345' \
  -H 'Authorization: ApiKey YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "sourceCurrency": {
      "amount": 100,
      "currency": {
        "budgetId": "b489ea2c-0dd1-4fb1-b345-de5a596a5527",
        "currencyCode": "GBP"
      }
    },
    "targetCurrency": {
      "currency": {
        "budgetId": "b489ea2c-0dd1-4fb1-b345-de5a596a5527",
        "currencyCode": "EUR"
      }
    },
    "settlementDate": "20231201",
    "type": {
      "from": "balance",
      "to": "payment"
    }
  }'
Copy
Copied
{
  "sourceCurrency": {
    "amount": number,
    "currency": {
      "budgetId": "string",
      "currencyCode": "string"
    }
  },
  "targetCurrency": {
    "amount": number,
    "currency": {
      "budgetId": "string",
      "currencyCode": "string"
    }
  },
  "settlementDate": "string",
  "type": {
    "from": "string",
    "to": "string"
  }
}

Query parameters

Parameter Description
accountId
string
required
The ID of the account that you're creating a quote for.

Allowable values:
An existing accountId

Request body schema

Parameter Description
sourceCurrency
object
required
Details about the source currency.

Allowable values:
A valid sourceCurrency object containing the following fields: amount, currency
sourceCurrency.amount
number
required if target currency amount not provided
The amount in the source currency.

Allowable values:
A valid number
sourceCurrency.currency
object
required
Details about the source currency.

Allowable values:
A valid currency object containing the following fields: budgetId, currencyCode
sourceCurrency.currency.budget
string
required
The ID of the source budget.

Allowable values:
<= 36 characters
sourceCurrency.currency.currencyCode
string
required
The currency code of the source currency, in ISO 4217 format.

Allowable values:
3 characters
targetCurrency
object
required
Details about the target currency.

Allowable values:
A valid targetCurrency object containing the following fields: amount, currency
targetCurrency.amount
number
required if source currency amount not provided
The amount in the target currency.

Allowable values:
A valid number
targetCurrency.currency
object
required
Details about the target currency.

Allowable values:
A valid currency object containing the following fields: budgetId, currencyCode
targetCurrency.currency.budgetId
string
required
The budget ID for the target currency.

Allowable values:
<= 36 characters
targetCurrency.currency.currencyCode
string
required
The currency code of the target currency, in ISO 4217 format.

Allowable values:
3 characters
settlementDate
string
required
The settlement date.

Allowable values:
^20[0-9]{2}[0-2]{1}[0-9]{1}[0-3]{1}[0-9]{1}$
type
object
required
Details about the type of order.

Allowable values:
A valid type object containing the following fields: from, to
type.from
string
required
The type of source.

Allowable values:
balance, bank
type.to
string
required
The type of target. For an internal currency exchange, set this to balance. For an outbound payment, use any of payment, multiple, or forward.

Allowable values:
balance, payment, multiple, forward, unknown

Response

If your request is successful, you'll receive a 200 response containing an orderId and a quoteRequestId. You'll need these to create an order.

Sample responseResponse structure
Copy
Copied
{
  "quoteRequestId": "4c14643c-072d-468a-81f0-791f4aca84ee-100-109.7222",
  "settlement": {
    "date": "20231201",
    "price": {
      "amount": 100,
      "currency": "GBP"
    },
    "charges": {
      "fee": 0
    }
  },
  "quote": {
    "rate": 1.0972222222,
    "inverseRate": 0.9113924051,
    "fromGbpAmount": 100,
    "from": {
      "amount": 100,
      "currency": "GBP"
    },
    "to": {
      "amount": 109.72,
      "currency": "EUR"
    },
    "direction": "1"
  },
  "orderId": "FPLZQVE5G2ZZKS"
}
Copy
Copied
{
  "quoteRequestId": "string",
  "settlement": {
    "date": "string",
    "price": {
      "amount": number,
      "currency": "string"
    },
    "charges": {
      "fee": number
    }
  },
  "quote": {
    "rate": number,
    "inverseRate": number,
    "fromGbpAmount": number,
    "from": {
      "amount": number,
      "currency": "string"
    },
    "to": {
      "amount": number,
      "currency": "string"
    },
    "direction": "string"
  },
  "orderId": "string"
}

For more detailed information about this request and its response, see the API reference.