API - Package

Created by KloudShip Support Admin, Modified on Fri, 24 Oct at 7:48 PM by KloudShip Support

GET: Get Package

The Get Package API provides the list of all created package in application

 

Endpoint details:

MethodPOST
Production Environment URLhttps://api.kloudship.com/api/v1/PackageType
Test Environment URLhttps://api-ppd.kloudship.com:960/api/v1/PackageType
Content-Typeapplication/json


Query parameters:

ParameterTypeRequiredDescriptionExample
pageNumberintegerNoSpecifies the page number to retrieve.1
fromDatestringNoFilters results from this date (in ISO format).2025-09-01
toDatestringNoFilters results up to this date (in ISO format).2025-09-30
searchStringstringNoFilters results by matching package name or type.Zerox
newestFirstbooleanNoIf true, results are sorted by newest creation date first.true


Request body:

Does not require any request parameter


Example cURL:

curl --location 'https://api-ppd.kloudship.com:960/api/v1/Packagetype?pageNumber=1&fromDate=&toDate=&searchString=null&newestFirst=true' \
--header 'Authorization: ••••••'

Response fields:

Root Object

FieldTypeDescription
resultsarrayList of package type objects.
pageSizeintegerNumber of results returned per page.
totalResultsintegerTotal number of package types available.
totalPagesintegerTotal number of pages available.
currentPageintegerCurrent page number of the response.


Results Object

FieldTypeDescription
idstringUnique identifier for the package type.
createdDatestringThe date and time when the package type was created (in ISO 8601 format).
packageTypestringType of package (e.g., Box, Envelope).
namestringName assigned to the package type.
lengthnumberLength of the package.
widthnumberWidth of the package.
heightnumberHeight of the package.
dimensionUnitstringUnit of measurement for dimensions (e.g., cm, in).
weightnumberWeight of the package.
weightUnitstringUnit of weight measurement (e.g., kg, lb).
isFavoritebooleanIndicates whether this package type is marked as favorite.


Response example:

{
  "results": [
    {
      "id": "68cc23a40c5df3b3aca50e18",
      "createdDate": "2025-09-18T15:22:12.037Z",
      "packageType": "Box",
      "name": "Zerox Package",
      "length": 5.0,
      "width": 5.0,
      "height": 5.0,
      "dimensionUnit": "in",
      "weight": 2.0,
      "weightUnit": "kg",
      "isFavorite": false
    },
    {
      "id": "6880a6b7e32e19eea1a57af8",
      "createdDate": "2025-07-23T09:09:11.575Z",
      "packageType": "Box",
      "name": "Toy Box",
      "length": 5.0,
      "width": 6.0,
      "height": 7.0,
      "dimensionUnit": "cm",
      "weight": 3.0,
      "weightUnit": "kg",
      "isFavorite": false
    }
  ],
  "pageSize": 20,
  "totalResults": 4,
  "totalPages": 1,
  "currentPage": 1
}

GET: Get package by ID

The Get Package by Id API provides the details of package which is fetched by id

Endpoint details:

MethodPOST
Production Environment URLhttps://api.kloudship.com/api/v1/PackageType/{id}
Test Environment URLhttps://api-ppd.kloudship.com:960/api/v1/PackageType{/id}
Content-Typeapplication/json
{id}: Here you will provide the location id

Query parameters:

ParameterTypeRequiredDescriptionExample
pageNumberintegerNoSpecifies the page number to retrieve.1
fromDatestringNoFilters results from this date (in ISO format).2025-09-01
toDatestringNoFilters results up to this date (in ISO format).2025-09-30
searchStringstringNoFilters results by matching package name or type.Zerox
newestFirstbooleanNoIf true, results are sorted by newest creation date first.true


Request body:

Does not require any request parameter


Example cURL:

curl --location 'https://api-ppd.kloudship.com:960/api/v1/Packagetype/6880a6b7e32e19eea1a57af7' \
--header 'Authorization: ••••••'

Response fields:

FieldTypeDescription
idstringUnique identifier for the package type.
createdDatestringThe date and time when the package type was created (in ISO 8601 format).
packageTypestringType of package (e.g., Box, Envelope).
namestringName assigned to the package type.
lengthnumberLength of the package.
widthnumberWidth of the package.
heightnumberHeight of the package.
dimensionUnitstringUnit of measurement for dimensions (e.g., cm, in).
weightnumberWeight of the package.
weightUnitstringUnit of weight measurement (e.g., kg, lb).
isFavoritebooleanIndicates whether this package type is marked as favorite.


Response example:

{
    "id": "6880a6b7e32e19eea1a57af7",
    "createdDate": "2025-07-23T09:09:11.575Z",
    "packageType": "Box",
    "name": "Medium Box - One KG",
    "length": 6.0,
    "width": 6.0,
    "height": 8.0,
    "dimensionUnit": "in",
    "weight": 1.0,
    "weightUnit": "kg",
    "isFavorite": false
}

POST: Create package by Id

This API allows users to create a new package type by providing dimensions, weight, and related details.
It returns the created package type object upon success.

 

Endpoint details:

MethodPOST
Production Environment URLhttps://api.kloudship.com/api/v1/PackageType
Test Environment URLhttps://api-ppd.kloudship.com:960/api/v1/PackageType
Content-Typeapplication/json


