I'm selling something on eBay that could be delivered entirely automatically if I could use the PayPal IPN.
I know that eBay sales still send information to my PayPal listener but is it possible to pull the eBay item number from the IPN information so I know which product to send to the buyer?
The eBay item ID is included with the PayPal IPN data as the shopping cart item number. Here's a sample of an IPN from an eBay transaction.
Array
(
[mc_gross] => 131.52
[protection_eligibility] => Eligible
[for_auction] => true
[address_status] => unconfirmed
[item_number1] => 301218066165
[tax] => 0.00
[payer_id] => V5ZZZZZZA4
[ebay_txn_id1] => 997709242020
[address_street] => 200 Jacksonville Rd
[payment_date] => 08:43:31 Jul 09, 2014 PDT
[payment_status] => Completed
[charset] => windows-1252
[auction_closing_date] => 08:39:55 Jul 09, 2014 PDT
[address_zip] => 37042
[mc_shipping] => 11.53
[mc_handling] => 0.00
[first_name] => Tester
[mc_fee] => 3.19
[auction_buyer_id] => someebayuser
[address_country_code] => US
[address_name] => Tester Testerson
[notify_version] => 3.8
[custom] => 16372911015
[payer_status] => unverified
[business] => sales@domain.net
[address_country] => United States
[mc_handling1] => 0.00
[num_cart_items] => 1
[address_city] => Clarksville
[verify_sign] => Ajfh8JrSDJjPlnEbvetFI.T0Ru67AHq1jQgmiX08YNtZfjc5B9GlZp.w
[mc_shipping1] => 0.00
[payer_email] => tester@email.com
[tax1] => 0.00
[txn_id] => 93M71753JN507112H
[payment_type] => instant
[last_name] => Testerson
[address_state] => MN
[item_name1] => Sony SmartWatch 2 SW2 Bluetooth NFC Smart Wrist Watch 1275-2741 Android NEW +Wty
[receiver_email] => receiver@email.com
[payment_fee] => 3.19
[shipping_discount] => 0.00
[quantity1] => 1
[insurance_amount] => 0.00
[receiver_id] => UBDZZZZZEPY
[txn_type] => cart
[item_name] => Sony SmartWatch 2 SW2 Bluetooth NFC Smart Wrist Watch 1275-2741 Android NEW +Wty
[discount] => 0.00
[mc_gross_1] => 119.99
[mc_currency] => USD
[item_number] => 301218066165
[residence_country] => US
[receipt_id] => 2559-0750-2193-4107
[shipping_method] => Default
[transaction_subject] =>
[payment_gross] => 131.52
[ipn_track_id] => ca2d1c92a0ee2
)
You can see the eBay ID is included in the ebay_txn_idn parameters, starting with 1, and you'll have a set of item parameters for each item on the sale.
If you need more detail than what the PayPal IPN provides you can use eBay's GetItemTransactions API from within your IPN script.