CompleteSale易趣API为多个项目 [英] CompleteSale Ebay API for multiple items

查看:359
本文介绍了CompleteSale易趣API为多个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前我有获取订单来自eBay​​列表(使用GetOrders API调用)做一些处理的系统。系统将显示订单列表,供用户查看更新状态出货(利用CompleteSale API调用)。

Currently I have a system which retrieves a list of orders from Ebay (using the GetOrders API call) to do some processing. System will display the list of orders for users to check to update status to Shipped (using CompleteSale API call).

我现在遇到的问题是,更新使用API​​状态的过程是一种缓慢的,因为CompleteSale被要求对每个订单(有可能是用户检查1000条记录,更新状态,在同一时间发货)。是否有可能派遣一个CompleteSale调用多个项目或者是有其他的API调用,能够?

The problem I am having now is that the process of updating the status using the API is kind of slow because the CompleteSale is being called for each order (possible that user check 1000 records to update status to Shipped at one time). Is it possible to send multiple items in one CompleteSale call or is there other API calls that is able to ?

感谢

推荐答案

您只需几个ItemIDs和TransactionIDs添加到一个请求,像这样(为PHP)

You simply add several ItemIDs and TransactionIDs to one request like this (for php)

$item_id_1 = 1234567890;
$item_id_2 = 0987654321;
$feedback = 'Thanks for a smooth transaction!';

$transaction_id_1 = 771234567819;
$transaction_id_2 = 770987654319;

$requestXmlBody = '<?xml version="1.0" encoding="utf-8" ?>';
$requestXmlBody .= '<CompleteSaleRequest xmlns="urn:ebay:apis:eBLBaseComponents">';

$requestXmlBody .= "<ItemID>$item_id_1</ItemID>";
$requestXmlBody .= "<ItemID>$item_id_2</ItemID>";

$requestXmlBody .= "<FeedbackInfo>";
$requestXmlBody .= "<CommentText>$feedback_text</CommentText>";
$requestXmlBody .= "<CommentType>Positive</CommentType>";
$requestXmlBody .= "</FeedbackInfo>";

$requestXmlBody .= "<Shipped>true</Shipped>";
$requestXmlBody .= "<TransactionID>$transaction_id_1</TransactionID>";
$requestXmlBody .= "<TransactionID>$transaction_id_2</TransactionID>";

$requestXmlBody .= "<RequesterCredentials><eBayAuthToken>$userToken</eBayAuthToken></RequesterCredentials>";
$requestXmlBody .= '</CompleteSaleRequest>';

我想,如果你使用orderIDs相反,它也应努力!请注意,您不能使用多个buyerUserIDs(收件人)。只使用ITEMID / TRANSACTIONID对。

I think it should also work if you use orderIDs instead! Please be aware that you cannot use multiple buyerUserIDs (for the recipient). Use only itemID/transactionID pairs.

这是基于该易趣PHP示例code这里提供:

This is based off the eBay PHP sample code provided here:

https://ebay.custhelp.com/app/answers/detail/a_id/1876/~/getorders-php-$c$c-sample

只要改变调用你需要的东西!

Just change the call to what you need!

希望这有助于!

这篇关于CompleteSale易趣API为多个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