This is a wrapper for the Csomagpiac API v1, which utilizes Laravel's built-in HTTP Requests class. The package manages authentication using a universal token. In its absence, it can also request the necessary token using a username + password combination. The token obtained in this manner is cached for faster access. The package supports switching between demo and production environments (demo vs. bestr).
API Documentation: Csomagpiac API v1
Requires
To get started with package, simply install it via Composer:
composer require cserepesmark/laravel-csomagpiac
The packages support the use of either a universal token or a username and password. However, the package prioritizes the use of the universal token.
Configure your API credentials in .env
CSOMAGPIAC_TOKEN=
CSOMAGPIAC_USERNAME=
CSOMAGPIAC_PASSWORD=
or in config/csomagpiac.php file:
'token' => env('CSOMAGPIAC_TOKEN', null),
'username' => env('CSOMAGPIAC_USERNAME', null),
'password' => env('CSOMAGPIAC_PASSWORD', null),
You can also easily switch between environments in .env
CSOMAGPIAC_LIVE_ENV=
or in config/csomagpiac.php file:
'live_env' => env('CSOMAGPIAC_LIVE_ENV', false),
See /examples
folder
ShipmentService method | API Name | API Endpoint |
---|---|---|
createShipment | new shipment | shipment/new |
downloadShipmentLabel | download shipment label | shipment/download |
deleteShipment | delete shipment | shipment/delete |
listShipments | list of shipments | shipment/list |
getShipmentStatus | shipment status | shipment/status |
listShipmentHistories | shipment history | shipment/history |
listAllStatuses | statuses | shipment/statuses |
ShipmentService method | API Name | API Endpoint |
---|---|---|
handleMplClose | mplClose | mplclose |
listMplCloses | mplClosesList | mplcloseslist |
downloadMplClose | mplClosePdf | mplclosepdf |
ShipmentService method | API Name | API Endpoint |
---|---|---|
listPickupPoints | pickuppoints | pickuppoints |
listLocations | pdpoints | locations/list |
listServices | services | client/services |
listLocationTypes | pdpointTypes | locations/types |
listHandlers | handlers | handlers |
The MIT License (MIT). Please see License File for more information.