eBay API 调用以获取所有已售商品

发布于 2024-12-02 22:36:03 字数 1441 浏览 2 评论 0原文

我正在阅读一些有关 eBay API 的内容, 但我找不到任何有关获取我正在销售的所有“未完成和完成的文章”的列表的信息。

是在购买 API 还是交易中?有人可以帮我看看哪里吗? 或者几行代码?

我登录以

$request = "<?xml version='1.0' encoding='iso-8859-1'?><request>"
   . "<RequestUserId>" . $EBAY_UID . "</RequestUserId>"
   . "<RequestPassword>" . $EBAY_PWD . "</RequestPassword>"
   . "<ErrorLevel>0</ErrorLevel>"
   . "<DetailLevel>0</DetailLevel>"
   . "<SiteId>0</SiteId>"
   . "<Verb>GeteBayOfficialTime</Verb></request>";

$headers[] = "X-EBAY-API-COMPATIBILITY-LEVEL: 305";
$headers[] = "X-EBAY-API-SESSION-CERTIFICATE: ".DEVID.";".APPID.";".CERTID;
$headers[] = "X-EBAY-API-DEV-NAME: ".DEVID;
$headers[] = "X-EBAY-API-APP-NAME: ".APPID;
$headers[] = "X-EBAY-API-CERT-NAME: ".CERTID;
$headers[] = "X-EBAY-API-CALL-NAME: GeteBayOfficialTime";
$headers[] = "X-EBAY-API-SITEID: 0";
$headers[] = "X-EBAY-API-DETAIL-LEVEL: 0";
$headers[] = "Content-Type: text/xml";
$headers[] = "Content-Length: " . strlen($request);

var_dump($header);

$curl = curl_init("https://api.sandbox.ebay.com/ws/api.dll");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
$result = curl_exec($curl);

获取 eBay 时间,但现在我想获取包含以下详细信息的列表 我的产品 x 于 xx 付款,我于 xx 收到款项,价格为 xx,收到该文章的人称为...

I'm reading a little bit about the eBay API,
but I can't find anything about getting a list with all "open and finished articles" that I am selling.

Is it in the buying API or trading? Could someone help me a little bit where to look?
Or some lines of code?

I logged in with

$request = "<?xml version='1.0' encoding='iso-8859-1'?><request>"
   . "<RequestUserId>" . $EBAY_UID . "</RequestUserId>"
   . "<RequestPassword>" . $EBAY_PWD . "</RequestPassword>"
   . "<ErrorLevel>0</ErrorLevel>"
   . "<DetailLevel>0</DetailLevel>"
   . "<SiteId>0</SiteId>"
   . "<Verb>GeteBayOfficialTime</Verb></request>";

$headers[] = "X-EBAY-API-COMPATIBILITY-LEVEL: 305";
$headers[] = "X-EBAY-API-SESSION-CERTIFICATE: ".DEVID.";".APPID.";".CERTID;
$headers[] = "X-EBAY-API-DEV-NAME: ".DEVID;
$headers[] = "X-EBAY-API-APP-NAME: ".APPID;
$headers[] = "X-EBAY-API-CERT-NAME: ".CERTID;
$headers[] = "X-EBAY-API-CALL-NAME: GeteBayOfficialTime";
$headers[] = "X-EBAY-API-SITEID: 0";
$headers[] = "X-EBAY-API-DETAIL-LEVEL: 0";
$headers[] = "Content-Type: text/xml";
$headers[] = "Content-Length: " . strlen($request);

var_dump($header);

$curl = curl_init("https://api.sandbox.ebay.com/ws/api.dll");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
$result = curl_exec($curl);

to get the eBay time but now I want to get a list with details like
my product x was paid on the xx and I received the money on the xx and the price is xx and the person who got the article is called...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凉薄对峙 2024-12-09 22:36:03

要获取有关您在 eBay 上销售的商品的详细信息:

您需要获取交易 API< /a> 特别是 getOrders() 操作。

To get details about your item sold on eBay:

You need to get the Trading API and specifically getOrders() operation.

伤感在游骋 2024-12-09 22:36:03

花了很多时间阅读……最后。

是的,我使用交易 API。
如果您使用 PHP 的 eBay Acellerator Toolkit,文档中有一个 GetSellerTransactions 的示例 - 它返回所有待售商品的列表,以及状态等附加信息。

echo "<pre>";
print_r("begin");


require_once '../EbatNs/EbatNs_ServiceProxy.php';
require_once '../EbatNs/EbatNs_Logger.php';
require_once '../EbatNs/GetSellerTransactionsRequestType.php';
require_once '../EbatNs/GetSellerTransactionsResponseType.php';
$session = new EbatNs_Session('config/ebay.config.php');
$cs = new EbatNs_ServiceProxy($session);

//$cs->attachLogger(new EbatNs_Logger(true));
$req = new GetSellerTransactionsRequestType();
$now = time();
$start = $now - (3600 * 24 * 30);
$end = $start + (3600 * 24 * 30);
// period 60 days
$req->ModTimeFrom = gmdate('Y-m-d H:i:s', $start);
$req->ModTimeTo = gmdate('Y-m-d H:i:s', $end);
$req->DetailLevel = $Facet_DetailLevelCodeType->ReturnAll;

//#type $res GetSellerTransactionsResponseType
$res = $cs->GetSellerTransactions($req);
if ($res->Ack == $Facet_AckCodeType->Success)
{
echo "<pre>";
print_r($res);
} else
{
echo "<pre>failure:";
print_r($res);

}

it's took a lot of reading...and finaly.

Yes I use Trading API.
If you use eBay Acellerator Toolkit for PHP, in documentation there was an example for GetSellerTransactions - which returns a list of all items for selling with additional info for statuses and etc.

echo "<pre>";
print_r("begin");


require_once '../EbatNs/EbatNs_ServiceProxy.php';
require_once '../EbatNs/EbatNs_Logger.php';
require_once '../EbatNs/GetSellerTransactionsRequestType.php';
require_once '../EbatNs/GetSellerTransactionsResponseType.php';
$session = new EbatNs_Session('config/ebay.config.php');
$cs = new EbatNs_ServiceProxy($session);

//$cs->attachLogger(new EbatNs_Logger(true));
$req = new GetSellerTransactionsRequestType();
$now = time();
$start = $now - (3600 * 24 * 30);
$end = $start + (3600 * 24 * 30);
// period 60 days
$req->ModTimeFrom = gmdate('Y-m-d H:i:s', $start);
$req->ModTimeTo = gmdate('Y-m-d H:i:s', $end);
$req->DetailLevel = $Facet_DetailLevelCodeType->ReturnAll;

//#type $res GetSellerTransactionsResponseType
$res = $cs->GetSellerTransactions($req);
if ($res->Ack == $Facet_AckCodeType->Success)
{
echo "<pre>";
print_r($res);
} else
{
echo "<pre>failure:";
print_r($res);

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文