Showing results for 
Search instead for 
Did you mean: 

Need to Patch Order but Order Already Completed?


Need to Patch Order but Order Already Completed?



I'm trying to implement the solution described in this post:


So I added the PHP PayPal SDK on my server-side code to PATCH the order after I get the information back:




 protected function patchOrder($orderId, $invoiceId)

        $client = PayPalClient::client();
        $request = new OrdersPatchRequest($orderId);
        $request->body = [  ['op' => 'add',
                                'path' => '/purchase_units/@reference_id==\'default\'/invoice_id',
                                'value' => $invoiceId] ];



 But my current client-side implementation completes the transaction so I get the fatal ORDER_ALREADY_COMPLETED error. I have tried various solutions like passing commit=false and intent=authorize into the script tag and actions.order.create() method but I still can't seem to intercept it before it completes. What am I missing?


  • Definitely don't want to interrupt PayPal Express Checkout workflow
  • Need to retrieve shipping information and orderID to save to my database server-side, then I have a ID I'd like to assign to the order's Invoice ID as the original post suggests
  • I'm fine to only authorize the payment then capture the funds on the server-side but I'm not sure how to stop the transaction from completing client-side, the button still reads "Pay Now" even when I alter the script tag or pass in a parameter.

Please don't link me to , that's the page I'm referencing but something is malfunctioning.




                createOrder: function (data, actions) {
                    return actions.order.create({
                        purchase_units: [{
                            amount: {
                                value: amt.toFixed(2)

                commit: false,
                onApprove: function (data, actions) {
                    return actions.order.capture().then(function (details) { // also tried actions.order.authorize() but no luck
                        if (details.purchase_units.length > 0) {






Dan Hermann

MUUSA Webmaster



Re: Need to Patch Order but Order Already Completed?

Did you ever figure this out?

I believe I'm having a very similar issue.
The `details` I get back from `actions.order.capture()` always reads ` intent: "CAPTURE", status: "COMPLETED"`.


I have similar server-side code to patch the order, I don't get an ORDER_ALREADY_COMPLETED error, I get this one:

`INVALID_REQUEST", message="Request is not well-formed, syntactically incorrect, or violates schema.`


I haven't been able to tell if my request is actually invalid, or if I'm just getting this error because the order is already completed. 


I am passing commit=false to my script tags, I am pretty sure intent authorize is not what I want, I just want to complete the payment after the user returns to my site from paypal, not days later.


Re: Need to Patch Order but Order Already Completed?

I fixed a few syntax issues, and now I'm definitely getting the same ORDER_ALREADY_COMPLETED error.


There must be a way on the client to capture the order without completing it, but I'm just not seeing it.

Is there a different js method to call other than actions.order.capture(), or should that not be called at all?