1. Brief
If you need to connect with Qianyi's third-party logistics provider, you need to see the document
2. Environmental requirements and basic agreements
Authorization: accessId (customer ID) and secretKey (key) are used to verify packet information. For the warehouse, the key agreed upon by both parties is used for verification.
Interface address: The third party provides the service address for Qianyi to call.
Request method:
- Method: POST
- Content-Type: application/x-www-form-urlencoded
Base request:
Field | DataType | Require | Description |
---|---|---|---|
accessId | String | Yes | The third party authorizes Qianyi customer ID. gwms |
method | String | Yes | The name of the interface method |
content | String | Yes | content |
sign | String | Yes | Signature |
headerParams:
Field | DataType | Require | Description |
---|---|---|---|
logisticsType | String | No | Type of logistics |
secret | String | No | Third-party warehouse keys. GWMS verifies the signature with the key agreed upon by both parties |
accessToken | String | No | accessToken |
refreshToken | String | No | refreshToken |
authInfo | String | No | The authorization information used by the GWMS carrier on the carrier's side. JSON format |
apiUrl | String | No | Service Request Domain: https://www.baidu.com |
authInfo Example of value transfer: "authInfo":[ {"authInfoKey":"MERCHANT_ID", "value":"BG2447"}, {"authInfoKey":"SECRET_KEY", "value":"f1dafc7b7c934d21327d990b0ea56cfcf4814ef699345a37010c07e02d5219a9"}, {"authInfoKey":"PRINT_SIZE", "value":""} ] Among them, MERCHANT_ID, SECRET_KEY, and PRINT_SIZE are all fields agreed by the logistics provider to be transmitted, and the fields may be different for different logistics providers, and they are all passed Request in JSON format.
Base Response:
Field | DataType | Require | Description |
---|---|---|---|
success | boolean | Yes | Whether the transaction was successful |
message | String | No | The service processes the exception message |
Signature method:
- Combine accessId and content into a JSON string {"accessId":"accessId","content":"Specific business Params"}, and when content is empty, {"accessId":"accessId"}. The accessId passed by gwms is empty
- Append the customer secretKey assigned by the third party to the end of the JSON to obtain the string to be encrypted {"accessId":"accessId","content":"Specific business Params"}secretKey. The secretKey passed by gwms is the key agreed upon by both parties
- Perform SHA1 encryption on the string to be encrypted (org.apache.commons.codec.digest.DigestUtils.sha1Hex(string to be encrypted))
- Assign the signature to the sign field of the common request
3. Channel List
Method Name:
- channels
Response:
Field | Field Description | DataType | Require | Description |
---|---|---|---|---|
channelList | Channel information | Array | ||
└ channelCode | Channel code | String | Require | Unique |
└ channelName | The name of the channel | String | Require | |
└ carrierName | Carrier name | String | No |
Request Sample:
{ "accessId": "3215435", "content": "", "method": "channels", "sign": "11fbd649164860b5571cb60dfc99baccb375f392" }
Response Sample:
{ "success": "true", "message": "", "channelList": [ { "channelCode": "FedexGround", "channelName": "FedEx Ground", "carrierName": "FEDEX" } ] }
4. Create Logistics Order (Apply for Number)
Method Name:
- createOrder
Interface Params:
Field | Field Description | DataType | Require | Description |
---|---|---|---|---|
customerNumber | Order number | String | Require | |
onlineOrderId | platform online Order Id | String | N | |
addedServices | Signature services | String | No | Signature services 1 - General signature service 2 - Acknowledged signature service |
channelCode | Shipping channel code | String | Require | |
recipientAddress | Recipient Information | Object | Require | |
└ name | Recipient name | String | Require | |
└ address1 | Recipient address 1 | String | Require | |
└ address2 | Recipient address 2 | String | No | |
└ phone1 | Recipient phone 1 | String | Require | |
└ phone2 | Recipient phone 2 | String | No | |
Recipient email | String | No | ||
└ country | Recipient country | String | Require | Two-character country code ISO 3166-1 |
└ province | Recipient province | String | Yes | |
└ city | Recipient city | String | Yes | |
└ town | Recipient district | String | No | |
└ postalCode | Recipient postal code | String | Require | |
senderAddress | Sender Information | Object | Require | |
└ name | Sender name | String | Require | |
└ address1 | Sender address 1 | String | Require | |
└ address2 | Sender address 2 | String | No | |
└ phone1 | Sender phone 1 | String | Require | |
└ phone2 | Sender phone 2 | String | No | |
Sender email | String | No | ||
└ country | Sender country | String | Require | Two-character country code ISO 3166-1 |
└ province | Sender province | String | Yes | |
└ city | Sender city | String | Yes | |
└ town | Sender district | String | Yes | |
└ postalCode | Sender postal code | String | Require | |
itemList | Order commodity information | Array | Require | |
└packageNumber | Unique package number | String | N | The current document has a unique package number, and the package list must be transmitted if it has a value |
└ sku | Commodity code | String | Require | |
└ skuName | The title of the product | String | No | |
└ length | Length | String | No | |
└ wide | Width | String | No | |
└ high | Height | String | No | |
└ lengthUnit | Length unit | String | No | cm (centimeter), In (inch), m (meter) |
└ weight | Declaration weight | BigDecimal | Yes | The weight is fixedly converted to KG, default 0 |
└ skuWeight | Commodity weight | Double | No | |
└ weightUnit | Weight unit | String | No | KG (kilogram), GRAM (gram), LBS (pound) |
└ color | Color | String | No | |
└ skuPrice | Commodity actual payment amount | BigDecimal | No | |
└ quantity | Quantity | String | Require | |
└ price | Commodity amount | BigDecimal | Require | The total amount of this commodity |
└ currency | Currency | String | Require | ISO 4217 |
└ customsCode | Customs code | String | No | |
└ cnCustomsName | Chinese customs declaration name | String | No | |
└ enCustomsName | English customs declaration name | String | No | |
codEnabled | Whether it is a COD order | Integer | No | 1: COD order 0: Non-COD order |
codPayAmount | COD order amount | BigDecimal | No | |
codCurrency | COD amount currency | String | No | |
packageList | package info list | Array | N | |
└packageNumber | Unique package number | String | Y | The current document has a unique package number |
└packageLength | Package length | Number | N | |
└packageWide | Package width | Number | N | |
└packageHigh | Package height | Number | N | |
└packageUnit | Package unit | String | N | cm (centimeter), In (inch), m (meter), Default value: cm |
└totalWeight | Total weight | Number | N | Unit is KG |
packageLength | Package length | Double | No | |
packageWide | Package width | Double | No | |
packageHigh | Package height | Double | No | |
packageUnit | Package unit | String | No | cm (centimeter), In (inch), m (meter), Default value: cm |
totalWeight | Total weight | BigDecimal | No | Unit is KG |
remarks | Description | String | No |
Return Information:
Field | Field Description | DataType | Require | Description |
---|---|---|---|---|
trackingNumber | Tracking Number | String | Require | |
customerNumber | Order number | String | No | |
addressType | Address type | Integer | No | Address type 1 - Unknown 2 - Commercial 3 - Residential |
feedBackId | feed back info | String | N | |
packageInfoList | multi package info | N | 多包裹信息 | |
└packageNumber | package Number | String | N | |
└trackingNumber | Tracking Number | String | N | |
└customerNumber | Order number | String | N |
Request Example:
{ "accessId" : "67436533", "method" : "createOrder", "content" : "{\"senderAddress\":{\"name\":null,\"company\":null,\"address1\": null,\"address2\":null,\"fullAddress\":null,\"phone1\":null,\"phone2\":null,\"email\":null,\"country\":null,\"province\": null,\"city\":null,\"town\":null,\"postalCode\":null},\"totalWeight\": 1,\"itemList\":[{\"sku\":\"A1223\",\"cnCustomsName\":null,\"enCustomsName\":null,\"customsCode\":null,\"price\":0,\"currency\":\"MYR\",\"quantity\":1,\"weight\":1,\"skuWeight\":1.0,\"color\":null,\"weightUnit\":\"KG\",\"length\":\"1.0\",\"width\":\"1.0\",\"height\":\"1.0\",\"lengthUnit\":\"cm\",\"skuPrice\":2E+2}] ,\"codPayAmount\":null,\"recipientAddress\":{\"name\":\"0983833206\",\"company\":null,\"address1\":\"0983833206\",\"address2\": \"10310\",\"fullAddress\":\"0983833206, 10310\",\"phone1\":\"12675638889\",\"phone2\":\"\",\"email\":\"\",\"country\": \"PH\",\"province\":\"Bangkok\",\"city\":\"Huai Khwang\",\"town\":null,\"postalCode\":\"10310\"},\"customerNumber\": \"DA241112100000\",\"remarks\":null,\"channelCode\":\"5\"}", "sign" : "c77f2ad0b06d8e2b04af9aec9b8b6f7740d07249" }
Return Example:
{ "success": "true", "message": "", "data": { "trackingNumber": "DS35841212312",
"customerNumber":"orderNumber",
“addressType”:1 } }
5. Cancel Logistics Order
Method Name:
- cancelOrder
Interface Params:
Field | Field Description | DataType | Require | Description |
---|---|---|---|---|
customerNumber | Qianyi Order number | String | Optional | One of customerNumber and trackingNumber is required |
trackingNumber | Tracking Number | String | Optional | One of customerNumber and trackingNumber is required |
Request Example:
{ "accessId": "3215435", "method": "cancelOrder", "content": "{\"orderNumber\":\"CESH210204147401\",\"trackingNumber\":\"DS35841212312\"}", "sign": "11fbd649164860b5571cb60dfc99baccb375f392" }
Return Example:
{ "success": "true", "message": "" }
6. Get Label
Method Name:
- getLabel
Interface Params:
Field | Field Description | DataType | Require | Description |
---|---|---|---|---|
customerNumber | Order number | String | Require | |
trackingNumber | Tracking Number | String | Require | |
labelType | Label type | String | Yes | Template size: A4, 10*15, etc. |
Return Information:
Field | Field Description | DataType | Require | Description |
---|---|---|---|---|
trackingNumber | Tracking Number | String | Require | |
customerNumber | Order number | String | No | |
labelData | Label | String | Require | PDF Base64 |
Request Example:
{ "accessId": "3215435", "method": "getLabel", "content": "{\"orderNumber\":\"CESH210204147401\",\"trackingNumber\":\"DS35841212312\",\"labelType\":\"10*15\"}", "sign": "11fbd649164860b5571cb60dfc99baccb375f392" }
Return Example:
{ "success": "true", "message": "", "data": { "trackingNumber": "DS35841212312",
"customerNumber":"CESH210204147401", "labelData": "5rWL6K+V6Z2i5Y2V5pWw5o2u" } }
7. Get trackingNumber and Label Interface
Interface Description: This is an extended interface that simultaneously retrieves the trackingNumber and label interface. Note: The functionality of the interfaces for对接createOrder (Apply for Number) and getLabel (Get Label) is consistent with this interface.
Method Name:
- apply
Interface Params:
Field | Field Description | DataType | Require | Description |
---|---|---|---|---|
customerNumber | Order number | String | Require | |
addedServices | Signature services | String | No | Signature services 1 - General signature service 2 - Acknowledged signature service |
channelCode | Shipping channel code | String | Require | |
labelType | Label type | String | Require | |
recipientAddress | Recipient Information | Object | Require | |
└ name | Recipient name | String | Require | |
└ address1 | Recipient address 1 | String | Require | |
└ address2 | Recipient address 2 | String | No | |
└ phone1 | Recipient phone 1 | String | Require | |
└ phone2 | Recipient phone 2 | String | No | |
Recipient email | String | No | ||
└ country | Recipient country | String | Require | Two-character country code ISO 3166-1 |
└ province | Recipient province | String | Yes | |
└ city | Recipient city | String | Yes | |
└ town | Recipient district | String | No | |
└ postalCode | Recipient postal code | String | Require | |
senderAddress | Sender Information | Object | Require | |
└ name | Sender name | String | Require | |
└ address1 | Sender address 1 | String | Require | |
└ address2 | Sender address 2 | String | No | |
└ phone1 | Sender phone 1 | String | Require | |
└ phone2 | Sender phone 2 | String | No | |
Sender email | String | No | ||
└ country | Sender country | String | Require | Two-character country code ISO 3166-1 |
└ province | Sender province | String | Yes | |
└ city | Sender city | String | Yes | |
└ town | Sender district | String | Yes | |
└ postalCode | Sender postal code | String | Require | |
itemList | Order commodity information | Array | Require | |
└packageNumber | Unique package number | String | N | The current document has a unique package number, and the package list must be transmitted if it has a value |
└ sku | Commodity code | String | Require | |
└ skuName | The title of the product | String | No | |
└ length | Length | String | No | |
└ wide | Width | String | No | |
└ high | Height | String | No | |
└ lengthUnit | Length unit | String | No | cm (centimeter), In (inch), m (meter) |
└ skuPrice | Commodity actual payment amount | BigDecimal | No | |
└ quantity | Quantity | String | Require | |
└ price | Commodity amount | BigDecimal | No | The total amount of this commodity |
└ currency | Currency | String | Require | ISO 4217 |
└ customsCode | Customs code | String | No | |
└ cnCustomsName | Chinese customs declaration name | String | No | |
└ enCustomsName | English customs declaration name | String | No | |
codEnabled | Whether it is a COD order | Integer | No | 1: COD order 0: Non-COD order |
codPayAmount | COD order amount | BigDecimal | No | |
codCurrency | COD amount currency | String | No | |
packageList | package info list | Array | N | |
└packageNumber | Unique package number | String | Y | The current document has a unique package number |
└packageLength | Package length | Number | N | |
└packageWide | Package width | Number | N | |
└packageHigh | Package height | Number | N | |
└packageUnit | Package unit | String | N | cm (centimeter), In (inch), m (meter), Default value: cm |
└totalWeight | Total weight | Number | N | Unit is KG |
packageLength | Package length | Double | No | |
packageWide | Package width | Double | No | |
packageHigh | Package height | Double | No | |
packageUnit | Package unit | String | No | cm (centimeter), In (inch), m (meter), Default value: cm |
totalWeight | Total weight | BigDecimal | No | Unit is KG |
remarks | Description | String | No |
Return Information:
Field | Field Description | DataType | Require | Description |
---|---|---|---|---|
labelDataList | List | Yes | ||
└packageNumber | Package number | String | No | |
└customerNumber | Order number | String | No | |
└trackingNumber | Tracking Number | String | Require | |
└labelDataType | Label type | String | Require | Label type, supports the following types: 1. PDF (Base64) 2. URL |
└labelData | Label | String | Require | |
└addressType | Address type | Integer | Require | Address type 1 - Unknown 2 - Commercial 3 - Residential |
Request Example:
{ "accessId": "3215435", "method": "createOrder", "content": "{\"orderNumber\":\"CESH210204147401\",\"channelCode\":\"FedexGround\",\"recipientAddress\":{\"name\":\"Kimberly White\",\"address1\":\"TestStreet1\",\"address2\":\"\",\"phone1\":\"1889838055188\",\"phone2\":\"\",\"email\":\"\",\"country\":\"US\",\"province\":\"AR\",\"city\":\"Harrison\",\"town\":null,\"postalCode\":\"72601\"},\"senderAddress\":{\"name\":\"Tally Mercy\",\"address1\":\"TestStreet2\",\"address2\":\"\",\"phone1\":\"1231434142341\",\"phone2\":\"\",\"email\":\"\",\"country\":\"US\",\"province\":\"AR\",\"city\":\"Harrison\",\"town\":null,\"postalCode\":\"72601\"},\"skuList\":[{\"sku\":\"CL0000000000001\",\"quantity\":1,\"price\":120.0,\"currency\":\"USD\",\"customsCode\":\"CL0000000000001\",\"cnCustomsName\":\"测试商品\",\"enCustomsName\":\"TEST\"}],\"codEnabled\":0,\"codPayAmount\":120.0,\"codCurrency\":\"US\",\"packageLength\":30.0,\"packageWide\":30.0,\"packageHigh\":20.0,\"packageUnit\":\"cm\",\"totalWeight\":5.0,\"remarks\":\"测试\"}", "sign": "11fbd649164860b5571cb60dfc99baccb375f392" }
Return Example:
{ "success": "true", "message": "", "data": { "labelDataList": [ { "trackingNumber": "DS35841212312", "labelDataType":"PDF", "labelData": "5rWL6K+V6Z2i5Y2V5pWw5o2u", "addressType":1 } ] } }
8. Query Logistics Tracking Information
Method Name:
- getTrackingInfo
Interface Params:
Field | Field Description | DataType | Require | Description |
---|---|---|---|---|
customerNumber | Qianyi Order number | String | Require | |
trackingNumber | Tracking Number | String | Require |
Return Information:
Field | Field Description | DataType | Require | Description |
---|---|---|---|---|
orderNumber | Qianyi Order number | String | Require | |
carrierName | Carrier name | String | Require | |
trackingNumber | Tracking Number | String | Require | |
status | Waybill status | String | Require | CREATED (Pending pickup) SHIPPED (Picked up) IN_TRANSIT (In transit) OUT_FOR_DELIVERY (Out for delivery) DELIVERED (Delivered) UNDELIVERABLE (Undeliverable) DELAYED (Delayed delivery) RETURNING (Returning) RETURNED (Returned) |
trackingEvents | Tracking information | Array | Require | |
└ eventDate | Event time | String | Require | Example: 2021-01-01 10:00:00 |
└ eventPlace | Event location | String | Require | Example: TEST transfer warehouse, CA |
└ eventDesc | Event description | String | Require | Example: Arrived at the transfer station |
Request Example:
{ "accessId": "3215435", "method": "getTrackingInfo", "content": "{\"orderNumber\":\"CESH210204147401\",\"trackingNumber\":\"DS35841212312\"}", "sign": "11fbd649164860b5571cb60dfc99baccb375f392" }
Return Example:
{ "success": "true", "message": "", "data": { "orderNumber": "CESH210204147401", "carrierName": "FedEx", "trackingNumber": "DS35841212312", "status": "IN_TRANSIT", "trackingEvents": [ { "eventDate": "2021-01-01 15:00:00", "eventPlace": "CA", "eventDesc": "The shipment has been loaded and is on the way for delivery" }, { "eventDate": "2021-01-01 10:00:00", "eventPlace": "CA", "eventDesc": "Shipping information sent to FedEx" } ] } }
9. Estimate Cost (Under Development)
Method Name:
- getEstimateCost
Interface Params:
Field | Field Description | DataType | Require | Description |
---|---|---|---|---|
customerOrderNo | Customer number | String | Require | |
sendAddress | Sender address | Object | Require | |
└contactName | Contact name | String | No | |
└companyName | Company name | String | No | |
└cellPhone | Contact phone | String | No | |
└countryCode | Two-character country code | String | No | |
└province | Two-character province code | String | No | |
└city | City | String | No | |
└postCode | Sender's postal code | String | Require | |
└address | Detailed address | String | No | |
└address2 | Detailed address 2 | String | No | |
receivingAddress | Receiver address | Object | Require | |
└contactName | Contact name | String | Require | |
└companyName | Company name | String | Require | |
└cellPhone | Contact phone | String | Require | |
└countryCode | Two-character country code | String | Require | |
└province | Two-character province code | String | Require | |
└city | City | String | Require | |
└postCode | Receiver's postal code | String | Require | |
└address | Detailed address | String | Require | |
└address2 | Detailed address 2 | String | Require | |
cargoReqList | Cargo box information | array [object] | Require | |
└serialNumber | Box number | String | Require | |
└weight | Box weight | number | Require | |
└length | Length | number | Require | |
└width | Width | number | Require | |
└high | Height | number | Require |
Return Information:
Field | Field Description | DataType | Require | Description |
---|---|---|---|---|
code | Require | |||
message | Require | |||
data | array[Object] | Require | ||
└productCode | Channel code | String | Require | |
└weightUnit | Billing weight unit | String | Require | |
└chargedWeight | Billing weight | number | Require | |
└totalFee | Total fee | number | Require | |
└addressType | Address type 1 - Unknown 2 - Commercial 3 - Residential | number | Require | |
└timestamp | number | Require |
Request Example:
{ "loginAccount": "Test001", "timestamp": 1234567898, "customerOrderNo": "test023203232", "schemeProductCodeList": [ "FEDEX-001" ], "sendAddress": { "contactName": "ONT8", "companyName":"yamax", "cellPhone": "6262652412", "countryCode": "US", "province": "CA", "city": "MORENO VALLEY", "postCode": "92551", "address": "24300 NANDINA AVE", "address2": "24300 NANDINA AVE" }, "receivingAddress": { "contactName": "ONT8", "companyName":"yamax", "cellPhone": "6262652412", "countryCode": "US", "province": "CA", "city": "MORENO VALLEY", "postCode": "92551", "address": "24300 NANDINA AVE", "address2": "24300 NANDINA AVE" }, "cargoReqList": [{ "serialNumber": "001", "weight": "15", "length": "60", "width": "50", "high": "40" }, { "serialNumber": "002", "weight": "15", "length": "60", "width": "50", "high": "40" }] }
Response Example:
{ "code": 0, "message": "string", "data": [ { "productCode": "string", "weightUnit": "string", "chargedWeight": 0, "totalFee": 0, "addressType": 0 } ], "timestamp": 0 }