question

$$anonymous$$ avatar image
0 Likes"
$$anonymous$$ Suspended asked

How to detect a sale has been made and also the number of items sold

I want to detect the sales made on ebay and also number of items sold from my web application. Please suggest the api or a way to accomplish this. I am new to ebay integration. Any sample code is welcome.

sale-number-of-items
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.

paulfsmith avatar image
0 Likes"
paulfsmith answered

Hi,

 

Your best bet is the GetOrders call. You need to poll for new orders on a regular basis. Ebay recommend once every 15 minutes. You process those orders and then call again in 15 minutes with a new "start" time to get any new orders.

 

Read the API User Guide here: http://developer.ebay.com/DevZone/XML/docs/WebHelp/wwhelp/wwhimpl/common...

 

and the API reference for GetOrders here: http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetOrders.html

 

CARE: GetOrders get orders where someone has committed to pay but hasn't yet paid, as well as orders that have been paid for. When an "authorized" but not paid for order is received, you should still allocate stock.

 

Best Regards

Paul Smith

 

 

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.

paulfsmith avatar image
0 Likes"
paulfsmith answered

I should add, the response from the GetOrders call returns a TransactionArray element from which you can get the number of items sold.
 

foreach (OrderType order in orders)
{

    TransactionTypeCollection orderTrans = order.TransactionArray;
    // The Order could be comprised of one or more items
     foreach (TransactionType transaction in orderTrans)
     {

        // Store order line items

        // Allocate inventory etc.

    }
}   
 

There is some basic GetOrders sample code in the .net Samples application. I recommend you download that if you haven't already done so.
 

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.

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.