1.1. Authentication & Request Protocol
1.1.1. About Request Params
All parameters use form-data parameters, and http method uses POST for all interfaces.
Interface Version
v1
Note: All interface paths have a version parameter, for example, https://www.qianyierp.com/api/{version}/asn, where the {version} field is fixed to v1 unless otherwise specified.
Charset
UTF-8
1.1.2. Base Request Params
Params | Require | DataType | Sample | Description |
---|---|---|---|---|
appId | Y | String | “abc” | QERP application ID, contact Qianyi official to obtain |
serviceType | Y | String | “QUERY_SALES_ORDER_LIST” | service name |
sign | Y | String | Signature string | |
bizParam | Y | String | “JSON” | API parameters, only strings in JSON format are supported |
timestamp | Y | Number | timestamp in milliseconds |
Sign generation
Splice all parameters except sign according to the ASCII code of the parameter name (alphabetical ascending order), and then splice the token, for example: a=parameter value ab=parameter value b{openApi_TOKEN}, and finally use md5 to generate the sign string
1.1.3. Base Reponse JSON
Params | Require | DataType | Sample | Description |
---|---|---|---|---|
errorCode | Y | String | 0 | Error Code |
errorMsg | Y | String | Error message | |
state | Y | String | success | Response State |
bizContent | Y | String | {"id":"1", ...} | Reponse,only json format is supported |
1.1.4. Sign Sample in java
appId:openApi_TEST
serviceType:CREATE_ASN_ORDER
bizParam:{"asnSkuVOList":[{"expectQuantity":"100","sku":"SKU1230","purchasePrice":"10","transferPrice":"100","firstLegPrice":"100"}],"warehouseName":"best warehouse(测试用)","customNumber":"xx1224325212","trackNumber":"xx1223122","remark":"xx122312","purchasePriceCurrency":"CNY","firstLegPriceCurrency":"CNY","transferPriceCurrency":"CNY"}
timestamp:1662448537275
sign:b3dfeed438e36f1f89534ce415cf4113
Sorted Params strings:
appId=openApi_TESTbizParam={"asnSkuVOList":[{"expectQuantity":"100","sku":"SKU1230","purchasePrice":"10","transferPrice":"100","firstLegPrice":"100"}],"warehouseName":"best warehouse(测试用)","customNumber":"xx1224325212","trackNumber":"xx1223122","remark":"xx122312","purchasePriceCurrency":"CNY","firstLegPriceCurrency":"CNY","transferPriceCurrency":"CNY"}serviceType=CREATE_ASN_ORDERtimestamp=1662448537275openApi_TOKEN
appId: openApi_TEST
appSecrest: openApi_TOKEN
package com.example.yahoo.test;
import org.springframework.util.DigestUtils;
import java.nio.charset.Charset;
public class SignUtils {
public static final String EQUAL_SIGN = "=";
public static final String APP_ID = "appId";
public static final String SERVICE_TYPE = "serviceType";
public static final String BIZ_PARAM = "bizParam";
public static final String TIMESTAMP = "timestamp";
public static String calcSign(final String appId, final String bizParam, final String serviceType, final Long timestamp,
final String secret) {
byte[] bytes = buildSignStr(appId, bizParam, serviceType, timestamp, secret)
.getBytes(Charset.forName("UTF-8"));
return new String(DigestUtils.md5DigestAsHex(bytes).getBytes(Charset.forName("UTF-8")));
}
private static String buildSignStr(final String appId, final String bizParam, final String serviceType, final Long timestamp,
final String secret) {
StringBuilder checkStr = new StringBuilder();
checkStr.append(APP_ID).append(EQUAL_SIGN).append(appId)
.append(BIZ_PARAM).append(EQUAL_SIGN).append(bizParam)
.append(SERVICE_TYPE).append(EQUAL_SIGN).append(serviceType)
.append(TIMESTAMP).append(EQUAL_SIGN).append(timestamp)
.append(secret);
return checkStr.toString();
}
}

1.1.5. API address
Version | Address |
---|---|
Cross-border version | www.qianyierp.com |
Overseas version | asia.qianyierp.com |
Test environment | gerp-test1.800best.com |