Canada Post - Rate Domestic

Carrier
Canada Post
Action
Rate Domestic
{
  "carrier": "canada",
  "action": "getallrates",
  "params": {
    "test": true,
    "packages": [
      {
        "weight": 2,
        "length": 6,
        "width": 16,
        "height": 26
      }
    ],
    "customs": [],
    "shipper": "John Doe",
    "ship_state": "BC",
    "ship_code": "V7A4M1",
    "ship_country": "CA",
    "to_state": "ON",
    "to_code": "L3R9W6",
    "to_country": "CA",
    "weight_unit": "KG",
    "length_unit": "CM"
  }
}

<?php
$rs = new RocketShipIt;
$response = $rs->request(
array (
  'carrier' => 'canada',
  'action' => 'getallrates',
  'params' => 
  array (
    'test' => true,
    'packages' => 
    array (
      0 => 
      array (
        'weight' => 2,
        'length' => 6,
        'width' => 16,
        'height' => 26,
      ),
    ),
    'customs' => 
    array (
    ),
    'shipper' => 'John Doe',
    'ship_state' => 'BC',
    'ship_code' => 'V7A4M1',
    'ship_country' => 'CA',
    'to_state' => 'ON',
    'to_code' => 'L3R9W6',
    'to_country' => 'CA',
    'weight_unit' => 'KG',
    'length_unit' => 'CM',
  ),
)
);

rs.request(
  {'action': 'getallrates',
 'carrier': 'canada',
 'params': {'customs': [],
            'length_unit': 'CM',
            'packages': [{'height': 26, 'length': 6, 'weight': 2, 'width': 16}],
            'ship_code': 'V7A4M1',
            'ship_country': 'CA',
            'ship_state': 'BC',
            'shipper': 'John Doe',
            'test': True,
            'to_code': 'L3R9W6',
            'to_country': 'CA',
            'to_state': 'ON',
            'weight_unit': 'KG'}}

)

rs.request(
  {"carrier"=>"canada",
 "action"=>"getallrates",
 "params"=>
  {"test"=>true,
   "packages"=>[{"weight"=>2, "length"=>6, "width"=>16, "height"=>26}],
   "customs"=>[],
   "shipper"=>"John Doe",
   "ship_state"=>"BC",
   "ship_code"=>"V7A4M1",
   "ship_country"=>"CA",
   "to_state"=>"ON",
   "to_code"=>"L3R9W6",
   "to_country"=>"CA",
   "weight_unit"=>"KG",
   "length_unit"=>"CM"}}

)

rocketshipit.request(
  {
  "carrier": "canada",
  "action": "getallrates",
  "params": {
    "test": true,
    "packages": [
      {
        "weight": 2,
        "length": 6,
        "width": 16,
        "height": 26
      }
    ],
    "customs": [],
    "shipper": "John Doe",
    "ship_state": "BC",
    "ship_code": "V7A4M1",
    "ship_country": "CA",
    "to_state": "ON",
    "to_code": "L3R9W6",
    "to_country": "CA",
    "weight_unit": "KG",
    "length_unit": "CM"
  }
}
)

← All Canada Post examples