#Shippo PHP API wrapper
Shippo provides a shipping API that integrates with various shipping providers such as USPS, UPS, and Fedex.
Don't have an account? Sign up at https://goshippo.com/
PHP 5.2 and later.
-
Get Composer [http://getcomposer.org/]
-
Create/append the following to your
composer.json
file{ "require": { "shippo/shippo-php": "1.*" } }
-
Install via:
composer.phar install
-
To use the bindings, either user Composer's autoload:
require_once('vendor/autoload.php');
Or manually:
require_once('/path/to/vendor/shippo/shippo-php/lib/Shippo.php');
Simple usage looks like:
// API Key is Generated by getting the Basic
// Auth of your username and password;
Shippo::setCredentials('username', 'password')
$address = Shippo_Address::
create(
array(
'object_purpose' => 'QUOTE',
'name' => 'John Smith',
'company' => 'Initech',
'street1' => 'Greene Rd.',
'street_no' => '6512',
'street2' => '',
'city' => 'Woodridge',
'state' => 'IL',
'zip' => '60517',
'country' => 'US',
'phone' => '123 353 2345',
'email' => 'jmercouris@iit.com',
'metadata' => 'Customer ID 234;234'
));
echo(var_dump($address));
// Please check Example.php for more examples
Please see https://goshippo.com/docs/ for up-to-date documentation.