Download the PHP package budgetlens/intrapost without Composer
On this page you can find all versions of the php package budgetlens/intrapost. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download budgetlens/intrapost
More information about budgetlens/intrapost
Files in budgetlens/intrapost
Package intrapost
Short Description Fluent PHP client for the Intrapost API (mail, parcels, track & trace)
License MIT
Informations about the package intrapost
Intrapost PHP Client
Fluent PHP client for the Intrapost API: create shipments, generate labels, track parcels, and manage daily mail orders for PostNL, DHL, and GLS.
Requirements
Installation
Configuration
Standalone PHP
Laravel
The package includes auto-discovery, so the service provider and facade are registered automatically.
Publish the config file:
Add to your .env:
Use via dependency injection or facade:
Which API do you use when?
The Intrapost API is split into four resources. Below is a guide on when to use which one.
Mail Piece vs. Track & Trace
This is the most important distinction:
| Mail Piece | Track & Trace | |
|---|---|---|
| What | Letters and unregistered mail items | Parcels with track & trace |
| When | Sending regular mail (letters, cards, small mail items up to 2kg) | Sending parcels that need to be tracked |
| Tracking | No full track & trace, only registration and a label | Full track & trace with VZ code and tracking link |
| Weight | In grams (1-2000g) | In kilograms |
| Products | Standard, FixedDays | 12 product types (standard, insured, registered, mailbox parcel, evening delivery, etc.) |
| Extra options | Limited (dimensions, project code) | Extensive (dimensions, pickup point, customs, signature, age check, etc.) |
Rule of thumb: sending a letter or unregistered mail item? Use mailPiece(). Sending a parcel that needs to be tracked? Use trackTrace().
Overview of all calls
| Method | Use when... |
|---|---|
| Mail Piece | |
mailPiece()->create() |
You want to register a new mail piece and generate a label |
mailPiece()->order() |
You want to retrieve the daily order of registered mail pieces (collective order) |
mailPiece()->getLabel() |
You want to retrieve the label of a previously created mail piece again |
| Track & Trace | |
trackTrace()->create() |
You want to register a new parcel with track & trace (the most used call) |
trackTrace()->createMailboxParcel() |
You specifically want to create a mailbox parcel with a ZPL label |
trackTrace()->createLabels() |
You want to generate labels for multiple shipments in a single file |
trackTrace()->getRetourLabel() |
You want to create a return label for an existing shipment |
trackTrace()->cancel() |
You want to cancel a shipment (before it has been processed) |
trackTrace()->search() |
You want to search shipments by date, zipcode, reference, etc. |
trackTrace()->getFromId() |
You want to retrieve shipments by their Piece ID (max. 50 at a time) |
trackTrace()->getFromVz() |
You want to retrieve shipments by their VZ code (max. 50 at a time) |
| Order (Daily Mail) | |
order()->createDailyMailOption1() |
Create a daily mail order (option 1) |
order()->createDailyMailOption2() |
Create a daily mail order (option 2) |
order()->createDailyMailOption3() |
Create a daily mail order (option 3) |
| Utility | |
utility()->lookupAddress() |
You want to validate/look up an address by zipcode + house number |
utility()->productCodes() |
You want to request which product codes are available for your account |
utility()->pickupPointsForAddress() |
You want to search pickup points near an address (for ParcelViaPickupLocation) |
utility()->dropoffPointsForInternationalAddress() |
You want to search drop-off points for international shipments |
Typical flow
Usage
Mail Pieces
Create a mail piece:
Shorthand product methods:
Order mail pieces:
Get a label:
Track & Trace Parcels
Create a shipment:
Available product shorthand methods:
Create a mailbox parcel:
Generate labels:
Get a return label:
Cancel a shipment:
Search shipments:
Look up by ID or VZ code:
Pickup at a Service Point
International Shipments with Customs
Daily Mail Orders
Utilities
Address lookup:
Product codes:
Pickup & drop-off points:
Supported Carriers
| Carrier | Enum |
|---|---|
| PostNL | CarrierType::PostNL |
| DHL | CarrierType::DHL |
| GLS | CarrierType::GLS |
Label Formats
| Format | Enum |
|---|---|
| ZPL Zebra 150x100mm | LabelFormatType::ZplZebra150x100 |
| PDF 150x100mm | LabelFormatType::Pdf150x100 |
Error Handling
The client throws specific exceptions for different error scenarios:
Testing
Code Style
License
MIT License. See LICENSE for details.