<div class="tab">
<button class="tablinks" onclick="openSnippet(event, 'HTML')" id="defaultOpen">HTML</button>
<button class="tablinks" onclick="openSnippet(event, 'cURL')">cURL</button>
<button class="tablinks" onclick="openSnippet(event, 'PHP-cURL')">PHP-cURL</button>
</div>
<div id="HTML" class="tabcontent">
<p><pre>POST<p>POST /json.php HTTP/1.1
Host: api.boxberry.ru
Content-Type: application/x-www-form-urlencoded
Content-Length: 2266
token=d6f33e419c16131e5325cbd84d5d6000&method=ParselCreate&sdata=%7B%0A%20%20%22partner_token%22%3A%20%22%22%2C%0A%20%20%22updateByTrack%22%3A%20%22%22%2C%0A%20%20%22order_id%22%3A%20%22%D0%A2%D0%B5%D1%81%D1%82%D0%BE%D0%B2%D1%8B%D0%B9%20%D0%B7%D0%B0%D0%BA%D0%B0%D0%B7%20001%22%2C%0A%20%20%22PalletNumber%22%3A%20%22%22%2C%0A%20%20%22barcode%22%3A%20%22%22%2C%0A%20%20%22price%22%3A%20%222000.00%22%2C%0A%20%20%22payment_sum%22%3A%20%222000.00%22%2C%0A%20%20%22delivery_sum%22%3A%20%22250.00%22%2C%0A%20%20%22vid%22%3A%20%222%22%2C%0A%20%20%22kurdost%22%3A%20%7B%0A%20%20%20%20%22index%22%3A%20%22%22%2C%0A%20%20%20%20%22citi%22%3A%20%22%D0%9D%D0%B8%D0%B6%D0%BD%D0%B8%D0%B9%20%D0%9D%D0%BE%D0%B2%D0%B3%D0%BE%D1%80%D0%BE%D0%B4%22%2C%0A%20%20%20%20%22addressp%22%3A%20%22%D1%83%D0%BB%20%D0%94%D1%80%D1%83%D0%B6%D0%B1%D1%8B%2C%20%D0%B4%205%22%2C%0A%20%20%20%20%22delivery_date%22%3A%20%22%22%2C%0A%20%20%20%20%22timesfrom1%22%3A%20%22%22%2C%0A%20%20%20%20%22timesto1%22%3A%20%22%22%2C%0A%20%20%20%20%22comentk%22%3A%20%22%22%0A%20%20%7D%2C%0A%20%20%22shop%22%3A%20%7B%0A%20%20%20%20%22name%22%3A%20%22%22%2C%0A%20%20%20%20%22name1%22%3A%20%22010%22%0A%20%20%7D%2C%0A%20%20%22customer%22%3A%20%7B%0A%20%20%20%20%22fio%22%3A%20%22%D0%98%D0%B2%D0%B0%D0%BD%D0%BE%D0%B2%20%D0%98%D0%B2%D0%B0%D0%BD%20%D0%98%D0%B2%D0%B0%D0%BD%D0%BE%D0%B2%D0%B8%D1%87%22%2C%0A%20%20%20%20%22phone%22%3A%20%229001122333%22%2C%0A%20%20%20%20%22phone2%22%3A%20%22%22%2C%0A%20%20%20%20%22email%22%3A%20%22%22%0A%20%20%7D%2C%0A%20%20%22items%20%22%3A%20%5B%7B%0A%20%20%20%20%22id%22%3A%20%22252112-dget%22%2C%0A%20%20%20%20%22name%22%3A%20%22%D0%9A%D1%83%D1%80%D1%82%D0%BA%D0%B0%20%D0%B4%D0%B5%D1%82%D1%81%D0%BA%D0%B0%D1%8F%22%2C%0A%20%20%20%20%22UnitName%22%3A%20%22%D1%88%D1%82.%22%2C%0A%20%20%20%20%22nds%22%3A%20%22%22%2C%0A%20%20%20%20%22price%22%3A%20%221750%22%2C%0A%20%20%20%20%22quantity%22%3A%20%221%22%2C%0A%20%20%20%20%22marking_crpt%22%3A%20%22%22%0A%20%20%7D%5D%2C%0A%20%20%22notice%22%3A%20%22%22%2C%0A%20%20%22weights%22%3A%20%7B%0A%20%20%20%20%22weight%22%3A%20%22400%22%2C%0A%20%20%20%20%22barcode%22%3A%20%22%22%2C%0A%20%20%20%20%22x%22%3A%20%2220%22%2C%0A%20%20%20%20%22y%22%3A%20%2220%22%2C%0A%20%20%20%20%22z%22%3A%20%2210%22%0A%20%20%7D%2C%0A%20%20%22issue%22%3A%20%221%22%0A%7D</p>
</pre>
</div>
<div id="cURL" class="tabcontent">
<p>curl<p><pre>curl --location --request POST 'https://api.boxberry.ru/json.php' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'token=d6f33e419c16131e5325cbd84d5d6000' \
--data-urlencode 'method=ParselCreate' \
--data-urlencode 'sdata={
"partner_token": "",
"updateByTrack": "",
"order_id": "Тестовый заказ 001",
"PalletNumber": "",
"barcode": "",
"price": "2000.00",
"payment_sum": "2000.00",
"delivery_sum": "250.00",
"vid": "2",
"kurdost": {
"index": "",
"citi": "Нижний Новгород",
"addressp": "ул Дружбы, д 5",
"delivery_date": "",
"timesfrom1": "",
"timesto1": "",
"comentk": ""
},
"shop": {
"name": "",
"name1": "010"
},
"customer": {
"fio": "Иванов Иван Иванович",
"phone": "9001122333",
"phone2": "",
"email": ""
},
"items ": [{
"id": "252112-dget",
"name": "Куртка детская",
"UnitName": "шт.",
"nds": "",
"price": "1750",
"quantity": "1",
"marking_crpt": ""
}],
"notice": "",
"weights": {
"weight": "400",
"barcode": "",
"x": "20",
"y": "20",
"z": "10"
},
"issue": "1"
}'</pre></p>
</div>
<div id="PHP-cURL" class="tabcontent">
<p><?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.boxberry.ru/json.php',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => 'token=d6f33e419c16131e5325cbd84d5d6000&method=ParselCreate&sdata=%7B%0A%20%20%22partner_token%22%3A%20%22%22%2C%0A%20%20%22updateByTrack%22%3A%20%22%22%2C%0A%20%20%22order_id%22%3A%20%22%D0%A2%D0%B5%D1%81%D1%82%D0%BE%D0%B2%D1%8B%D0%B9%20%D0%B7%D0%B0%D0%BA%D0%B0%D0%B7%20001%22%2C%0A%20%20%22PalletNumber%22%3A%20%22%22%2C%0A%20%20%22barcode%22%3A%20%22%22%2C%0A%20%20%22price%22%3A%20%222000.00%22%2C%0A%20%20%22payment_sum%22%3A%20%222000.00%22%2C%0A%20%20%22delivery_sum%22%3A%20%22250.00%22%2C%0A%20%20%22vid%22%3A%20%222%22%2C%0A%20%20%22kurdost%22%3A%20%7B%0A%20%20%20%20%22index%22%3A%20%22%22%2C%0A%20%20%20%20%22citi%22%3A%20%22%D0%9D%D0%B8%D0%B6%D0%BD%D0%B8%D0%B9%20%D0%9D%D0%BE%D0%B2%D0%B3%D0%BE%D1%80%D0%BE%D0%B4%22%2C%0A%20%20%20%20%22addressp%22%3A%20%22%D1%83%D0%BB%20%D0%94%D1%80%D1%83%D0%B6%D0%B1%D1%8B%2C%20%D0%B4%205%22%2C%0A%20%20%20%20%22delivery_date%22%3A%20%22%22%2C%0A%20%20%20%20%22timesfrom1%22%3A%20%22%22%2C%0A%20%20%20%20%22timesto1%22%3A%20%22%22%2C%0A%20%20%20%20%22comentk%22%3A%20%22%22%0A%20%20%7D%2C%0A%20%20%22shop%22%3A%20%7B%0A%20%20%20%20%22name%22%3A%20%22%22%2C%0A%20%20%20%20%22name1%22%3A%20%22010%22%0A%20%20%7D%2C%0A%20%20%22customer%22%3A%20%7B%0A%20%20%20%20%22fio%22%3A%20%22%D0%98%D0%B2%D0%B0%D0%BD%D0%BE%D0%B2%20%D0%98%D0%B2%D0%B0%D0%BD%20%D0%98%D0%B2%D0%B0%D0%BD%D0%BE%D0%B2%D0%B8%D1%87%22%2C%0A%20%20%20%20%22phone%22%3A%20%229001122333%22%2C%0A%20%20%20%20%22phone2%22%3A%20%22%22%2C%0A%20%20%20%20%22email%22%3A%20%22%22%0A%20%20%7D%2C%0A%20%20%22items%20%22%3A%20%5B%7B%0A%20%20%20%20%22id%22%3A%20%22252112-dget%22%2C%0A%20%20%20%20%22name%22%3A%20%22%D0%9A%D1%83%D1%80%D1%82%D0%BA%D0%B0%20%D0%B4%D0%B5%D1%82%D1%81%D0%BA%D0%B0%D1%8F%22%2C%0A%20%20%20%20%22UnitName%22%3A%20%22%D1%88%D1%82.%22%2C%0A%20%20%20%20%22nds%22%3A%20%22%22%2C%0A%20%20%20%20%22price%22%3A%20%221750%22%2C%0A%20%20%20%20%22quantity%22%3A%20%221%22%2C%0A%20%20%20%20%22marking_crpt%22%3A%20%22%22%0A%20%20%7D%5D%2C%0A%20%20%22notice%22%3A%20%22%22%2C%0A%20%20%22weights%22%3A%20%7B%0A%20%20%20%20%22weight%22%3A%20%22400%22%2C%0A%20%20%20%20%22barcode%22%3A%20%22%22%2C%0A%20%20%20%20%22x%22%3A%20%2220%22%2C%0A%20%20%20%20%22y%22%3A%20%2220%22%2C%0A%20%20%20%20%22z%22%3A%20%2210%22%0A%20%20%7D%2C%0A%20%20%22issue%22%3A%20%221%22%0A%7D',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/x-www-form-urlencoded'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
</p>
</div>
|