Exchange Rate
π Introduction
The Exchange Rate function allows users to view and manage exchange rates for different currencies. This function is essential for financial operations, ensuring accurate conversion rates for transactions.
π οΈ Usage
Exchange rates can be updated manually or automatically downloaded from the internet. In Vietnam, the default exchange rates are sourced from the Vietcombank API.
To initiate the update process, use the command UpdateRate
You also have an option to copy and paste the source exchange table from web into the Transfer In function of the InfoList . InfoList
π« Notes
If you run the Update Rate at the end of a month, Rates will automatically posted into Period Rate
π·οΈ Data Fields
General
- π TxnId
- Automatic id of exchange rate transaction
- π UpdatingSource
- Indicate the source where this rate record is updated from
- π EffectiveDate
- This rate is effective from this date
Rate Info
- πβCurrency π Currency
- Select one currency code like USD, CAD, VND, which will be converted to base currency
- π Rate
- Conversion Rate of this currency to base currency
- π ExchangeOperator
- Divide or Multiply
Reference
- π BuyingRate
- Reference Buying Rate of this currency
- π SellingRate
-
Reference Selling Rate of this currency
π§ Automatic Update
To automatically update the exchange rate table from the internet using an API provided by SPC, you can use a scheduled task or a cron job to periodically fetch the latest exchange rates and update your database. Hereβs a step-by-step guide on how to achieve this:
Step 1: Obtain API Key First, you need to obtain an API key from SPC. This key will be used to authenticate your requests to the API.
Step 2: Set Up API Endpoint Identify the API endpoint provided by SPC for fetching exchange rates. For example, it might look something like this:
https://api.phoebus.app/exchange-rates