Cancel an order with PayPal API v2

45 Views Asked by At

I want to know if there is any possibility to cancel a paypal order with status CREATED or PENDING? With API v1 there was a orders_cancel endpoint to cancel an order: https://developer.paypal.com/docs/api/orders/v1/#orders_cancel But v1 is already deprecated and if possible I don't want to use that.

Why I want to cancel an order: I have an online shop and sell second hand clothes. So every peoduct is unique and I reserve the product for the user during the checkout. But I want to give the user a timelimit of about 20 Minutes before I cancel the checkout and release the product for others.

With OnCancel / OnError callback this is no problem. But if a user let the PayPal popup opened without finishing the payment and closes the app or if the browser maybe crashes I don't get any callback and cancel the order.

Hope my problem is understandable. I'm happy for any solution.

1

There are 1 best solutions below

1
Preston PHX On

v2 order objects serve no purpose beyond checkout approval. Therefore there is no way to cancel a v2 order, as doing so would serve no actual purpose.

If you have a v2 order that you do not intend to use, simply abandon and forget its existence. That is all.


The old v1 orders API was deprecated soon after release; it was different from what's described above (i.e. did serve a purpose after checkout approval) but since no one should be using it for anything, these details aren't important.