# Create Ship Via Code

Create a ship via code that represents a specific combination of carrier, carrier account,
parcel type, service, and special services.
This ship via code can then be used in the **Create Shipment API**, so users don't need to manually
re-enter these parameters each time.
Once generated, the code can be reused across multiple shipments to reduce effort in shipping requests.

Endpoint: POST /api/v1/shipviacode
Version: 1.0.0
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer

## Request fields (application/json):

  - `code` (string, required)
    Unique ship via code value defined by the client.
    Example: FEDEX-custom-code1

  - `carrier` (string, required)
    Carrier name associated with the custom configuration.
    Example: FEDEX

  - `carrierAccountId` (string, required)
    Unique identifier of the carrier account under which shipments will be processed.
    Example: xxxxxxxxxxx

  - `parcelType` (string)
    Parcel type (e.g., PKG for package, LTR for letter).
    Example: PKG

  - `parcelName` (string)
    Human-readable name for the parcel type (optional).
    Example: Package

  - `serviceId` (string)
    Identifier of the shipping service to be used.
    Example: GRD

  - `serviceName` (string)
    Human-readable name of the shipping service (optional).
    Example: Ground

  - `specialServices` (array)
    List of special services applied to the ship via code.

  - `specialServices.specialServiceId` (string)
    Identifier of the special service.
    Example: INS

  - `specialServices.inputParameters` (array)
    Input parameters for the special service.

  - `specialServices.inputParameters.name` (string)
    Parameter name.
    Example: INPUT_VALUE

  - `specialServices.inputParameters.value` (string)
    Parameter value.
    Example: 101

  - `specialServices.fee` (number)
    Monetary fee associated with the service (if any).
    Example: 0

## Response 201:

  - `201` (unknown)
    Ship Via Code successfully created.

## Response 201 fields (application/json):

  - `code` (string)
    The generated ship via code that can be reused in Create Shipment API.
    Example: FEDEX-custom-code1

## Response 400:

  - `400` (unknown)
    Invalid request.

## Response 400 fields (application/json):

  - `errors` (array)
    List of errors.

  - `errors.errorCode` (string)
    This error can be validation_error or internal_error or not_found or already_exists
    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: Custom Fields not found

## 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, that 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 error.

