API Integration

PayWay APIs are provided as REST and has predictable, resource-oriented URLs. It uses HTTP response codes to indicate API errors. In order to call our APIs, you need to pass authentication in the form of merchant key and authorization header. Values for both merchant key and Authorization header are made available via email used at the time of registration.

The API allows you to interact securely from a client-side application, we return JSON for all API responses, including specific error message.

Here you will find all the APIs provided by PayWay for different functions like

  • Create Transaction - Create a transaction in PayWay
  • Check Transaction - Check transaction status
  • Get Transaction - Get transactions list
  • Push Back Notification

Every time you use above APIs you will have to pass authentication, you can authenticate your account by including your secret key and apply encrypt mechanism in API requests.
Your API keys manage many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas on any online source code version control, online drive share, client-side code, etc.

Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth value. You do not need to provide username and password.

API URL

The APIs are accessible from the URL:

Testing Server base url:

https://sandbox.payway.com.kh/api/{merchant_api_name}/

Production Server base url:

https://payway.ababank.com/api/{merchant_api_name}/

Sample Request Diagram

The REST API will be following below example sequence to execute the call

Error Codes

When accessing PayWay, any invalid request that is received is responded to with any of the following error code

ERROR CODEERROR MESSAGE
1Invalid Hash.
2Invalid Transaction ID.
3Invalid Amount format.
4Duplicate Transaction ID.
5Invalid Continue Success URL (Must be registered in PayWay backend).
6Invalid Domain Name (Need to register in PayWay backend).
7Invalid Return Param (String mast be smaller than 500 chars).
8Invalid Limit Amount (The amount must be smaller than value that allowed in PayWay backend).
9Invalid Shipping Amount.
10PayWay Server Side Error.
11Invalid Currency Type (Merchant is allowed only one currency - USD or KHR).
12Invalid Item.