Prapare

Testing Environment
HOST:https://apitest.baaship.com
Token:Consult customer service

Production Environment
HOST:https://api.baaship.com
Token:Consult customer service
Parcel Forecast Creation

Service Ability: Create Parcel Forecast

Request URL: host:/createShipment


Request Method: POST


Header (Used for Token Verification):
Parameter Name Example Value
token 4e411a926e7a33ca9d04cd1942ac54a2
Body Request Parameters:
Parameter Name Description Required Data Type Field Length
referenceNo Customer-defined unique order number Yes String 30
productCode Service code
(Take the value from Product Code)
Yes String 10
orderNo Customer order number No String 30
incoterms Trade terms (choose one of DDU, DDP) No String 30
storeId Store code (shop ID)
- Required for store delivery mode
(Obtain shop ID from getShopInfo interface)
Yes (for store delivery) String 20
codAmount COD amount for the parcel
- Required when service code is:
TWYCS-COD, TWFMART-COD, TW711-COD
Yes (for COD services) Number 10
remark Parcel delivery remarks No String 100
sender Sender information Yes Object  
 company Sender's company No String 100
 contact Sender's contact person Yes String 50
 phone Sender's phone number Yes String 20
 email Sender's email No String 50
 country Sender's country Yes String 50
 province Sender's province/state Yes String 100
 city Sender's city Yes String 100
 address Sender's detailed address Yes String 200
 postCode Sender's postal code Yes String 10
receiver Recipient information Yes Object  
 company Recipient's company No String 100
 contact Recipient's contact person Yes String 50
 phone Recipient's phone number Yes String 20
 email Recipient's email No String 50
 country Recipient's country/region
- Not required for store delivery mode
Yes (not for store delivery) String 50
 province Recipient's province/state No String 100
 city Recipient's city/district
- Not required for store delivery mode
Yes (not for store delivery) String 100
 suburb Recipient's administrative district No String 100
 address Recipient's detailed address
- Not required for store delivery mode
Yes (not for store delivery) String 200
 postCode Recipient's postal code
- Not required for store delivery mode
Yes (not for store delivery) String 10
 vat Recipient's tax number/ID No String 10
packageList Parcel goods information Yes Array[PackageList]  
 weight Actual weight of the parcel, unit: kg
Precision up to 3 decimal places
Yes Number 8
 length Length of the parcel, unit: cm
Precision up to 1 decimal place
No Number 5
 width Width of the parcel, unit: cm
Precision up to 1 decimal place
No Number 5
 height Height of the parcel, unit: cm
Precision up to 1 decimal place
No Number 5
 packageItemList Item details in the parcel Yes Array[PackageItemList]  
  sku SKU code No String 30
       goodsNameEn English/local product name Yes String 100
       goodsNameCn Chinese product name Yes String 100
  fullDescEn Sales description No String 1000
  hsCode HS Code No String 10
  quantity Quantity Yes Number 10
  itemWeight Weight of the item, unit: kg
Precision up to 3 decimal places
Yes Number 7
  itemValue Value of the item Yes String 10
  currency Currency (e.g., USD) Yes String 5
  itemSellingUrl Item sales link No String 1000
  imageUrl Image link of the item No String 500
Parcel Forecast Creation Request Example:

