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 Payout

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:

{
	"extparam": {
		"accountname": "Nguyễn Thành Phát",
		"bankaccount": "0824287105",
		"bankcode": "MB"
	},
	"amount": 10000,
	"mchid": 100000,
	"out_trade_no": "23092024183233784",
	"subject": "pay_test",
	"channel": "vnpay_payout",
	"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 parameter description

  • When the channel is inpay_payout/vnpay_payout, extparam needs to add bankcode/bankaccount/accountname parameter:
{
	"accountname": "Nguyễn Thành Phát",
	"bankaccount": "0824287105",
	"bankcode": "MB"
}

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_payout",
		"out_trade_no": "23092024183233784",
		"client_ip": "127.0.0.1",
		"amount": "10000",
		"currency": "VND",
		"subject": "pay_test",
		"body": "pay_test",
		"extparam": {
			"accountname": "Nguyễn Thành Phát",
			"bankaccount": "0824287105",
			"bankcode": "MB"
		},
		"credential": {
			"out_trade_no": "9451fa8fac8569dab6443cb54270728a",
			"merchant_wallet": {
				"uid": 100000,
				"total_limit_credits": "-1000000000.00",
				"total_security_deposit_credits": "0.00",
				"total_unsettled_credits": "121356.33",
				"total_hold_credits": "0.00",
				"total_commission_credits": "229.47",
				"total_available_credits": "-42728.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

Prev
Order Payment
Next
Notify Payment