Royal Mail - Label Domestic

Carrier: Royal Mail
Action: Label Domestic
Description: Example implementation for Royal Mail Label Domestic
{
    "carrier": "RoyalMail",
    "action": "SubmitShipment",
    "params": {
      "application_id": "",
      "client_id": "",
      "client_secret": "",
      "username": "",
      "password": "",
      "packages": [
        {
          "weight": 5,
          "length": 7
        },
        {
          "weight": 5,
          "length": 7
        }
      ],
      "service": "1",
      "service_offering": "CRL",
      "service_format": "P",
      "to_name": "John Doe",
      "to_email": "john.doe@email.com",
      "to_company": "Test Department",
      "to_addr1": "6 Sovereign Road",
      "to_addr2": "#103",
      "to_city": "Birmingham",
      "to_code": "B30 3HN",
      "to_country": "GB",
      "to_phone": "004407870701234",
      "reference_value": "DN123456",
      "image_type": "GIF",
      "test": true
    }
}

<?php
$rs = new RocketShipIt;
$response = $rs->request(
array (
  'carrier' => 'RoyalMail',
  'action' => 'SubmitShipment',
  'params' => 
  array (
    'application_id' => '',
    'client_id' => '',
    'client_secret' => '',
    'username' => '',
    'password' => '',
    'packages' => 
    array (
      0 => 
      array (
        'weight' => 5,
        'length' => 7,
      ),
      1 => 
      array (
        'weight' => 5,
        'length' => 7,
      ),
    ),
    'service' => '1',
    'service_offering' => 'CRL',
    'service_format' => 'P',
    'to_name' => 'John Doe',
    'to_email' => 'john.doe@email.com',
    'to_company' => 'Test Department',
    'to_addr1' => '6 Sovereign Road',
    'to_addr2' => '#103',
    'to_city' => 'Birmingham',
    'to_code' => 'B30 3HN',
    'to_country' => 'GB',
    'to_phone' => '004407870701234',
    'reference_value' => 'DN123456',
    'image_type' => 'GIF',
    'test' => true,
  ),
)
);

rs.request(
  {'action': 'SubmitShipment',
 'carrier': 'RoyalMail',
 'params': {'application_id': '',
            'client_id': '',
            'client_secret': '',
            'image_type': 'GIF',
            'packages': [{'length': 7, 'weight': 5},
                         {'length': 7, 'weight': 5}],
            'password': '',
            'reference_value': 'DN123456',
            'service': '1',
            'service_format': 'P',
            'service_offering': 'CRL',
            'test': True,
            'to_addr1': '6 Sovereign Road',
            'to_addr2': '#103',
            'to_city': 'Birmingham',
            'to_code': 'B30 3HN',
            'to_company': 'Test Department',
            'to_country': 'GB',
            'to_email': 'john.doe@email.com',
            'to_name': 'John Doe',
            'to_phone': '004407870701234',
            'username': ''}}

)

rs.request(
  {"carrier"=>"RoyalMail",
 "action"=>"SubmitShipment",
 "params"=>
  {"application_id"=>"",
   "client_id"=>"",
   "client_secret"=>"",
   "username"=>"",
   "password"=>"",
   "packages"=>[{"weight"=>5, "length"=>7}, {"weight"=>5, "length"=>7}],
   "service"=>"1",
   "service_offering"=>"CRL",
   "service_format"=>"P",
   "to_name"=>"John Doe",
   "to_email"=>"john.doe@email.com",
   "to_company"=>"Test Department",
   "to_addr1"=>"6 Sovereign Road",
   "to_addr2"=>"#103",
   "to_city"=>"Birmingham",
   "to_code"=>"B30 3HN",
   "to_country"=>"GB",
   "to_phone"=>"004407870701234",
   "reference_value"=>"DN123456",
   "image_type"=>"GIF",
   "test"=>true}}

)

rocketshipit.request(
  {
    "carrier": "RoyalMail",
    "action": "SubmitShipment",
    "params": {
      "application_id": "",
      "client_id": "",
      "client_secret": "",
      "username": "",
      "password": "",
      "packages": [
        {
          "weight": 5,
          "length": 7
        },
        {
          "weight": 5,
          "length": 7
        }
      ],
      "service": "1",
      "service_offering": "CRL",
      "service_format": "P",
      "to_name": "John Doe",
      "to_email": "john.doe@email.com",
      "to_company": "Test Department",
      "to_addr1": "6 Sovereign Road",
      "to_addr2": "#103",
      "to_city": "Birmingham",
      "to_code": "B30 3HN",
      "to_country": "GB",
      "to_phone": "004407870701234",
      "reference_value": "DN123456",
      "image_type": "GIF",
      "test": true
    }
}
)
← Back to All Examples