PHP code example of yasserbelhimer / laravel-yalidine-dz-api

1. Go to this page and download the library: Download yasserbelhimer/laravel-yalidine-dz-api 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/ */

    

yasserbelhimer / laravel-yalidine-dz-api example snippets


    $parcels = Yalidine::getParcels([]);

    $trackings = ['YAL-PAR1','YAL-PAR2'....]; // list of your parcels tracking 
    $parcels = Yalidine::getParcels($trackings);

    $parcels = array( // the array that contains all the parcels
        array ( // first parcel
            "order_id"=>"MyFirstOrder",
            "firstname"=>"Brahim",
            "familyname"=>"Mohamed",
            "contact_phone"=>"0123456789,",
            "address"=>"Cité Kaidi",
            "to_commune_name"=>"Bordj El Kiffan",
            "to_wilaya_name"=>"Alger",
            "product_list"=>"Presse à café",
            "price"=>3000,
            "freeshipping"=> true,
            "is_stopdesk"=> false,
            "has_exchange"=> 0,
            "product_to_collect" => null
        ),
        array ( // second parcel
            "order_id" =>"MySecondOrder",
            "firstname"=>"رفيدة",
            "familyname"=>"بن مهيدي",
            "contact_phone"=>"0123456789",
            "address"=>"حي الياسمين",
            "to_commune_name"=>"Ouled Fayet",
            "to_wilaya_name"=>"Alger",
            "product_list"=>"كتب الطبخ",
            "price"=>2400,
            "freeshipping"=>0,
            "is_stopdesk"=>0,
            "has_exchange"=> false,
        ),
        array ( // third parcel
            ...
        ),
        array( // etc
            ...
        )
    );
    $response = Yalidine::createParcels($parcels );

    $trackings = ['YAL-PAR1','YAL-PAR2'....]; // list of your parcels tracking 
    $deliveryFees = Yalidine::deleteParcels($trackings);

    $deliveryFees = Yalidine::getDeliveryFees();