# Search Packages with Custom Header Mapping

This operation returns package records based on the requested custom header mapping. The request body contains package field names as keys and custom header labels as values. These header labels can be used to display the returned package data with user-defined column names.

Endpoint: POST /api/v1/packages/search
Version: 1.0.0
Security: bearerAuth

## Query parameters:

  - `startDate` (string)
    Filter package updated on or after this date.
    Example: "2024-11-27T18:30:00.000Z"

  - `endDate` (string)
    Filter package updated on or before this date.
    Example: "2024-11-28T18:30:00.000Z"

  - `page` (integer)
    The page number of the results to retrieve. Pagination starts from 1.
    Example: "1"

  - `size` (integer)
    The number of assets to retrieve per page.
    Example: "25"

  - `status` (string)
    Filter assets by status.
    Example: "UNDELIVERED"

  - `sort` (string)
    Specify the sorting order of the results.
    Example: "insertTimestamp"

  - `inboundSiteId` (string)
    This is the identifier of the Inbound Site to be searched.
    Example: "bzxgKm861vv"

## Response 200 fields (application/json):

  - `packages` (array)
    Returns package records with fields labeled based on the provided custom header mappings.

Each package object contains dynamic key-value pairs where:
  
- Key: Custom header label defined in the request
- Value: Corresponding package field value

If no mappings are provided in the request, the response returns package fields using their default field names.
    Example: [{"Bank":"Sector 142 LockerBank","DT":"","Delivered By":"","Given To":"","JvoZmPNeYGWlKR0w7gKlR":"lkgP5Xb0r32AMKK6w2z6E","Operator":"pse US Sanity","ReceivedDate":"2026-04-09T13:58:17.394Z","Route":"Delhi Route","SiteName":"API_Site_Update","Status":"RECEIVED","locZip":"06810","subID":"sac11be"}]

  - `totalCount` (integer)
    Total number of package records returned.
    Example: 1

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