PHP code example of vitalybaev / yandex.delivery

1. Go to this page and download the library: Download vitalybaev/yandex.delivery 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/ */

    

vitalybaev / yandex.delivery example snippets


$methodKeys = [
    "getPaymentMethods" => "8fbde...11a58",
    "getSenderOrderLabel" => "464ff...579fb",
    ...
    "getPaymentMethods" => "2dd0...7d475f",
];

use Vitalybaev\YandexDelivery\Client;

$ydClient = new Client($clientId, $senderId, '1.0', $methodKeys);

$deliveries = $ydClient->call('searchDeliveryList', [
    'city_from' => 'Москва',
    'city_to' => 'Челябинск',
    'weight' => '1.25',
    'width' => '35',
    'height' => '25',
    'length' => '9',
    'total_cost' => '0',
    'order_cost' => '1920',
    'assessed_value' => '1920',
    'to_yd_warehouse' => '1',
]);