Skip to Content
Foreign exchange (FX)

Create a Forex Booking

This API allows clients to book an FX trade by specifying the currency pair, amount, and type. It is currently supported for clients operating under a pre-agreed pricing model with the bank, allowing them to execute FX trades without needing to request an executable rate beforehand.

Test mode

With a test API key, this endpoint uses fixed sample rates, not live market rates. See test mode.

POST
/v1/forex/booking

Authorization

authorization
headerAuthorizationBearer <SECRET_API_KEY>

Set Your Secret API Key

Header Parameters

Idempotency-Key?string

A unique value, eg. a UUID.

Request Body

application/json
amount*integer

The trade amount in a positive integer value in the specified currency's smallest unit. e.g. for SGD, $10 would be represented as 1000 (cents).

Format int64
currencyPair*string

A currency pair is two currency codes. The first is known as the base currency and the second as the quote currency. Each currency code is a three-letter ISO 4217 currency code in full uppercase. USDSGD with BUY type means you want to buy USD by selling SGD; USDSGD with SELL type means you want to sell USD to buy SGD.

Match ^[A-Z]{6}$
tenor*"TODAY"

The tenor for the forex booking.

Value in

  • "TODAY"
type*string

The type of the trade.

Value in

  • "BUY"
  • "SELL"

Response Body

OK

*/*
amount?integer

The trade amount in a positive integer value in the specified currency's smallest unit.

Format int64
contraAmount?integer

The contra amount in the quote currency's smallest unit, at the executed rate.

Format int64
createdAt?string

Time at which the object was created. In ISO 8601 format.

currencyPair?string

A currency pair is two currency codes. The first is known as the base currency and the second as the quote currency.

id?string

Unique identifier for the object.

rate?string

The executed exchange rate.

resultCode?string

Additional information when the booking fails, if available.

sourceTraceId?string

Trace ID of the booking request, for support enquiries.

status?string

Status of the booking.

tenor?string

The tenor for the forex booking.

transactionReference?string

The transaction reference for the forex booking.

type?string

The type of the trade.

updatedAt?string

Time at which the object was last updated. In ISO 8601 format.

Example Request
curl -X POST 'https://api.tryacme.com/v1/forex/booking' \
  -H 'Content-Type: application/json' \
  -d '{
  "amount": 0,
  "currencyPair": "string",
  "tenor": "TODAY",
  "type": "BUY"
}'
Example Response
{
  "amount": 0,
  "contraAmount": 0,
  "createdAt": "string",
  "currencyPair": "string",
  "id": "string",
  "rate": "string",
  "resultCode": "string",
  "sourceTraceId": "string",
  "status": "string",
  "tenor": "string",
  "transactionReference": "string",
  "type": "string",
  "updatedAt": "string"
}