Developer Suite
Register Sandbox
Register Sandbox
  1. Payment Link
  • 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. Payment Link

Create payment link

POST
/api/merchant-portal/merchant-access/payment-link/create
This API allows you to create a payment link from your application.

Request

Header Params
Content-Type
string 
required
Example:
multipart/form-data
Body Params multipart/form-data
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.
merchant_auth
string 
required
A JSON string representing a JSON object, encrypted using OpenSSL with an RSA public key.

mc_id string mandatory
The same value as merchant_id

title string mandatory
Title of the payment link. Max. Lenght 250.

amount string mandatory
Payment link amount. Must be at least 100 KHR or 0.01 USD. Cannot be null or zero.

currency string mandatory
Transaction currency code (Mandatory). Supported values: KHR or USD.

description string
Description of the payment link. Optional. Max. Lenght 250

payment_limit string
Maximum number of transactions allowed for this payment link (Optional). If left blank, there is no limit..

expired_date string mandatory
Expiration date of the payment link. A null value means no expiry date.

return_url string mandatory
Once a payment is made on the payment link, the payment gateway will call this URL to send the payment details. This URL must be encrypted in Base64.

merchant_ref_no string optional
Your payment link ID. We suggest using a unique ID. PayWay does not validate duplicates. This ID will be included in the callback when the payment is completed. Max length: 50.

payout string optional
Payout instruction of the payment link. Total payout amount must equal to payment link amount.

PHP Sample Code
image
file 
optional
An image associated with the payment link
Maximum file size: 3MB
Supported file formats: JPG, JPEG, PNG
hash
string 
required
Base64-encoded HMAC SHA-512 hash of the concatenated values: request_time, merchant_id, and merchant_auth with public_key.
PHP Sample Code

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/payment-link/create' \
--header 'Content-Type: multipart/form-data' \
--form 'request_time=""' \
--form 'merchant_id=""' \
--form 'merchant_auth=""' \
--form 'image=@""' \
--form 'hash=""'

Responses

🟢200Success
application/json
Headers
Content-Type
string 
optional
Example:
application/json
Body
data
object 
optional
id
string 
optional
A unique payment link ID generated by the payment gateway.
title
string 
optional
The title of your payment link.
image
object 
optional
Image associated with the payment link
amount
number <double>
optional
Payment link amount.
currency
string 
optional
Payment link currency. Supported values: KHR, USD.
>= 3 characters<= 3 characters
status
string 
optional
Once the payment link is created, its status is "OPEN"
description
string 
optional
A description of your payment link.
payment_limit
number 
optional
The maximum number of transactions allowed for this payment link.
total_amount_org
string 
optional
Total payment amount before refund.
total_amount
number 
optional
Total amount after refund.
total_refund
number 
optional
Total refunded amount.
total_trxn
number 
optional
The total number of completed payment transactions. A newly created payment link will have a value of 0
created_at
string 
optional
Date and time when the payment link was created in the payment gateway.
updated_at
string 
optional
The last updated date and time of the payment link.
expired_date
number 
optional
The expiration timestamp for this payment link.
return_url
string 
optional
The URL that the payment gateway will call to send payment status updates.
merchant_ref_no
string 
optional
The payment link reference number.
outlet_id
string 
optional
A unique outlet identifier
outlet_name
string 
optional
The outlet name.
payment_link
string 
optional
Full URL of the payment link
payout
array [object {3}] 
optional
Payout instructions for the payment link
acc
string 
optional
The ABA account number or MID of the beneficiary
amt
number 
optional
The payout amount. The currency will follow the payment link currency.
acc_name
string 
optional
The name of the beneficiary. If the beneficiary is an ABA account number, it will show the account holder's name. If the beneficiary is a MID (ABA Merchant), it will show the outlet name associated with that MID.
status
object 
optional
code
string 
optional
PTL02 : Wrong Hash
PTL05 : Parameter Invalid Format
PTL99 : Merchant invalid currency.
PTL132 : Invalid payment link.
message
string 
optional
Please see the property response code for details.
tran_id
string 
optional
A unique log ID generated by the payment gateway.
Examples
{
    "data": {
        "id": "UD/8Hl***Ht1xQdhlw==",
        "title": "Test curl 001",
        "image": {
            "image": "",
            "filename": "",
            "size": 0
        },
        "amount": "0.03",
        "currency": "USD",
        "status": "OPEN",
        "description": "Payment link created from curl",
        "payment_limit": 5,
        "total_amount_org": 0,
        "total_refund": 0,
        "total_amount": 0,
        "total_trxn": 0,
        "created_at": "2023-04-13 03:43:30",
        "updated_at": "2023-04-13 03:43:30",
        "expired_date": 1681357409,
        "return_url": "https://domain.com",
        "merchant_ref_no": "ref00001",
        "outlet_id": "xknY***QfbOCJA==",
        "outlet_name": "Book Store",
        "payout": [
            {
                "acc": "000***222",
                "amt": "0.01",
                "acc_name": "Red cafe online"
            },
            {
                "acc": "122***425",
                "amt": "0.02",
                "acc_name": "Red Cafe 02 by K.S"
            }
        ],
        "payment_link": "https://dpayment-euat.payway.com.kh/JT4630l"
    },
    "status": {
        "code": "00",
        "message": "Success!"
    },
    "tran_id": 1681357410
}
Previous
Payment Link
Next
Get payment link details