Hello Tristan,
Thank you for the information. We have tested your parameters using the php library, hopefully this will help you to see how it is working.
Here is the PHP code:
// setup stuart client
$environment = \Stuart\Infrastructure\Environment::SANDBOX;
$api_client_id = 'your_client_id'; // can be found here: https://dashboard.sandbox.stuart.com/settings/api
$api_client_secret = 'your_client_secret'; // can be found here: https://dashboard.sandbox.stuart.com/settings/api
$authenticator = new \Stuart\Infrastructure\Authenticator($environment, $api_client_id, $api_client_secret);
$httpClient = new \Stuart\Infrastructure\HttpClient($authenticator);
$client = new \Stuart\Client($httpClient);
// create a new job
$job = new \Stuart\Job();
$job->addPickup('147 St Johns Hill, SW11 1TQ')
->setContactFirstName('Tristan')
->setContactLastName('Allen')
->setContactCompany('PowderKeg');
$job->addDropOff('135-137 Stephendale Rd, Fulham, SW6 2PR')
->setPackageType('small')
->setContactCompany('The Sands End')
->setContactFirstName('Tristen')
->setContactLastName('Allen');
$created_job = client->createJob($job);
// showing the result in the console
print_r($created_job);
And here the response we’ve got in the console:
Stuart\Job Object
(
[id:Stuart\Job:private] => 131343
[transportType:Stuart\Job:private] =>
[assignmentCode:Stuart\Job:private] =>
[status:Stuart\Job:private] => searching
[pickups:Stuart\Job:private] => Array
(
[0] => Stuart\Pickup Object
(
[pickupAt:Stuart\Pickup:private] =>
[address:Stuart\Location:private] => 147 St John's Hill, SW11 1TQ, London, london, The United Kingdom, 147 St John's Hill, SW11 1TQ, London, The United Kingdom
[comment:Stuart\Location:private] =>
[phone:Stuart\Location:private] =>
[email:Stuart\Location:private] =>
[firstName:Stuart\Location:private] => Tristan
[lastName:Stuart\Location:private] => Allen
[company:Stuart\Location:private] => PowderKeg
)
)
[dropOffs:Stuart\Job:private] => Array
(
[0] => Stuart\DropOff Object
(
[packageType:Stuart\DropOff:private] => small
[packageDescription:Stuart\DropOff:private] =>
[clientReference:Stuart\DropOff:private] =>
[dropoffAt:Stuart\DropOff:private] =>
[address:Stuart\Location:private] => 135-137 Stephendale Rd, SW6 2PJ, London, london, The United Kingdom, 135-137 Stephendale Rd, SW6 2PJ, London, The United Kingdom
[comment:Stuart\Location:private] =>
[phone:Stuart\Location:private] =>
[email:Stuart\Location:private] =>
[firstName:Stuart\Location:private] => Tristen
[lastName:Stuart\Location:private] => Allen
[company:Stuart\Location:private] => The Sands End
)
)
[deliveries:Stuart\Job:private] => Array
(
[0] => Stuart\Delivery Object
(
[id:Stuart\Delivery:private] => 133153
[status:Stuart\Delivery:private] => pending
[trackingUrl:Stuart\Delivery:private] => https://stuart.sandbox.followmy.delivery/133153/c34fd19302cae8855d048fa4280b27e8
[origin:Stuart\Delivery:private] => Stuart\Pickup Object
(
[pickupAt:Stuart\Pickup:private] =>
[address:Stuart\Location:private] => 147 St John's Hill, SW11 1TQ, London, london, The United Kingdom, 147 St John's Hill, SW11 1TQ, London, The United Kingdom
[comment:Stuart\Location:private] =>
[phone:Stuart\Location:private] =>
[email:Stuart\Location:private] =>
[firstName:Stuart\Location:private] => Tristan
[lastName:Stuart\Location:private] => Allen
[company:Stuart\Location:private] => PowderKeg
)
[destination:Stuart\Delivery:private] => Stuart\DropOff Object
(
[packageType:Stuart\DropOff:private] => small
[packageDescription:Stuart\DropOff:private] =>
[clientReference:Stuart\DropOff:private] =>
[dropoffAt:Stuart\DropOff:private] =>
[address:Stuart\Location:private] => 135-137 Stephendale Rd, SW6 2PJ, London, london, The United Kingdom, 135-137 Stephendale Rd, SW6 2PJ, London, The United Kingdom
[comment:Stuart\Location:private] =>
[phone:Stuart\Location:private] =>
[email:Stuart\Location:private] =>
[firstName:Stuart\Location:private] => Tristen
[lastName:Stuart\Location:private] => Allen
[company:Stuart\Location:private] => The Sands End
)
)
)
[distance:Stuart\Job:private] => 2.22
[duration:Stuart\Job:private] => 8
[pricing:Stuart\Job:private] => Stuart\Pricing Object
(
[priceTaxIncluded:Stuart\Pricing:private] => 6.3
[priceTaxExcluded:Stuart\Pricing:private] => 5.25
)
)