My company has just deployed Acumatica to our Mexico branch. We noticed the exchange rate pulled from Open Exchange doesn’t match the MX governments (DOF). To resolve this we are going to use Zapier and some Python to pull the exchange rate from the DOF’s website and apply it in Acumatica
(Currency Rate (CM301000)).
I have worked through adding Currency Rate and it’s details screen to an endpoint. With the following bit of code can get the list of currencies and their exchange rates.
Code:
cury = {
'ToCurrency':{'value': 'USD'},
'EffectiveDate':{'value': '2025-02-28T00:00:00'}
}
endpoint = 'https://tormach.acumatica.com/entity/Magento/22.200.001/CurrencyRate?$expand=Details'
req = session.put(endpoint, json=cury)
print(json.dumps(req.json(), indent=2))
Output:
"id": "cc39eca5-673b-444e-a080-8e548c6d80fa",
"rowNumber": 1,
"note": null,
"Details": [
{
"id": "e2782637-564c-4cbd-8efd-bfcabea7fdc8",
"rowNumber": 1,
"note": {
"value": ""
},
"CurrencyEffectiveDate": {
"value": "2025-02-28T00:00:00+00:00"
},
"CurrencyRate": {
"value": 1.444058
},
"CurrencyRateType": {
"value": "SPOT"
},
"CuryRateID": {
"value": 15902
},
"FromCurrency": {
"value": "CAD"
},
"MultDiv": {
"value": "Divide"
},
"RateReciprocal": {
"value": 0.69249296
},
"custom": {},
"_links": {
"files:put": "/entity/Magento/22.200.001/files/PX.Objects.CM.CuryRateMaint/CuryRateRecordsEntry/e2782637-564c-4cbd-8efd-bfcabea7fdc8/{filename}"
}
},
{
"id": "4777c353-8ce3-4856-bec4-909a1a1fb275",
"rowNumber": 2,
"note": {
"value": ""
},
"CurrencyEffectiveDate": {
"value": "2025-02-28T00:00:00+00:00"
},
"CurrencyRate": {
"value": 7.2875
},
"CurrencyRateType": {
"value": "SPOT"
},
"CuryRateID": {
"value": 15903
},
"FromCurrency": {
"value": "CNY"
},
"MultDiv": {
"value": "Divide"
},
"RateReciprocal": {
"value": 0.13722127
},
"custom": {},
"_links": {
"files:put": "/entity/Magento/22.200.001/files/PX.Objects.CM.CuryRateMaint/CuryRateRecordsEntry/4777c353-8ce3-4856-bec4-909a1a1fb275/{filename}"
}
},
{
"id": "e86a588d-0a49-4e2e-ad00-3eb281e5f30d",
"rowNumber": 3,
"note": {
"value": ""
},
"CurrencyEffectiveDate": {
"value": "2025-02-28T00:00:00+00:00"
},
"CurrencyRate": {
"value": 32.922999
},
"CurrencyRateType": {
"value": "SPOT"
},
"CuryRateID": {
"value": 15905
},
"FromCurrency": {
"value": "TWD"
},
"MultDiv": {
"value": "Divide"
},
"RateReciprocal": {
"value": 0.0303739
},
"custom": {},
"_links": {
"files:put": "/entity/Magento/22.200.001/files/PX.Objects.CM.CuryRateMaint/CuryRateRecordsEntry/e86a588d-0a49-4e2e-ad00-3eb281e5f30d/{filename}"
}
}
],
"EffectiveDate": {
"value": "2025-02-28T00:00:00+00:00"
},
"ToCurrency": {
"value": "USD"
},
"custom": {}
}
This is where my problem comes in, how do I add a new line (currency and exchange rate)? Currency Rate is an inquire form and works different and I haven’t had success.