customer_shipment_id(字符串,可选):唯一字段。留空时,系统会自动生成 ID。如果此前已使用相同的 customer_shipment_id 发起调用,且状态为待处理或成功,则后续调用不会被处理。如果此前的货件处理失败,可使用相同的 customer_shipment_id 再次调用 API。recipient(对象,必填):货件收件人信息。company_name(字符串,可选):接收包裹的公司名称。person_name(字符串,必填):收件人姓名。phone_number(字符串,必填):收件人电话号码(10 个字符)。address_line1(字符串,必填):收件人地址第 1 行。address_line2(字符串,可选):收件人地址第 2 行。state_code(字符串,必填):收件人所在地的州代码(例如,"IN" 表示印第安纳州)。city(字符串,必填):收件人所在城市。postal_code(字符串,必填):收件人所在地的邮政编码。country_code(字符串,必填):收件人所在地的国家代码(例如,"US" 表示美国)。parcels(数组,必填):包含包裹详情的数组。weight(数字,必填):包裹重量。width(数字,必填):包裹宽度。height(数字,必填):包裹高度。length(数字,必填):包裹长度。weight_unit(字符串,必填):重量单位(例如,"LB" 表示磅)。dimension_unit(字符串,必填):尺寸单位(例如,"IN" 表示英寸)。count(数字,必填):相同规格的包裹数量。reference_codes(对象,可选):货件的附加参考编号。ref_1、ref_3(字符串):参考编号(ref_2 保留用于组织 ID)。callback_url(字符串,可选):接收货件通知的 URL。{
"customer_shipment_id" :"1234555",
"recipient": {
"company_name": "Shipnitro",
"person_name" :"Test User",
"phone_number":"9125929406",
"address_line1": "1151 S GRAHAM RD",
"state_code": "IN",
"city": "GREENWOOD",
"postal_code": "46143",
"country_code": "US"
},
"parcels": [
{
"weight": 1,
"width": 5,
"height": 20,
"length": 10,
"weight_unit": "LB",
"dimension_unit": "IN",
"count": 2
}
],
"reference_codes": {
"ref_1": "2333",
"ref_3": "111"
},
"callback_url": "http://192.168.1.6:3001/"
}批量发货时 PDF 数量较多,因此 PDF 会分块发送。
hash = 整个 PDF 的 MD5 哈希值,可在接收完成后用于校验 PDF 的完整性。body = 包含经过 Base64 编码的 PDF 数据。box_id = 请求的唯一 ID。totalNumberOfPdf = 预计接收的 PDF 数量。{
'hash' : '------------',
'body' : [
'masterTrackingNumber' => ,
'netCharge' => null,
'masterPDF' => null,
'results' => [],
]
'box_id' : 'unique box id'
'totalNumberOfPdf' : ''
}box_id - 与第一批数据中的请求唯一标识符相同。contents - 经过 Base64 编码的 PDF 数据。{
'box_id': '',
'contents' : ''
}{
'box_id' : ''
'finished' : true
}curl --location 'https://staging.shipnitro.com/api/create/label' \
--header 'Authorization: Basic {{apiKey}}' \
--header 'Content-Type: application/json' \
--data '{
"recipient": {
"address_line1": "100 Factory St, Ste C1",
"address_line2": " ",
"city": "Nashua",
"country_code": "US",
"state_code": "NH",
"postal_code": "03060",
"email": "",
"person_name": "LISHU LIANG Andy60018",
"company_name": "fengniao",
"phone_number": "6468810775",
"residential": false
},
"parcels": [
{
"length": 58,
"width": 38,
"height": 43,
"weight": 13.78,
"count": 1,
"weight_unit": "KG",
"dimension_unit": "CM"
},
{
"length": 57,
"width": 37,
"height": 43,
"weight": 13.73,
"count": 1,
"weight_unit": "KG",
"dimension_unit": "CM"
},
{
"length": 58,
"width": 37,
"height": 43,
"weight": 13.75,
"count": 1,
"weight_unit": "KG",
"dimension_unit": "CM"
},
{
"length": 57,
"width": 37,
"height": 43,
"weight": 13.67,
"count": 1,
"weight_unit": "KG",
"dimension_unit": "CM"
},
{
"length": 58,
"width": 37,
"height": 43,
"weight": 13.77,
"count": 1,
"weight_unit": "KG",
"dimension_unit": "CM"
},
{
"length": 58,
"width": 37,
"height": 43,
"weight": 13.67,
"count": 1,
"weight_unit": "KG",
"dimension_unit": "CM"
},
{
"length": 57,
"width": 38,
"height": 43,
"weight": 13.76,
"count": 1,
"weight_unit": "KG",
"dimension_unit": "CM"
},
{
"length": 57,
"width": 37,
"height": 43,
"weight": 13.75,
"count": 1,
"weight_unit": "KG",
"dimension_unit": "CM"
}
],
"reference_codes": {
"ref_1": "BR88888006764K",
"ref_2": "FL069785"
},
"callback_url":"127.0.0.1:"
}'{
"box_id": "api_66675c95791e88f6c2019ab2",
"message": "Label is generated label will be send later",
"masterTrackingNumber": null
}