I would like to know how to get Transaction ID from PayPal API v2.
I've created an order by PayPal API v2 (https://developer.paypal.com/docs/api/orders/v2/) and captured it successfully. Order's status is COMPLETED, and the order has appeared in Activities in my PayPal Sandbox Account as I expected. Now I would like to get Transaction ID of capture transaction (see image), but I'm not able to get it.
I get Orders' detail by PayPal API, but there are only retrieved Order ID and Capture ID. Transaction ID that is marked on image is missing in API response. What I have to do to get Transaction ID? Very thanks.
{
"statusCode": 200,
"result": {
***************************************************************
"id": "91K02466UY433503E", <= ORDER ID
***************************************************************
"intent": "CAPTURE",
"purchase_units": [
{
"reference_id": "PZ755454789",
"amount": {
"currency_code": "EUR",
"value": "48.10",
"breakdown": {
"item_total": {
"currency_code": "EUR",
"value": "32.06"
},
"shipping": {
"currency_code": "EUR",
"value": "9.95"
},
"handling": {
"currency_code": "EUR",
"value": "0.00"
},
"tax_total": {
"currency_code": "EUR",
"value": "6.09"
},
"insurance": {
"currency_code": "EUR",
"value": "0.00"
},
"shipping_discount": {
"currency_code": "EUR",
"value": "0.00"
},
"discount": {
"currency_code": "EUR",
"value": "0.00"
}
}
},
"payee": {
"email_address": "XXXXXXXXXXXXXXX",
"merchant_id": "HE3H3VSFV3Q5G"
},
"description": "PZ755454789",
"custom_id": "PZ755454789",
"items": [
{
"name": "Calvin Klein Euphoria for Women Eau De Parfum 100 ml (woman)",
"unit_amount": {
"currency_code": "EUR",
"value": "32.06"
},
"tax": {
"currency_code": "EUR",
"value": "6.09"
},
"quantity": "1",
"sku": "24837"
}
],
"shipping": {
"name": {
"full_name": "XXXXXXXXX"
},
"address": {
"address_line_1": "XXXXXXX",
"admin_area_2": "XXXXX",
"postal_code": "XXXXX",
"country_code": "XX"
}
},
"payments": {
"captures": [
{
*******************************************************
"id": "40J088343X584271G", <= CAPTURE ID
*******************************************************
"status": "COMPLETED",
"amount": {
"currency_code": "EUR",
"value": "48.10"
},
"final_capture": true,
"seller_protection": {
"status": "ELIGIBLE",
"dispute_categories": [
"ITEM_NOT_RECEIVED",
"UNAUTHORIZED_TRANSACTION"
]
},
"seller_receivable_breakdown": {
"gross_amount": {
"currency_code": "EUR",
"value": "48.10"
},
"paypal_fee": {
"currency_code": "EUR",
"value": "1.26"
},
"net_amount": {
"currency_code": "EUR",
"value": "46.84"
}
},
"custom_id": "PZ755454789",
"links": [
{
"href": "https:\/\/api.sandbox.paypal.com\/v2\/payments\/captures\/40J088343X584271G",
"rel": "self",
"method": "GET"
},
{
"href": "https:\/\/api.sandbox.paypal.com\/v2\/payments\/captures\/40J088343X584271G\/refund",
"rel": "refund",
"method": "POST"
},
{
"href": "https:\/\/api.sandbox.paypal.com\/v2\/checkout\/orders\/91K02466UY433503E",
"rel": "up",
"method": "GET"
}
],
"create_time": "2019-08-14T12:44:13Z",
"update_time": "2019-08-14T12:44:13Z"
}
]
}
}
],
"payer": {
"name": {
"given_name": "XXXXXX",
"surname": "XXXXXXX"
},
"email_address": "XXXXXXXXXXXX",
"payer_id": "SS5Q2CS6CKX5L",
"phone": {
"phone_number": {
"national_number": "0111111111"
}
},
"address": {
"country_code": "XX"
}
},
"update_time": "2019-08-14T12:44:13Z",
"links": [
{
"href": "https:\/\/api.sandbox.paypal.com\/v2\/checkout\/orders\/91K02466UY433503E",
"rel": "self",
"method": "GET"
}
],
"status": "COMPLETED"
},
"headers": {
"": "",
"Date": "Fri, 16 Aug 2019 06",
"Server": "Apache",
"paypal-debug-id": "557573ed4e5b2",
"HTTP_X_PP_AZ_LOCATOR": "sandbox.slc",
"Paypal-Debug-Id": "557573ed4e5b2",
"Set-Cookie": "X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00",
"Vary": "Authorization",
"Content-Length": "2339",
"Connection": "close",
"Content-Type": "application\/json"
}
}
There are two transaction ID's one for the seller and one for the buyer. You as an API caller can only ever see the seller transaction ID (Capture ID) but not the buyer.
is there any reason you have a need to show the buyer transaction_id?