USPS-REST - Rates International

Carrier: USPS-REST
Action: Rates International
Description: Example implementation for USPS-REST Rates International
{
  "carrier": "USPS-REST",
  "action": "GetAllRates",
  "params": {
    "test": true,
    "key": "your-key-from-authenticate-request",
    "price_type": "RETAIL",
    "packages": [
      {
        "length": 5,
        "width": 5,
        "height": 5,
        "weight": 16
      }
    ],
    "ship_code": "90210",
    "to_country": "CA"
  }
}

<?php
$rs = new RocketShipIt;
$response = $rs->request(
array (
  'carrier' => 'USPS-REST',
  'action' => 'GetAllRates',
  'params' => 
  array (
    'test' => true,
    'key' => 'your-key-from-authenticate-request',
    'price_type' => 'RETAIL',
    'packages' => 
    array (
      0 => 
      array (
        'length' => 5,
        'width' => 5,
        'height' => 5,
        'weight' => 16,
      ),
    ),
    'ship_code' => '90210',
    'to_country' => 'CA',
  ),
)
);

rs.request(
  {'action': 'GetAllRates',
 'carrier': 'USPS-REST',
 'params': {'key': 'your-key-from-authenticate-request',
            'packages': [{'height': 5, 'length': 5, 'weight': 16, 'width': 5}],
            'price_type': 'RETAIL',
            'ship_code': '90210',
            'test': True,
            'to_country': 'CA'}}

)

rs.request(
  {"carrier"=>"USPS-REST",
 "action"=>"GetAllRates",
 "params"=>
  {"test"=>true,
   "key"=>"your-key-from-authenticate-request",
   "price_type"=>"RETAIL",
   "packages"=>[{"length"=>5, "width"=>5, "height"=>5, "weight"=>16}],
   "ship_code"=>"90210",
   "to_country"=>"CA"}}

)

rocketshipit.request(
  {
  "carrier": "USPS-REST",
  "action": "GetAllRates",
  "params": {
    "test": true,
    "key": "your-key-from-authenticate-request",
    "price_type": "RETAIL",
    "packages": [
      {
        "length": 5,
        "width": 5,
        "height": 5,
        "weight": 16
      }
    ],
    "ship_code": "90210",
    "to_country": "CA"
  }
}
)
← Back to All Examples

Other USPS-REST Examples

Address Validation
Example implementation for USPS-REST Address Validation
Address Validation City/State from Zip
Example implementation for USPS-REST Address Validation City/State from Zip
Authenticate
Example implementation for USPS-REST Authenticate
Authenticate using apis endpoint
Example implementation for USPS-REST Authenticate using apis endpoint
Create Manifest
Example implementation for USPS-REST Create Manifest
Get Purchase Token
Example implementation for USPS-REST Get Purchase Token
Label
Example implementation for USPS-REST Label
Label Return
Example implementation for USPS-REST Label Return
Letter Rates
Example implementation for USPS-REST Letter Rates
Rate Single with rate indicator
Example implementation for USPS-REST Rate Single with rate indicator
Rates
Example implementation for USPS-REST Rates
Time in Transit
Example implementation for USPS-REST Time in Transit
Tracking
Example implementation for USPS-REST Tracking
Void Shipment
Example implementation for USPS-REST Void Shipment