Developer Suite
Register Sandbox
Register Sandbox
  1. Pre-auth
  • Overview
  • API Endpoints
  • Ecommerce Checkout
    • Purchase
      POST
    • Get a transaction details
      POST
    • Close transaction
      POST
    • Check transaction
      POST
    • Refund API
      POST
    • Get transaction list
      POST
    • Exchange rate
      POST
  • Checkout Plugins
    • Prestashop
    • Woocommerce
  • Credentials on File
    • Link Account
      POST
    • Link Card
      POST
    • Purchase using token
      POST
    • Remove account token
      POST
    • Remove card token
      POST
    • Get linked account details
      POST
  • ABA QR API
    • QR API
      POST
  • Payment Link
    • Create payment link
      POST
    • Get payment link details
      POST
  • Pre-auth
    • Complete pre-auth transactions
      POST
    • Complete pre-auh transaction with payout
      POST
    • Cancel pre-purchase transaction
      POST
  • Payout
    • Payout
    • Update a beneficiary status
    • Add a beneficiary to whitelist
  • KHQR Guideline
  • Resources
  1. Pre-auth

Complete pre-auh transaction with payout

POST
/api/merchant-portal/merchant-access/online-transaction/pre-auth-completion
A complete pre-auth refers to the action where the merchant proceeds with capturing the funds after the initial authorization, typically at the time the product or service is provided.
This process involves two steps:
Pre-authorization: The merchant requests a certain amount to be reserved on the customer’s account, usually to confirm the customer has sufficient funds or credit.
Completion (or Capture): The merchant later captures the pre-authorized amount, finalizing the transaction and actually charging the customer's account.
Conditions
You can only complete the pre-auth once.
Pre-auth cannot be completed on transactions that have already expired or been canceled.
For card payments, you can complete the pre-auth with an additional 10% above the original pre-auth amount.

Request

Header Params
Content-Type
string 
required
Example:
application/json
Body Params application/json
request_time
string 
required
Request date and time in UTC format as YYYYMMDDHHmmss.
merchant_id
string 
required
A unique merchant key provided by ABA Bank.
<= 20 characters
merchant_auth
string 
required
The JSON-encoded object contains the fields mc_id, tran_id, and complete_amount, and payout which are encrypted using RSA public key encryption in chunks.

mc_id string mandatory
A unique merchant key which provided by ABA Bank. Same value as merchant_id.

tran_id string mandatory
Pre-auth purcahse transaction id to complete.

complete_amount decimal mandatory
Amount to complete.

payout string mandatory
Payout instruction

PHP Sample Code
hash
string 
required
Base64-encoded HMAC-SHA512 hash of concatenated values: merchant_auth, request_time, and merchant_id with public_key.
Example
{
    "request_time": "20200728093403",
    "merchant_id": "ec000002",
    "merchant_auth": "b1453eac8cd686f90542c9d7dc026a3f70678afd",
    "hash": "wR2bVPVKY9M4WmeGoQUUcmtrJYFofFuMrgTMBLj/g8kPfXgnpK/qpjptO+1D0nKbpFktqM/iPWEyQ6/llsnJ bw=="
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/merchant-portal/merchant-access/online-transaction/pre-auth-completion' \
--header 'Content-Type: application/json' \
--data-raw '{
    "request_time": "20200728093403",
    "merchant_id": "ec000002",
    "merchant_auth": "b1453eac8cd686f90542c9d7dc026a3f70678afd",
    "hash": "wR2bVPVKY9M4WmeGoQUUcmtrJYFofFuMrgTMBLj/g8kPfXgnpK/qpjptO+1D0nKbpFktqM/iPWEyQ6/llsnJ bw=="
}'

Responses

🟢200OK
application/json
Body
grand_total
number 
required
The original amount authorized for pre-auth transactions.
currency
string 
required
Original transaction currency
>= 3 characters<= 3 characters
transaction_status
string 
required
Transaction status. Once successfully completed, the status will beCOMPLETED
status
object 
required
code
string 
required
00 - Transaction successful.
PTL02 - Invalid hash value.
PTL04 - Parameter validation failed.
PTL06 - The request has expired.
PTL36 - Invalid transaction.
PTL62 - Merchant information is invalid.
PTL63 - The merchant does not have a security configuration file.
PTL59 - Unable to complete or cancel the pre-authorization.
PTL60 - Pre-authorization completion amount exceeds the authorized limit.
PTL61 - Invalid action type.
PTL153 - Completing pre-authorization fees for a merchant with multiple settlement accounts is not allowed.
PTL157 - An unexpected error occurred. Please try again later or contact our digital support team.
PTL168 - Concurrent requests are not allowed for this operation. Please try again in a few seconds.
PTL169 - The merchant profile cannot accept payments because the settlement account is closed.
USD-NOT-ALLOW - The requested amount is not allowed for USD transactions.
KHR-LESS-100 - The transaction amount in KHR must be at least 100 KHR.
KHR-CONTAIN-DECIMAL - KHR transaction amounts cannot contain decimal places.
message
string 
required
Please see more details on the property code above.
Examples
{
    "grand_total": 1.5,
    "currency": "USD",
    "transaction_status": "COMPLETED",
    "status": {
        "code": "00",
        "message": "Success!"
    }
}
Previous
Complete pre-auth transactions
Next
Cancel pre-purchase transaction