Webhook — различия между версиями

Материал из Меасофт
Перейти к: навигация, поиск
(Новая страница: «Передает данные по заказам и статусам на ваш URL. Пример запроса: <div style="font-size: 18px; color: #a92424;…»)
 
Строка 2: Строка 2:
  
 
Пример запроса:
 
Пример запроса:
 +
<source lang=xml>
 +
<?xml version="1.0"?>
 +
<order orderno="00032011" awb="000320214" orderno2="" ordercode="3482087" givencode="">
 +
    <barcode>00032011</barcode>
 +
    <sender>
 +
        <company>TEST</company>
 +
        <date/>
 +
        <time_min/>
 +
        <time_max/>
 +
    </sender>
 +
    <receiver>
 +
        <company>TEST2</company>
 +
        <person/>
 +
        <phone>+7 (495) 000-00-00</phone>
 +
        <contacts>
 +
            <phone>+74950000000</phone>
 +
        </contacts>
 +
        <inn/>
 +
        <zipcode/>
 +
        <date>2022-01-21</date>
 +
        <time_min/>
 +
        <time_max/>
 +
        <coords lat="55.7287" lon="37.6447"/>
 +
        <deliveryPIN/>
 +
    </receiver>
 +
    <pickup>NO</pickup>
 +
    <return>YES</return>
 +
    <weight>0.4</weight>
 +
    <return_weight/>
 +
    <quantity>1</quantity>
 +
    <paytype>NO</paytype>
 +
    <print_check>YES</print_check>
 +
    <service>1</service>
 +
    <return_service>1</return_service>
 +
    <type>1</type>
 +
    <return_type>1</return_type>
 +
    <waittime>0</waittime>
 +
    <price>0.00</price>
 +
    <inshprice>0.00</inshprice>
 +
    <enclosure/>
 +
    <instruction/>
 +
    <basestatus code="0"/>
 +
    <currcoords lat="" lon="" accuracy="" RequestDateTime=""/>
 +
    <receiverpays>NO</receiverpays>
 +
    <acceptpartially>YES</acceptpartially>
 +
    <status eventstore="NEW" eventtime="2022-01-20 17:08:43" createtimegmt="2022-01-20 17:08:43" message="" title="new">NEW</status>
 +
    <statushistory>
 +
        <status eventstore="NEW" eventtime="2022-01-20 17:08:43" createtimegmt="2022-01-20 17:08:43" message="" title="NEW" country="RU">NEW</status>
 +
    </statushistory>
 +
    <customstatecode>1</customstatecode>
 +
    <clientstatecode/>
 +
    <department/>
 +
    <return_message/>
 +
    <deliveredto/>
 +
    <delivereddate/>
 +
    <deliveredtime/>
 +
    <outstrbarcode/>
 +
    <arrival/>
 +
    <costcode/>
 +
    <receipt/>
 +
    <items>
 +
    </items>
 +
    <packages>
 +
    </packages>
 +
    <webhook_status_code>NEW</webhook_status_code>
 +
    <webhook_status_time>2022-01-20 20:08:43</webhook_status_time>
 +
    <webhook_statuses>
 +
        <webhook_status code="NEW" time="2022-01-20 20:08:43"/>
 +
    </webhook_statuses>
 +
</order>
 +
</source>
 +
  
 
<div style="font-size: 18px; color: #a92424; background-color: #ffdede; border: 1px solid #ebccd1; padding: 3px 10px 10px;">
 
<div style="font-size: 18px; color: #a92424; background-color: #ffdede; border: 1px solid #ebccd1; padding: 3px 10px 10px;">

Версия 06:26, 21 января 2022

Передает данные по заказам и статусам на ваш URL.

Пример запроса:

<?xml version="1.0"?>
<order orderno="00032011" awb="000320214" orderno2="" ordercode="3482087" givencode="">
    <barcode>00032011</barcode>
    <sender>
        <company>TEST</company>
        <date/>
        <time_min/>
        <time_max/>
    </sender>
    <receiver>
        <company>TEST2</company>
        <person/>
        <phone>+7 (495) 000-00-00</phone>
        <contacts>
            <phone>+74950000000</phone>
        </contacts>
        <inn/>
        <zipcode/>
        <date>2022-01-21</date>
        <time_min/>
        <time_max/>
        <coords lat="55.7287" lon="37.6447"/>
        <deliveryPIN/>
    </receiver>
    <pickup>NO</pickup>
    <return>YES</return>
    <weight>0.4</weight>
    <return_weight/>
    <quantity>1</quantity>
    <paytype>NO</paytype>
    <print_check>YES</print_check>
    <service>1</service>
    <return_service>1</return_service>
    <type>1</type>
    <return_type>1</return_type>
    <waittime>0</waittime>
    <price>0.00</price>
    <inshprice>0.00</inshprice>
    <enclosure/>
    <instruction/>
    <basestatus code="0"/>
    <currcoords lat="" lon="" accuracy="" RequestDateTime=""/>
    <receiverpays>NO</receiverpays>
    <acceptpartially>YES</acceptpartially>
    <status eventstore="NEW" eventtime="2022-01-20 17:08:43" createtimegmt="2022-01-20 17:08:43" message="" title="new">NEW</status>
    <statushistory>
        <status eventstore="NEW" eventtime="2022-01-20 17:08:43" createtimegmt="2022-01-20 17:08:43" message="" title="NEW" country="RU">NEW</status>
    </statushistory>
    <customstatecode>1</customstatecode>
    <clientstatecode/>
    <department/>
    <return_message/>
    <deliveredto/>
    <delivereddate/>
    <deliveredtime/>
    <outstrbarcode/>
    <arrival/>
    <costcode/>
    <receipt/>
    <items>
    </items>
    <packages>
    </packages>
    <webhook_status_code>NEW</webhook_status_code>
    <webhook_status_time>2022-01-20 20:08:43</webhook_status_time>
    <webhook_statuses>
        <webhook_status code="NEW" time="2022-01-20 20:08:43"/>
    </webhook_statuses>
</order>


В случае успешной обработки вебхука, наша система ожидает от вас ответ

{
    "result": true
}