Search code examples
paypalpaypal-ipn

Can PayPal's CUSTOM variable be used on eBay?


I program with PHP and I'm familiar with getting data from PayPal's IPN. I need to send custom data to ebay and get it back when payment is made. For example, if sold 1 Widget on ebay and that widget has a stock number of 12345A, I receive data back from PayPal. I get things like customer's name, address, item name, etc. But, unless I include that stock number in my title, I don't see any way to get that data back from PayPal. I don't want to use ebay's limited title space for including my stock numbers. I realize I could do it if I had another database to store ebay's item numbers and cross reference them with my stock numbers, but I don't want to do that.

I have noticed that when data comes back from PayPal after an ebay sale, it includes the custom variable and that variable has a large number in assigned to it. I have no idea what that is. I've also tried using ebay's custom label feature that's found in Turbo Lister and Selling Manager Pro. I was hoping that would be sent back in PayPal's custom variable, but no luck. Any ideas?


Solution

  • As you've discovered, it looks like it's some internal id number uniquely identifying each eBay order. You can probably forget about specifying a value for this field as it isn't documented anywhere.

    The best solution to your problem is to use the eBay API. GetSingleItem will return information about an item given the item id.

    The ItemSpecifics list will contain any item specific data that the seller has entered about the product. In my case, I added a custom field called SKU to the eBay item. Just add itemspecifics to your include selector. The call can be executed with a GET request:

    http://open.api.ebay.com/shopping?callname=GetSingleItem&IncludeSelector=ItemSpecifics&appid=YOURAPPID=515&ItemID=ITEMIDOFINTEREST
    

    What you get back will contain those custom fields you added to your item:

       
        ..
        <ItemSpecifics>
        <NameValueList>
        <Name>MPN</Name>
        <Value>MyPartModelA</Value>
        </NameValueList>
        <NameValueList>
        <Name>SKU</Name>
        <Value>123-456</Value>
        </NameValueList>
        </ItemSpecifics>
        ..