# Bulk Import Shipments ERR

This operation imports the .CSV file which includes fields required for creating ERR (Electronic Return Receipt) Bulk Shipments. 
  The payload, which is used for shipment transactions, contains the following essential information in .CSV file:
  - Carrier Account
  - Output format: Shipping Label and Coversheet 
  - Services, and
  - Special Services 

  The above-mentioned information are stored in AWS-S3 which in turn provides URL to users. When Batch is submitted, S3 returned URL along with .CSV file are uploaded, which generates BatchID. 
  The same BatchID is used to track the status of BulkImport.

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

## Security:

  - `bearerAuth` (unknown)
    http bearer

## Header parameters:

  - `X-PB-Developer-Partner-ID` (string)
    The PB-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.

## Request body:

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

## Request fields (application/json):

  - `name` (string)
    Name of the of ERR Batch which is imported, e.g. ERR-Import-05.

  - `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,i.e., DocSize.
    Enum: "ERR Label - DOC_8X11 and DOC_4X6.", "ERR Coversheet - 10, 6 X 9, 6 X 9.5, and 9.5 X 12"

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

  - `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. Default CarrierAccountID for this batch will be user's registered USPS account.

  - `serviceId` (string, required)
    A unique identifier given to the carrier-specific service. 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 USPS 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 USPS Service and ParcelTypes/PackageTypes.

## Response 200:

  - `200` (unknown)
    ERR Bulk Shipment has been successfully imported.

## Response 200 fields (application/json):

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

  - `name` (string)
    Name of the of ERR 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.

