USPS - Label International Priority Mail

Carrier: USPS
Action: Label International Priority Mail
Description: Example implementation for USPS Label International Priority Mail
{
  "carrier": "USPS",
  "action": "SubmitShipment",
  "params": {
    "username": "YOUR_USERNAME",
    "packages": [
      {
        "weight": 5,
        "length": 6,
        "width": 7,
        "height": 8
      }
    ],
    "customs": [
      {
        "customs_description": "my shipment",
        "customs_quantity": 1,
        "customs_weight": 2.5,
        "customs_value": 5.0,
        "customs_hs_tariff": "",
        "customs_origin_country": "US"
      }
    ],
    "shipper": "RocketShipIt",
    "ship_addr1": "123 Main St",
    "ship_city": "Whitehall",
    "ship_state": "MT",
    "ship_code": "59759",
    "ship_phone": "1231231234",
    "to_name": "Toronto Zoo",
    "to_addr1": "2000 Meadowvale Road",
    "to_state": "MB",
    "to_city": "Toronto",
    "to_code": "M1B5K7",
    "to_phone": "1231231234",
    "to_country": "CA",
    "test": true,
    "service": "US-PMI",
    "reference_value": "asdf",
    "customs_content_type": "SAMPLE"
  }
}

<?php
$rs = new RocketShipIt;
$response = $rs->request(
array (
  'carrier' => 'USPS',
  'action' => 'SubmitShipment',
  'params' => 
  array (
    'username' => 'YOUR_USERNAME',
    'packages' => 
    array (
      0 => 
      array (
        'weight' => 5,
        'length' => 6,
        'width' => 7,
        'height' => 8,
      ),
    ),
    'customs' => 
    array (
      0 => 
      array (
        'customs_description' => 'my shipment',
        'customs_quantity' => 1,
        'customs_weight' => 2.5,
        'customs_value' => 5.0,
        'customs_hs_tariff' => '',
        'customs_origin_country' => 'US',
      ),
    ),
    'shipper' => 'RocketShipIt',
    'ship_addr1' => '123 Main St',
    'ship_city' => 'Whitehall',
    'ship_state' => 'MT',
    'ship_code' => '59759',
    'ship_phone' => '1231231234',
    'to_name' => 'Toronto Zoo',
    'to_addr1' => '2000 Meadowvale Road',
    'to_state' => 'MB',
    'to_city' => 'Toronto',
    'to_code' => 'M1B5K7',
    'to_phone' => '1231231234',
    'to_country' => 'CA',
    'test' => true,
    'service' => 'US-PMI',
    'reference_value' => 'asdf',
    'customs_content_type' => 'SAMPLE',
  ),
)
);

rs.request(
  {'action': 'SubmitShipment',
 'carrier': 'USPS',
 'params': {'customs': [{'customs_description': 'my shipment',
                         'customs_hs_tariff': '',
                         'customs_origin_country': 'US',
                         'customs_quantity': 1,
                         'customs_value': 5.0,
                         'customs_weight': 2.5}],
            'customs_content_type': 'SAMPLE',
            'packages': [{'height': 8, 'length': 6, 'weight': 5, 'width': 7}],
            'reference_value': 'asdf',
            'service': 'US-PMI',
            'ship_addr1': '123 Main St',
            'ship_city': 'Whitehall',
            'ship_code': '59759',
            'ship_phone': '1231231234',
            'ship_state': 'MT',
            'shipper': 'RocketShipIt',
            'test': True,
            'to_addr1': '2000 Meadowvale Road',
            'to_city': 'Toronto',
            'to_code': 'M1B5K7',
            'to_country': 'CA',
            'to_name': 'Toronto Zoo',
            'to_phone': '1231231234',
            'to_state': 'MB',
            'username': 'YOUR_USERNAME'}}

)

rs.request(
  {"carrier"=>"USPS",
 "action"=>"SubmitShipment",
 "params"=>
  {"username"=>"YOUR_USERNAME",
   "packages"=>[{"weight"=>5, "length"=>6, "width"=>7, "height"=>8}],
   "customs"=>
    [{"customs_description"=>"my shipment",
      "customs_quantity"=>1,
      "customs_weight"=>2.5,
      "customs_value"=>5.0,
      "customs_hs_tariff"=>"",
      "customs_origin_country"=>"US"}],
   "shipper"=>"RocketShipIt",
   "ship_addr1"=>"123 Main St",
   "ship_city"=>"Whitehall",
   "ship_state"=>"MT",
   "ship_code"=>"59759",
   "ship_phone"=>"1231231234",
   "to_name"=>"Toronto Zoo",
   "to_addr1"=>"2000 Meadowvale Road",
   "to_state"=>"MB",
   "to_city"=>"Toronto",
   "to_code"=>"M1B5K7",
   "to_phone"=>"1231231234",
   "to_country"=>"CA",
   "test"=>true,
   "service"=>"US-PMI",
   "reference_value"=>"asdf",
   "customs_content_type"=>"SAMPLE"}}

)

rocketshipit.request(
  {
  "carrier": "USPS",
  "action": "SubmitShipment",
  "params": {
    "username": "YOUR_USERNAME",
    "packages": [
      {
        "weight": 5,
        "length": 6,
        "width": 7,
        "height": 8
      }
    ],
    "customs": [
      {
        "customs_description": "my shipment",
        "customs_quantity": 1,
        "customs_weight": 2.5,
        "customs_value": 5.0,
        "customs_hs_tariff": "",
        "customs_origin_country": "US"
      }
    ],
    "shipper": "RocketShipIt",
    "ship_addr1": "123 Main St",
    "ship_city": "Whitehall",
    "ship_state": "MT",
    "ship_code": "59759",
    "ship_phone": "1231231234",
    "to_name": "Toronto Zoo",
    "to_addr1": "2000 Meadowvale Road",
    "to_state": "MB",
    "to_city": "Toronto",
    "to_code": "M1B5K7",
    "to_phone": "1231231234",
    "to_country": "CA",
    "test": true,
    "service": "US-PMI",
    "reference_value": "asdf",
    "customs_content_type": "SAMPLE"
  }
}
)
← Back to All Examples

Other USPS Examples

Address Validation
Example implementation for USPS Address Validation
Address Validation City/State from Zip
Example implementation for USPS Address Validation City/State from Zip
Create Manifest
Example implementation for USPS Create Manifest
EMRS Return Label
Example implementation for USPS EMRS Return Label
Label
Example implementation for USPS Label
Label First Class Mail International
Example implementation for USPS Label First Class Mail International
Label International Express Mail
Example implementation for USPS Label International Express Mail
Rate International
Example implementation for USPS Rate International
Rate Regional
Example implementation for USPS Rate Regional
Rates
Example implementation for USPS Rates
Rates First Class
Example implementation for USPS Rates First Class
Time in Transit
Example implementation for USPS Time in Transit
Tracking
Example implementation for USPS Tracking