Capture/Completion
A Capture/Completion API is used to finalise a payment transaction that was previously authorised using a Pre-auth API. It’s a critical part of the payment flow in industries where the final transaction amount may change after the initial authorisation—such as hospitality, fuel, or services.
Key Parameters:
MsgType.SALE_COMP: Indicates a completion.origTransNo: STAN of the originalPRE_AUTHtransaction.tokenReq: Enables agreement fields iftrue.
The System Trace Audit Number or STAN number is the primary method to link the message to the original/parent transaction. In addition to this, invoice number may also be used
What a Capture/Completion API Does
1
Finalises the Transaction
It confirms the transaction and instructs the payment gateway to transfer the reserved funds from the customer’s account to the merchant.
2
References the Pre-auth
The API uses the authorisation code and transaction ID from the original pre-auth request to link the two operations.
3
Specifies Final Amount
It may include the same or adjusted amount (e.g. adding minibar charges to a hotel bill), depending on business rules and gateway support.
4
Updates Receipts and Logs
The system generates a final receipt and updates transaction logs for reconciliation and reporting.
5
Handles Errors and Expiry
If the pre-auth has expired or is invalid, the API will return an error, prompting the merchant to re-authorise or retry the transaction.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Button.onClick {
val parsedAmount = parseAmount(amount) ?: return@onClick
val parsedStan = parseStan(stan) ?: return@onClick
val requestMsg = RequestMsg(
msgType = MsgType.SALE_COMP,
invoiceNbr = "10120304",
amount = 1500, // $15.00
currency = "USD",
stan = 2,
tokenReq = true,
agreementID = "MERCH123_20250804_001",
agreementType = "I"
)
sdk.sendRequestMessage(requestMsg)
}