Amazon - Label with Amazon Order

Carrier: Amazon
Action: Label with Amazon Order
Description: Example implementation for Amazon Label with Amazon Order
{
  "carrier": "amazon",
  "action": "SubmitShipment",
  "params": {
    "client_id": "amzn1.application-oa2-client.abc123",
    "client_secret": "your-client-secret",
    "refresh_token": "Atzr|your-refresh-token",
    "application_id": "AmazonShipping_US",
    "order": {
      "id": "111-7676169-9674624"
    },
    "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_phone": "1231231234",
    "ship_country": "US",
    "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",
    "image_type": "PNG",
    "weight_unit": "LB",
    "length_unit": "IN"
  }
}

<?php
$rs = new RocketShipIt;
$response = $rs->request(
array (
  'carrier' => 'amazon',
  'action' => 'SubmitShipment',
  'params' => 
  array (
    'client_id' => 'amzn1.application-oa2-client.abc123',
    'client_secret' => 'your-client-secret',
    'refresh_token' => 'Atzr|your-refresh-token',
    'application_id' => 'AmazonShipping_US',
    'order' => 
    array (
      'id' => '111-7676169-9674624',
    ),
    '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_phone' => '1231231234',
    'ship_country' => 'US',
    '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',
    'image_type' => 'PNG',
    'weight_unit' => 'LB',
    'length_unit' => 'IN',
  ),
)
);

rs.request(
  {'action': 'SubmitShipment',
 'carrier': 'amazon',
 'params': {'application_id': 'AmazonShipping_US',
            'client_id': 'amzn1.application-oa2-client.abc123',
            'client_secret': 'your-client-secret',
            'image_type': 'PNG',
            'length_unit': 'IN',
            'order': {'id': '111-7676169-9674624'},
            '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"=>"SubmitShipment",
 "params"=>
  {"client_id"=>"amzn1.application-oa2-client.abc123",
   "client_secret"=>"your-client-secret",
   "refresh_token"=>"Atzr|your-refresh-token",
   "application_id"=>"AmazonShipping_US",
   "order"=>{"id"=>"111-7676169-9674624"},
   "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_phone"=>"1231231234",
   "ship_country"=>"US",
   "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",
   "image_type"=>"PNG",
   "weight_unit"=>"LB",
   "length_unit"=>"IN"}}

)

rocketshipit.request(
  {
  "carrier": "amazon",
  "action": "SubmitShipment",
  "params": {
    "client_id": "amzn1.application-oa2-client.abc123",
    "client_secret": "your-client-secret",
    "refresh_token": "Atzr|your-refresh-token",
    "application_id": "AmazonShipping_US",
    "order": {
      "id": "111-7676169-9674624"
    },
    "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_phone": "1231231234",
    "ship_country": "US",
    "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",
    "image_type": "PNG",
    "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
Purchase Shipment
Example implementation for Amazon Purchase Shipment
Rates
Example implementation for Amazon Rates
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