Amazon - Rates with Package Reference

Carrier
Amazon
Action
Rates with Package Reference
{
  "carrier": "amazon",
  "action": "getallrates",
  "params": {
    "client_id": "amzn1.application-oa2-client.abc123",
    "client_secret": "your-client-secret",
    "refresh_token": "Atzr|your-refresh-token",
    "application_id": "AmazonShipping_US",
    "packages": [
      {
        "weight": 5,
        "length": 10,
        "width": 8,
        "height": 4,
        "reference_value": "ORDER-12345"
      }
    ],
    "ship_name": "RocketShipIt",
    "ship_addr1": "123 Main St",
    "ship_city": "Whitehall",
    "ship_state": "MT",
    "ship_code": "59759",
    "ship_country": "US",
    "ship_phone": "1231231234",
    "to_name": "John Doe",
    "to_addr1": "940 Presidio Ave",
    "to_addr2": "#103",
    "to_city": "San Francisco",
    "to_state": "CA",
    "to_code": "94115",
    "to_country": "US",
    "weight_unit": "LB",
    "length_unit": "IN"
  }
}

<?php
$rs = new RocketShipIt;
$response = $rs->request(
array (
  'carrier' => 'amazon',
  'action' => 'getallrates',
  'params' => 
  array (
    'client_id' => 'amzn1.application-oa2-client.abc123',
    'client_secret' => 'your-client-secret',
    'refresh_token' => 'Atzr|your-refresh-token',
    'application_id' => 'AmazonShipping_US',
    'packages' => 
    array (
      0 => 
      array (
        'weight' => 5,
        'length' => 10,
        'width' => 8,
        'height' => 4,
        'reference_value' => 'ORDER-12345',
      ),
    ),
    'ship_name' => 'RocketShipIt',
    'ship_addr1' => '123 Main St',
    'ship_city' => 'Whitehall',
    'ship_state' => 'MT',
    'ship_code' => '59759',
    'ship_country' => 'US',
    'ship_phone' => '1231231234',
    'to_name' => 'John Doe',
    'to_addr1' => '940 Presidio Ave',
    'to_addr2' => '#103',
    'to_city' => 'San Francisco',
    'to_state' => 'CA',
    'to_code' => '94115',
    'to_country' => 'US',
    'weight_unit' => 'LB',
    'length_unit' => 'IN',
  ),
)
);

rs.request(
  {'action': 'getallrates',
 'carrier': 'amazon',
 'params': {'application_id': 'AmazonShipping_US',
            'client_id': 'amzn1.application-oa2-client.abc123',
            'client_secret': 'your-client-secret',
            'length_unit': 'IN',
            'packages': [{'height': 4,
                          'length': 10,
                          'reference_value': 'ORDER-12345',
                          'weight': 5,
                          'width': 8}],
            'refresh_token': 'Atzr|your-refresh-token',
            'ship_addr1': '123 Main St',
            'ship_city': 'Whitehall',
            'ship_code': '59759',
            'ship_country': 'US',
            'ship_name': 'RocketShipIt',
            'ship_phone': '1231231234',
            'ship_state': 'MT',
            'to_addr1': '940 Presidio Ave',
            'to_addr2': '#103',
            'to_city': 'San Francisco',
            'to_code': '94115',
            'to_country': 'US',
            'to_name': 'John Doe',
            'to_state': 'CA',
            'weight_unit': 'LB'}}

)

rs.request(
  {"carrier"=>"amazon",
 "action"=>"getallrates",
 "params"=>
  {"client_id"=>"amzn1.application-oa2-client.abc123",
   "client_secret"=>"your-client-secret",
   "refresh_token"=>"Atzr|your-refresh-token",
   "application_id"=>"AmazonShipping_US",
   "packages"=>
    [{"weight"=>5,
      "length"=>10,
      "width"=>8,
      "height"=>4,
      "reference_value"=>"ORDER-12345"}],
   "ship_name"=>"RocketShipIt",
   "ship_addr1"=>"123 Main St",
   "ship_city"=>"Whitehall",
   "ship_state"=>"MT",
   "ship_code"=>"59759",
   "ship_country"=>"US",
   "ship_phone"=>"1231231234",
   "to_name"=>"John Doe",
   "to_addr1"=>"940 Presidio Ave",
   "to_addr2"=>"#103",
   "to_city"=>"San Francisco",
   "to_state"=>"CA",
   "to_code"=>"94115",
   "to_country"=>"US",
   "weight_unit"=>"LB",
   "length_unit"=>"IN"}}

)

rocketshipit.request(
  {
  "carrier": "amazon",
  "action": "getallrates",
  "params": {
    "client_id": "amzn1.application-oa2-client.abc123",
    "client_secret": "your-client-secret",
    "refresh_token": "Atzr|your-refresh-token",
    "application_id": "AmazonShipping_US",
    "packages": [
      {
        "weight": 5,
        "length": 10,
        "width": 8,
        "height": 4,
        "reference_value": "ORDER-12345"
      }
    ],
    "ship_name": "RocketShipIt",
    "ship_addr1": "123 Main St",
    "ship_city": "Whitehall",
    "ship_state": "MT",
    "ship_code": "59759",
    "ship_country": "US",
    "ship_phone": "1231231234",
    "to_name": "John Doe",
    "to_addr1": "940 Presidio Ave",
    "to_addr2": "#103",
    "to_city": "San Francisco",
    "to_state": "CA",
    "to_code": "94115",
    "to_country": "US",
    "weight_unit": "LB",
    "length_unit": "IN"
  }
}
)

← All Amazon examples