Updating a foreign exchange set
When you update a foreign exchange rate set, you replace the items in the foreign
exchange rate set array. Consider the following when updating a foreign exchange rate set:
- Each foreign exchange set array must contain at least one foreign exchange rate. Each
foreign exchange rate includes a priceCurrency
codeandrate. - You can update the priceCurrency
codeorrateof an existing foreign exchange rate. - You can exclude an existing foreign exchange rate to delete it. Or, replace an existing foreign exchange rate with a new foreign exchange rate.
Use the following endpoint to update a foreign exchange rate set:
- PATCH
/admin/v1/foreign-exchange-rate-sets/{foreignExchangeRateSetId}
For example, the following request updates an exchange rate set pc:ABCD123:
Command
PATCH /admin/v1/foreign-exchange-rate-sets/pc:ABCD123Request payload
{
"data": {
"attributes": {
"foreignExchangeRates": [
{
"marketDateTime": "2024-07-21",
"priceCurrency": {
"code": "eur"
},
"rate": "0.9382"
},
{
"marketDateTime": "2024-07-21T00:00:01.000Z",
"priceCurrency": {
"code": "gbp"
},
"rate": "0.792"
},
{
"marketDateTime": "2024-07-21",
"priceCurrency": {
"code": "cad"
},
"rate": "1.352"
}
]
}
}
}For more information on updating an array with a PATCH endpoint, see PATCHes.