Skip to main content

Create FX Trade (Atlas)

Overview

The POST /banking/ibans/v2/fx/payments endpoint executes a foreign exchange trade using funds from your multi-currency wallets.

The request payload supports two distinct workflows using the paymentType discriminator:

  1. convertWithinWallets: Converts funds from one of your wallets (or multiple funding sources) and deposits the converted amount into another wallet belonging to your organization.
  2. convertWalletPayout: Converts wallet funds and routes the proceeds directly to an external beneficiary bank account or mobile wallet (targetAccountId).

[!IMPORTANT] To execute a trade, you must provide a valid, non-expired vfxToken obtained from POST /banking/ibans/v2/fx/quote. This guarantees the agreed conversion rate.

Resource Access

  • HTTP Method: POST
  • Endpoint: /banking/ibans/v2/fx/payments
  • Authentication: Bearer token required

Request Headers

HeaderValueRequiredDescription
AuthorizationBearer {access_token}YesJWT Bearer access token
Content-Typeapplication/jsonYesRequest payload format
Acceptapplication/jsonYesResponse payload format

Request Body

Schema 1: Convert Within Wallets (convertWithinWallets)

FieldTypeRequiredDescription
paymentTypestringYesMust be convertWithinWallets.
vfxTokenstringYesRate-locking token returned by POST /banking/ibans/v2/fx/quote.
sourceWalletIdnumberConditionalID of the funding wallet. Use either sourceWalletId or sources.
sourcesarrayConditionalArray of { walletId, amount } objects for multi-wallet funding.
sourceAmountnumberConditionalAmount to sell. Provide either sourceAmount or targetAmount.
targetAmountnumberConditionalAmount to buy. Provide either sourceAmount or targetAmount.
targetWalletIdnumberYesID of the recipient wallet where converted funds are deposited.
paymentIdstring (UUID)NoClient idempotency UUID to prevent duplicate executions.
customPaymentReferencestringNoOptional client reference tag.

Schema 2: Convert and Pay Out (convertWalletPayout)

FieldTypeRequiredDescription
paymentTypestringYesMust be convertWalletPayout.
vfxTokenstringYesRate-locking token returned by POST /banking/ibans/v2/fx/quote.
sourceWalletIdnumberConditionalID of the source wallet funding the payout.
targetAccountIdnumberYesID of the beneficiary account receiving the converted payout.
purposeIdnumberYesPurpose of payment identifier (required for compliance routing).
senderobjectNoOriginator entity details (country, name, `type: individual

Request Examples

1. Convert Within Own Wallets

{
"paymentType": "convertWithinWallets",
"vfxToken": "vfx_9f83a28c11e04812b7fa128471203",
"sourceWalletId": 101,
"sourceAmount": 5000.00,
"targetWalletId": 202,
"paymentId": "550e8400-e29b-41d4-a716-446655440000",
"customPaymentReference": "Q3-Treasury-Rebalance"
}

2. Convert and Pay Out to Beneficiary

{
"paymentType": "convertWalletPayout",
"vfxToken": "vfx_9f83a28c11e04812b7fa128471203",
"sourceWalletId": 101,
"sourceAmount": 12500.00,
"targetAccountId": 948201,
"purposeId": 1,
"paymentId": "771e8400-e29b-41d4-a716-446655440099",
"customPaymentReference": "Supplier-Invoice-982"
}

Response

Success Response (200 OK)

{
"id": "10492",
"reference": "EN-01011900-001",
"currencyFrom": "USD",
"amountFrom": 5000.00,
"currencyTo": "GBP",
"amountTo": 3927.00,
"rate": 0.7854,
"state": "confirmed",
"source": "wallet",
"sourceId": 101,
"target": "wallet",
"targetId": 202,
"createdAt": "2026-09-16T02:00:00.000Z",
"tracking": {
"uetr": "dd60300f-25e6-4fb3-bb87-36ceb02844f2"
}
}

Response Fields

FieldTypeDescription
idstringUnique internal order identifier.
referencestringPublic trade reference (e.g. EN-01011900-001).
statestringTrade execution state: initiated, confirmed, inwardSettlementDone, outwardSettlementDone.
amountFromnumberAmount debited in source currency.
amountTonumberAmount credited in target currency.
ratenumberEffective exchange rate executed.
tracking.uetrstringUnique End-to-End Transaction Reference for international settlement tracking.

Error Responses

  • 400 Bad Request: Expired vfxToken, insufficient wallet balance, or missing mandatory fields.
  • 401 Unauthorized: Missing or expired Bearer token.
  • 403 Forbidden: Access denied to source wallet or target account.
  • 500 Internal Server Error: Trade execution gateway error.

Code Examples

cURL

curl -X POST "https://gateway.ahrvo.network/banking/ibans/v2/fx/payments" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"paymentType": "convertWithinWallets",
"vfxToken": "vfx_9f83a28c11e04812b7fa128471203",
"sourceWalletId": 101,
"sourceAmount": 5000.00,
"targetWalletId": 202
}'

Python

import requests

url = "https://gateway.ahrvo.network/banking/ibans/v2/fx/payments"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json"
}

payload = {
"paymentType": "convertWithinWallets",
"vfxToken": "vfx_9f83a28c11e04812b7fa128471203",
"sourceWalletId": 101,
"sourceAmount": 5000.00,
"targetWalletId": 202
}

response = requests.post(url, json=payload, headers=headers)
print("Trade Reference:", response.json().get("reference"))

JavaScript (Node.js)

const axios = require('axios');

const url = 'https://gateway.ahrvo.network/banking/ibans/v2/fx/payments';
const headers = {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
};

const payload = {
paymentType: 'convertWithinWallets',
vfxToken: 'vfx_9f83a28c11e04812b7fa128471203',
sourceWalletId: 101,
sourceAmount: 5000.00,
targetWalletId: 202
};

axios.post(url, payload, { headers })
.then(res => console.log('Order Reference:', res.data.reference))
.catch(err => console.error(err.response ? err.response.data : err.message));

Interactive API Explorer