My eBay integration just broke after months of working properly and I’m not sure if its a bug or not on their end.
My buyer made 2 transactions of two different items and then combined them to save shipping. All this happened in a matter of a few minutes.
This had the following result :
- New sales record created (which incidentally doesn’t show up in seller manager)
- New
OrderId
created for the combined order. Contains the two transactions (as expected). ThisOrderId
was assigned to the original 2 orders and the combined one (not expected!) - Three orders returned in call to
GetOrders
. All have the sameOrderId
value - The
CreatedTime
on eachOrderType
returned is different for each with the most recent order having the latest time (as expected).
What I’m trying to figure out is how I’m supposed to know not to ship all 3 orders. If my code hadn’t been trying to put these orders into a dictionary then I wouldn’t even have known there were duplicate OrderId
values being returned.
I’m hoping there’s a property somewhere that indicates the order record was combined into another order – but I can’t find it.
Am I supposed to look at the time of the order and pick the most recent one? Or is there a way to exclude transactions that have been subsequently combined from the search results.
3
Answers
This is my C# code to check for dupes of this nature and return only the latest order. There's a lot of assertion checking in here but it hasn't crashed yet - then again I don't know if the codepath where
o.Count() != 1
has ever been hit yet.It doesn’t guarantee that the latest order is the one with the combined order nodes. In my experience, it happened that the later order is only a suppose line item of the previous order. We reported countless times to ebay support on this and they only say that they’ll fix it soon.
My solution for now is compare with the order’s PayPal transaction using the GetTransactionDetails API. I assumed the PayPal transaction should have the combined order records. What I did is, I created a map of ebay line items ({ItemID:Quantity}) and created a map of paypal transaction line items ({Number:Quantity}) then compared the two with the paypal transaction map as the reference. If an ebay order node doesn’t match with the paypal transaction, then ignore it and proceed to next order node until the one with the combined order is met. Sometimes, the one with combined order records comes first of the order nodes of the GetOrdersResponse, so just ignore the next ones when detected. Hope I helped.
Looks like eBay orders are created when a buyer commits to buy for example winning the auction. So when they are about to make the payment they can combine these orders together and it would create another order with the transactions. I am having the same issues as well, just thinking what if we pass the order status only to retrieve the complete orders?
A good presentation by eBay about the API https://youtu.be/n4UDGrO6H_g?t=1111