Conversion
The Conversion resources provide capability to create transactions that convert from one currency into another. The transaction will result in a debit and credit against your wallet balances. Both Quotes and Rates transactions can be created using the Conversion resources.
POST /api/v1/fx/conversions/createGET /api/v1/fx/conversions/{conversion_id}GET /api/v1/fx/conversions
Create a conversion
POST /api/v1/fx/conversions/create
Create a new conversion to be executed within your Airwallex wallet. To associate a conversion with a payout, use the Payment API. (Note: Some exotic currencies require conversions to be associated with payouts.)
If using Quotes, users must provide a valid Quote ID in the conversion request. The key details of the conversion request such as buy_currency, sell_currency, and conversion_date (if specified) must match the quote details. Otherwise, users can leave the Quote ID field blank, resulting in the conversion being executed at the current market rate.
On a conversion, populate both buy_currency and sell_currency, but define only one of either buy_amount or sell_amount. This populated amount defines the dealt (also known as fixed) side of the conversion. The other amount will be computed by Airwallex based on the exchange rate of the conversion. The minimum conversion limit per conversion is USD $1.
Currency that the client buys (in 3-letter ISO-4217 format).
Client-generated idempotency key. Must be unique per request attempt. Conversion requests with the same request_id will be rejected. Parameter supports a maximum of 64 characters.
Currency that the client sells (in 3-letter ISO-4217 format).
The application fee options applied to the transaction.
A positive integer specifying the amount of the fee expressed in the smallest unit of the currency. e.g. cents for USD. This field is required only when type is FIXED.
Specify the currency of the application fee in ISO 4217 currency code format, e.g., USD, AUD. This field is required when the type is FIXED.
When the type is PERCENTAGE and source_type is CONVERSION, the currency for the conversion if specified must be from the currency pair. If the currency is unspecified, the contra currency of the quote will be used.
The metadata of the application fee. The value should be set in key:value format. (e.g., id:1).
Required if the type is PERCENTAGE, and the value to be provided depends on the transaction context.
FX Conversions: The value acts as a markup on the FX rate, increasing the conversion cost by the specified percentage.
Others: The value represents a direct fee calculated as a percentage of the transaction amount.
Specify type of the source transaction.
CONVERSION, TRANSFER
Define the type of fee calculation. If the source_type is CONVERSION, then the type must be PERCENTAGE.
FIXED, PERCENTAGE
Amount in buy_currency that the client buys. Must be specified if sell_amount is not specified.
Date on which the conversion will be settled. conversion_date defaults to current date, if funding is available, unless specified.
The funding information for this conversion. By default (when the funding object is not specified), conversions will source funds from the wallet.
The funding source unique identifier only supports Linked Accounts. Please provide the unique identifier of your Linked Account as returned in Create a Linked Account. Note that if not specified, the funding source will default to your Wallet.
The type of deposit you would like to create, either DIRECT_DEBIT or FASTER_DIRECT_DEBIT. If not specified, it will default to DIRECT_DEBIT
A set of key-value pairs for storing your own data together with the conversion.
Provide a valid Quote unique identifier if you want the conversion executed at the client_rate returned in the quote.
Amount in sell_currency that the client sells. Must be specified if buy_amount is not specified.
The application fee options applied to the transaction.
A positive integer specifying the amount of the fee expressed in the smallest unit of the currency. e.g. cents for USD. This field is required only when type is FIXED.
Specify the currency of the application fee in ISO 4217 currency code format, e.g., USD, AUD. This field is required when the type is FIXED.
When the type is PERCENTAGE and source_type is CONVERSION, the currency for the conversion if specified must be from the currency pair. If the currency is unspecified, the contra currency of the quote will be used.
The metadata of the application fee. The value should be set in key:value format. (e.g., id:1).
Required if the type is PERCENTAGE, and the value to be provided depends on the transaction context.
FX Conversions: The value acts as a markup on the FX rate, increasing the conversion cost by the specified percentage.
Others: The value represents a direct fee calculated as a percentage of the transaction amount.
Specify type of the source transaction.
CONVERSION, TRANSFER
Define the type of fee calculation. If the source_type is CONVERSION, then the type must be PERCENTAGE.
FIXED, PERCENTAGE
Application fees in this transaction.
The application fee amount.
The currency of the application fee.
Specify the type of source transaction for this application fee.
CONVERSION, TRANSFER
For reference purposes only. This is a reference rate Airwallex compiles by analyzing prices across multiple banking providers and independent rate publishers.
The amount in buy_currency that was bought by the client.
Currency that the client bought (in 3-letter ISO-4217 format).
The transaction execution rate of the conversion. This is the rate at which the client is charged.
Date on which the conversion will be settled. conversion_date defaults to current date, if funding is available, unless specified.
Airwallex-generated unique identifier for the conversion record.
The time at which the conversion was created. Follows the same timestamp format as the rest of Airwallex’s APIs.
The currency pair associated with awx_rate and client_rate.
Dealt denotes the fixed side of the conversion request. If buy_amount was specified, then buy_currency; else, sell_currency (in 3-letter ISO-4217 format).
The funding information for this conversion.
Can be one of: FASTER_DIRECT_DEBIT, DIRECT_DEBIT.
Empty unless the funding is in an error state.
The id of the funding source, it can be null if using a wallet.
The funding statuses of this conversion.
The funding information for this conversion.
The funding source unique identifier only supports Linked Accounts. Please provide the unique identifier of your Linked Account as returned in Create a Linked Account. Note that if not specified, the funding source will default to your Wallet.
The type of deposit you would like to create, either DIRECT_DEBIT or FASTER_DIRECT_DEBIT. If not specified, it will default to DIRECT_DEBIT
For reference purposes only. This rate represents the midpoint of the current bid and ask price.
The Quote used to execute the conversion. Echoes the request’s Quote unique identifier, if provided.
Breakdown of rates at different user levels.
The total amount being bought at the respective level.
Supported levels include: CLIENT, AWX, PLATFORM_CLIENT
The exchange rate from the respective level's perspective.
The total amount being sold at the respective level.
Echoes request’s client-supplied request unique identifier (idempotency key).
The amount in sell_currency that was sold by the client.
Currency that the client sold (in 3-letter ISO-4217 format).
This is latest time by which the sell_amount in sell_currency needs to be available in Airwallex account balance for the conversion to be successfully settled.
Shortened transaction unique identifier for ease of use within Web GUI and with Airwallex support.
Status of the conversion. Can be one of SCHEDULED, CANCELLED, OVERDUE, SETTLED.
The time at which the conversion was last updated (including status changes). Follows the same timestamp format as the rest of Airwallex’s APIs.
| Error status | Description |
|---|---|
| 400 | Possible errors: |
| 401 | Possible errors: |
| 429 | Too many requests |
| 500 | Service unavailable |
$curl --request POST \> --url 'https://api-demo.airwallex.com/api/v1/fx/conversions/create' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json' \> --data '{> "application_fee_options": [> {> "amount": "5",> "currency": "AUD",> "percentage": "0.1",> "source_type": "TRANSFER",> "type": "FIXED"> }> ],> "buy_amount": "10000",> "buy_currency": "USD",> "conversion_date": "2017-03-22",> "funding_source": {> "debit_type": "DIRECT_DEBIT",> "id": "<string>"> },> "metadata": {},> "quote_id": "<string>",> "request_id": "67f687fe-dcf4-4462-92fa-20335301d9d8",> "sell_amount": "<string>",> "sell_currency": "AUD">}'
1{2 "application_fee_options": [3 {4 "amount": "5",5 "currency": "AUD",6 "percentage": "0.1",7 "source_type": "TRANSFER",8 "type": "FIXED"9 }10 ],11 "application_fees": [12 {13 "amount": "5",14 "currency": "AUD",15 "source_type": "TRANSFER"16 }17 ],18 "awx_rate": 0.781523,19 "buy_amount": "10000",20 "buy_currency": "USD",21 "client_rate": 0.781623,22 "conversion_date": "2017-03-22",23 "conversion_id": "d9af1614-a6a1-4d45-aae7-6858fc6d9ede",24 "created_at": "2017-03-20T10:08:12+1100",25 "currency_pair": "AUDUSD",26 "dealt_currency": "USD",27 "funding": {28 "debit_type": "DIRECT_DEBIT",29 "failure_reason": "<string>",30 "funding_source_id": "<string>",31 "status": "<string>"32 },33 "funding_source": {34 "debit_type": "DIRECT_DEBIT",35 "id": "<string>"36 },37 "mid_rate": 0.761223,38 "quote_id": "<string>",39 "rate_details": [40 {41 "buy_amount": "10000",42 "level": "CLIENT",43 "rate": 0.781523,44 "sell_amount": 12794.2745 }46 ],47 "request_id": "67f687fe-dcf4-4462-92fa-20335301d9d8",48 "sell_amount": 12794.27,49 "sell_currency": "AUD",50 "settlement_cutoff_at": "2017-03-22T14:00:00+1100",51 "short_reference_id": "20170608-AF3GJ9",52 "status": "SETTLED",53 "updated_at": "2017-03-20T14:00:01+1100"54}
Retrieve a conversion
GET /api/v1/fx/conversions/{conversion_id}
Get a specific conversion by specifying the Airwallex conversion_id.
Unique identifier of the conversion to retrieve.
The application fee options applied to the transaction.
A positive integer specifying the amount of the fee expressed in the smallest unit of the currency. e.g. cents for USD. This field is required only when type is FIXED.
Specify the currency of the application fee in ISO 4217 currency code format, e.g., USD, AUD. This field is required when the type is FIXED.
When the type is PERCENTAGE and source_type is CONVERSION, the currency for the conversion if specified must be from the currency pair. If the currency is unspecified, the contra currency of the quote will be used.
The metadata of the application fee. The value should be set in key:value format. (e.g., id:1).
Required if the type is PERCENTAGE, and the value to be provided depends on the transaction context.
FX Conversions: The value acts as a markup on the FX rate, increasing the conversion cost by the specified percentage.
Others: The value represents a direct fee calculated as a percentage of the transaction amount.
Specify type of the source transaction.
CONVERSION, TRANSFER
Define the type of fee calculation. If the source_type is CONVERSION, then the type must be PERCENTAGE.
FIXED, PERCENTAGE
Application fees in this transaction.
The application fee amount.
The currency of the application fee.
Specify the type of source transaction for this application fee.
CONVERSION, TRANSFER
For reference purposes only. This is a reference rate Airwallex compiles by analyzing prices across multiple banking providers and independent rate publishers.
The amount in buy_currency that was bought by the client.
Currency that the client bought (in 3-letter ISO-4217 format).
The transaction execution rate of the conversion. This is the rate at which the client is charged.
Date on which the conversion will be settled. conversion_date defaults to current date, if funding is available, unless specified.
Airwallex-generated unique identifier for the conversion record.
The time at which the conversion was created. Follows the same timestamp format as the rest of Airwallex’s APIs.
The currency pair associated with awx_rate and client_rate.
Dealt denotes the fixed side of the conversion request. If buy_amount was specified, then buy_currency; else, sell_currency (in 3-letter ISO-4217 format).
The funding information for this conversion.
Can be one of: FASTER_DIRECT_DEBIT, DIRECT_DEBIT.
Empty unless the funding is in an error state.
The id of the funding source, it can be null if using a wallet.
The funding statuses of this conversion.
The funding information for this conversion.
The funding source unique identifier only supports Linked Accounts. Please provide the unique identifier of your Linked Account as returned in Create a Linked Account. Note that if not specified, the funding source will default to your Wallet.
The type of deposit you would like to create, either DIRECT_DEBIT or FASTER_DIRECT_DEBIT. If not specified, it will default to DIRECT_DEBIT
For reference purposes only. This rate represents the midpoint of the current bid and ask price.
The Quote used to execute the conversion. Echoes the request’s Quote unique identifier, if provided.
Breakdown of rates at different user levels.
The total amount being bought at the respective level.
Supported levels include: CLIENT, AWX, PLATFORM_CLIENT
The exchange rate from the respective level's perspective.
The total amount being sold at the respective level.
Echoes request’s client-supplied request unique identifier (idempotency key).
The amount in sell_currency that was sold by the client.
Currency that the client sold (in 3-letter ISO-4217 format).
This is latest time by which the sell_amount in sell_currency needs to be available in Airwallex account balance for the conversion to be successfully settled.
Shortened transaction unique identifier for ease of use within Web GUI and with Airwallex support.
Status of the conversion. Can be one of SCHEDULED, CANCELLED, OVERDUE, SETTLED.
The time at which the conversion was last updated (including status changes). Follows the same timestamp format as the rest of Airwallex’s APIs.
| Error status | Description |
|---|---|
| 400 | ["field_required" ,"invalid_argument" ,] |
| 401 | Possible errors: |
| 404 | Possible errors: |
| 429 | Too many requests |
| 500 | Service unavailable |
$curl --request GET \> --url 'https://api-demo.airwallex.com/api/v1/fx/conversions/conversion_id' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "application_fee_options": [3 {4 "amount": "5",5 "currency": "AUD",6 "percentage": "0.1",7 "source_type": "TRANSFER",8 "type": "FIXED"9 }10 ],11 "application_fees": [12 {13 "amount": "5",14 "currency": "AUD",15 "source_type": "TRANSFER"16 }17 ],18 "awx_rate": 0.781523,19 "buy_amount": 10000,20 "buy_currency": "USD",21 "client_rate": 0.781623,22 "conversion_date": "2017-03-22",23 "conversion_id": "d9af1614-a6a1-4d45-aae7-6858fc6d9ede",24 "created_at": "2017-03-20T10:08:12+1100",25 "currency_pair": "AUDUSD",26 "dealt_currency": "USD",27 "funding": {28 "debit_type": "DIRECT_DEBIT",29 "failure_reason": "<string>",30 "funding_source_id": "<string>",31 "status": "<string>"32 },33 "funding_source": {34 "debit_type": "DIRECT_DEBIT",35 "id": "<string>"36 },37 "mid_rate": 0.761223,38 "quote_id": "<string>",39 "rate_details": [40 {41 "buy_amount": 10000,42 "level": "CLIENT",43 "rate": 0.781523,44 "sell_amount": 12794.2745 }46 ],47 "request_id": "67f687fe-dcf4-4462-92fa-20335301d9d8",48 "sell_amount": 12794.27,49 "sell_currency": "AUD",50 "settlement_cutoff_at": "2017-03-22T14:00:00+1100",51 "short_reference_id": "20170608-AF3GJ9",52 "status": "SETTLED",53 "updated_at": "2017-03-20T14:00:01+1100"54}
List all conversions
GET /api/v1/fx/conversions
Retrieve conversions, using any combination of optional queryable parameters below. You may specify none, one of, or both from_created_at or to_created_at parameters. If none of these parameters are specified, results for the last 31 days will be returned. If only one of these parameters are specified, we will assume a 31-day range to calculate the other, undefined parameter. The conversions are returned in descending order, with the most recent transactions appearing first. Each queryable parameter below supports only one defined value at a time.
Currency that the client bought (in 3-letter ISO-4217 format).
The starting value for specifying a date range for results to be returned. The date range is specific to conversion creation (a conversion's created_at date). Specify a starting created_at date (in ISO-8601 format). This starting date is inclusive of the range.
Page number, starts from 0.
Number of results per page. Default value is 100.
Client-supplied conversion request_id (idempotency key).
Currency that the client sold (in 3-letter ISO-4217 format).
Status of the conversion. Can be one ofSCHEDULED, OVERDUE, CANCELLED, SETTLED.
The ending value for specifying a date range for results to be returned. The date range is specific to conversion creation (a conversion's created_at date). Specify an ending created_at date (in ISO-8601 format). This ending date is inclusive of the range.
A flag which identifies whether there are more results.
Paged results.
For reference purposes only. This is a reference rate Airwallex compiles by analyzing prices across multiple banking providers and independent rate publishers.
The amount in buy_currency that was bought by the client.
Currency that the client bought (in 3-letter ISO-4217 format).
The transaction execution rate of the conversion. This is the rate at which the client is charged.
Date on which the conversion will be settled. conversion_date defaults to current date, if funding is available, unless specified.
Airwallex-generated unique identifier for the conversion record.
The time at which the conversion was created. Follows the same timestamp format as the rest of Airwallex’s APIs.
The currency pair associated with awx_rate and client_rate.
Dealt denotes the fixed side of the conversion request. If buy_amount was specified, then buy_currency; else, sell_currency (in 3-letter ISO-4217 format).
For reference purposes only. This rate represents the midpoint of the current bid and ask price.
Echoes request’s client-supplied request unique identifier (idempotency key).
The amount in sell_currency that was sold by the client.
Currency that the client sold (in 3-letter ISO-4217 format).
This is latest time by which the sell_amount in sell_currency needs to be available in Airwallex account balance for the conversion to be successfully settled.
Shortened transaction unique identifier for ease of use within Web GUI and with Airwallex support.
Status of the conversion. Can be one of SCHEDULED, CANCELLED, OVERDUE, SETTLED.
The time at which the conversion was last updated (including status changes). Follows the same timestamp format as the rest of Airwallex’s APIs.
The application fee options applied to the transaction.
A positive integer specifying the amount of the fee expressed in the smallest unit of the currency. e.g. cents for USD. This field is required only when type is FIXED.
Specify the currency of the application fee in ISO 4217 currency code format, e.g., USD, AUD. This field is required when the type is FIXED.
When the type is PERCENTAGE and source_type is CONVERSION, the currency for the conversion if specified must be from the currency pair. If the currency is unspecified, the contra currency of the quote will be used.
The metadata of the application fee. The value should be set in key:value format. (e.g., id:1).
Required if the type is PERCENTAGE, and the value to be provided depends on the transaction context.
FX Conversions: The value acts as a markup on the FX rate, increasing the conversion cost by the specified percentage.
Others: The value represents a direct fee calculated as a percentage of the transaction amount.
Specify type of the source transaction.
CONVERSION, TRANSFER
Define the type of fee calculation. If the source_type is CONVERSION, then the type must be PERCENTAGE.
FIXED, PERCENTAGE
Application fees in this transaction.
The application fee amount.
The currency of the application fee.
Specify the type of source transaction for this application fee.
CONVERSION, TRANSFER
The funding information for this conversion.
Can be one of: FASTER_DIRECT_DEBIT, DIRECT_DEBIT.
Empty unless the funding is in an error state.
The id of the funding source, it can be null if using a wallet.
The funding statuses of this conversion.
The funding information for this conversion.
The funding source unique identifier only supports Linked Accounts. Please provide the unique identifier of your Linked Account as returned in Create a Linked Account. Note that if not specified, the funding source will default to your Wallet.
The type of deposit you would like to create, either DIRECT_DEBIT or FASTER_DIRECT_DEBIT. If not specified, it will default to DIRECT_DEBIT
The Quote used to execute the conversion. Echoes the request’s Quote unique identifier, if provided.
Breakdown of rates at different user levels.
The total amount being bought at the respective level.
Supported levels include: CLIENT, AWX, PLATFORM_CLIENT
The exchange rate from the respective level's perspective.
The total amount being sold at the respective level.
| Error status | Description |
|---|---|
| 400 | Possible errors: |
| 401 | Possible errors: |
| 429 | Too many requests |
| 500 | Service unavailable |
$curl --request GET \> --url 'https://api-demo.airwallex.com/api/v1/fx/conversions' \> --header 'Authorization: Bearer {{ACCESS_TOKEN}}' \> --header 'Content-Type: application/json'
1{2 "has_more": false,3 "items": [4 {5 "application_fee_options": [6 {7 "amount": "5",8 "currency": "AUD",9 "percentage": "0.1",10 "source_type": "TRANSFER",11 "type": "FIXED"12 }13 ],14 "application_fees": [15 {16 "amount": "5",17 "currency": "AUD",18 "source_type": "TRANSFER"19 }20 ],21 "awx_rate": 0.781523,22 "buy_amount": 10000,23 "buy_currency": "USD",24 "client_rate": 0.781623,25 "conversion_date": "2017-03-22",26 "conversion_id": "d9af1614-a6a1-4d45-aae7-6858fc6d9ede",27 "created_at": "2017-03-20T10:08:12+1100",28 "currency_pair": "AUDUSD",29 "dealt_currency": "USD",30 "mid_rate": 0.761223,31 "rate_details": [32 {33 "buy_amount": 10000,34 "level": "CLIENT",35 "rate": 0.781523,36 "sell_amount": 12794.2737 }38 ],39 "request_id": "67f687fe-dcf4-4462-92fa-20335301d9d8",40 "sell_amount": 12794.27,41 "sell_currency": "AUD",42 "settlement_cutoff_at": "2017-03-22T14:00:00+1100",43 "short_reference_id": "20170608-AF3GJ9",44 "status": "SETTLED",45 "updated_at": "2017-03-20T14:00:01+1100"46 }47 ]48}