question

foxytronics_llc avatar image
0 Likes"
foxytronics_llc asked ·

What date to use in CreateTimeFrom to reliably get new orders?

I need to import ebay orders into my ecommerce system outside of ebay. Currently I simply set a date range of one day, but this is inefficient and is going to start returning huge responses once I start getting more orders. I need a way to only retrieve new orders from ebay. The only fields that will allow me to do this are CreateTimeFrom and CreateTimeTo. My question is, what values from the Order response correspond to these fields? In other words, when I import orders I need to store some date in my database, then when I get orders the next time I will use this date for the CreateTimeFrom value in order to only retrieve new orders. However, there are a bunch of dates returned in the Order responses and I don't know which date I should use. The documentation is confusing.. Thanks for your help. ----------------------------------------------------------- EDIT: Hello, Thanks for your response. I read the page you linked to, but am still concerned about a possible issue. The GetOrders documentation page says: "OrderArray.Order .TransactionArray.Transaction .CreatedDate Indicates the creation time of the order line item... For a fixed-price listing or a Buy It Now auction listing, an order line item is created once the buyer clicks the Buy button." Consider this scenario: 1. John Doe clicks the Buy button but doesn't pay for the item (or puts the item in the cart and leaves it in there for a while) 2. I import orders with OrderStatus = "Completed", some of which have a later CreatedDate than John Doe's 3. John doe buys his item, either using the Buy button or checkout out using the cart 4. I grab the latest CreatedDate from my database and use it when calling Getorders 5. John Doe's order will NOT be returned, since his order's CreatedDate is less than the last order I imported That's what I'm worried about. Can you please provide more information on CreatedDate so I know the above scenario will not occur? Thanks.
getordersgetorders-ebay-apicreatetimetocreatetimecreatetimefrom
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

p0wer0n0ff avatar image
0 Likes"
p0wer0n0ff answered ·
hi, actually you dont need to rely on CreationTime, use LastModificationTime for it, which will be updated everytime the Order (or any related parts of it change), i.e.: Date modifiedFrom = dateSinceLastPull; GetOrdersCall api = new GetOrdersCall(apiContext); api.setDetailLevel(new DetailLevelCodeType[]{DetailLevelCodeType.RETURN_ALL}); api.setOrderStatus(OrderStatusCodeType.COMPLETED); api.setOrderRole(TradingRoleCodeType.SELLER); final Calendar calFrom = Calendar.getInstance(EBAY_LOCALE); calFrom.setTime(modifiedFrom); api.setModTimeFrom(calFrom); final Calendar calTo = Calendar.getInstance(EBAY_LOCALE); // according to ebay spec -2 mins, but just to be sure calTo.add(Calendar.MINUTE, -3); api.setModTimeTo(calTo); in sample above I pull all COMPLETED Orders with Role as SELLER which were modified *AFTER* the "modifiedFrom" date. Usually, you dont have to set the ModTimeTo constraint, since eBay set's it for you to current-time, *BUT* eBay recommends to set this field to at least 2 minutes in the past, so I do. Now you can put that all into a separate method() which you then use for polling incremental changes. All you have to do is to remember the last pull-time as *dateSinceLastPull*, then use it as your "fromDate" in the next poll-iteration. For Date I use the official eBay Server Time, [which is this one][1] [1]: http://viv.ebay.com/ws/eBayISAPI.dll?EbayTime
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

vijayta.developersupport avatar image
0 Likes"
vijayta.developersupport answered ·
Hi @foxytronics_llc I would need more information to understand your application in order to recommend the best possible solution. But from what I understand so far, I think implementing ModTime filter would be better than CreateTime. Reason being when an existing order is modified i.e. Paid, Shipped etc, the LastModifiedTime in the order gets updated because of which you will be able to see the old orders that have been recently paid. You can still implement the same 10-15 min thing that is mentioned in the above KB, but there would a change of filters. You can also subscribe to some notifications that would be sent when the item id sold, paid, closed etc Here is the link for notifications : http://developer.ebay.com/Devzone/XML/docs/Reference/eBay/SetNotificationPreferences.html and the events you can subscribe for : http://developer.ebay.com/Devzone/XML/docs/Reference/eBay/types/NotificationEventTypeCodeType.html In case, you still face any issues, please share your developer account username, and I will create a free support request for you and we can discuss it in more details. Hope that helps ! Thanks
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

vijayta.developersupport avatar image
0 Likes"
vijayta.developersupport answered ·
Hi @foxytronics_llc Please refer to the KB : https://ebaydts.com/eBayKBDetails?KBid=1788 Thanks
· 2 · Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello, I have edited my question to express directly what my concern is regarding the use of CreatedDate. Could you provide clarification?
0 Likes 0 · ·
@vijayta.developersupport I forgot to tag your username in my comment.
0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.