Download the PHP package smart-dato/post-it-sdk without Composer

On this page you can find all versions of the php package smart-dato/post-it-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package post-it-sdk

Poste Italiane SDK for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Saloon-based client for the Poste Italiane (POST_IT) shipping API.

Installation

The service provider is auto-discovered. Optionally publish the config file:

Configuration

The SDK is credential-free by default — it does not read credentials from config or env. Pass them explicitly when constructing PostIt. The published config file (config/post-it-sdk.php) is provided as a convenience for single-account integrations that want to centralise defaults; multi-tenant applications typically store credentials per CarrierAccount row.

Token caching (multi-account)

By default the access token is cached in-memory on the instance and refreshed automatically as it nears the expires_in deadline. Pass a Laravel cache repository to share tokens across requests and processes:

The cache key is scoped per account — post-it:token:{clientId}:{hash}, where the hash folds in the base URL, scope, grant type, and secret. Several accounts may therefore share a single cache store and will never be served each other's token; a rotated secret transparently invalidates the cached entry.

Creating a waybill

PostItApiException is thrown when the upstream returns result.errorCode !== 0 or when the response is missing required fields.

International shipments

For international products (APT000903 / APT000904 / APT001013) add an InternationalData block and the customs fields on each declaration. Sender and receiver require contactName, email, phone, and a province for US/Canada destinations.

The customs/international fields are only serialised when set, so domestic payloads are unaffected.

Tracking a shipment

Each TrackingEventData also exposes occurredAt (?DateTimeImmutable), phase, and synthesisStatusDescription. Pass fullHistory: false to receive only the latest tracing state instead of the entire history.

International lookups

These supporting endpoints feed the data needed to compile international waybills. The country/TARIC lists take no request body.

Pickups & deposits

The pickup/deposit responses report success via an OK/KO outcome; the SDK throws PostItApiException on failure (except per-barcode release outcomes, which are exposed on DepositsReleaseResponseData::$items / failed()).

DigiPOD, delivery points, transit time & Green Index

Note: date formats and a few field names differ between the manual's tables and its JSON examples (e.g. pickupDate as YYYYMMDD vs YYYY-MM-DD, content/tipocontText). The SDK follows the example payloads and passes dates through as strings — verify against the test environment for your contract.

Enums for fixed values

Documented fixed-value fields are typed enums. Each exposes a lenient make() factory (trims, matches case-insensitively on value or case name, throws ValueError on a miss) and a null-returning tryMake():

WaybillData::$printFormat and $product accept the enum or a raw string, so contract-specific values not modelled here still pass through unchanged.

Testing

The SDK tests itself with Saloon's MockClient. Consumer applications can do the same:

Integration tests (live API)

The default suite is fully mocked. A separate tests/Integration suite hits the real Poste Italiane test environment ("kindergarden", PostIt::TEST_BASE_URL). Those tests skip themselves unless the required env vars are set, so they never break CI:

PostIt::test(...) is a convenience factory pointed at the test environment, mirroring PostIt::production(...).

Quality gate

License

MIT — see LICENSE.md.


All versions of post-it-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/contracts Version ^10.0||^11.0||^12.0||^13.0
saloonphp/saloon Version ^4.0
saloonphp/laravel-plugin Version ^4.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package smart-dato/post-it-sdk contains the following files

Loading the files please wait ...