1. Go to this page and download the library: Download stas-plov/jde-shipping 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/ */
stas-plov / jde-shipping example snippets
$jdeShipping = new JdeShipping();
$jdeShipping->setUser('1234');
$jdeShipping->setToken('1234');
$geo = new GeoSearchRequest();
$geo ->setMode(1);
$result = $jdeShipping->getGeoSearch($geo);
$order = (new OrderCreateRequest())
->setFrom("1125899906842653")
->setTo("1125899906842629")
->setVolume(1)
->setWeight(1)
->setPositions(2)
->setGruzdesc("Бытовая техника и электроника")
->setPayer(JdeShipping::PAYER_SENDER)
->setSender(
(new PersonSender)
->setAddr("Санкт-Петербург, Невский 30-2-12")
->setTitle("ООО Отправитель")
->setPhone("+79110000000")
)
->setReceiver(
(new PersonReceiver)
->setAddr("г. Москва, ул. 2-й Лучевой просек, д. 5В")
->setTitle("ООО Получатель")
->setPhone("+79110000000")
);
$result = $this->jdeShipping->sendOrderCreate($geoKladr);
$orderNumber = $result->getOrderNumber();