Ksher Payment API Gateway for Developers
Number of APIs: 20
Ksher Payment API Gateway for Developers
Ksher will shut down the API connection via .vip.ksher.net. That make
new register merchant will unable to use system over .vip.ksher.net. If
you never integrate API with Ksher, Please to use api.ksher.net
Enable ePayment for your Website and App via simple API
https://doc.vip.ksher.net
Introduction
Ksher API Gateway supports payment in multiple countries and multiple payment channels (different card schemes, wallets and offline channels). All countries and channels can be integrated using a unified API.
In the sale transaction process, the interaction between the merchant and the gateway is as follows:
- The merchant's website initiates a transaction through an API call, and the API request contains the following main information:
- Amount
- Successful transaction redirect url
- Transaction failed redirect url
- The API gateway returns a payment link to the merchant website, and the merchant website redirects the consumer's browser (or the webview built in the mobile APP) to this payment link.
- The consumer visits the payment link and completes the payment.
- After the payment is successful, the API gateway sends a Webhook to the merchant's website, and at the same time redirects the consumer's browser to access the
transaction successful redirect url
in the first step request

The above figure is a sequence diagram of the interaction among consumers, merchant websites, API gateways, and wallets in a payment scenario.
API Spec
The Document for each API is in swagger format and located under your own integration gateway site. https://your_url
.vip.ksher.net/api-docs
For your convenience, ksher has created a sandbox for merchants that don't have own portal, which can be tested here.
https://sandboxdoc.vip.ksher.net/api-docs
In case the merchant has obtained the portal from ksher, use the portal obtained for testing.
There are a number of API collections included.
- redirect API is for Website and Mobile App integration.
- settlement API is for checking the settlement information.
- miniapp API is for WeChat and Alipay Mini-Program integration.
- event API is for checking the events deliveried.
- C scan B API is for C scan B(merchant present QR code) or Kiosk integration.
- B scan C API is for B scan C(customer present QR code) or POS integration.
For normal integration, you will only need to check the redirect API.
Gateway interface integration guide
1. Interface description
Request URL
The actual request address of all interface URLs is payment gateway address + interface URL
The exclusive payment gateway address can be obtained by contacting ksher.
Response http Status Code
When the http status code is 200, the response contains errorcode and errormessage fields, indicating the result of this request
Create an order, query an order, and refund an order. When the call is successful, the interface will return the order details .
http status code | instruction |
---|---|
200 | Success |
400 | Request parameter format verification failed |
401 | unauthorized |
403 | Permission denied |
404 | The requested resource does not exist |
400 response example
{
"code": 400,
"name": "Bad Request",
"description": "<p class='preserveHtml' class='preserveHtml'>BadRequest {'redirect_url': ['Not a valid URL.']}</p>",
"log_entry_url": "https://dev.vip.ksher.net/web#action=153&view_type=form&model=rest.log&id=1254"
}
-
redirect - redirect-creat new POST {{base_url}}/api/v1/redirect/orders
-
Mini program - miniapp-creat new POST {{base_url}}/api/v1/miniapp/orders
-
Mini program - miniapp-query GET {{base_url}}/api/v1/miniapp/orders/:order_id?signature={{signature}}×tamp=1647228347
-
b scan c - B scan C - create new POST {{base_url}}/api/v1/bscanc/orders
-
report - Transaction data GET {{base_url}}/api/v1/finance/settlements/order/:date?signature={{signature}}×tamp=1647228347&mid=mch35618&offset=0&limit=50
-
redirect - redirect-refund PUT {{base_url}}/api/v1/redirect/orders/:order_id
-
Mini program - miniapp-refund PUT {{base_url}}/api/v1/redirect/orders/:order_id
-
app - app-creat new POST {{base_url}}/api/v1/app/orders
-
app - app-query GET {{base_url}}/api/v1/app/orders/:order_id?signature={{signature}}×tamp=1647228347
-
app - app-refund PUT {{base_url}}/api/v1/app/orders/:order_id