Red je Pakketje API documentation
Get it with composer
composer require jacobdekeizer/redjepakketje-client
Create the client
$client = new \jacobdekeizer\Client();
$client->setApiKey('api_key');
$shipment = (new \jacobdekeizer\Resources\Shipment())
->setCompanyName('Boeren BV')
->setName('Gijs Boersma')
->setStreet('Lange laan')
->setHouseNumber(29)
->setHouseNumberExtension('a')
->setZipcode('9281EM')
->setCity('Zevenaar')
->setTelephone('0602938172')
->setEmail('[email protected]')
->setReference('Bestelling 112')
->setNote('Some note')
->setName('My Company')
->setDeliveryDate(date('Y-m-d'))
->setProduct(\jacobdekeizer\Resources\Shipment::PRODUCT_SAME_DAY_PARCEL_STANDARD)
->setPickUpPoint('pick_up_point_uuid');
$shipmentResponse = $client->shipments()->create(
$shipment,
new \jacobdekeizer\Parameters\Shipments\Create() // optional
);
$label = $shipmentResponse->getLabel();
$shipmentsList = $client->shipments()->all(
new \jacobdekeizer\Parameters\Shipments\All() // optional
);
$shipmentResponse = $client->shipments()->get(
'your_tracking_code',
new \jacobdekeizer\Parameters\Shipments\GetLabel() // optional
);
$labelContents = $client->shipments()->getLabel(
'your_tracking_code',
new \jacobdekeizer\Parameters\Shipments\GetLabel() // optional
);
$returnShipment = (new \jacobdekeizer\Resources\ReturnShipment())
->setName('Gijs Boersma')
->setStreet('Lange laan')
->setHouseNumber(29)
->setHouseNumberExtension('a')
->setZipcode('9281EM')
->setCity('Zevenaar')
->setTelephone('0602938172')
->setEmail('[email protected]')
->setReference('Bestelling 112')
->setNote('Some note')
->setReceiverName('My company')
->setPickUpPoint('pick_up_point_uuid')
->setProduct(\jacobdekeizer\Resources\ReturnShipment::PRODUCT_SAME_DAY_PARCEL_STANDARD)
->setNote('some text');
$returnShipmentResponse = $client->returns()->create($returnShipment);
$returnShipmentsList = $client->returns()->all(
new \jacobdekeizer\Parameters\Returns\All() // optional
);
$returnShipment = $client->returns()->get('return_shipment_uuid');
$pickUpPoints = $client->pickUps()->all();
$pickUpPoint = $client->pickUps()->get('pick_up_point_uuid');
$contact = (new \jacobdekeizer\Resources\Contact())
->setFirstName('John')
->setLastName('Doe')
->setEmail('[email protected]')
->setTelephone('+31612345678')
->setGender(\jacobdekeizer\Resources\Contact::GENDER_MALE)
->setReference('abcdefg');
$contactResponse = $client->contacts()->create($contact);
$contacts = $client->contacts()->all();
$contact = $client->contacts()->get('3c8a9435-8b68-4d06-847d-4d1cd5f7c27a');
$contact = (new \jacobdekeizer\Resources\Contact())
->setUuid('uuid_of_contact')
->setFirstName('Jane')
->setLastName('Doe')
->setEmail('[email protected]')
->setTelephone('+31612345678')
->setGender(\jacobdekeizer\Resources\Contact::GENDER_FEMALE)
->setReference('abcdefg');
$contactResponse = $client->contacts()->update($contact);