ClearBank

FX trade (RFQ)

FX trade (RFQ)

A Request for Quote (RFQ) in the context of foreign exchange (FX) will allow you to request a price up-front for any of our currently supported currency pairs and hold that rate for a set period.

Once you receive the response with the quote, the rate is held for 45 seconds. If you decide that you want to initiate the trade, a separate trade request must be submitted within the held rate period. This functionality enhances your trading capabilities by providing a transparent and efficient way to secure the held rates via ClearBank.

This message flow diagram shows the flow of requesting a rate quote, successfully executing the trade within the held rate period, and the associated trade settled webhook.



A message flow diagram detailing a successful quote request and quote execution. The customer uses the POST /fx/v1/quote endpoint to request an FX trade quote from ClearBank. ClearBank sends a 200 OK response which contains the quoted rate and a quoteId. The customer uses the POST /fx/v1/ExecuteQuote endpoint within the 45 second held rate period to execute the trade using the quoted amount. As the trade was executed within the held rate period, the customer receives a 202 Accepted response. This results in a successful trade, evidenced by the customer receiving an FX Trade Executed and FX Trade Settled webhook. This is the end of the message flow.



This message flow diagram shows the flow of requesting a rate quote, an attempt to execute the trade outside the held rate period, and the associated 400 error.



A message flow diagram detailing a successful quote request but followed by an unsuccessful quote execution. The customer uses the POST /fx/v1/quote endpoint to request an FX trade quote from ClearBank. ClearBank sends a 200 OK response which contains the quoted rate and a quoteId. The customer uses the POST /fx/v1/ExecuteQuote endpoint outside of the 45 second held rate period. ClearBank sends a 400 Bad Request response. This is the end of the message flow.



Trade examples

You can use our FX trade functionality to perform FX trades between accounts which belong to the same owner. For example, let’s assume that you want to sell GBP from Account A to purchase EUR for Account B – in doing so, you will need to ensure that the owner of both accounts is the same. This applies to two accounts that belong to you, that is, the financial institution or your customers.

Example: Specifying the sell amount with margin

Trade Request:

  • InstructedAmount: 1000
  • FixedSide: Sell
  • BuyCurrency: USD
  • SellCurrency: GBP (This means the fixed side of the trade is GBP and the floating side is USD. Therefore, the margin will be in USD).
  • Margin: 0.01 (Where 0.01 represents a 1% margin)
  • Assume the ClearBank rate is: 1.40 for GBP/USD
  • Margin amount: 1.4 x 0.01 x GBP 1000 = USD 14

Resulting transactions in respective accounts:

  • Debit to the sellAccount: GBP 1000.00
  • Credit to the buyAccount: USD 1386 [USD 1.4 x (1-0.01) x 1000]
  • Credit to the specified margin account: USD 14

Example: Specifying the buy amount with margin

Trade Request:

  • InstructedAmount: 1400
  • FixedSide: Buy
  • BuyCurrency: USD
  • SellCurrency: GBP
  • This means the fixed side of the trade is USD and the floating side is GBP, therefore the margin will be in GBP
  • Margin: 0.01 (Where 0.01 represents a 1% margin)
  • Assume the ClearBank rate is: 1.40 for GBP/USD
  • Margin amount: 1400 / 1.4 x 0.01 = GBP 10

