PHP code example of sylapi / courier-enadawca

1. Go to this page and download the library: Download sylapi/courier-enadawca library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sylapi / courier-enadawca example snippets



$courier = new Courier('Enadawca');

$courier->sandbox(true);
$courier->setLogin('123456');
$courier->setPassword('abc12345def');

$address = [
    'name' => 'Name Lastname',
    'company' => 'Company Name',
    'street' => 'Street 123/2A',
    'postcode' => '12-123',
    'city' => 'Warszawa',
    'country' => 'PL',
    'phone' => '602602602',
    'email' => 'name@example.com'
];

$courier->setSender($address);
$courier->setReceiver($address);

$courier->setOptions([
        'weight' => 3.00,
        'width' => 30.00,
        'height' => 50.00,
        'depth' => 10.00,
        'amount' => 2390.10,
        'cod' => true,
        'saturday' => false,
        'custom' => [
            'parcel_cost' => 8,
            'ubezpieczenie' => 1000,
            'gabaryt' => 'XXL'
        ],
        'references' => 'order #4567',
        'note' => 'Note'
    ]);