{
    "referenceNo": "TEST190107003",
    "productCode": "TESTPRODUCT",
    "orderNo": "OD190107003",
    "incoterms": "DDU",
    "remark": "Test Remark",
    "sender": {
        "company": "TEST COMPANY",
        "contact": "TEST SENDER",
        "phone": "0977777777",
        "email": "test@test.com",
        "country": "CN",
        "province": "GUANGDONG",
        "city": "GUANGZHOU",
        "address": "No.100 South Baiyun Street, Baiyun District",
        "postCode": "510000"
    },
    "receiver": {
        "company": "",
        "contact": "TEST RECEIVER",
        "phone": "212340908",
        "email": "test@gmail.com",
        "country": "NZ",
        "province": "Waikato",
        "city": "Te Aroha",
        "suburb": "Te Aroha",
        "address": "3 Churchill Avenue",
        "postCode": "3320",
        "vat": "A123456789"
    },
    "packageList": [
        {
            "weight": "13.109",
            "length": "50",
            "width": "80",
            "height": "45",
            "codAmount": 3980,
            "packageItemList": [
                {
                    "sku": "td2902sx880",
                    "goodsNameEn": "Computer Bag",
                    "goodsNameCn": "电脑包",
                    "fullDescEn": "笔记本电脑背包-带2个隔间的电脑包,符合人体工程学的肩带,15英寸笔记本电脑套,拉柄-书籍背包-黑色",
                    "hsCode": "36890233",
                    "quantity": "1",
                    "itemWeight": "2.102",
                    "itemValue": "29.9",
                    "currency": "USD",
                    "itemSellingUrl": "https://www.amazon.com/JanSport-Big-Student-Backpack-Black/dp/B07K74LDCH/",
                    "imageUrl": "https://m.media-amazon.com/images/I/51wX5vhTB4L._AC_SX679_.jpg"
                },
                {
                    "sku": "dy102348",
                    "goodsNameEn": "vacuum cup",
                    "goodsNameCn": "保温杯",
                    "fullDescEn": "运动和旅行用隔热不锈钢吸管水瓶,不含双酚A,32盎司,冰镇微风",
                    "hsCode": "36890235",
                    "quantity": "1",
                    "itemWeight": "0.88",
                    "itemValue": "17.8",
                    "currency": "USD",
                    "itemSellingUrl": "https://www.amazon.com/Owala-FreeSip-Insulated-Stainless-BPA-Free/dp/B0C59F7Y8J/",
                    "imageUrl": "https://m.media-amazon.com/images/I/518uAgWUTgL._AC_SX679_.jpg"
                }
            ]
        }
    ]
}
Response Field Description:
Field Name Description Data Type
success True or False Boolean
code 200: Success
Other: Failure
Integer
message Request return message String
requestId Request ID String
data   Object
 waybill Tracking number String
 referenceNo Customer-defined unique order number String
 productCode Service code String
 labelUrl URL address of the label, in PDF format String
Success Example Response:

{
    "success": true,
    "code": 200,
    "message": "success",
    "requestId": "65bcecc674687425",
    "data": [
        {
            "waybill": "T80000045",
            "referenceNo": "TEST240202005",
            "productCode": "TEST",
            "labelUrl": "https://apitest.baaship.com/pdf-file/T80000045/3a8df10c-c1ce-11ee-8445-00163e0cad28.pdf"
        }
    ]
}
Error Code Description:
Error Code Error Description
1001 Token validation error, please check if the entered Token is correct.
1002 Request parameter data structure error, please detect and re-enter.
1003 The length of the input parameters does not meet the requirements.
1004 Interface exception.
1005 Customer-defined order number is duplicated.
1006 The parcel weight exceeds the limit.
1007 The declared value exceeds the limit.
1008 Address issue.
Error Example Response:

{
    "success":false,
    "code":1001,
    "message":"Token incorrect",
    "requestId":"655c00af45b3a785"
}
Create Reverse Shipment

Service Ability: Create Reverse Shipment

Request URL: host:/reverseShipment


Request Method: POST


Header (Used for Token Verification):
Parameter Name Example Value
token 4e411a926e7a33ca9d04cd1942ac54a2
Body Request Parameters:
Parameter Name Description Required Data Type Field Length
referenceNo Customer-defined unique order number Yes String 30
productCode Service code
(Take the value from Product Code)
Yes String 10
orderNo Customer order number No String 30
remark Parcel delivery remarks No String 100
sender Sender information Yes Object  
 company Sender's company No String 100
 contact Sender's contact person Yes String 30
 phone Sender's phone number Yes String 20
 email Sender's email No String 50
 country Sender's country Yes String 50
 province Sender's province/state Yes String 40
 city Sender's city Yes String 40
 address Sender's detailed address Yes String 100
 postCode Sender's postal code Yes String 10
packageList Parcel goods information Yes Object  
 weight Actual weight of the parcel, unit: kg
Precision up to 3 decimal places
Yes Number 8
 length Length of the parcel, unit: cm
Precision up to 1 decimal place
No Number 5
 width Width of the parcel, unit: cm
Precision up to 1 decimal place
No Number 5
 height Height of the parcel, unit: cm
Precision up to 1 decimal place
No Number 5
 packageItemList Item details in the parcel Yes Array[PackageItemList]  
  sku SKU code No String 30
       goodsNameEn English/local product name Yes String 100
       goodsNameCn Chinese product name Yes String 100
  fullDescEn Sales description No String 1000
  hsCode HS Code No String 10
  quantity Quantity Yes Number 10
  itemWeight Weight of the item, unit: kg
