# Get Batch Status

This operation retrieves the status of an existing Batch using *Batch ID*. Once the Job status is completed, the URL received from Response can be used to download the shipping label in PDF format.

Endpoint: GET /api/v1/shipments/batch/{batchId}/status
Version: 1.0.0
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer

## Path parameters:

  - `batchId` (string, required)
    This is a system-generated unique identifier assigned to the Batch while it is processed.

## Header parameters:

  - `X-PB-Developer-Partner-ID` (string)
    The Developer-Partner- ID is assigned by PB to uniquely identify a Developer's strategic business partners. If the developer is the sole business partner, this field is not required.

## Response 200:

  - `200` (unknown)
    Here, is the status of the Batch ID.

## Response 200 fields (application/json):

  - `batchId` (string)
    This is a system-generated unique identifier assigned to the Batch while it is processed.

  - `name` (string)
    Name of the of Batch which consists of multiple shipments (shipments in bulk).

  - `groupName` (string)
    Indicates the name of the group of batches, which consists of multiple Batch groups.

  - `status` (string)
    This shows all the status related to the Batch Job.
    Enum: "SUBMITTED", "ADDRESS_VALIDATION_PROCESSING", "ADDRESS_VALIDATED", "ADDRESS_VALIDATION_FAILED", "RATE_VALIDATION_PROCESSING", "RATE_VALIDATED", "RATE_VALIDATION_FAILED", "LABEL_GENERATION_PROCESSING", "LABEL_GENERATION_FAILED", "LABEL_GENERATED", "COMPLETED"

  - `import` (object)
    This will display the status counts for shipments or batch which are submitted via Import .CSV file

  - `import.success` (number)
    The number of shipments which have been successfully imported.
    Example: 20

  - `import.failed` (number)
    The number of shipments failed during Import.
    Example: 10

  - `import.pending` (number)
    The number of shipments which are pending and in-queue to be imported.
    Example: 10

  - `addressValidation` (object)
    This indicates the status count of addresses which are at validation stage.

  - `addressValidation.success` (number)
    The number of addresses which have been successfully validated.
    Example: 20

  - `addressValidation.failed` (number)
    The number of addresses failed at validation due to incorrect entry in the address.
    Example: 10

  - `addressValidation.pending` (number)
    The number of addresses which are pending and in-queue to be processed.
    Example: 10

  - `rating` (object)
    This indicates the status count of shipments which are at Rating stage. Rating is a process of assessing the shipping/freight charge associated with the Bulk shipment. Rates are calculated based on selected special/extra services corresponding to the carrier, linked services, and selected ParcelType.

  - `rating.success` (number)
    The number of shipments that have been successfully processed for Ratings.
    Example: 20

  - `rating.failed` (number)
    The number of shipments which failed processing at Rating due to some scenarios like unsupported extra services or incompatible special services combined for a shipment.
    Example: 10

  - `rating.pending` (number)
    The number of shipments which are pending and in-queue to be processed.
    Example: 10

  - `labelGeneration` (object)
    Indicates the status of shipping labels/coversheets which are at final steps before printing.

  - `labelGeneration.success` (number)
    The number of shipment labels which have been successfully generated.
    Example: 20

  - `labelGeneration.failed` (number)
    The number of shipment labels which failed processing and could not be generated due to some errors with shipment.
    Example: 10

  - `labelGeneration.pending` (number)
    The number of shipment labels which are pending and in-queue to be processed.
    Example: 10

  - `voidLabel` (object)
    Indicates the status of shipping labels/shipments which are sent to be cancelled.

  - `voidLabel.success` (number)
    The number of shipment labels which have been successfully cancelled.
    Example: 20

  - `voidLabel.failed` (number)
    The number of shipment labels which failed cancelling due to some validation issue.
    Example: 10

  - `voidLabel.pending` (number)
    The number of shipment labels which are pending and in-queue to be cancelled.
    Example: 10

  - `labelDetails` (object)

  - `labelDetails.layout` (object)
    This indicates the layout of the label.

  - `labelDetails.layout.fileFormat` (string)
    Defines the format of the document file the print takes
    Example: PDF

  - `labelDetails.layout.size` (string)
    Defines the label size of the Shipment, that is, the Shipping Label is available in different Doc Size.
    Enum: "DOC_8X11", "DOC_4X6"

  - `labelDetails.layout.type` (string)
    This indicates the type of the label.
    Example: SHIPPING_LABEL

  - `labelDetails.results` (array)
    This indicates the results of the label generation.

  - `labelDetails.results.url` (string)
    This indicates URL of the shipping label in PDF format.
    Example: https://api-sandbox.pitneybowes.com/shippingservices/v1/shipments/210000000000000000/labels/210000000000000000.pdf

  - `labelDetails.results.shipmentIdentifiers` (array)
    Indicates the following identifiers related to Shipment.

  - `labelDetails.results.shipmentIdentifiers.id` (string)
    This indicates the identifier at DB level mapped with Shipment ID.
    Example: 64993ea9c3257d74798d4589

  - `labelDetails.results.shipmentIdentifiers.labelOrder` (number)
    The 'labelOrder' is the identifier of label order mapped with Shipment ID.
    Example: 1

  - `labelDetails.results.shipmentIdentifiers.parcelTrackingNumber` (string)
    The `parcelTrackingNumber` is a unique identifier assigned to a shipment for tracking.
    Example: 9414809898643517754882

  - `labelDetails.results.shipmentIdentifiers.shipmentId` (string)
    Shipment ID is a unique identifier for an individual shipment.
    Example: USPS2200592809609000

  - `labelDetails.results.shipmentIdentifiers.externalId` (string)
    This is a user-defined value provided by users just for their reference. This is for mapping purpose against each shipment.
    Example: 123456789

  - `totalShipmentCharge` (number)
    The `totalShipmentCharge` represents the total cost of shipping for all the parcels in the batch. This amount reflects the shipping charges applied to the batch as a whole.
    Example: 8.97

## Response 400:

  - `400` (unknown)
    Invalid request.

## 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)
    The HTTP 400 Bad/Invalid 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: Error while getting rates for carrier with carrierAccount eRMnRx4mzPP.

  - `additionalCode` (string)
    A unique identifier for the error, for example 1101055, 0100008, or 1021126.

  - `additionalInfo` (string)
    This is an additional information about the error. This error 'Invalid Request' might appear due to invalid dimension, weight, or serviceid, or if the information is missing.

  - `additionalParameters` (array)

## 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, which indicates that the client request has not been completed because it lacks valid authentication credentials for the requested resource.

## Response 404:

  - `404` (unknown)
    The requested resource was not found.

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

  - `additionalInfo` (string)
    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`.

  - `additionalParameters` (array)

## Response 500:

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

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

