У Яндекса в документации есть
Запрос:
curl -i -H 'Content-Type: application/xml'-X POST 'https://api.partner.market.yandex.ru/v2/campaigns/12345/outlets.xml'
Тело POST-запроса:
-d '<outlet name="На Озёрной" type="DEPOT" coords="20.4522144, 54.7104264" is-main="false" shop-outlet-code="419" visibility="VISIBLE">
<address region-id="22" street="ОЗЕРНАЯ" number="20А"/>
<phones>
<phone>+7 (401) 212-22-32 #123</phone>
</phones>
<working-schedule work-in-holiday="false">
<schedule-items>
<schedule-item start-day="MONDAY" end-day="FRIDAY" start-time="09:00" end-time="19:00"/>
<schedule-item start-day="SATURDAY" end-day="SATURDAY" start-time="10:00" end-time="16:00"/>
</schedule-items>
</working-schedule>
<delivery-rules>
<delivery-rule cost="285" min-delivery-days="19" max-delivery-days="30" delivery-service-id="100" order-before="24" price-free-pickup="120"/>
</delivery-rules>
<emails>
<email>example-shop@yandex.ru</email>
</emails>
</outlet>'
Как его выполнить с помощью php curl?
Пытаюсь сделать как то так
$request = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<outlet name="На Озёрной" type="DEPOT" coords="20.4522144, 54.7104264" is-main="false" shop-outlet-code="419" visibility="VISIBLE">
<address region-id="22" street="ОЗЕРНАЯ" number="20А"/>
<phones>
<phone>+7 (401) 212-22-32 #123</phone>
</phones>
<working-schedule work-in-holiday="false">
<schedule-items>
<schedule-item start-day="MONDAY" end-day="FRIDAY" start-time="09:00" end-time="19:00"/>
<schedule-item start-day="SATURDAY" end-day="SATURDAY" start-time="10:00" end-time="16:00"/>
</schedule-items>
</working-schedule>
<delivery-rules>
<delivery-rule cost="285" min-delivery-days="19" max-delivery-days="30" delivery-service-id="100" order-before="24" price-free-pickup="120"/>
</delivery-rules>
<emails>
<email>example-shop@yandex.ru</email>
</emails>
</outlet>
XML;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
PS Техподдержка Яндекса пишет, что я не передаю тело запроса.