Precision up to 3 decimal places
Yes Number 7
  itemValue Value of the item Yes Number 10
  currency Currency (e.g., TWD, USD) Yes String 5
  itemSellingUrl Item sales link No String 1000
  imageUrl Image link of the item No String 500
Parcel Forecast Creation Request Example:
{
    "referenceNo": "TEST20220123007",
    "productCode": "BNRTN",
    "orderNo": "TEST20220123007",
    "remark": "Test Remark",
    "sender": {
        "company": "TEST COMPANY",
        "contact": "JOHN WAKER",
        "phone": "6732238181",
        "email": "marecarmejia00-test@gmail.com",
        "country": "BN",
        "province": "KAMPONG KAPOK",
        "city": "MUARA",
        "address": "NO. 7 SIMPANG 170, JALAN",
        "postCode": "BT2328"
    },
    "packageList": {
        "weight": "13.109",
        "length": "50",
        "width": "80",
        "height": "45",
        "packageItemList": [
            {
                "sku": "td2902sx880",
                "goodsNameEn": "Computer Bag",
                "goodsNameCn": "电脑包",
                "fullDescEn": "笔记本电脑背包-带2个隔间的电脑包,符合人体工程学的肩带,15英寸笔记本电脑套,拉柄-书籍背包-黑色",
                "hsCode": "36890233",
                "quantity": "1",
                "itemWeight": "2.102",
                "itemValue": "29.9",
                "currency": "USD",
                "itemSellingUrl": "https://www.amazon.com/JanSport-Big-Student-Backpack-Black/dp/B07K74LDCH/",
                "imageUrl": "https://m.media-amazon.com/images/I/51wX5vhTB4L._AC_SX679_.jpg"
            },
            {
                "sku": "dy102348",
                "goodsNameEn": "vacuum cup",
                "goodsNameCn": "保温杯",
                "fullDescEn": "运动和旅行用隔热不锈钢吸管水瓶,不含双酚A,32盎司,冰镇微风",
                "hsCode": "36890235",
                "quantity": "1",
                "itemWeight": "0.88",
                "itemValue": "17.8",
                "currency": "USD",
                "itemSellingUrl": "https://www.amazon.com/Owala-FreeSip-Insulated-Stainless-BPA-Free/dp/B0C59F7Y8J/",
                "imageUrl": "https://m.media-amazon.com/images/I/518uAgWUTgL._AC_SX679_.jpg"
            }
        ]
    }
}
Response Field Description:
Field Name Description Data Type
success True or False Boolean
code 200: Success
Other: Failure
Integer
message Request return message String
requestId Request ID String
data   Object
 waybill Tracking number String
 referenceNo Customer-defined unique order number String
 productCode Service code String
 labelUrl URL address of the label, in PDF format String
Success Example Response:
{
    "success": true,
    "code": 200,
    "message": "success",
    "requestId": "65bcecc674687425",
    "data": {
        "waybill": "T80000045",
        "referenceNo": "TEST240202005",
        "productCode": "TEST",
        "labelUrl": "https://apitest.baaship.com/pdf-file/T80000045/3a8df10c-c1ce-11ee-8445-00163e0cad28.pdf"
    }
}
Error Code Description:
Error Code Error Description
1001 Token validation error, please check if the entered Token is correct.
1002 Request parameter data structure error, please detect and re-enter.
1003 The length of the input parameters does not meet the requirements.
1004 Interface exception.
1005 Customer-defined order number is duplicated.
1006 The parcel weight exceeds the limit.
Error Example Response:
{
    "success":false,
    "code":1001,
    "message":"Token incorrect",
    "requestId":"655c00af45b3a785"
}
Cancel Shipment

Service Ability: Cancel create&reverse Shipment

Request URL: host:/cancelShipment


Request Method: GET


Header (Used for Token Verification):
Parameter Name Example Value
token 4e411a926e7a33ca9d04cd1942ac54a2
Body Request Parameters:
Parameter Name Description Required Data Type Field Length
waybill Tracking number Yes String 30
Request Example:
https://apitest.baaship.com/cancelShipment?waybill=70000000366

Response Field Description:
Field Name Description Data Type
success True or False Boolean
code 200: Success
Other: Failure
Integer
message Request return message String
requestId Request ID String
waybill Tracking Number String
Success Example Response:

