创建商户
请求地址
POST
https://sandbox.j-pay.net/pay/merchant/create
测试账号
商户ID:10010
ApiKey: 7e4nicn14nhyup146dfbi8hpnpus9juz
请求头
| 请求头名称 | 请求头值 |
|---|---|
| Agent-Merchant-Id | 10010 |
请求参数
| 参数名称 | 类型 | 是否必填 | 参与签名 | 参数说明 |
|---|---|---|---|---|
| String | Y | Y | 商户邮箱 | |
| country | String | Y | Y | 国家,是一个ISO 3166-1 alpha-2国家代码 |
| company | Array | Y | N | 关于公司或业务的信息。 |
| business_profile | Array | N | N | 关于商户账户的业务信息。 |
| sign | String | Y | N | 请参阅验证签名字段格式 |
Company
| 参数名称 | 类型 | 是否必填 | 参与签名 | 参数说明 |
|---|---|---|---|---|
| name | String | Y | N | 公司名称. |
| tax_id | String | N | N | 公司的业务ID号,根据公司的国家适当。 |
| phone | String | N | N | 公司的电话号码。 |
| state | String | N | N | 国家的州、县、省或区域(ISO 3166-2) |
| city | String | N | N | 城市. |
| line1 | String | N | N | 地址行1. |
| line2 | String | N | N | 地址行2. |
| postal_code | String | N | N | ZIP或邮政编码。 |
Business Profile
| 参数名称 | 类型 | 是否必填 | 参与签名 | 参数说明 |
|---|---|---|---|---|
| mcc | String | Y | N | 商户分类代码。例如:7372表示在线购物。 |
| url | String | Y | N | 商户的公开网站。例如:google.com |
返回参数
| 参数名称 | 类型 | 参数说明 |
|---|---|---|
| code | String | 请求状态 1:成功 0:失败 |
| info | String | 请求消息 |
| data | Integer | 商户ID |
示例
- Javascript
- Php
- Python
import { md5 } from "js-md5";
import axios from "axios";
const KEY = "7e4nicn14nhyup146dfbi8hpnpus9juz";
const MEMBER_ID = "10010";
let query = {
email: Date.now().valueOf() + "@123.com",
country: 'US',
};
let signData = [];
Object.keys(query)
.sort()
.forEach((key) => signData.push(`${key}=${query[key]}`));
signData.push(`key=${KEY}`);
Object.assign(query, {
sign: md5(signData.join("&")).toUpperCase(),
company: {
name: "Nimiya Shop",
phone: "1234567890",
tax_id: "000000000",
city: "San Francisco",
state: "CA",
line1: "123 Main St",
postal_code: "94102",
},
business_profile: {
mcc: "7372",
url: "nimiya.shop"
},
});
axios
.request({
url: "https://sandbox.j-pay.net/pay/merchant/create",
method: "post",
headers: {
"Agent-Merchant-Id": MEMBER_ID,
"Content-Type": "application/x-www-form-urlencoded",
},
data: query,
})
.then(({ data }) => {
console.log("success", data);
})
.catch((error) => {
console.log("error", error);
});
Continuously updating...
Continuously updating...