# Add Carrier

Add Carrier Account API

Endpoint: POST /api/v1/carrierAccounts
Version: 0.1
Security: bearerAuth

## Header parameters:

  - `X-PB-Developer-Partner-ID` (string)
    This is the Developer Partner ID. When the developer is the only partner, this field is not required.

  - `X-PB-LocationId` (string)
    This header is required when onboarding a carrier belongs to a locarion other than the developer's default location.

## Request fields (application/json):

  - `accountNumber` (string)
    Unique identifier of the account
    Example: 123338

  - `carrierID` (string)
    It defines the carrier ID, can be get from `Get Carriers API`
    Enum: "FEDEX", "UPS", "DHLEXP", "SPEEDEE", "NORATE"

  - `description` (string)
    It defines the carrier account name
    Example: FedEx Account

  - `parameters` (object)
    It lists the additional details required adding carrier account

  - `parameters.username` (string)
    Username for the account, required for DHL Express
    Example: abcjsk

  - `parameters.password` (string)
    Password for the account, required for DHL Express
    Example: *******

  - `parameters.accountAddress` (object)
    It includes the account address details

  - `parameters.accountAddress.addressLine1` (string)
    The addressLine1 can contain the Flat number, Building or Apartment Name/number (if any) or company name (if not residential).
    Example: 27 Watervw Dr

  - `parameters.accountAddress.city` (string)
    The name of the city or town to where the address belongs.
    Example: shelton

  - `parameters.accountAddress.state` (string)
    The State or Province of the address. For a US or Canadian address, it is the 2-letter state or province code.
    Example: CT

  - `parameters.accountAddress.postalCode` (string)
    The postal code or ZIP code of the address. For US addresses, use either the 5-digit or 9-digit ZIP code in one of the following formats: '12345' or '12345-6789'. If you use a different format, such as 12345- or 123451234, will receive an error.
    Example: 06484

  - `parameters.accountAddress.countryCode` (string)
    This indicates the two-character ISO code of the source country from the ISO country list.
    Example: US

  - `parameters.accountAddress.email` (string)
    The email address of the sender. It can be person's email address or company email address (for non-residential).

  - `parameters.accountAddress.company` (string)
    This indicates the name of the company, in case if  address is not residential.

  - `parameters.accountAddress.name` (string)
    Name of the sender to which this address points.

  - `parameters.accountAddress.phone` (string)
    This is sender's phone number. Enter the digits with or without spaces or hyphens. The maximum characters for Phone number is 10 digits.

  - `parameters.contactAddress` (object)
    It includes the contact address details

  - `parameters.contactAddress.addressLine1` (string)
    The addressLine1 can contain the Flat number, Building or Apartment Name/number (if any) or company name (if not residential).
    Example: 27 Watervw Dr

  - `parameters.contactAddress.city` (string)
    The name of the city or town to where the address belongs.
    Example: shelton

  - `parameters.contactAddress.state` (string)
    The State or Province of the address. For a US or Canadian address, it is the 2-letter state or province code.
    Example: CT

  - `parameters.contactAddress.postalCode` (string)
    The postal code or ZIP code of the address. For US addresses, use either the 5-digit or 9-digit ZIP code in one of the following formats: '12345' or '12345-6789'. If you use a different format, such as 12345- or 123451234, will receive an error.
    Example: 06484

  - `parameters.contactAddress.countryCode` (string)
    This indicates the two-character ISO code of the source country from the ISO country list.
    Example: US

  - `parameters.contactAddress.email` (string)
    The email address of the sender. It can be person's email address or company email address (for non-residential).

  - `parameters.contactAddress.company` (string)
    This indicates the name of the company, in case if  address is not residential.

  - `parameters.contactAddress.name` (string)
    Name of the sender to which this address points.

  - `parameters.contactAddress.phone` (string)
    This is sender's phone number. Enter the digits with or without spaces or hyphens. The maximum characters for Phone number is 10 digits.

  - `parameters.hubID` (string)
    It defines FedEx Smartpost hub ID, required only for FedEx Smartpost account, it can be referred from response of `Get FedEx Smartpost hub details`
    Example: 1544

  - `parameters.invoiceAmount` (string)
    It defines the invoice amount ,Only for UPS acccount
    Example: 2121

  - `parameters.invoiceControlID` (string)
    It defines the invoice controlID ,Only for UPS acccount
    Example: 123D

  - `parameters.invoiceDate` (string)
    It defines the date of the invoice in the format YYYYMMDD., Only for UPS account
    Example: 20201203

  - `parameters.invoiceNumber` (string)
    It defines the invoice number ,Only for UPS acccount
    Example: saas212121

  - `parameters.hostName` (string)
    It is required for SpeeDee. Manifest Details are provided by the carrier and these are required for end-of-day manifesting. Please contact your carrier relationship person for more details
    Example: gppprt2ftp-ext.test.com

  - `parameters.manifestUserId` (string)
    It is required for SpeeDee. Manifest Details are provided by the carrier and these are required for end-of-day manifesting. Please contact your carrier relationship person for more details
    Example: testuser

  - `parameters.manifestPassword` (string)
    It is required for SpeeDee. Manifest Details are provided by the carrier and these are required for end-of-day manifesting. Please contact your carrier relationship person for more details
    Example: testpassword

  - `parameters.manifestPath` (string)
    It is required for SpeeDee. Manifest Details are provided by the carrier and these are required for end-of-day manifesting. Please contact your carrier relationship person for more details
    Example: /in