{
    "success": true,
    "code": 200,
    "message": "success",
    "requestId": "65bcecc674687425",
    "waybill": "T80000045"
}
Error Code Description:
Error Code Error Description
1001 Token validation error, please check if the entered Token is correct.
1002 Request parameter data structure error, please detect and re-enter.
1003 The length of the input parameters does not meet the requirements.
1004 Interface exception.
Error Example Response:

{
    "success":false,
    "code":1001,
    "message":"Token incorrect",
    "requestId":"655c00af45b3a785"
}
Parcel Tracking

Service Ability: Track Parcel Logistics

Request URL: host:/tracking


Request Method: GET


Header (Used for Token Verification):
Parameter Name Example Value
token 4e411a926e7a33ca9d04cd1942ac54a2
Body Request Parameters:
Parameter Name Description Required Data Type Field Length
waybill Tracking number Yes String 30
Request Example:
https://apitest.baaship.com/tracking?waybill=70000000366
Response Fields:
Field Name Description Data Type
success True or False Boolean
code 200: Success
Others: Failure
Integer
message Request return message String
requestId Request ID String
data   Array
 waybill Tracking number String
 shipmentType Forward/Reverse String
 latestStatus Latest status String
 latestLocalTime Latest status time String
 events Tracking details Array
  statusCode Tracking Status Code String
  location Location of tracking event String
  description Description of tracking event String
  localTime Date of tracking event String
  timeZone Time Zone String
  country Country String
  state State/Province String
  city City String
  postcode postcode String
Successful Response Example:
{
    "success": true,
    "code": 200,
    "message": "success",
    "requestId": "6593c83cd7a70494",
    "data": [
        {
            "waybill": "40001044465",
            "shipmentType": "Reverse",
            "latestStatus": "Shipment Delivered",
            "latestLocalTime": "2023-12-27 11:00:08",
            "events": [
                {
                    "statusCode": "DL01",
                    "location": "Maraetai",
                    "description": "Your parcel has been delivered.",
                    "localTime": "2023-12-27 11:00:08",
                    "timeZone": "UTC+12",
                    "country": "NZ",
                    "state": "Auckland",
                    "city": "Maraetai",
                    "postcode": "2018"
                },
                // Additional events...
            ]
        }
    ]
}
Error Code Description:
Error Code Error Description
1001 Token validation error, please check if the entered Token is correct
1002 Request parameter data structure error, please check and re-enter
1003 Interface exception
1004 Waybill or referenceNo does not exist
Error Response Example:

{
    "success": false,
    "code": 1001,
    "message": "Token validation error, please check if the entered Token is correct",
    "requestId": "655c00af45b3a785"
}
Get Package Label API Documentation

Service Ability: Get Package Label

Request URL: host:/getShipmentLabel


Request Method: GET


Header (Used for Token Verification):
Parameter Name Example Value
token 4e411a926e7a33ca9d04cd1942ac54a2
Body Request Parameters:
Parameter Name Description Required Data Type Field Length
waybill Tracking number
waybill and referenceNo, Choose one of them.
Yes String 30
referenceNo Customer Reference No
waybill and referenceNo, Choose one of them.
Yes String 30
Request Example:
https://apitest.baaship.com/getShipmentLabel?waybill=70000000366

Response Fields:
Field Name Description Data Type
success True or False Boolean
code 200: Success
Other: Failure
Integer
message Request return message String
requestId Request ID String
data   Object
 waybill Tracking number String
 referenceNo Customer reference number String
 labelUrl URL address of the label String
Successful Response Example:

{
    "success":true,
    "code":200,
    "message":"success",
    "requestId":"655c779c9af8b772",
    "data":{
        "waybill":"70000000366",
        "referenceNo":"TEST20210923823",
        "labelUrl":"https://apitest.baaship.com/pdf-file/70000000366/ef7ce42a-8807-11ee-ae09-00163e0cad28.pdf"
    }
}
Error Code Description:
Error Code Error Description
1001 Token validation error, please check if the entered Token is correct
1002 Request parameter data structure error, please detect and re-enter
1003 The length of the input parameters does not meet the requirements
1004 Interface exception
Product Code Type Is COD Weight Limit(kg) Amount Limit Label Size Label Direction
BNRTN Reverse No ≤25 ≤295 USD 100x150mm Vertical