APG PayAPG Paydocs

Transactions

Update transaction

PATCH/transactions/{transactionId}

Capture or cancel an authorisation. Selected by the body's type.

2 actionsTranUpdateCancelTranUpdateCapture

Permissions

Required permission

Required action depends on the request variant. Select a variant in the request body below to see the permission it requires.

Path parameters

transactionIdstring
required

Request body

This body is a typed union. Pick a variant to see its fields, the permission it requires, and a matching example.

Discriminated by type
type = "TranUpdateCancel"
Required permission
transactions:delete

Release an authorisation

This variant has no additional fields.

curl -X PATCH https://api.tst.au.apgpay.dev/transactions/{transactionId} \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "TranUpdateCancel"
}'

Responses

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

Discriminated by type
type = "TranUpdateRspAttributes"

The resource as it stands after the change.

Example
{
  "type": "TranUpdateRspAttributes",
  "updated": {
    "type": "TranViewAttributes",
    "transactionId": "tran_9f2Kd8QpLzXw",
    "merchantId": "mcht_9f2Kd8QpLzXw",
    "customer": {
      "type": "RfndCustomerAttributes",
      "customerId": "cust_9f2Kd8QpLzXw",
      "name": "Ada Lovelace",
      "emailAddress": "ada@example.com",
      "phoneNumber": "+61400000000"
    },
    "orderId": "ordr_9f2Kd8QpLzXw",
    "referenceOrderId": "your-own-reference",
    "paymentType": "PayInFull",
    "status": "Accepted",
    "amounts": {
      "type": "TranAmountsAttributes",
      "currency": "AUD",
      "amount": 1250,
      "surcharge": 1250,
      "refunded": 1250,
      "fee": 1250
    },
    "refunds": [
      {
        "type": "RfndViewAttributes",
        "refundId": "rfnd_9f2Kd8QpLzXw",
        "subject": {
          "type": "RfndSubjectTransaction",
          "transactionId": "tran_9f2Kd8QpLzXw"
        },
        "merchantId": "mcht_9f2Kd8QpLzXw",
        "customer": {
          "type": "RfndCustomerAttributes",
          "customerId": "cust_9f2Kd8QpLzXw",
          "name": "Ada Lovelace",
          "emailAddress": "ada@example.com",
          "phoneNumber": "+61400000000"
        },
        "status": "Pending",
        "amounts": {
          "type": "RfndAmountsAttributes",
          "currency": "AUD",
          "amount": 1250,
          "transactionAmount": 1250
        },
        "orderId": "ordr_9f2Kd8QpLzXw",
        "referenceOrderId": "your-own-reference",
        "orderMetadata": {
          "yourKey": {}
        },
        "payoutId": "payout_9f2Kd8QpLzXw",
        "settlementDate": "2026-08-19",
        "attempts": 1250,
        "lastError": "string",
        "createdAt": "2026-08-19T04:21:07Z",
        "refundedAt": "2026-08-19T04:21:07Z",
        "updatedAt": "2026-08-19T04:21:07Z"
      }
    ],
    "disputes": [
      {
        "type": "DisputeViewAttributes",
        "disputeId": "dispute_9f2Kd8QpLzXw",
        "subject": {
          "type": "RfndSubjectTransaction",
          "transactionId": "tran_9f2Kd8QpLzXw"
        },
        "merchantId": "mcht_9f2Kd8QpLzXw",
        "customer": {
          "type": "RfndCustomerAttributes",
          "customerId": "cust_9f2Kd8QpLzXw",
          "name": "Ada Lovelace",
          "emailAddress": "ada@example.com",
          "phoneNumber": "+61400000000"
        },
        "status": "Pending",
        "gatewayState": "string",
        "amounts": {
          "type": "DisputeAmountsAttributes",
          "currency": "AUD",
          "amount": 1250,
          "transactionAmount": 1250
        },
        "feeAmount": {
          "type": "IsoCurrencyAmount",
          "minorCurrencyUnits": 1250,
          "currency": "AUD"
        },
        "reason": "Requested by the customer.",
        "description": "string",
        "orderId": "ordr_9f2Kd8QpLzXw",
        "referenceOrderId": "your-own-reference",
        "orderMetadata": {
          "yourKey": {}
        },
        "evidenceDueBy": "2026-08-19",
        "createdAt": "2026-08-19T04:21:07Z",
        "updatedAt": "2026-08-19T04:21:07Z"
      }
    ],
    "payoutId": "payout_9f2Kd8QpLzXw",
    "settlementDate": "2026-08-19",
    "availableOn": "2026-08-19",
    "referenceTransactionId": "your-own-reference",
    "referenceIssuerTransactionId": "your-own-reference",
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  }
}

Error responses