# Pre-auth

## 1. Introduction

Pre-auth (**pre-authorization**) is a **temporary hold** placed on a customer’s funds to confirm they have enough money for a transaction. The money is **not immediately deducted**, but it is reserved for potential payment. Later, the merchant can either **capture** the amount (finalize the charge) or **release** it (cancel the hold).  

It’s commonly used in **hotels, car rentals, gas stations, and online payments** where the final amount may change before the transaction is completed.  

**Think of it like a security deposit**—the money is set aside but not actually spent until the final charge is confirmed.

## 2. Integration Steps
:::tip[]
Before you start, make sure you have the following:
- PayWay Sandbox Account – **[Register here](https://sandbox.payway.com.kh/register-sandbox/)** to test transactions.
- Sandbox Merchant ID & API Key—You’ll receive these via email after registering for the sandbox.
:::
<Steps>
  <Step title="Create pre-auth transaction">
      
<Tabs>
  <Tab title="Checkout API">
     Please follow [Purchase](https://developer.payway.com.kh/purchase-14530820e0.md) API specification. 
      - Set `type` of the requst to `pre-auth`
      - Supported payment methods: ABA PAY, KHQR, Credit/Debit Card (Vsia, Mastercard, JCB, UPI)
  </Tab>
  <Tab title="Purchase with AoC/CoF Token">
    Please follow [Puchase using token](https://developer.payway.com.kh/purchase-using-token-14530833e0.md) API specification
  </Tab>

</Tabs>

      
      
   
  </Step>
  <Step title="Complete pre-auth">
      
      
<Tabs>
  <Tab title="Without payout">
      To complete pre-auth **without payout** please follow [Complete pre-purchase transaction](https://developer.payway.com.kh/complete-pre-auth-transactions-14530835e0.md) API specification.
  </Tab>
  <Tab title="With payout">
      To complete pre-auth **with payout** please follow [Complete pre-auh transaction with payout](https://developer.payway.com.kh/complete-pre-auh-transaction-with-payout-14666701e0.md)  API specification.
  </Tab>
</Tabs>

  
  </Step>
  <Step title="Cancel pre-auth">
    To cancel pre-auth please follow [Cancel pre-purchase transaction](https://developer.payway.com.kh/cancel-pre-purchase-transaction-14530836e0.md) API specification.
  </Step>
</Steps>



:::caution[]
If don't cancel or complete pre-auth transaction within 30 days (default value), the transaction will automatically cancel. The fund will be return back to the payer.
:::


