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" => "firstname.lastname@example.org",
"password" => "yourpassword"
$ch = curl_init('https://shiptheory.com/api/token');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Length: ' . strlen($data))
$result = curl_exec($ch);
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