## Response 200 fields (application/json):

  - `carrierAccountID` (string)
    Unique identifier of carrier account created
    Example: abc3849

  - `accountNumber` (string)
    Unique identifier of the account
    Example: 123338

  - `carrierID` (string)
    It defines the carrier ID, can be get from `Get Carriers API`
    Enum: "FEDEX", "UPS", "DHLEXP"

  - `description` (string)
    It defines the carrier account name
    Example: FedEx Account

  - `carrierAccountType` (string)
    This defines carrier account type
    Example: Shipping

  - `provisioningType` (string)
    It defines the provisioning method
    Example: API

  - `parameters` (object)
    It lists the additional details required adding carrier account

  - `parameters.username` (string)
    Username for the account, required for DHL Express
    Example: abcjsk

  - `parameters.accountAddress` (object)
    It includes the account address details

  - `parameters.accountAddress.addressLine1` (string)
    The addressLine1 can contain the Flat number, Building or Apartment Name/number (if any) or company name (if not residential).
    Example: 27 Watervw Dr

  - `parameters.accountAddress.city` (string)
    The name of the city or town to where the address belongs.
    Example: shelton

  - `parameters.accountAddress.state` (string)
    The State or Province of the address. For a US or Canadian address, it is the 2-letter state or province code.
    Example: CT

  - `parameters.accountAddress.postalCode` (string)
    The postal code or ZIP code of the address. For US addresses, use either the 5-digit or 9-digit ZIP code in one of the following formats: '12345' or '12345-6789'. If you use a different format, such as 12345- or 123451234, will receive an error.
    Example: 06484

  - `parameters.accountAddress.countryCode` (string)
    This indicates the two-character ISO code of the source country from the ISO country list.
    Example: US

  - `parameters.accountAddress.email` (string)
    The email address of the sender. It can be person's email address or company email address (for non-residential).

  - `parameters.accountAddress.company` (string)
    This indicates the name of the company, in case if  address is not residential.

  - `parameters.accountAddress.name` (string)
    Name of the sender to which this address points.

  - `parameters.accountAddress.phone` (string)
    This is sender's phone number. Enter the digits with or without spaces or hyphens. The maximum characters for Phone number is 10 digits.

  - `parameters.contactAddress` (object)
    It includes the contact address details

  - `parameters.contactAddress.addressLine1` (string)
    The addressLine1 can contain the Flat number, Building or Apartment Name/number (if any) or company name (if not residential).
    Example: 27 Watervw Dr

  - `parameters.contactAddress.city` (string)
    The name of the city or town to where the address belongs.
    Example: shelton

  - `parameters.contactAddress.state` (string)
    The State or Province of the address. For a US or Canadian address, it is the 2-letter state or province code.
    Example: CT

  - `parameters.contactAddress.postalCode` (string)
    The postal code or ZIP code of the address. For US addresses, use either the 5-digit or 9-digit ZIP code in one of the following formats: '12345' or '12345-6789'. If you use a different format, such as 12345- or 123451234, will receive an error.
    Example: 06484

  - `parameters.contactAddress.countryCode` (string)
    This indicates the two-character ISO code of the source country from the ISO country list.
    Example: US

  - `parameters.contactAddress.email` (string)
    The email address of the sender. It can be person's email address or company email address (for non-residential).

  - `parameters.contactAddress.company` (string)
    This indicates the name of the company, in case if  address is not residential.

  - `parameters.contactAddress.name` (string)
    Name of the sender to which this address points.

  - `parameters.contactAddress.phone` (string)
    This is sender's phone number. Enter the digits with or without spaces or hyphens. The maximum characters for Phone number is 10 digits.

  - `parameters.hubID` (string)
    It defines FedEx Smartpost hub ID, required only for FedEx Smartpost account
    Example: 1544

  - `parameters.invoiceAmount` (string)
    It defines the invoice amount ,Only for UPS acccount
    Example: 2121

  - `parameters.invoiceControlID` (string)
    It defines the invoice controlID ,Only for UPS acccount
    Example: 123D

  - `parameters.invoiceDate` (string)
    It defines the date of the invoice in the format YYYYMMDD., Only for UPS account
    Example: 20201203

  - `parameters.invoiceNumber` (string)
    It defines the invoice number ,Only for UPS acccount
    Example: saas212121

## Response 400 fields (application/json):

  - `errors` (array)

  - `errors.errorCode` (string)
    Error code(s) that appear due to HTTP  400- Invalid or Bad Request, e.g. validation-error.
    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: Error while getting rates for carrier with carrierAccount eRMnRx4mzPP.

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

  - `errors.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.

  - `errors.additionalParameters` (array)

## 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.
    Example: Unauthorized

