Skip to content

proclame/mikropakket-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mikropakket PHP Api

Latest Version on Packagist Total Downloads

This package is a PHP implementation for the Mikropakket API, with it, you can create and track parcels.

Installation

You can install the package via composer:

composer require proclame/mikropakket-php

Notes

  • Each service requires it's own API Key
  • ParcelLabelWebservice has a separate Testing endpoint
  • ParcelStatusService has a separate endpoint for Belgium & Netherlands
  • The use of the Preadvice Webservice is unclear / unnecessary and therefore unimplemented

Usage

// Create a parcel
$request = new Mikropakket\ParcelRequest();
$request->setApiKey((string) API_KEY, (bool) $isProduction);
$request->setAttributes($attributes = ["attribute_key" => "attribute_value"]);
$labelResponse = $request->request();

$labelResponse->shipmentParcel->stream("optional-filename.pdf"); // ->download() can be used as well

Endpoint Hosts

Service Test Netherlands Belgium
ParcelLabel https://mpws.mikropakket.nl:9220 https://mpws.mikropakket.nl:9200 https://mpws.mikropakket.nl:9200
ParcelStatus https://mpws.mikropakket.nl:8901 https://mpws.mikropakket.nl:8901 https://www.mikropakket.be:8901

Endpoints

info for contributors

Service Endpoint Usage
ParcelLabel POST /mikropakketparcellabel/api/v1-1/parcel-label/{pagesize} pagesize => 1: A6, 2: A5, 3: A4 (1 label per page)
Create a new Parcel Label
ParcelStatus GET /ParcelStatusService/api/v1-0/Get/Status
POST /ParcelStatusService/api/v1-0/Post/Status
Get status (tracking) of a parcel, use either Reference or ParcelNumber + Postal Code
ParcelStatus GET /ParcelStatusService/api/v1-0/Get/Signature
POST /ParcelStatusService/api/v1-0/Post/Signature
Get signature of a delivered parcel, use ParcelNumber + Postal Code

ParcelLabel Attributes

Key Required Example Default Description
SendersCountryCode * "BE" Countrycode from sender in isocode-1366 format
MPCustomerNumber * 123456456 Mikropakket Customer number
SendersName * "Jane Doe" Name of the parcel sender
SendersStreet * "Main Street" Senders street (no housenumber)
SendersHouseNumber * "123" Senders Housenumber
SendersZipcode * "2000" Senders Zip Code
SendersCity * "Antwerp" Senders City
ReceiversName * "Joe Dane" Receivers Name
ReceiversStreet * "Second Street" Receivers Street (no housenumber)
ReceiversHouseNumber * "456" Receivers Housenumber
ReceiversZipcode * "1000" Receivers Zip Code
ReceiversCity * "Brussels" Receivers City
ReceiversCountryCode * "BE" Countrycode addressee in isocode-1366 format
ParcelNumber 1234567890 Unique parcel nr, length 10 digits (unsure of purpose)
SendersPhoneNumber "0471234567" Senders Phone Number (unsure if used)
ReceiversPhoneNumber "0471234567" Receivers Phone Number (unsure if used)
ReceiversAcceptant "John Smith" Receivers personal name (eg: if ReceiversName = business name)
DeliveryNote "Leave at front door" Delivery directions
CashDeliveryInCents Not sure this is supported in BE
CashDeliveryReference Not sure this is supported in BE
DeliveryTimeWindow Timewindow for delivery on time in iso8601 format
PickUpDate Date of pick up at senders location
CreateRetourLabel 1 0 Create return label as well
PickupType Unsure
Reference "order-number" Reference for the order
ReceiversEmail "receiver@email.com" Receivers Email address (for notification)
SendersEmail "sender@email.com" Senders Email address
ReceiversNote Unsure
SendersNote Unsure
AlsoSaturday Not used anymore

Testing

  • @todo: Add tests

Contributing

Feel free to contribute by Forking the repo and submitting a pull request.

Security Vulnerabilities

Please submit security vulnerabilities by email to nick@proclame.be

Author

License

The MIT License (MIT). Please see License File for more information.

About

PHP API Implementation for Mikropakket

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages