# Pickup package from locker unit

This API operation is used to pick up deposited packages from locker units within the specified locker bank.

Use this endpoint when:
- A recipient picks up a delivered package from a locker unit.
- A mailroom operator removes expired packages from locker units.
- An authorized user performs a package retrieval operation.

The request can include one or more pickup requests. Each pickup request identifies the locker unit and package pickup code associated with the parcel pickup operation.

If pickupExpiryPackage is set to true, the API allows pickup of expired packages from locker units.

Note: This API is designed solely for client-side end-to-end testing in the sandbox environment.

Endpoint: POST /api/v1/lockerBanks/{lockerBankId}/lockers/pickup
Version: 1.0.0
Security: bearerAuth

## Path parameters:

  - `lockerBankId` (string, required)
    The unique identifier of the locker bank where the package pickup operation is performed.
    Example: "AOne"

## Request fields (application/json):

  - `userId` (string, required)
    The identifier of the user performing the package pickup operation.
    Example: "user@gmail.com"

  - `pickupExpiryPackage` (boolean)
    Indicates whether expired packages can be picked up from the locker unit.

  - `pickupRequests` (array, required)
    The list of package pickup requests.

  - `pickupRequests.pickupCode` (string)
    Pickup code associated with the deposited package.
    Example: "NR8PBW"

  - `pickupRequests.lockerUnitId` (string)
    The unique identifier of the locker unit from which the package will be picked up.
    Example: "7"

  - `pickupRequests.contactId` (string)
    The identifier of the recipient or department performing the pickup.
    Example: "684a6b7bbc85e1bce739xxxx"

  - `pickupRequests.contactType` (string)
    The type of contact performing the pickup.
    Enum: "recipient", "department"

## Response 400 fields (application/json):

  - `errorCode` (string)
    Error code(s) that appear due to HTTP  400- Invalid or Bad Request, e.g., validation-error.
    Example: "validation_error"

  - `errorDescription` (string)
    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: "userId - value missing."

  - `additionalCode` (string)
    A unique identifier for the error, for example ILP10010, or ILP10030.
    Example: "already_exists"

  - `additionalInfo` (string)
    This is an additional information about the error. This error 'Invalid Request' might appear due to invalid data, or if the information is missing.
    Example: "674eb7b67b34d787400fa453"

  - `additionalParameters` (array)
    Example: ["userId"]

## Response 401 fields (application/json):

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

## Response 404 fields (application/json):

  - `errorCode` (string)
    Error code(s) that appear due HTTP 404 Page or File not found.
    Example: "not_found"

  - `errorDescription` (string)
    HTTP 404 Not Found response status code indicates that the server cannot find the requested resource.
    Example: "resource not found"

  - `additionalCode` (string)
    A unique identifier for the error, for example 0100025, 1110017, or 1090001.
    Example: "0100025"

  - `additionalInfo` (string)
    The additional information about the error. This error 'Not Found' might appear due to Shipment Not Found, No Shipments to close, or Original Transaction not found.
    Example: "Resource not found"

  - `additionalParameters` (array)
    Example: ["userId"]

## Response 500 fields (application/json):

  - `message` (string, required)
    This is HTTP 500 Internal Server Error response status code, which indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.
    Example: "The request could not be completed."


