# Decode Tracking Number

This operation decodes a tracking number from a barcode, extracting package details like carrier information, receiver Id, and package type. It supports 2D barcodes.

Endpoint: GET /api/v1/packages/tracking/decode
Version: 1.0.0
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer

## Query parameters:

  - `trackingNumber` (number, required)

  - `expectedPackage` (boolean)

  - `editflow` (boolean)

## Response 200:

  - `200` (unknown)
    Successful response containing decoded tracking details and package information.

## Response 200 fields (application/json):

  - `package` (object)

  - `package.trackingNumber` (string)
    Tracking number of the package.
    Example: PBYV4PVRBYLAAW

  - `package.carrier` (object)

  - `package.carrier.carrierId` (string)
    The unique identifier of the carrier being used.
    Example: FedEx

  - `package.carrier.name` (string)
    Name of the carrier used.
    Example: FedEx

  - `package.damaged` (boolean)
    Whether the package is damaged
    Example: false

  - `package.comment` (string)
    Comment on the package
    Example: user_comment

  - `package.currentLocation` (object)

  - `package.currentLocation.inboundSiteId` (string)
    Unique identifier of the inbound site where the package is currently located.
    Example: zy0a23Bo4Gn0

  - `package.currentLocation.name` (string)
    Name of the current location of the package.
    Example: Site 1CD1001RMF

  - `package.currentLocation.parent` (string)
    The parent location, indicating the immediate hierarchical parent.
    Example: Site

  - `package.currentLocation.type` (string)
    Type of the current location (e.g., site, building, floor, mailstop).
    Example: site

  - `package.currentLocation.locationHierarchy` (string)
    Hierarchy path of the current location of the package in standard format, e.g., Site > Building > Floor > Mailstop.
    Example: Noida, Office of CG| Noida,Bldg| Noida,Floor| Noida,MS

  - `package.currentLocation.ancestorlist` (array)
    A list of ancestors in the location hierarchy, providing a traceable path to the current location.For example, [Site, Building, Floor].
    Example: ["k5OrZWe0ly6dg1v","gKP4RNbMzrPO","XbyR9zpPDneY"]

  - `package.currentLocation.topTier` (object)
    Details of the top-tier location in the hierarchy.

  - `package.currentLocation.topTier.inboundSiteId` (string)
    The unique Inbound Site ID of the top-tier location.
    Example: EMPTY_SITE

  - `package.currentLocation.topTier.name` (string)
    The name of the top-tier location.
    Example: EMPTY_SITE

  - `package.currentStatus` (string)
    Current status of the package.
    Example: RECEIVED

  - `package.confirmationType` (string)
    The type of confirmation captured during the delivery of the package. Indicates proof of delivery, such as PHONE.
    Example: PHONE

  - `package.additionalConfirmationType` (string)
    An additional type of confirmation captured during the delivery.          Like `confirmationType`, it can include values like SIGNATURE.
    Example: SIGNATURE

  - `package.timezone` (integer)
    Timezone offset of the package location in minutes.
    Example: -330

  - `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

  - `decodedCarriers` (array)
    A list of decoded carriers associated with the request.

  - `decodedCarriers.trackingNum` (string)
    The tracking number decoded for the carrier.
    Example: PBLZQ93PMANYPO

## 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.

