APG PayAPG Paydocs

Ledgers and journals

Update journals

PATCH/journals

Open or clear the journals of a set of merchants. Answers with what was done, an empty merchantIds acts on every merchant.

Permissions

Required permission
systemJournals:update

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

Request body

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

Discriminated by type
type = "SjnlCollectionUpdateAttributes"

What to do to their books.

merchantIdsarray of MchtId

The merchants to act on. Omit to act on every merchant, which is what a full rebuild does.

Example mcht_9f2Kd8QpLzXw

curl -X PATCH https://api.tst.au.apgpay.dev/journals \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "SjnlCollectionUpdateAttributes",
  "action": {
    "type": "SjnlActionClear",
    "realtimeJournals": true
  },
  "merchantIds": [
    "mcht_9f2Kd8QpLzXw"
  ]
}'

Responses

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

Discriminated by type
type = "SjnlMaintenanceAttributes"

The maintenance that ran, echoed back.

merchantIdsarray of MchtId

The merchants it ran for, as sent. Empty when it ran for every merchant.

Example mcht_9f2Kd8QpLzXw

appliedToEveryMerchantbooleanrequired

true when merchantIds was empty and the maintenance therefore ran for every merchant on the platform. Assert on this rather than on the list.

Example true

Example
{
  "type": "SjnlMaintenanceAttributes",
  "action": {
    "type": "SjnlActionClear",
    "realtimeJournals": true
  },
  "merchantIds": [
    "mcht_9f2Kd8QpLzXw"
  ],
  "appliedToEveryMerchant": true
}

Error responses