Register Parcels

Use this endpoint to register multiple parcels. A maximum of 100 parcels can be registered at one time.

Path

POST /register

Request

The request body is an array of parcels where each parcel must have 3 key pieces of information -

  • Info - this contains information about the parcel (e.g. weight, dimensions, tracking number, etc.)
  • Sender - describes the contact information of the parcel’s sender
  • Receiver - desribes the contact information of the parcel’s receiver

A sample request body looks like below -

{
  "customer_id": "6097515d8765a531d11c6404",
  "shipper_id": "608bbf6790528b6eb5d27d37",
  "parcels": [
    {
      "info": {
        "tracking_no": "TRI12323128",
        "weight": "2.0 KG",
        "quantity": 1,
        "price": 5,
        "currency": "RM",
        "fragile": true
      },
      "sender": {
        "name": "ThiyraashSender",
        "phone_no": "+01116495901",
        "phone_alt": "+01116495901",
        "add1": "NO 20,TAMAN BAHAGIA SS2 PETALING JAYA",
        "add2": "",
        "add3": "",
        "add4": "",
        "postcode": "40000",
        "city": "Kuala Lumpur",
        "state": "Kuala Lumpur",
        "country": "MY"
      },
      "receiver": {
        "name": "Baraa",
        "phone_no": "+01116495901",
        "phone_alt": "+01116495901",
        "add1": "",
        "add2": "",
        "add3": "",
        "add4": "",
        "postcode": "40000",
        "city": "Kuala Lumpur",
        "state": "Kuala Lumpur",
        "country": "MY"
      }
    }
  ]
}

Parcel Fields

FieldDetailsComments
customer_idstring, requiredCustomer Id
shipper_idstring, requiredShipper Id
parcels.infoObject, requiredParcel Info
parcel.senderObject, requiredSender Info
parcel.receiverObject, requiredReceiver Info
parcelarray of objects, requiredList of Parcel
parcel.info.tracking_nostring,min 6 chactacter ,requiredTracking Number
parcel.info.weightstring, requiredWeight
parcel.info.quantityint, required , >= 1Quantity
parcel.info.currencystring, optionalCurrency
parcel.info.pricedouble, optionalPrice
parcel.info.fragilebool, default = falseFragile
parcel.sender.namestring, requiredName
parcel.sender.phonestring, requiredPhone
parcel.sender.alternatestring, optionalAlternate Phone
parcel.sender.emailstring, optionalEmail
parcel.sender.add1string, requiredAddress Line 1
parcel.sender.add2string, optionalAddress Line 2
parcel.sender.add3string, optionalAddress Line 3
parcel.sender.add4string, optionalAddress Line 4
parcel.sender.postcodestring, requiredPostcode
parcel.sender.citystring, requiredCity
parcel.sender.statestring, requiredState
parcel.sender.countrystring, requiredCountry List
parcel.receiver.namestring, requiredName
parcel.receiver.phonestring, requiredPhone
parcel.receiver.alternatestring, optionalAlternate Phone
parcel.receiver.emailstring, optionalEmail
parcel.receiver.add1string, requiredAddress Line 1
parcel.receiver.add2string, optionalAddress Line 2
parcel.receiver.add3string, optionalAddress Line 3
parcel.receiver.add4string, optionalAddress Line 4
parcel.receiver.postcodestring, requiredPostcode
parcel.receiver.citystring, requiredCity
parcel.receiver.statestring, requiredState
parcel.receiver.countrystring, requiredCountry List

Response

On success, response looks like below -

{
  "error": 0,
  "message": "Parcel has been successfully registered",
  "data": {}
}

If there is server error, the response would look like below -

{
  "error": 500,
  "message": "Internal Error occurred"
}

If validation on body on the request failed ( Example , missing required field) -

{
  "error": 400,
  "message": "Some parcels failed to registered",
  "data": {
    "errors": [
      {
        "tracking_no": "TRI3212323",
        "error": "Weight cannot be empty"
      }
    ]
  }
}