LaravelPackages.net
Acme Inc.
Toggle sidebar
smart-dato/eushipments

EuShipments Laravel SDK

6.450
0
0.0.4
About smart-dato/eushipments

smart-dato/eushipments is a Laravel package for eushipments laravel sdk. It currently has 0 GitHub stars and 6.450 downloads on Packagist (latest version 0.0.4). Install it with composer require smart-dato/eushipments. Discover more Laravel packages by smart-dato or browse all Laravel packages to compare alternatives.

Last updated

EuShipments Laravel SDK

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

This is our EuShipments Laravel SDK. API documentation can be found here

Installation

You can install the package via composer:

composer require smart-dato/eushipments

You can publish the config file with:

php artisan vendor:publish --tag="eushipments-config"
EUSHIPMENTS_BASE_URL=https://test-api.inout.bg/api/v1/
EUSHIPMENTS_TOKEN=your-api-token

The test environment is https://test-api.inout.bg/api/v1/; production is https://api1.inout.bg/api/v1/.

Usage

use SmartDato\EuShipments\Data\AddressData;
use SmartDato\EuShipments\Data\AirWaybillData;
use SmartDato\EuShipments\Data\ShipmentData;
use SmartDato\EuShipments\Enums\Payer;
use SmartDato\EuShipments\Enums\Service;
use SmartDato\EuShipments\EuShipmentsConnector;
use SmartDato\EuShipments\Requests\Shipment\CreateShipmentRequest;

$connector = new EuShipmentsConnector();

$response = $connector->send(new CreateShipmentRequest(new ShipmentData(
    senderId: 1234,
    courierId: 999,
    waybillAvailableDate: now(),
    serviceName: Service::crossborder,
    recipient: new AddressData(
        name: 'Jane Doe',
        countryIsoCode: 'PL',
        streetName: 'ul. Przykladowa 1',
        buildingNumber: '1',
        addressText: 'ul. Przykladowa 1',
        phoneNumber: '000000000',
        cityName: 'Warszawa',
        zipCode: '00-001',
        contactPerson: 'Jane Doe',
        email: '[email protected]',
    ),
    awb: new AirWaybillData(
        parcels: 1,
        envelopes: 0,
        totalWeight: 0.7,
        openPackage: false,
        saturdayDelivery: false,
        referenceNumber: 'order-1001',
        products: 'Clothes',
        bankRepayment: 0,
        shipmentPayer: Payer::sender,
        declaredValue: 0,
        otherRepayment: null,
        observations: null,
        fragile: true,
        productsInfo: 'Clothes',
        piecesInPack: 1,
    ),
)));

senderId and courierId are the IDs from your EuShipments account.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

Comments