Matching CHECKOUT.ORDER.APPROVED with PAYMENT.CAPTURE.COMPLETED
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm completely new to the PayPal API.
I'm using the smart button with a web hook to capture the payment & shipping information.
I thought I'd get the shipping info with the event CHECKOUT.ORDER.APPROVED then when I get the PAYMENT.CAPTURE.COMPLETED event I'll be sure the payment is fully processed.
I noticed that the transaction ID for both are different. so I have no way of matching the two.
Is there a way to match the two that I'm missing?
Or can I just assume CHECKOUT.ORDER.APPROVED is enough to trust that everything is good and ignore PAYMENT.CAPTURE.COMPLETED?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @djslim
We would always recommend waiting for the "Payment.Capture.Completed" webhook for each transaction. The webhook for "Checkout.Order.Approved" was actually intended to be used to notify your system to attempt Payment Capture. In other words, some capture immediately and really don't need the Approved webhook since just the Completed one would suffice. But some choose to authorize, then capture later, checking to make sure they got an Approved webhook before initiating the capture. That's just a glimpse into the original intent.
I believe you can add your own order id called an "invoice_id". You can pass this in the "purchase_units" object when creating the transaction. Then, when you receive the checkout.order.approved webhook, you can look at the details of the transaction to find the invoice_id. Then, when capturing the transaction, that same invoice ID will be attributed to the captured ID as well.
I hope that helps!
-Aaron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is the reality of PayPal in 2021. You cant pass data to PAYMENT.CAPTURE.COMPLETED for whatever reason and you can't match CHECKOUT.ORDER.APPROVED that contains the relevant data to the right COMPLETED.
Using PayPal feels like fighting against PayPal not like using it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a serious problem for us. There is no way to attribute `CHECKOUT.ORDER.APPROVED` with a `PAYMENT.CAPTURE.COMPLETED` since anything within the purchase_units don't show up in the latter webhook.
Aaron... help us out man.
Edit: I did find a way by analyzing the JSON payload in the webhook. I was able to match the checkout with the successful payment using:
req.body.resource.supplementary_data.related_ids.order_id

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Turn off taxes automatically ? in PayPal Payments Standard
- requesting additional information with a Paypal payment in PayPal Payments Standard
- Use Rest Api, Error Respone Code 421 Requested host does not match any names on certificate in REST APIs
- Host name does not match server certificate for https://ipnpb.sandbox.paypal.com/cgi-bin/webscr in Sandbox Environment
- IPN in sandbox works sporadically in Sandbox Environment