Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Transaction ID for Paypal API V2

Tags:

api

paypal

How to find the transaction ID from Paypal V2 API? I would like to give the transaction ID for buyer to track their transaction.

I can get the order ID and Capture ID but fail to find where to find the transaction ID. Only the deprecated V1 API can get the transaction ID. Is it not available anymore for V2?

FYI, the answer for V1 is here Paypal Transaction ID

like image 698
ehku Avatar asked Oct 15 '22 15:10

ehku


2 Answers

In the  PayPal V2 API, there are three APIs are normally associated:

1) Create authorization - https://developer.paypal.com/docs/api/overview/#authentication-and-authorization

2) Create order - https://developer.paypal.com/docs/api/orders/v2/#orders_create

3) Capture order -  https://developer.paypal.com/docs/api/orders/v2/#orders_capture
   You can get the Transaction ID from this API response. It should be under   
      "payments": {
        "captures": [
          {
            "id": "3C679366HH908993F",
like image 171
PayPal_Bala Avatar answered Nov 15 '22 12:11

PayPal_Bala


An API caller is never shared the transaction ID that is sent in the receipt to the buyer. Seller has their own capture/authorization id Buyer has their own capture/authorization id

if you want to use a common tracking identifier you can populate invoice_id ?

just curious how do intent to use >> I would like to give the transaction ID for buyer to track their transaction. >> can you elaborate it a little bit.

like image 39
Rahul Dighe Avatar answered Nov 15 '22 13:11

Rahul Dighe