# Bulk Import Shipments

"This operation imports the .CSV file for Bulk Shipment, which includes fields essential to create Bulk Shipments. 
  The payload contains the following essential fields in .CSV file, used for shipment transactions:
  - Carrier Account
  - Output format, which includes Shipping Label and Coversheet 
  - Services, and
  - Special Services 

  User stores this information in AWS-S3 which in turn provides URL to users. 
  After submitting Batch, user uploads the S3 returned URL along with the .CSV file, which generates BatchID. The same BatchID can be used to track the status of BulkImport."

Endpoint: POST /api/v1/shipments/importUrl
Version: 1.0.0
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer

## 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 isn't required.

## Request body:

  - `application/json` (unknown)
    This is the request body to import Bulk shipments.

## Request fields (application/json):

  - `name` (string)
    Name of the of Batch which which is imported (imported shipments in bulk).

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

  - `size` (string, required)
    This indicates the label size of the Bulk Shipment when it gets printed, e.g., DocSize can be 8' X 11' or 4' X 6'.
    Enum: "DOC_8X11", "DOC_4X6"

  - `type` (string, required)
    This indicates the type of the Batch Shipment, e.g., Shipping Label.
    Enum: "SHIPPING_LABEL"

  - `format` (string)
    This defines the type of the shipment which is printed, e.g., Shipping label gets printed in PDF form.
    Enum: "PDF"

  - `carrierAccountId` (string, required)
    A unique identifier associated with the carrier account used by client users during shipment process.

  - `serviceId` (string, required)
    A unique identifier given to the carrier-specific service. This varies as per carrier selection. User can override this value by defining it at Shipment level.

  - `parcelType` (string, required)
    Parcel Type is required for creating a shipment while rating a parcel. And it varies as per carrier and its selected services, e.g. FRPKG, LGENV, TUBE, and PKG.

  - `specialServices` (array)

  - `specialServices.inputParameters` (array)
    > - These parameters are required to set for the special service, such as an Insurance value or a Receipt-number format. This is applicable only when Special Service requires input parameters. If a Special Service does not require input parameters, user can or pass an empty array.

  - `specialServices.inputParameters.name` (string, required)
    The name of the parameter which is passed for Special Service.
    Example: INPUT_VALUE

  - `specialServices.inputParameters.value` (string, required)
    > - Parameter value is as per the carrier specifications. This can be blank if the parameter is sufficient and no value is associated.
    Example: 100

  - `specialServices.specialserviceId` (string, required)
    A unique identifier associated with the special service which varies based on selected Carrier Service and ParcelTypes/PackageTypes.

## Response 200:

  - `200` (unknown)
    The bulk shipment has been successfully imported.

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

  - `uploadURL` (string)
    For the stored Batch file under S3, this is the S3 returned URL. The URL is uploaded along with the .CSV file to get the BatchID, which is used to track the import status.

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

