Skip to content

Add Package

Request

This API operation creates a new package in the system and records its associated activity.
Each package requires a unique tracking number to be added successfully. If an attempt is made to add multiple packages using the same tracking number, the API will return an error.
When to use Add Package API?

  • For packages with a barcode
    • Customers scan the barcode label on the package and decode the tracking number using the Decode Tracking Number API.
    • Use the Get Package by Tracking Number API to check if the package already exists in the system:
      • If the package is not found, use Add Package API to add the package in the system.
  • For packages without a barcode or tracking number, generate a unique tracking number using the Generate Tracking Number API and then add the package using Add Package API.
Security
bearerAuth
Bodyapplication/jsonrequired
packageobjectrequired

Details of the package to be added.

lastActivityobject
imagesArray of objects

List of images related to the packages.

curl -i -X POST \
  https://api-sandbox.sendpro360.pitneybowes.com/pitneytrack/api/v1/packages \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "package": {
      "trackingNumber": "PB7WMALJAWRMJW",
      "assetType": "PACKAGE",
      "damaged": false,
      "timezone": -330,
      "carrier": {
        "carrierId": "FedEx"
      },
      "currentStatus": "RECEIVED",
      "customFields": [
        {
          "name": "End User",
          "status": "ACTIVE",
          "customFieldId": "o1axRY2NKxq",
          "value": "string"
        }
      ],
      "sender": {
        "contactId": "5f508e6baa797f3c3d092307"
      },
      "receiver": {
        "contactId": "5f508e6baa797f3c3d092307"
      },
      "givenTo": {
        "contactId": "5f508e6baa797f3c3d092307"
      },
      "comment": "User comments",
      "confirmationType": "PHONE",
      "additionalConfirmationType": "SIGNATURE"
    },
    "lastActivity": {
      "status": "RECEIVED",
      "location": {
        "inboundSiteId": "zy0a23Bo4Gn0"
      }
    },
    "images": [
      {
        "imageLevel": "ASSET",
        "imageType": "PHOTO",
        "tempURL": "temp/images/vvrbWY3rRBz",
        "contentType": "image/png"
      }
    ]
  }'

Responses

Package has been created successfully.

Bodyapplication/json
packageIdstring

Unique identifier generated for the package

Example:"NeLnz9LZ1j4KK5WlEOlyW"
trackingNumberstring

Tracking number associated with the package

Example:"PB4OZAWWNPBGB"
imagesArray of objects
Response
{ "packageId": "NeLnz9LZ1j4KK5WlEOlyW", "trackingNumber": "PB4OZAWWNPBGB", "images": [ { "contentType": "image/gif", "imageId": "7NNO1R3e1455", "url": "https://225934331380-receiving-service-artifacts-qa.s3.amazonaws.com/images/sac11be/Vlyx3zyQNr8omx6VzoR8Q/7NNO1R3e1455" } ] }