# Update Package

This operation updates the details of an existing package using its unique packageId. Updates include the latest activity performen on the package or current status of the package such as `RECEIVED` or `DELIVERED` as well as recording additional information like damage reports, location changes, or other relevant package events.

Endpoint: PUT /api/v1/packages/{packageId}
Version: 1.0.0
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer

## Path parameters:

  - `packageId` (string, required)

## Request fields (application/json):

  - `package` (object, required)

  - `package.trackingNumber` (string)
    The tracking number associated with the asset to be updated.
    Example: TB123456789ABCE

  - `package.assetType` (string)
    The type of the asset.
    Enum: "PACKAGE", "POUCH"

  - `package.damaged` (boolean)
    Indicates whether the package is marked as damaged.
    Example: false

  - `package.timezone` (integer)
    The timezone offset of the asset's current location in minutes.
    Example: -330

  - `package.sender` (object)
    Details of the sender for the package.

  - `package.sender.contactId` (string)
    The contact ID for the sender selected for the package. The `contactId` corresponds to the field `Id` in the address book for a contact with `contactType: SENDER` or `contactType: ALL`.
    Example: 5f508e6baa797f3c3d092307

  - `package.receiver` (object)
    Details of the receiver for the package.

  - `package.receiver.contactId` (string)
    The contact ID for the recipient selected for the package. The `contactId` corresponds to the field `Id` in the address book for a contact with `contactType: RECEIVER` or `contactType: ALL`.
    Example: 5f508e6baa797f3c3d092307

  - `package.givenTo` (object)
    Details of the person or entity the last activity is assigned to.

  - `package.givenTo.contactId` (string)
    The Contact ID of the person or entity the last activity is assigned to.
    Example: 5f508e6baa797f3c3d092307

  - `package.comment` (string)
    Optional comments or notes related to the package.
    Example: User comments

  - `package.confirmationType` (string)
    Confirmation type
    Example: PHONE

  - `package.additionalConfirmationType` (string)
    Additional confirmation type
    Example: SIGNATURE

  - `package.customFields` (array)
    List of custom fields associated with the package.Custom fields are additional package fields that can be added to display on PitneyTrack workflow pages.These fields can be defined from the 'My Settings' page in platform settings.

  - `package.customFields.name` (string)
    Name of the custom field as defined by the user in the 'My Settings' page of platform settings.
    Example: End User

  - `package.customFields.status` (string)
    Status of the custom field. Supported values are:
- ACTIVE: The custom field is currently in use.
- INACTIVE: The custom field is not in use.
    Example: ACTIVE

  - `package.customFields.customFieldId` (string)
    Unique identifier for the custom field.
    Example: o1axRY2NKxq

  - `package.customFields.value` (string)
    Value associated with the custom field, as set by the user.
    Example: end user

  - `lastActivity` (object)

  - `lastActivity.status` (string)
    The updated status of the last activity performed on the package.
    Example: RECEIVED

  - `lastActivity.location` (object)
    Details of the location where the last activity occurred.

  - `lastActivity.location.inboundSiteId` (string)
    The unique identifier of the inbound site where the package was last processed.
    Example: zy0a23Bo4Gn0

  - `images` (array)
    List of images related to the packages.

  - `images.imageLevel` (string)
    Level of the image to be added with the package.
    Example: ASSET

  - `images.imageType` (string)
    Type of the image to be added with the package.
    Example: PHOTO

  - `images.tempURL` (string)
    Temporary URL for accessing the image to be added with the packae.
    Example: temp/images/vvrbWY3rRBz

  - `images.contentType` (string)
    Content type of the image to be added with the package.
    Example: image/png

## Response 200:

  - `200` (unknown)
    Package has been updated successfully.

## Response 200 fields (application/json):

  - `packageId` (string)
    Unique identifier generated for the package
    Example: NeLnz9LZ1j4KK5WlEOlyW

  - `trackingNumber` (string)
    Tracking number associated with the package
    Example: PB4OZAWWNPBGB

  - `images` (array)

  - `images.imageId` (string)
    Unique identifier for the uploaded image.
    Example: img12345

  - `images.tempURL` (string)
    Temporary URL to access the uploaded image.
    Example: temp/images/a5qk9gR1X85v

  - `images.imageType` (string)
    Type or format of the uploaded image.
    Example: PHOTO

## Response 400:

  - `400` (unknown)
    Invalid request.

## Response 400 fields (application/json):

  - `errors` (array)
    List of errors.

  - `errors.errorCode` (string)
    This error can be validation_error or internal_error or not_found or already_exists
    Example: validation_error

  - `errors.errorDescription` (string)
    The HTTP 400 Bad Request response status code indicates that the server cannot process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
    Example: Asset not found.

  - `errors.additionalCode` (string)
    A unique identifier for the error
    Example: 020005

  - `errors.additionalInfo` (string)
    additional information of the error.
    Example: additional information

  - `errors.additionalParameters` (string)
    The field(s) that might be incorrect in the request.
    Example: additional parameters

  - `errors.correlationID` (string)
    Example: correlationId

## Response 401:

  - `401` (unknown)
    The request could not be authorized.

## Response 401 fields (application/json):

  - `message` (string, required)
    This is HTTP 401 Unauthorized response status code, that indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource.

## Response 500:

  - `500` (unknown)
    The request could not be completed due to an internal error.

