ykyazilim adlı üyeden alıntı: mesajı görüntüle
merhabalar,
pazaryerleri entegrasyonu için trendyol ve ticimaxdan siparişleri rahatlıkla çekebildim anak hepsiburadada bir sorun yaşıyorum.
https://oms-external-sit.hepsiburada.com/orders/merchantid/{merchantId}

dokumanında belirttiği gibi bu endpointi kullanıyorum.
authorization için yine dokumanda olduğu gibi merchantId:secret_key i base64 e çevirip gönderiyorum ancak 401 hatası veriyor, yardımcı olabilecek var mı?
Merhaba

username password formatı ile uygulamanız gerekebilir eskiden uğraşıyordum çok hatırlamıyorum ama dener misin ?


<?php
$merchantId = "MERCHANT_ID_BURAYA";
$username = "USERNAME_BURAYA";
$password = "SECRET_KEY_BURAYA";

$credentials = base64_encode($username . ':' . $password);

$url = "https://oms-external-sit.hepsiburada.com/orders/merchantid/" . $merchantId;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Basic ' . $credentials,
'Content-Type: application/json'
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "HTTP Code: " . $httpCode . "n";
echo "Response: " . $response . "n";