Webhook

Материал из Меасофт
Перейти к: навигация, поиск

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


Чтобы создать оповещение о статусах на ваш URL, в разделе интеграции создайте интеграцию с типом Webhhok. В настройках укажите URL на который мы будем слать уведомление.


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

<?xml version="1.0"?>
<order orderno="00032011" awb="00032011" orderno2="" ordercode="0000032" 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
}