DHL eCommerce - Rates

Carrier: DHL eCommerce
Action: Rates
Description: Example implementation for DHL eCommerce Rates
{
  "carrier": "DHL-ecommerce",
  "action": "GetAllRates",
  "params": {
    "username": "YOUR_DHL_CLIENT_ID",
    "password": "YOUR_DHL_CLIENT_SECRET",
    "account_number": "YOUR_DHL_PICKUP_ID",
    "test": true,
    "packages": [
      {
        "weight": 5,
        "length": 5,
        "width": 5,
        "height": 5
      }
    ],
    "customs": [],
    "shipper": "RocketShipIt",
    "ship_addr1": "123 Main St",
    "ship_city": "Whitehall",
    "ship_state": "MT",
    "ship_code": "59759",
    "ship_country": "US",
    "to_country": "US",
    "to_code": "90210",
    "weight_unit": "LBS",
    "pickup_type": "01",
    "customer_classification": "01",
    "length_unit": "IN",
    "packaging_type": "02"
  }
}

<?php
$rs = new RocketShipIt;
$response = $rs->request(
array (
  'carrier' => 'DHL-ecommerce',
  'action' => 'GetAllRates',
  'params' => 
  array (
    'username' => 'YOUR_DHL_CLIENT_ID',
    'password' => 'YOUR_DHL_CLIENT_SECRET',
    'account_number' => 'YOUR_DHL_PICKUP_ID',
    'test' => true,
    'packages' => 
    array (
      0 => 
      array (
        'weight' => 5,
        'length' => 5,
        'width' => 5,
        'height' => 5,
      ),
    ),
    'customs' => 
    array (
    ),
    'shipper' => 'RocketShipIt',
    'ship_addr1' => '123 Main St',
    'ship_city' => 'Whitehall',
    'ship_state' => 'MT',
    'ship_code' => '59759',
    'ship_country' => 'US',
    'to_country' => 'US',
    'to_code' => '90210',
    'weight_unit' => 'LBS',
    'pickup_type' => '01',
    'customer_classification' => '01',
    'length_unit' => 'IN',
    'packaging_type' => '02',
  ),
)
);

rs.request(
  {'action': 'GetAllRates',
 'carrier': 'DHL-ecommerce',
 'params': {'account_number': 'YOUR_DHL_PICKUP_ID',
            'customer_classification': '01',
            'customs': [],
            'length_unit': 'IN',
            'packages': [{'height': 5, 'length': 5, 'weight': 5, 'width': 5}],
            'packaging_type': '02',
            'password': 'YOUR_DHL_CLIENT_SECRET',
            'pickup_type': '01',
            'ship_addr1': '123 Main St',
            'ship_city': 'Whitehall',
            'ship_code': '59759',
            'ship_country': 'US',
            'ship_state': 'MT',
            'shipper': 'RocketShipIt',
            'test': True,
            'to_code': '90210',
            'to_country': 'US',
            'username': 'YOUR_DHL_CLIENT_ID',
            'weight_unit': 'LBS'}}

)

rs.request(
  {"carrier"=>"DHL-ecommerce",
 "action"=>"GetAllRates",
 "params"=>
  {"username"=>"YOUR_DHL_CLIENT_ID",
   "password"=>"YOUR_DHL_CLIENT_SECRET",
   "account_number"=>"YOUR_DHL_PICKUP_ID",
   "test"=>true,
   "packages"=>[{"weight"=>5, "length"=>5, "width"=>5, "height"=>5}],
   "customs"=>[],
   "shipper"=>"RocketShipIt",
   "ship_addr1"=>"123 Main St",
   "ship_city"=>"Whitehall",
   "ship_state"=>"MT",
   "ship_code"=>"59759",
   "ship_country"=>"US",
   "to_country"=>"US",
   "to_code"=>"90210",
   "weight_unit"=>"LBS",
   "pickup_type"=>"01",
   "customer_classification"=>"01",
   "length_unit"=>"IN",
   "packaging_type"=>"02"}}

)

rocketshipit.request(
  {
  "carrier": "DHL-ecommerce",
  "action": "GetAllRates",
  "params": {
    "username": "YOUR_DHL_CLIENT_ID",
    "password": "YOUR_DHL_CLIENT_SECRET",
    "account_number": "YOUR_DHL_PICKUP_ID",
    "test": true,
    "packages": [
      {
        "weight": 5,
        "length": 5,
        "width": 5,
        "height": 5
      }
    ],
    "customs": [],
    "shipper": "RocketShipIt",
    "ship_addr1": "123 Main St",
    "ship_city": "Whitehall",
    "ship_state": "MT",
    "ship_code": "59759",
    "ship_country": "US",
    "to_country": "US",
    "to_code": "90210",
    "weight_unit": "LBS",
    "pickup_type": "01",
    "customer_classification": "01",
    "length_unit": "IN",
    "packaging_type": "02"
  }
}
)
← Back to All Examples

Other DHL eCommerce Examples

Create Manifest
Example implementation for DHL eCommerce Create Manifest
International Label
Example implementation for DHL eCommerce International Label
Tracking
Example implementation for DHL eCommerce Tracking