APG PayAPG Paydocs

Payments

Authorise, then capture or cancel

Hold the funds now, decide later, and know how long you have.

Authorising holds the money without taking it. Use it when you cannot ship yet: the funds are reserved, the customer sees a pending amount, and you capture when you are ready or cancel if you never are.

authoriseOnly is the whole difference from taking the money now. The transaction comes back Authorised, not Captured.

Request
curl -X POST "https://api.tst.au.apgpay.dev/bezel/transactions" \
  -H "Authorization: Bearer $API_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "orderId": "<useOrderIdFromSeed>",
  "paymentTokenId": "<usePaymentTokenIdFromSeed>",
  "authoriseOnly": true,
  "requestThreeDS": null,
  "returnUrl": "https://bluehillcoffee.example/checkout/complete",
  "offSession": null,
  "cardStatementName": null,
  "cardStatementCity": null,
  "referenceTransactionId": "web-order-10423",
  "type": "TranCmdCreate"
}'
An authorisation expires, and how long it lasts is the card scheme's decision, not ours, commonly around seven days, shorter for some card types. An expired authorisation cannot be captured, so treat the window as a deadline rather than a suggestion.

Capturing is a status change on the transaction, not a separate action verb, Captured is a state the transaction moves to. You may capture less than you authorised; you may not capture more.

Request
curl -X PATCH "https://api.tst.au.apgpay.dev/bezel/transactions/<useTransactionIdFromStep1>" \
  -H "Authorization: Bearer $API_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "captureAmount": {
    "minorCurrencyUnits": 9500,
    "currency": "AUD"
  },
  "type": "TranUpdateCapture"
}'

Cancelling releases the hold. Do it as soon as you know you will not ship, the customer sees their available balance restored, and until you do they do not.

Request
curl -X PATCH "https://api.tst.au.apgpay.dev/bezel/transactions/<useTransactionIdFromStep1>" \
  -H "Authorization: Bearer $API_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "type": "TranUpdateCancel"
}'
Cancelling is not refunding. A cancel releases money that was never taken; a refund returns money that was. If the transaction is already Captured, cancelling is not available and you want refund-a-payment.

See refund a payment.