To obtain a Shiptheory API Token you'll need to run the below script, bear in mind that authentication tokens expire after 60 minutes.


$data = json_encode(

        "email" => "",

        "password" => "yourpassword"


$ch = curl_init('');

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(

    'Accept: application/json',

    'Content-Type: application/json',

    'Content-Length: ' . strlen($data))

$result = curl_exec($ch);

echo $result;


Within the response will either be an error or the API token you'll need to make any other requests through Shiptheory, if you have any questions about this, feel free to contact support and we'll be happy to help or take a read through our API documentation