Amazon - Rates

Carrier: Amazon
Action: Rates
Description: Example implementation for Amazon Rates
{
  "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
      }
    ],
    "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,
      ),
    ),
    '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, '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}],
   "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
      }
    ],
    "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"
  }
}
)
← Back to Amazon Examples

Other Amazon Examples

Authenticate
Example implementation for Amazon Authenticate
Label
Example implementation for Amazon Label
Label with Amazon Order
Example implementation for Amazon Label with Amazon Order
Purchase Shipment
Example implementation for Amazon Purchase Shipment
Rates with Insured Value and Items
Example implementation for Amazon Rates with Insured Value and Items
Tracking
Example implementation for Amazon Tracking
Void Shipment
Example implementation for Amazon Void Shipment