Payment Gateway Develop API DocsPayment Gateway Develop API Docs
  • English
  • 简体中文
  • English
  • 简体中文
  • Introduction
  • General
    • Business Process
    • API Rule
    • Response Code
  • API
    • Order Payment
    • Order Payout
    • Notify Payment
    • Notify Payout
    • Query Order
    • Query Balance
  • Appendix
    • Banks

Order Payment

Interface Gateway

URL address:

https://pay.xxx.io/pay/unifiedorder

Tips

This interface is a test interface, please ask the sales person for it

Request Parameter

Parameter NameVariable NameTypeRequiredExampleComment
Merchant UIDmchidstringTRUE100000Merchant UID
Merchant User IDuseridstringTRUEU123456789Merchant User ID
Merchant Trade Noout_trade_nostringTRUE1.00966E+18Merchant Trade No
Product DescriptionsubjectstringTRUEDemoProduct Description
Product InfobodystringTRUEDemoProduct Info
Pay AmountamountfloatTRUE1000Total pay amount, two digits precision
Pay CodechannelstringTRUEinpay_payout(1) Payment: inpay_bankupi/vnpay_napas_vietqr
(2) Payout: inpay_payout/vnpay_payout
Extra DataextparamstringTRUEIf it is a payment request (channel is inpay_payout/vnpay_payout), then extparam needs to add userid bankname bankcode bankaccount accountname parameter, the parameter format is json
Currency CodecurrencystringTRUEINRPayment Currency: CNY, INR, VND
Client IPclient_ipstringTRUE127.0.0.1Client IP
Callback URLnotify_urlstringFALSEAsynchronous callback address: If it is empty or not passed, there will be no callback.
Return URLreturn_urlstringFALSESynchronous redirect address: If it is empty or not passed, there will be no redirect.

Example:

{
	"amount": 15000,
	"mchid": 100000,
	"out_trade_no": "23092024181832904",
	"subject": "pay_test",
	"channel": "vnpay_napas_vietqr",
	"return_url": "http://localhost:8001/demo.html",
	"currency": "VND",
	"client_ip": "127.0.0.1",
	"body": "pay_test",
	"notify_url": "http://localhost:8001/cashier/demonotify",
	"userid": "U123456789"
}

Tips

extparam additional parameter description

  • cashier_type: Not required. This parameter can specify the cashier payment method, 0 is not specified, 1 is quick click payment, 2 is QR code scanning payment, 3 is bank transfer payment
{
	"cashier_type": 2,
}

Response Result

Result NameVariable NameTypeRequiredExampleComment
Result Coderesult_codestringTRUEOKResult Code. OK: Success, Other: Failure
Return Messageresult_msgstringTRUESUCCESSPrompt Information. SUCCESS: success
PayloadchargeobjectTRUEReturn the payment payload object (please see the specific data below)

Success Example:

{
	"result_code": "OK",
	"result_msg": "SUCCESS",
	"charge": {
		"channel": "vnpay_napas_vietqr",
		"out_trade_no": "23092024181832904",
		"client_ip": "127.0.0.1",
		"amount": "15000",
		"currency": "VND",
		"subject": "pay_test",
		"body": "pay_test",
		"extparam": [],
		"credential": {
			"order_amount": "15000",
			"pay_amount": "15000",
			"out_trade_no": "03e1afadd4dee63f69e111804b09d400",
			"merch_name": "demo",
			"pay_channel": "vnpay_napas_vietqr",
			"viet_qr": "00020101021238540010A00000072701240006970422011042196868680208QRIBFTTA53037045405150005802VN62210817Transfer 03e1afad63042170",
			"bank_name": "Ngân hàng TMCP Quân đội",
			"bank_code": 970422,
			"bank_account": "4219686868",
			"account_name": "CTY TNHH MTV TM TOAN HUNG PHAT",
			"cashier_url": "http://gopay.local/cashier/napas_vietqr/data/MTA3NjAwMg==",
			"time": 1727087015,
			"merchant_wallet": {
				"uid": 100000,
				"total_limit_credits": "-1000000000.00",
				"total_security_deposit_credits": "0.00",
				"total_unsettled_credits": "101356.33",
				"total_hold_credits": "0.00",
				"total_commission_credits": "229.47",
				"total_available_credits": "-22728.13"
			}
		}
	}
}

Error Example:

{
    "error_msg": "Invalid Request.[ Request header [authentication] Failure.]",
    "error_code": 400000
}

Tips

[success] This is the successful return information, only when result_code=OK and result_msg= SUCCESS in the returned JSON data can charge

  • status is order business status:
    • 0-closed
    • 1-waiting
    • 2-success
    • 3-failure
    • 4-paying
    • 5-settled
    • 6-refunded
    • 7-dispute

[error] This is the error return information only have error_code and error_msg in the returned JSON data

Next
Order Payout