# Connect a freight provider account

Products
            Plans
          
        
        
          
            
              
              Formerly ShipEngine
            
            
              Free
              Advanced
              Enterprise
            
          
          
            
              
            
            
              Free
              Starter
              Standard
              Premium
            
          
        
      
      
        
          Learn about products and plans
          
        
      
    

Connect a freight account the seller already holds with the provider. Both connectable providers — speedship (WWEX) and unishippers — authenticate with an OAuth client ID / secret pair issued by the provider.

The credentials are verified against the provider before they are stored, so a 201 means the connection can be quoted against immediately.

A seller may hold one connection per provider. Connecting a provider that is already connected returns 409 with error code freight_provider_already_connected and the existing freight_provider_account_id. Use PUT /v2/freight/provider_accounts/{freight_provider_account_id}/credentials to rotate credentials on the existing connection. Use DELETE /v2/freight/provider_accounts/{freight_provider_account_id} to disconnect it.

Endpoint: POST /v2/freight/provider_accounts
Version: 2.0.0
Security: api_keys

## Request fields (application/json):

  - `freight_provider_code` (string, required)
    The code of the provider to connect. The connectable codes are the freight_provider_code values returned by [List freight provider accounts](#operation/list_freight_provider_accounts). Currently supported: speedship (WWEX) and unishippers.
    Example: "speedship"

  - `client_id` (string, required)
    The OAuth client ID issued by the freight provider.
    Example: "my-client-id"

  - `client_secret` (string, required)
    The OAuth client secret issued by the freight provider.
    Example: "my-client-secret"

  - `nickname` (string,null)
    An optional label for the connection. Echoed back by [List freight provider accounts](#operation/list_freight_provider_accounts).
    Example: "My WWEX account"

## Response 201 fields (application/json):

  - `freight_provider_account_id` (string)
    The identifier of the freight provider account. Pass it as freight_provider_account_id when quoting, booking, or tracking.
    Example: "se-28529731"

  - `freight_provider_code` (string)
    The code of the freight provider, such as UNISHIPPERS or WWEX. This is the same value returned as freight_provider_code on quotes, shipments, and tracking.
    Example: "UNISHIPPERS"

  - `nickname` (string,null)
    The name given to the connection when it was set up, or null when it has none.
    Example: "Unishippers - Midwest"

## Response 400 fields (application/json):

  - `request_id` (string, required)
    A UUID that uniquely identifies the request id.
This can be given to the support team to help debug non-trivial issues that may occur
    Example: "aa3d8e8e-462b-4476-9618-72db7f7b7009"

  - `errors` (array, required)
    The errors associated with the failed API call

  - `errors.error_source` (string, required)
    The source of the error, as indicated by the name this informs us if the API call failed because of the
carrier, the order source, the ShipStation API itself, or the underlying ShipEngine platform.
    Enum: "carrier", "order_source", "ShipStation", "shipengine"

  - `errors.error_type` (string, required)
    The type of error
    Enum: "account_status", "business_rules", "validation", "security", "system", "integrations"

  - `errors.error_code` (string, required)
    The error code specified for the failed API Call
    Enum: "auto_fund_not_supported", "batch_cannot_be_modified", "carrier_conflict", "carrier_disconnected", "carrier_not_connected", "carrier_not_supported", "confirmation_not_supported", "default_warehouse_cannot_be_deleted", "field_conflict", "field_value_required", "forbidden", "identifier_conflict", "identifiers_must_match", "insufficient_funds", "invalid_address", "invalid_billing_plan", "invalid_field_value", "invalid_identifier", "invalid_status", "invalid_string_length", "label_images_not_supported", "meter_failure", "order_source_not_active", "rate_limit_exceeded", "refresh_not_supported", "request_body_required", "return_label_not_supported", "settings_not_supported", "subscription_inactive", "terms_not_accepted", "tracking_not_supported", "trial_expired", "unauthorized", "unknown", "unspecified", "verification_failure", "warehouse_conflict", "webhook_event_type_conflict", "customs_items_required", "incompatible_paired_labels", "invalid_charge_event", "invalid_object", "no_rates_returned", "freight_connection_inactive", "freight_provider_id_required", "freight_shipment_not_found", "freight_tracking_not_available", "freight_tracking_not_found", "freight_shipment_not_batchable", "freight_provider_already_connected"

  - `errors.message` (string, required)
    An error message associated with the failed API call
    Example: "Body of request cannot be null."

  - `errors.field_name` (string)
    The name of the field that caused the error (only present for validation errors)
    Example: "inventory_warehouse_id"

  - `errors.field_value` (string)
    The invalid value that was provided for the field (only present for validation errors)
    Example: "invalid-id"


