Payment

Base URL: https://checkout-sandbox.payway.com.kh/Copy to clipboard
POST

This Payment API allows you to initiate transactions using a token. It supports the following token types: CITI_FLEX, CITO_FLEX, and CITR_FIX.

Unschedule payment flow

Request

Header Params
stringrequired

Example: application/json

Body Params application/json

stringrequired

Request date and time in UTC format as YYYYMMDDHHmmss.

stringrequired

A unique merchant key which provided by ABA Bank.

<= 20 characters
stringrequired

A unique transaction identifier for the payment.

<= 20 characters
stringrequired

Your consumer identification number.

<= 24 characters
stringrequired

PWT (PayWay Token) is a unique token automatically generated by the PayWay system and is used to complete the purchase.

string nullable optional

Buyer's first name.

<= 20 characters
string nullable optional

Buyer's last name.

<= 20 characters
string nullable optional

Buyer's email address.

<= 50 characters
string nullable optional

Buyer's phone #.

<= 20 characters
numberrequired

Total purchase amount (excluding shipping fee). For KHR, the amount must be at least 100. For USD, the amount must be at least 0.01.

format: double
numberoptional

Shipping fee. Can be any amount.

format: double
stringrequired

The transaction currency for the payment. Supported values are KHR or USD. Please ensure that your merchant profile has these currencies enabled.

stringrequired

Supported value CITU_FLEX, MITU_FLEX and MITR_FIX. Make sure your merchant profile enable to support your business cases.

string nullable optional

The type of transaction. The default value is purchase. Supported values:

  • pre-auth : Pre-authorization (for pre-purchase).
  • purchase : Full purchase transaction.
stringoptional

URL to receive callbacks upon payment completion, encrypted with Base64.

string nullable optional

A Base64-encoded JSON array describing the items being purchased. It supports up to 50 line items with no character limit.

PHP Sample Code

$item = base64_encode(json_encode([
    ["name" => "product 1","quantity" => 1,"price" => 1.00],
    ["name" => "product 2","quantity" => 2, "price" => 4.00]
]));
<= 500 characters
string nullable optional

If you want to include extra data to associate with the transaction and receive it back after payment, you can use the field parameter. Once the payment is completed, this data will be returned in the response.

<= 500 characters
string nullable optional

Base64-encoded JSON string representing payout details

PHP Sample Code

$payout = base64_encode(json_encode([
    ["acc" => "000133879","amt"=> 1],
    ["acc" => "000133880","amt" => 1]
]));
<= 500 characters
string nullable optional

Additional information you want to attach to the transaction.
This information appears in transaction details, lists, and export reports.
Must be base64-encoded JSON.

<= 500 characters
stringrequired

PHP Sample Code

// public key provided by ABA Bank
$api_key = "API KEY PROVIDED BY ABA BANK";

// Prepare the data to be hashed
$b4hash = $request_time . $merchant_id . $tran_id . $amount . $currency . $items . $ctid . $pwt . $first_name . $last_name . $email . $phone . $purchase_type . $callback_url . $custom_fields . $return_params . $payout . $token_flag . $shipping_fee;

// Generate the HMAC hash using SHA-512 and encode it in Base64
$hash = base64_encode(hash_hmac('sha512', $b4hash, $api_key, true));

Example

{
  "request_time": "",
  "merchant_id": "",
  "tran_id": "",
  "ctid": "",
  "pwt": "",
  "first_name": "",
  "last_name": "",
  "email": "",
  "phone": "",
  "amount": "",
  "shipping_fee": "",
  "currency": "",
  "token_flag": "",
  "purchase_type": "",
  "callback_url": "",
  "items": "",
  "return_params": "",
  "payout": "",
  "custom_fields": "",
  "hash": ""
}
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R

Responses