Download RocketShipIt from the My Account page and extract it somewhere in your local development environment.
For macOS and Linux you can extract by doing
tar -xf rocketshipit2-*.tar.gz
Next, download the
license.lic file from the My Account page and place it in the same directory.
The contents should be organized like this:
. ├── CHANGES.md ├── clients │ ├── nodejs │ │ ├── example.js │ │ └── rocketshipit.js │ ├── perl │ │ ├── example.pl │ │ └── RocketShipIt.pm │ ├── php │ │ ├── example.php │ │ ├── README.md │ │ └── RocketShipIt.php │ ├── python │ │ ├── example.py │ │ └── rocketshipit.py │ ├── README.md │ └── ruby │ ├── example.rb │ └── rocketshipit.rb ├── license.lic ├── LICENSE.txt ├── README.txt └── RocketShipIt
clients folder contains the RocketShipIt client libraries for each officially supported programming language. Next, navigate to your targeted language. For this guide we will be using
example.php in your favorite text editor.
Then uncomment the following line and fill it in with your RocketShipIt API key which can be found in the My Account page:
$rs->apiKey = 'ADD YOUR RocketShipIt API KEY HERE';
This will instruct the RocketShipIt PHP client to connect to RocketShipIt in the cloud as this is the easiest way to get started; however, the preferred way is to self-host the RocketShipIt API.
php example.php. You should get something like:
php example.php Array ( [meta] => Array ( [code] => 200 [error_message] => ) [data] => Array ( [errors] => Array (  => Array ( [code] => 1000 [description] => Authentication Failed [type] => ERROR ) ) [rates] => ) )
In this case, the Authentication Failed error is actually coming from the shipping carrier. If your RocketShipIt API key was invalid you would see an error in the
meta.error_message field. For more information about errors see: Errors
Once you fill in your carrier credentials in
example.php you should get a successful response:
Array ( [meta] => Array ( [code] => 200 [error_message] => ) [data] => Array ( [errors] => [rates] => Array (  => Array ( [desc] => UPS Next Day Air Early AM [rate] => 118.95 [negotiated_rate] => 117.76 [currency] => USD [service_code] => 14 [est_delivery_time] => 2018-02-26T08:30:00-00:00 [delivery_days] => 1 [package_type] => ...
Next, we encourage you to check out the API Explorer.