GET API TOKEN

NOTE :Get API token before every requests. This token will expire in a minute.

Field Type Required Description
user String Yes Your username.
password password Yes Your password.

RESPONSE:

{
"success": true ,
"data": {
"message": "SUCCESS",
"token": "eyJ0eXA iOiJKV1Q***"
}
}

NATIVE PAY

  • Use this API to request a dynamic qr code with a specific transaction amount. Buyer will scan this qr code to proceed the payment.
  • sub_store_name is nullable. Merchant sub store name use to show payer as the payment body. Default is merchant store name.
  • sub_store_id is nullable. Merchant sub store id not use for payment. It just reference.
  • fee_rate: 2 is Over charge buyer 2% of include total amount

Content-Type: application/json

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUz...

REQUEST:

{
"service_id": 30 ,
"store_id": "123**" ,
"sub_store_id": 123** ,
"sub_store_name": "Test Store" ,
"amount": 0.01 ,
"fee_rate": 2 ,
"auth_code": 284*** ,
"out_trade_no": "ORDER-4339***"
}

RESPONSE:

{
"success": true ,
"data": {
"qr_code": "weixin:\/\/wxpay\/bizpayurl?pr=6E4ptwz"
"amount": 0.01,
"out_trade_no": "ORDER-433***",
"result_code": "SUCCESS",
}
}

QUICK PAY

  • Use this API to request a payment from buyer with a specific transaction amount. Seller scan the buyer qr code to proceed the payment.
  • *Note: Request timeout should be increase to 45s, if payer required to enter the payment pin code to confirm the payment. The MOTP server will called continuously until the payment is successful or timeout (advised timeout time is 45s, advised calling frequency is 3s once) sub_store_id is nullable. Merchant sub store id not use for payment. It just reference.
  • sub_store_name is nullable. Merchant sub store name use to show payer as the payment body. Default is merchant store name.

Content-Type: application/json

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1N.....

REQUEST:

{
"service_id": 2 ,
"store_id": "10***" ,
"sub_store_id": 123*** ,
"sub_store_name": "Foo Bar" ,
"amount": 0.01 ,
"fee_rate": 2 ,
"auth_code": 284957*** ,
"out_trade_no": "ORDER-433***"
}

RESPONSE:

{
"success": true ,
"data": {
"amount": 0.01 ,
"currency": "USD",
"out_trade_no": "ORDER-4***",
"transaction_id": "4200***",
"result_code": "SUCCESS"
}
}

JSAPI PAY

Content-Type: application/json

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1N.....

REQUEST:

{
"service_id": 30 ,
"store_id": "10***" ,
"sub_store_id": 123*** ,
"sub_store_name": "Foo Bar" ,
"amount": 0.01 ,
"fee_rate": 2 ,
"auth_code": 284957*** ,
"out_trade_no": "ORDER-433***"
}

RESPONSE:

{
"success": true ,
"data": {
"amount": 0.01 ,
"currency": "USD",
"out_trade_no": "ORDER-4***",
"transaction_id": "4200***",
"result_code": "SUCCESS"
}
}

REFUND TO BUYER

Content-Type: application/json

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJI...

REQUEST:

{
"service_id": 30 ,
"store_id": "109038" ,
"refund_amount": 0.01 ,
"out_trade_no": "ORDER-433***" ,
"out_refund_no": "REFUND-433***-1" ,
"reason": "...."
}

RESPONSE:

{
"success": true ,
"data": {
"service_id": 30 ,
"store_id": 109038,
"refund_amount": 0.01,
"currency": "USD",
"out_trade_no": "ORDER-433***",
"out_refund_no": "REFUND-433***-1",
"transaction_id": "420000***",
"result_code": "SUCCESS"
}
}

CHECK PAYMENT STATUS

Content-Type: application/json

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIU...

REQUEST:

{
"store_id": 109038 ,
"out_trade_no": "ORDER-433***"
}

RESPONSE:

{
"success": true ,
"data": {
"is_success": true ,
"service_id": 30,
"out_trade_no": "ORDER-433***",
"amount": 0.01,
"out_trade_no": "ORDER-433***",
"out_refund_no": "REFUND-433***",
"currency": "USD",
"message": "Payment Successful!"
}
}

CHECK REFUND STATUS

Content-Type: application/json

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI....

REQUEST:

{
"store_id": 109038 ,
"out_trade_no": "ORDER-433***"
}

RESPONSE:

{
"success": true ,
"data": {
"is_success": true ,
"service_id": 30,
"out_trade_no": "ORDER-433***",
"amount": 0.01,
"out_trade_no": "ORDER-433***",
"out_refund_no": "REFUND-433***",
"currency": "USD",
"message": "Refund Successful!"
}
}