Request body:

The request body should contain a JSON object with the address information to be posted. Here is an example of the 

request body:

FieldTypeRequiredDescriptionExample
namestringYesThe name of the package type.Zerox Package
lengthnumberYesLength of the package.5
widthnumberYesWidth of the package.5
heightnumberYesHeight of the package.5
dimensionUnitstringYesUnit for dimensions (cm, in).in
weightnumberYesWeight of the package.2
weightUnitstringYesUnit for weight (kg, lb).kg


Example cURL:

curl --location 'https://api-ppd.kloudship.com:960/api/v1/Packagetype' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
  "name": "Zerox Package", 
  "length": 5,
  "width": 5,
  "height": 5,
  "dimensionUnit": "in",
  "weight": 2,
  "weightUnit": "kg"
}'


Example Request:

{
  "name": "Zerox Package", 
  "length": 5,
  "width": 5,
  "height": 5,
  "dimensionUnit": "in",
  "weight": 2,
  "weightUnit": "kg"
}

Response fields:

FieldTypeDescription
idstringUnique identifier for the created package type.
createdDatestringTimestamp of when the package type was created (ISO 8601 format).
packageTypestringType of package (e.g., Box, Envelope).
namestringName assigned to the package type.
lengthnumberLength of the package.
widthnumberWidth of the package.
heightnumberHeight of the package.
dimensionUnitstringUnit for dimensions (cm, in).
weightnumberWeight of the package.
weightUnitstringUnit for weight (kg, lb).
isFavoritebooleanIndicates whether the package type is marked as a favorite (true = Yes, false = No).


Response example:

{
    "id": "68f0a950f452c6ae5889d0f1",
    "createdDate": "2025-10-16T08:14:08.1740701Z",
    "packageType": "Box",
    "name": "Zerox Package",
    "length": 5.0,
    "width": 5.0,
    "height": 5.0,
    "dimensionUnit": "in",
    "weight": 2.0,
    "weightUnit": "kg",
    "isFavorite": false
}

PUT: Update package type

Updates the details of the package type based on the provided package type id.


Endpoint details:

MethodPOST
Production Environment URLhttps://api.kloudship.com/api/v1/PackageType/{id}
Test Environment URLhttps://api-ppd.kloudship.com:960/api/v1/PakageType/{id} 
Content-Typeapplication/json
{id}: Here you will provide the package type id


Request body:

The request body should contain a JSON object with the address information to be posted. Here is an example of the 

request body:

FieldTypeRequiredDescriptionExample
namestringYesThe name of the package type.Zerox Package
lengthnumberYesLength of the package.5
widthnumberYesWidth of the package.5
heightnumberYesHeight of the package.5
dimensionUnitstringYesUnit for dimensions (cm, in).in
weightnumberYesWeight of the package.2
weightUnitstringYesUnit for weight (kg, lb).kg


Example cURL:

curl --location --request PUT 'https://api-ppd.kloudship.com:960/api/v1/Packagetype/6880a6b7e32e19eea1a57af8' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
  "name": "Toy Box",
  "length": 5,
  "width": 6,
  "height": 7,
  "dimensionUnit": "cm",
  "weight": 3,
  "weightUnit": "kg"
}'


Example Request:

{
  "name": "Zerox Package", 
  "length": 5,
  "width": 5,
  "height": 5,
  "dimensionUnit": "in",
  "weight": 2,
  "weightUnit": "kg"
}

Response fields:

FieldTypeDescription
idstringUnique identifier for the created package type.
createdDatestringTimestamp of when the package type was created (ISO 8601 format).
packageTypestringType of package (e.g., Box, Envelope).
namestringName assigned to the package type.
lengthnumberLength of the package.
widthnumberWidth of the package.
heightnumberHeight of the package.
dimensionUnitstringUnit for dimensions (cm, in).
weightnumberWeight of the package.
weightUnitstringUnit for weight (kg, lb).
isFavoritebooleanIndicates whether the package type is marked as a favorite (true = Yes, false = No).


Response example:

{
    "id": "68f0a950f452c6ae5889d0f1",
    "createdDate": "2025-10-16T08:14:08.1740701Z",
    "packageType": "Box",
    "name": "Zerox Package",
    "length": 5.0,
    "width": 5.0,
    "height": 5.0,
    "dimensionUnit": "in",
    "weight": 2.0,
    "weightUnit": "kg",
    "isFavorite": false
}

DEL: Delete package type

The Delete Package type API allows you to delete a specific package type using its unique `package_id`.


Endpoint details:

MethodPOST
Production Environment URLhttps://api.kloudship.com/api/v1/Pacagetype/{id}
Test Environment URLhttps://api-ppd.kloudship.com:960/api/v1/PackageType/{id} 
Content-Typeapplication/json
{id}: Here you will provide the package type id

Example cURL:

curl --location --request DELETE 'https://api-ppd.kloudship.com:960/api/v1/Packagetype/6880a6b7e32e19eea1a57af8' \
--header 'Authorization: ••••••'

Response:

The response from the Delete package type API includes status code 200, which signifies the request was successful and the server has responded with the requested information. The response will contain either a "true" or "false" value.


Not Yet Signed Up?

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article