APG PayAPG Paydocs

FX rates

Update FX rate set

PATCH/fx-rate-sets/{fxRateSetId}

Load new rates. replaceOldRates decides whether they replace the set's rates or merge into them, there is no safe default.

Permissions

Required permission
fxRates:update

Requires the `update` action on `fxRates` for the supplied runtime context

Path parameters

fxRateSetIdstring
required

Request body

This body is a tagged shape: type is always "FxrsUpdateRates". Send it; more variants can be added, and a caller that switches on it keeps working when they are.

Discriminated by type
type = "FxrsUpdateRates"

The rates to load. At least one, the platform takes a non-empty set, and this now says so rather than refusing after the fact.

ratesUpdatedAtstring (date-time)

When they were struck. Defaults to now.

Example 2026-08-19T04:21:07Z

replaceOldRatesbooleanrequired

true replaces the set's rates with these. false merges them, leaving pairs you did not send as they were. Required, neither default is safe.

Example true

curl -X PATCH https://api.tst.au.apgpay.dev/fx-rate-sets/{fxRateSetId} \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "FxrsUpdateRates",
  "rates": [
    {
      "type": "FxrsRateAttributes",
      "baseCurrency": "AUD",
      "termCurrency": "AUD",
      "bidRate": "0.9412",
      "askRate": "0.9412"
    }
  ],
  "ratesUpdatedAt": "2026-08-19T04:21:07Z",
  "replaceOldRates": true
}'

Responses

The response is a tagged shape: type is always "FxrsUpdateRspAttributes". Switch on it; subtypes can be added, and a client that already reads it will not break.

Discriminated by type
type = "FxrsUpdateRspAttributes"

The resource as it stands after the change.

Example
{
  "type": "FxrsUpdateRspAttributes",
  "updated": {
    "type": "FxrsViewAttributes",
    "fxRateSetId": "fxrset_9f2Kd8QpLzXw",
    "rateSetCode": "0.9412",
    "enterpriseId": "ent_9f2Kd8QpLzXw",
    "description": "string",
    "crossCurrency": "AUD",
    "timeZone": "string",
    "rates": {
      "type": "FxrsSnapshotAttributes",
      "ratesUpdatedAt": "2026-08-19T04:21:07Z",
      "recordedAt": "2026-08-19T04:21:07Z",
      "rates": [
        {
          "type": "FxrsRateAttributes",
          "baseCurrency": "AUD",
          "termCurrency": "AUD",
          "bidRate": "0.9412",
          "askRate": "0.9412"
        }
      ]
    },
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  }
}

Error responses