PayPal Checkout items webhook

cmccaskey
Contributor
Contributor

I am using PayPal checkout on my website to generate orders. With the PayPal checkout, I can create an order with a list of items and their costs. Which webhook will return a list of the items ordered when the PayPal checkout is completed? I have tried payment sale completed and checkout order completed but they do not return an item list in the JSON.

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

cmccaskey
Contributor
Contributor

For anyone else following along, you can add webhooks using the API rather than the online client which will let you add the webhook above. However if you are have the same needs as me, you can instead use the PayPal IPN to receive an item list after every order. PayPal has some good code examples for various languages to get started with the IPN:  https://github.com/paypal/ipn-code-samples

View solution in original post

Login to Me Too
6 REPLIES 6

angelleye
Advisor
Advisor
Seems a little odd those wouldn't be returning the itemized data, but if that is indeed the case you could just hit the API from within your Webhook listener to pull the order details on the order_id provided in the Webhook data.
Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

cmccaskey
Contributor
Contributor
That would work but require extra backend processing. I've noticed that the invoice webhooks include an item list. But when I use that webhooks, it does not get issued when checking out via PayPal checkout. Any ideas on how to get the item list using strictly webhooks?
Login to Me Too

angelleye
Advisor
Advisor
You did try CHECKOUT.ORDER.PROCESSED?
Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

cmccaskey
Contributor
Contributor
It doesn't look like that is an option on the add webhooks page. When I test the checkout with all webhooks enabled it only sends the payment sale completed webhook which don't contain an item list.
Login to Me Too
Solved

cmccaskey
Contributor
Contributor

For anyone else following along, you can add webhooks using the API rather than the online client which will let you add the webhook above. However if you are have the same needs as me, you can instead use the PayPal IPN to receive an item list after every order. PayPal has some good code examples for various languages to get started with the IPN:  https://github.com/paypal/ipn-code-samples

Login to Me Too

angelleye
Advisor
Advisor
IPN would not be triggered from REST API requests, though, FYI. If you want to use IPN you'll need to use PayPal Standard or Classic API calls.
Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.