Skip to main content

Create a new payment

Request address

POST

https://sandbox.j-pay.net/api/v1/payment/createOrder

Test account

Merchant ID:10010

ApiKey: 7e4nicn14nhyup146dfbi8hpnpus9juz

Request parameters

Parameter NameTypeRequiredSign(Y OR N)Parameter Description
Order Information
memberidStringYYThe platform assigns merchant ID
out_trade_noStringYYMerchant order number
amountStringYYPayment amount (two decimal places only)
currencyStringYYCurrency code, For example:USD,JPY,GBP,EUR,AUD,HKD,CAD,MXN
orderTypeStringYYList of order type
notifyurlStringYYA successful transfer will be notified at this address
remarkStringYYThe remarks cannot be empty and contain more than 4 characters
signStringYNPlease see MD5 signature field method
User Information
firstnameStringYYRecipient's name
lastnameStringNYPayee's last name (blank not required to sign) Required when the payment type is ach, Visa Direct or local banks in some countries
payeecontactStringNYPayee contact information (email), Required when the payment type is Venmo or ach or local banks in some countries
payeephoneStringNYPayee contact information (phone), Required when the payment type is BANK
payeeCountryStringNYCountry of the recipient, Required when the payment type is ach,CASHAPPOUT or BANK
provinceStringNYRequired when the payment type is ach or local banks in some countries
cityStringNYRequired when the payment type is ach or local banks in some countries
payeeAddressStringNYFull address of payee, Required when the payment type is ach or local banks in some countries
payeePostalCodeStringNYPayee postal code, Required when the payment type is ach or local banks in some countries
Bank Information
payeeaccountStringYYBank card number, Wallet account number
banknameStringNYBank name of payment card
subbranchStringNYBank branch name of payment card
accountnameStringNYAccount name of settlement card
payeeBankRoutingStringNYBank routing, This parameter is required if the payment type is ach
bankswiftStringNYSWIFT/BIC. Click here to find your SWIFT/BIC. Such as ABCDGITTXXX, This parameter is required if the payment type is Bank in some countries
bankibanStringNYIBAN should include 30 characters.3rd and 4th characters must be digits. Such as KW74NBOK0000000000001000372151, This parameter is required if the payment type is Bank in some countries

Return parameters

Parameter NameTypeParameter Description
transaction_idStringTransaction order number
statusstringsuccess:SUCCESS
error:failed
msgStringState description

Notify parameters

Parameter NameTypeParameter Description
memberidStringMerchant ID
out_trade_nostringMerchant order number
transaction_idStringTransaction order number
amountStringTotal transaction amount
actualamountStringActual amount
original_amountStringOriginal amount
datetimeIntgerTransaction timestamp(second)
transferMessageStringResult message
statusstringSUCCESS:successful
FAIL:failed
signStringSee MD5 signature example

Demo

Request

import { md5 } from "js-md5";
import axios from "axios";

const KEY = "7e4nicn14nhyup146dfbi8hpnpus9juz";
const MEMBER_ID = "10010";
let query = {
memberid: MEMBER_ID,
out_trade_no: "O" + Date.now().valueOf(),
amount: "1.00",
currency: "USD",
orderType: "PayPal-A",
firstname: "Jack",
payeeaccount: "12345678",
notifyurl: "https://www.google.com",
remark: "This is a new payment"
};
let signData = [];
Object.keys(query)
.sort()
.forEach((key) => signData.push(`${key}=${query[key]}`));

signData.push(`key=${KEY}`);
query.sign = md5(signData.join("&")).toUpperCase()

axios
.request({
url: "https://sandbox.j-pay.net/api/v1/payment/createOrder",
method: "post",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
data: query,
})
.then(({ data }) => {
console.log("success", data);
})
.catch((error) => {
console.log("error", error);
});

Response

{ status: 'success', msg: '代付申请提交成功', transaction_id: '151398410112' }

Notify

{
"memberid": "10010",
"out_trade_no": "13676",
"transaction_id": "257354624363",
"amount": "10.00",
"actualamount": "9.80",
"datetime": false,
"transferMessage": "转账成功",
"status": "SUCCESS",
"sign": "6EF39FDDC82DFD5C346A020EEF477D21"
}