Resulting transactions in respective accounts:

  • Debit to the sellAccount: GBP [1110 (1400 / 1.4 x (1 + 0.01)]
  • Credit to the buyAccount: USD 1400
  • Credit to the specified margin account: GBP 10

FX trade cut-off times

  • If a trade is booked in time for same-day settlement, you will receive a webhook notification of the settlement. If it fails to settle (in practice, because there are insufficient funds in the account), you will learn of the failure immediately. ClearBank will then send a fx-trade-cancelled-v1 webhook.

  • If a trade is booked, but cannot be settled until a later day, and the settlement fails, the fx-trade-settlement-failed-v1 webhook notifies you of the failure. Make sure you subscribe to this webhook if you are making FX trades with a value (settlement) date later than the day of booking.

Refer to the below table detailing the cut-off times for all currently supported currencies. Note that all times are in UK time.

CurrencyCurrency codeStart timeFX cut-off time (same day)FX cut-off time (next day/2 days' time)
Canadian DollarCAD07:0013:0023:30
Swiss FrancCHF07:0009:3023:30
Czech KorunaCZK07:00TBC23:30 (not yet enabled)
Danish KroneDKK07:0009:3023:30
EuroEUR07:0013:0023:30
British PoundsGBP07:0013:0023:30
Hungarian ForintHUF07:00TBC23:30 (not yet enabled)
Norwegian KroneNOK07:0009:3023:30
Polish ZlotyPLN07:00TBC23:30 (not yet enabled)
Romanian LeuRON07:00TBC23:30 (not yet enabled)
Swedish KronaSEK07:0009:3023:30
United States DollarUSD07:0013:0023:30

FX trades minimum values

FX trades have minimum trading values defined for each currency. If you try to request a trade below these values, you will receive a 400 error response. For the full list of minimum trade values per currency, see Foreign exchange trade.

Request a quote

post/fx/v1/quote

Requests a quote for a specified FX trade.

Parameters

  • Authorization string, header, Required

    Your API token, obtained from the ClearBank Portal.

  • DigitalSignature string, header, Required

    Signed hash of the body of the request. The hash is signed by your private key.

  • X-Request-Id string, header, Required

    A unique identifer for the request; valid for 24 hours, max length 83.

Request Payload (application/json)

  • valueDate string, Required

    Settlement date for the proposed FX trade in the format yyyy-MM-ddTHH:mm:ssZ.

  • instructedAmount number, Required

    Amount instructed to buy or sell.

  • fixedSide string, Required

    The side of the trade to be fixed.

    Enum array
    buy, sell
  • sellCurrency string, Required

    Three-letter ISO 4217 currency code for the currency to sell.

    Minimum length
    3
    Maximum length
    3
  • buyCurrency string, Required

    Three-letter ISO 4217 currency code for the currency to buy.

    Minimum length
    3
    Maximum length
    3
  • margin number

    The optional margin (as a percentage) from the trade to be credited to a margin account. Must be below 0.05 (for example, 0.002 = 0.2% margin).

    Minimum
    0
    Maximum
    0.0499

request

{
"valueDate": "2024-08-24T14:15:22Z",
"instructedAmount": "1000.00",
"fixedSide": "buy",
"sellCurrency": "EUR",
"buyCurrency": "USD",
"margin": "0.01"
}
Code copied

Response (application/json)

  • 200 OK
  • 400 Bad Request

OK

{
"quoteRequest": {
"valueDate": "2024-08-24T14:15:22Z",
"instructedAmount": "1000.00",
"fixedSide": "buy",
"sellCurrency": "EUR",
"buyCurrency": "USD",
"margin": "0.01"
},
"quoteId": "d4f23e64-276c-48b1-9b8c-5c4e1c395a82",
"valueDate": "2024-08-24T14:15:22Z",
"currencyPair": "EUR/USD",
"exchangeRate": "1.214021494",
"sellCurrency": "EUR",
"sellAmount": "1000.00",
"buyCurrency": "USD",
"buyAmount": "1214.02",
"createdAt": "2024-08-24T14:15:23Z",
"expiresAt": "2024-08-24T14:16:08Z",
"marginAmount": "12.29",
"marginCurrency": "USD"
}
Code copied

Bad Request

{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"property1": null,
"property2": null
}
Code copied

Execute a quote

post/fx/v1/ExecuteQuote

Execute a trade using the quoted rate.

Parameters

  • Authorization string, header, Required

    Your API token, obtained from the ClearBank Portal.

  • DigitalSignature string, header, Required

    Signed hash of the body of the request. The hash is signed by your private key.

  • X-Request-Id string, header, Required

    A unique identifer for the request; valid for 24 hours, max length 83.

Request Payload (application/json)

  • quoteId string, Required

    ID of the quoted rate to be executed in the trade

  • customerInformation object, Required

  • marginAccount object

request

{
"quoteId": "d4f23e64-276c-48b1-9b8c-5c4e1c395a82",
"customerInformation": {
"sellAccount": {
"owner": "FX Service Ltd",
"iban": "GB57CLRB04040100057354"
},
"buyAccount": {
"owner": "FX Service Ltd",
"iban": "GB57CLRB04040100057354"
},
"attestation": "Y"
},
"marginAccount": {
"owner": "FX Service Ltd",
"iban": "GB57CLRB04040100057354"
}
}
Code copied

Response (application/json)

  • 202 Accepted
  • 400 Bad Request
  • 409 Conflict
  • 423 Locked
  • 503 Service Unavailable

Associated Webhooks