Skip to main content

Get an FX Trade (New)

Overview

Retrieve the details of a specific FX trade using the Ahrvo transaction reference number or payment ID. This endpoint provides complete details including settlement times, transaction details, and current state.

Resource Access

  • HTTP Method: GET
  • Endpoint: /banking/ibans/v2/fx/{reference}
  • Authentication: Bearer token required

Request Headers

HeaderValueRequiredDescription
Acceptapplication/jsonYesContent type for the response
AuthorizationBearer {access_token}YesBearer token for authentication
x-api-keystringNoAPI key for additional authentication

Path Parameters

ParameterTypeRequiredDescription
referencestringYesThe FX trade reference number, wallet payment reference, or paymentId

Response

Success Response (200 OK)

{
"id": "20088",
"reference": "EN-05062024-055",
"userId": "2289",
"companyId": "2233",
"currencyFrom": "USD",
"amountFrom": 4800,
"currencyTo": "NGN",
"amountTo": 4936560,
"rate": 1028.4456,
"pricing": {
"overageFee": 0,
"usageId": "6660409cc733e0fac55eb97f",
"subscriptionId": "664b3fc0e8e52032427e0b70"
},
"state": "inwardSettlementDone",
"source": "wallet",
"sourceId": "11435",
"target": "account",
"targetId": "32655",
"description": null,
"inwardSettlementTime": "2024-06-05T10:40:44.000Z",
"outwardSettlementTime": null,
"purpose": "Professional fees payment(i.e. legal, accountant)",
"scheduledAt": null,
"expiredAt": null,
"createdAt": "2024-06-05T10:40:29.000Z",
"updatedAt": "2024-06-05T10:40:51.000Z",
"transaction": {
"receiver": {
"accountNumber": "5401662301",
"bankName": "Providus Bank",
"name": "crest",
"bankCode": "000023"
},
"shortURL": "https://pay.vertofx.com/n3hjz2v"
},
"paymentId": "88ba34cd-7074-46f4-a006-4fd8c7a5e1e8"
}

Response Fields

FieldTypeDescription
idstringUnique trade identifier
referencestringAhrvo reference number for this trade
userIdstringUser ID who initiated the trade
companyIdstringCompany ID associated with the trade
currencyFromstringCurrency being sold/exchanged
amountFromnumberAmount sold/exchanged
currencyTostringCurrency being bought
amountTonumberAmount received
ratenumberExchange rate applied
pricing.overageFeenumberFee for exceeding usage limits
pricing.usageIdstringUsage tracking identifier
pricing.subscriptionIdstringSubscription plan identifier
statestringCurrent state of the trade
sourcestringSource entity type (wallet/account)
sourceIdstringSource entity identifier
targetstringTarget entity type (wallet/account)
targetIdstringTarget entity identifier
inwardSettlementTimestring (date-time)When sender's account was debited
outwardSettlementTimestring (date-time)When receiver's account was credited
purposestringPurpose of the trade
scheduledAtstringScheduled execution time (if applicable)
expiredAtstringExpiration timestamp (if applicable)
createdAtstring (date-time)Trade creation timestamp
updatedAtstring (date-time)Last update timestamp
transaction.receiverobjectReceiver's bank account details
transaction.shortURLstringShort URL for the trade
paymentIdstringUUID of the associated payment

Trade States

StateDescription
confirmedTrade has been confirmed
inwardSettlementDoneSender's account has been debited
outwardSettlementDoneReceiver's account has been credited
inwardSettlementPendingAwaiting inward settlement
outwardSettlementPendingAwaiting outward settlement

Error Responses

  • 400 Bad Request: Invalid reference format
  • 401 Unauthorized: Invalid or missing authentication token
  • 403 Forbidden: Insufficient permissions
  • 404 Not Found: Trade not found for the given reference
  • 500 Internal Server Error: Server error

Code Examples

cURL

curl -X GET \
'https://gateway.ahrvo.network/banking/ibans/v2/fx/EN-05062024-055' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN'

Python

import requests

reference = "EN-05062024-055"
url = f"https://gateway.ahrvo.network/banking/ibans/v2/fx/{reference}"
headers = {
"Accept": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}

response = requests.get(url, headers=headers)
trade = response.json()
print(f"Trade state: {trade['state']}, Rate: {trade['rate']}")

JavaScript (Node.js)

const axios = require('axios');

const reference = 'EN-05062024-055';
const url = `https://gateway.ahrvo.network/banking/ibans/v2/fx/${reference}`;
const headers = {
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
};

axios.get(url, { headers })
.then(response => {
console.log('Trade state:', response.data.state);
console.log('Amount converted:', response.data.amountFrom, response.data.currencyFrom, '→', response.data.amountTo, response.data.currencyTo);
})
.catch(error => {
console.error(error.response.data);
});

Usage Notes

  • The reference path parameter accepts either the Ahrvo reference number (e.g., EN-05062024-055), wallet payment reference, or the paymentId UUID
  • Use this endpoint to track individual trade progress and settlement status
  • Store the reference or paymentId after creating a trade for future lookups

Interactive API Explorer