本文介绍了eBay API CompleteSale调用多个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 目前,我有一个系统可以从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 ?谢谢推荐答案您只需将多个ItemID和TransactionID添加到这样的一个请求中(对于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>';我认为,如果您使用orderID,它也应该起作用!请注意,您不能使用多个buyerUserID(用于收件人)。仅使用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.这是基于此处提供的eBay PHP示例代码:This is based off the eBay PHP sample code provided here: https://ebay.custhelp.com/ app / answers / detail / a_id / 1876 /〜/ getorders-php-code-sample只需将通话更改为您所需!Just change the call to what you need!希望这会有所帮助! 这篇关于eBay API CompleteSale调用多个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-15 07:40