Canada Post - Label

Carrier
Canada Post
Action
Label
{
  "carrier": "canada",
  "action": "submitshipment",
  "params": {
    "packages": [
      {
        "weight": 4,
        "length": 7,
        "width": 5,
        "height": 5
      }
    ],
    "service": "DOM.EP",
    "shipper": "RocketShipIt",
    "ship_addr1": "123 Main St",
    "ship_city": "Ottawa",
    "ship_state": "ON",
    "ship_code": "K1A0B1",
    "ship_phone": "1231231234",
    "ship_country": "US",
    "to_name": "John Doe",
    "to_addr1": "361A Old Finch Avenue",
    "to_addr2": "#103",
    "to_state": "ON",
    "to_city": "Toronto",
    "to_code": "M1B5K7",
    "to_country": "CA",
    "test": true
  }
}

<?php
$rs = new RocketShipIt;
$response = $rs->request(
array (
  'carrier' => 'canada',
  'action' => 'submitshipment',
  'params' => 
  array (
    'packages' => 
    array (
      0 => 
      array (
        'weight' => 4,
        'length' => 7,
        'width' => 5,
        'height' => 5,
      ),
    ),
    'service' => 'DOM.EP',
    'shipper' => 'RocketShipIt',
    'ship_addr1' => '123 Main St',
    'ship_city' => 'Ottawa',
    'ship_state' => 'ON',
    'ship_code' => 'K1A0B1',
    'ship_phone' => '1231231234',
    'ship_country' => 'US',
    'to_name' => 'John Doe',
    'to_addr1' => '361A Old Finch Avenue',
    'to_addr2' => '#103',
    'to_state' => 'ON',
    'to_city' => 'Toronto',
    'to_code' => 'M1B5K7',
    'to_country' => 'CA',
    'test' => true,
  ),
)
);

rs.request(
  {'action': 'submitshipment',
 'carrier': 'canada',
 'params': {'packages': [{'height': 5, 'length': 7, 'weight': 4, 'width': 5}],
            'service': 'DOM.EP',
            'ship_addr1': '123 Main St',
            'ship_city': 'Ottawa',
            'ship_code': 'K1A0B1',
            'ship_country': 'US',
            'ship_phone': '1231231234',
            'ship_state': 'ON',
            'shipper': 'RocketShipIt',
            'test': True,
            'to_addr1': '361A Old Finch Avenue',
            'to_addr2': '#103',
            'to_city': 'Toronto',
            'to_code': 'M1B5K7',
            'to_country': 'CA',
            'to_name': 'John Doe',
            'to_state': 'ON'}}

)

rs.request(
  {"carrier"=>"canada",
 "action"=>"submitshipment",
 "params"=>
  {"packages"=>[{"weight"=>4, "length"=>7, "width"=>5, "height"=>5}],
   "service"=>"DOM.EP",
   "shipper"=>"RocketShipIt",
   "ship_addr1"=>"123 Main St",
   "ship_city"=>"Ottawa",
   "ship_state"=>"ON",
   "ship_code"=>"K1A0B1",
   "ship_phone"=>"1231231234",
   "ship_country"=>"US",
   "to_name"=>"John Doe",
   "to_addr1"=>"361A Old Finch Avenue",
   "to_addr2"=>"#103",
   "to_state"=>"ON",
   "to_city"=>"Toronto",
   "to_code"=>"M1B5K7",
   "to_country"=>"CA",
   "test"=>true}}

)

rocketshipit.request(
  {
  "carrier": "canada",
  "action": "submitshipment",
  "params": {
    "packages": [
      {
        "weight": 4,
        "length": 7,
        "width": 5,
        "height": 5
      }
    ],
    "service": "DOM.EP",
    "shipper": "RocketShipIt",
    "ship_addr1": "123 Main St",
    "ship_city": "Ottawa",
    "ship_state": "ON",
    "ship_code": "K1A0B1",
    "ship_phone": "1231231234",
    "ship_country": "US",
    "to_name": "John Doe",
    "to_addr1": "361A Old Finch Avenue",
    "to_addr2": "#103",
    "to_state": "ON",
    "to_city": "Toronto",
    "to_code": "M1B5K7",
    "to_country": "CA",
    "test": true
  }
}
)

← All Canada Post examples