Airwallex logo
Airwallex logoAirwallex logo

LockFX

Copy for LLMView as Markdown

For accounts that are configured to make use of the LockFX product you can create a quote that can be used in a subsequent Conversion request during the requested validity period.

Endpoints
POST /api/v1/lockfx/create

Create a LockFX quote

POST /api/v1/lockfx/create

The LockFX quote endpoint gives the user a guaranteed rate for an agreed period of time.

Request body
buy_currencyrequiredstring

Currency (3-letter ISO-4217 code) the client buys

sell_currencyrequiredstring

Currency (3-letter ISO-4217 code) the client sells. This is the currency you will need to send us by the settlement cutoff time

validityrequiredstring

Quote validity period. Available options: [MIN_1, MIN_15, MIN_30, HR_1, HR_4, HR_8, HR_24]

buy_amountnumber

Amount the client buys in buy_currency (must be blank if sell_amount is specified)

conversion_datestring

Date on which the conversion will be settled. conversion_date defaults to current date, if funding is available, unless specified.

sell_amountnumber

Amount the client sells in sell_currency (must be blank if buy_amount is specified)

Response body - 201 Created
awx_ratenumber

For reference purposes only. This is a reference rate Airwallex compiles by analyzing prices across multiple banking providers and independent rate publishers

buy_amountnumber

buy_amount copied from the Quote request (if specified). Otherwise, this is calculated by multiplying/dividing the sell_amount by the FX quote depending on the direction of the currency pair

buy_currencystring

Buy currency of the quote (3-letter ISO-4217 code)

client_ratenumber

The returned FX quote

conversion_datestring

Date on which the conversion will be settled. conversion_date defaults to current date, if funding is available, unless specified.

currency_pairstring

The currency pair that the quote is for. The direction of the currency pair is per market convention where possible

dealt_currencystring

The currency where the client provided the exact amount for in the request

mid_ratenumber

For reference purposes only. This rate represents the midpoint of the current bid and ask price

quote_idstring

The quote unique identifier

rate_detailsarray

Breakdown of rates at different user levels.

rate_details.buy_amountnumber

The total amount being bought at the respective level.

rate_details.levelstring

Level of the view. CLIENT and AWX level supported

CLIENT, AWX

rate_details.ratenumber

The exchange rate from the respective level's perspective.

rate_details.sell_amountnumber

The total amount being sold at the respective level.

sell_amountnumber

sell_amount copied from the Quote request (if specified). Otherwise, this is calculated by multiplying/dividing the buy_amount by the FX quote depending on the direction of the currency pair

sell_currencystring

Sell currency of the quote (3-letter ISO-4217 code)

usagestring

Quote usage, SINGLE_USE or MULTI_USE

valid_fromstring

Quote valid from in ISO8601 format (inclusive)

valid_tostring

Quote valid to in ISO8601 format (inclusive)

validitystring

Quote validity period in the create request

MIN_1, MIN_15, MIN_30, HR_1, HR_4, HR_8, HR_24

Errors
Error statusDescription
400

Possible errors: amount_below_limit, amount_above_limit, operation_failed, field_required, invalid_settlement_date, invalid_endpoint, invalid_argument, unsupported_currency

401

Possible errors: credentials_invalid, credentials_expired

429

Too many requests

500

Service unavailable

POST /api/v1/lockfx/create
$curl --request POST \
> --url 'https://api-demo.airwallex.com/api/v1/lockfx/create' \
> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \
> --header 'Content-Type: application/json' \
> --data '{
> "buy_amount": 10000,
> "buy_currency": "AUD",
> "conversion_date": "2017-04-01",
> "sell_amount": 100,
> "sell_currency": "USD",
> "validity": "HR_24"
>}'
Response (201 Created)
1{
2 "awx_rate": 0.7622,
3 "buy_amount": 10000,
4 "buy_currency": "AUD",
5 "client_rate": 0.7632,
6 "conversion_date": "2017-04-01",
7 "currency_pair": "AUDUSD",
8 "dealt_currency": "AUD",
9 "mid_rate": 0.7612,
10 "quote_id": "a08c0f2f-3f26-4443-b5df-fad15582eb94",
11 "rate_details": [
12 {
13 "buy_amount": 10000,
14 "level": "CLIENT",
15 "rate": 0.781523,
16 "sell_amount": 12794.27
17 }
18 ],
19 "sell_amount": 7632,
20 "sell_currency": "USD",
21 "usage": "SINGLE_USE",
22 "valid_from": "2019-05-03T02:49:05+0000",
23 "valid_to": "2019-05-04T02:49:05+0000",
24 "validity": "HR_24"
25}
Was this section helpful?