This POST API can be used to capture new additions in currency exchange rate details from ERP into GEP SMART, that can be used as reference in P2P transactions.
URL Format: https://<Instance>/SmartInterfaceAPI/api/Currency/CurrencyExchangeRate
[
{
"fromCurrency": "String",
"toCurrency": "String",
"exchangeRate": 0,
"effectiveDate": "2020-01-22T12:26:39.342Z"
}
]
{
"data": null,
"statusCode": "String",
"errorDetails": [
{
"key": "string",
"errors": [
{
"errorCode": "string",
"errorDescription": "string"
}
]
}
],
"successDetails": [
{
"key": "String"
}
]
}
Success Scenario – Request
Below request only contains the mandatory attribute(s):
[
{
"fromCurrency": "USD",
"toCurrency": "EUR",
"exchangeRate": 3
},
{
"fromCurrency": "ZAR",
"toCurrency": "LBP",
"exchangeRate": 1.5
}
]
Success Scenario – Response
{
"data": null,
"statusCode": "200",
"errorDetails": [],
"successDetails": [
{
"key": "USD|EUR"
},
{
"key": "ZAR|LBP"
}
]
}
Error Scenario 1 – Request
Below request contains a missing value of the mandatory attribute – fromCurrency:
[
{
"toCurrency": "EUR",
"exchangeRate": 1.5,
"effectiveDate": "10-12-2019"
},
{
"fromCurrency": "USD",
"toCurrency": "LBP",
"exchangeRate": 3,
"effectiveDate": null
}
]
Error Scenario 1 – Response
{
"data": null,
"statusCode": "400",
"errorDetails": [
{
"key": "|EUR",
"errors": [
{
"errorCode": "MandatoryField",
"errorDescription": "FromCurrency field value is Mandatory"
}
]
}
],
"successDetails": []
}
Error Scenario 2 – Request
Below request contains an invalid format of effectiveDate:
[
{
"fromCurrency": "USD",
"toCurrency": "EUR",
"exchangeRate": 1.5,
"effectiveDate": "13-12-2019"
},
{
"fromCurrency": "USD",
"toCurrency": "EUR",
"exchangeRate": 1.5,
"effectiveDate": null
}
]
Error Scenario 2 – Response
{
"data": null,
"statusCode": "400",
"errorDetails": [
{
"key": "Model Validation",
"errors": [
{
"errorCode": "",
"errorDescription": "Could not convert string to DateTime: 13-12-2019."
}
]
}
],
"successDetails": []
}
Save Currency Exchange Rate |
|||||
S.No. |
Property |
Required? |
Data type |
Description |
Validations/Exceptions |
1 |
FromCurrency |
Yes |
String(10) |
From Currency name |
|
2 |
ToCurrency |
Yes |
String(10) |
To Currency name |
|
3 |
ExchangeRate |
Yes |
Decimal (18,6) |
Rate of exchange |
|
4 |
EffectiveDate |
No |
DateTime |
Effective date |