Convert transaction ID to order ID

mdeemer
Contributor
Contributor

Good evening

Sometimes my basket/API system fails and a user's Payment doesn't save in my database.

Could somebody please help me find a way to convert the "transaction ID" which is in my Paypal account transactions into an "Order ID" for use with the API?

 

It's this value I need... https://api.paypal.com/v2/checkout/orders/ ....orderid

 

Thanks in advance for your help

 

-Matt

Login to Me Too
1 REPLY 1

MTS_Chiranjeevi
Moderator
Moderator

Good day @mdeemer,

 

Thank you for your post and welcome to the Community Forum.

 

Merchants should first perform Create Order API(https://developer.paypal.com/docs/api/orders/v2/#orders_create) call and then redirect the customer/buyer to "approve" URL returned from the Create Order API response as below: 

 

{ "href": "https://www.sandbox.paypal.com/checkoutnow?token=*************J", "method": "GET", "rel": "approve" },

 

Once the order is approved by the customer/buyer, merchant should perform Capture Order (https://developer.paypal.com/docs/api/orders/v2/#orders_capture) API call using the “Order ID” returned in the above Create Order API response and customer/buyer should pass the valid funding source.

 

PayPal transaction ID will be generated once the payment processed successfully by the customer and will be returned in the Capture Order (https://developer.paypal.com/docs/api/orders/v2/#orders_capture) API response. 

 

Merchants should handle their internal website code by fetching the order details from the PayPal API response and update their internal database.

 

I request to please refer the below detailed guide link to create and capture the orders. 

https://developer.paypal.com/docs/api/orders/v2/#orders_create

https://developer.paypal.com/docs/api/orders/v2/#orders_capture

 

Sincerely,

Chiranjeevi

PayPal/Braintree MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

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.