Showing results for 
Search instead for 
Did you mean: 

PHP Orders V2 REST Receiving "RESOURCE_NOT_FOUND" when executing OrdersPatchRequest()

Posted on

I create a simple order with the OrdersCreateRequest() function, passing in a reference_id which I get later using the OrdersGetRequest().

I receive the customer's shipping address from Paypal, calculate taxes and shipping cost, and issue a patch request using OrdersPatchRequest(). This works in my dev environment 100% of the time.


In production, I always receive RESOURCE_NOT_FOUND with reason INVALID_RESOURCE_ID. 

My orders only ever have one purchase unit, and for the path, I've tried

"path":"/purchase_units/@reference_id=='ref_zzz002186'/amount", // my actual reference ID for this purchase unit

"path":"/purchase_units/@reference_id=='default'/amount", // The supposed value when only one purchase unit exists

"path":"/purchase_units/@reference_id=='PUHF'/amount", // Taken from all Paypal documentation


Here is an example full patch request JSON: 
























And the response:






    "description":"Specified resource ID does not exist. Please check the resource ID and try again."


"message":"The specified resource does not exist.",





Where am I doing something wrong? What is a RESOURCE_ID?


Here is the OrdersGetRequest() Response:

    "statusCode": 200,
    "result": {
    "id": "zzz100811C357161W",
    "intent": "CAPTURE",
    "status": "APPROVED",
    "purchase_units": [{
       "reference_id": "ref_zzz002186",
       "amount": {
          "currency_code": "USD",
          "value": "18.00"



I appreciate any help...

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.