APG PayAPG Paydocs

Orders

Update order

PATCH/orders/{orderId}

Update an order's own details, cancel it, reissue its payment link or send it. Selected by the body's type.

4 actionsOrdrUpdateCancelOrdrUpdateDetailsOrdrUpdateReissuePaymentLinkOrdrUpdateSendPaymentLink

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

orderIdstring
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 = "OrdrUpdateCancel"
Required permission
orders:delete

Cancel an unpaid order

This variant has no additional fields.

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

Responses

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

Discriminated by type
type = "OrdrUpdateRspAttributes"

An order, the commerce record a payment settles.

Example
{
  "type": "OrdrUpdateRspAttributes",
  "updated": {
    "type": "OrdrViewAttributes",
    "orderId": "ordr_9f2Kd8QpLzXw",
    "merchantId": "mcht_9f2Kd8QpLzXw",
    "marketplaceId": "mktp_9f2Kd8QpLzXw",
    "customer": {
      "type": "OrdrCustomerAttributes",
      "name": "Ada Lovelace",
      "emailAddress": "ada@example.com",
      "phoneNumber": "+61400000000"
    },
    "status": "Created",
    "orderType": "Online",
    "amounts": {
      "type": "OrdrAmountsAttributes",
      "currency": "AUD",
      "total": 1250,
      "tax": 1250,
      "paid": 1250,
      "outstanding": 1250,
      "surcharge": 1250,
      "discount": 1250
    },
    "lineItems": [
      {
        "type": "OrdrLineItemInvoice",
        "description": "string",
        "unitCount": 12.5,
        "fee": 1250,
        "tax": 1250,
        "value": 1250,
        "category": "string",
        "notes": "string"
      }
    ],
    "description": "string",
    "shipping": {
      "type": "OrdrShippingAttributes",
      "name": "Ada Lovelace",
      "address": {
        "type": "OrdrAddressAttributes",
        "line1": "string",
        "line2": "string",
        "city": "string",
        "state": "string",
        "postalCode": "3000",
        "country": "AU"
      },
      "amount": 1250,
      "carrier": "string",
      "trackingNumber": "string",
      "phone": "+61400000000"
    },
    "billing": {
      "type": "OrdrBillingAttributes",
      "name": "Ada Lovelace",
      "address": {
        "type": "OrdrAddressAttributes",
        "line1": "string",
        "line2": "string",
        "city": "string",
        "state": "string",
        "postalCode": "3000",
        "country": "AU"
      },
      "phone": "+61400000000"
    },
    "settlement": "Default",
    "request3DSOnPayment": true,
    "emailCustomerReceipt": true,
    "referenceOrderId": "your-own-reference",
    "metadata": {
      "yourKey": {}
    },
    "createdAt": "2026-08-19T04:21:07Z",
    "updatedAt": "2026-08-19T04:21:07Z"
  },
  "paymentLink": {
    "type": "OrdrPaymentLinkAttributes",
    "token": "tok_9f2Kd8QpLzXwR4mN",
    "url": "https://example.com/callback"
  }
}

Error responses