Short answer: there isn't any. There's an issue tracking it in Paypal's github but the entirety of their response after 8 months has been "lol sorry". You just have to kinda guess at what the code should be by using the REST API documentation. Also, if you're using webhooks: "CHECKOUT.ORDER.APPROVED" doesn't always mean that payment was successful, but "PAYMENT.CAPTURE.COMPLETED" doesn't contain the items in the order so you may need to use both. Unfortunately ['resource']['id'] is different for both of these. ['resource']['purchase_units'][0]['payments']['captures'][0]['id'] on "CHECKOUT.ORDER.APPROVED" matches ['resource']['id'] on "PAYMENT.CAPTURE.COMPLETED", but it doesn't always exist so I have no idea how PayPal expects people to actually align a successful order to a successful payment. There's no documentation on this either.
... View more