API - Where to find Order Id?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am having trouble with the API for Orders. I have the following code in PHP and would like to retrieve the order info. The order was created using woocommerce's subscription plugin.
$ch = curl_init('https://api.sandbox.paypal.com/v2/checkout/orders/824);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Bearer '.$access_token
));
$result = curl_exec($ch);
I am able to request and retrieve an access token but I get an error whenever I get to this code.
{"name":"RESOURCE_NOT_FOUND","details":[{"issue":"INVALID_RESOURCE_ID","description":"Specified resource ID does not exist. Please check the resource ID and try again."}],"message":"The specified resource does not exist.","debug_id":"cd668e38e28d9","links":[{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-INVALID_RESOURCE_ID","rel":"information_link","method":"GET "}]}
In the sandbox business account transaction, here are the different IDs.
Transaction ID: 2D8522225D2047105
Invoice ID: WC-824
Custom: {"order_id":824,"order_key":"wc_order_v2JJlOLsPIPIx"}
I've tried the different IDs as substitute for the Order Id but I still get the same error. Any help would be appreciated.
Thank you.
Denz

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Which api can get oauth2.0 authorization_code? in REST APIs
- Is it possible to make payments in RON (Romanian Leu) through PayPal? in REST APIs
- No way to contact company and I want a refund! Please help. in PayPal Reporting
- Google Pay SCA authentication dialog appears behind pay.google.com overlay in REST APIs
- Assistance Needed: Passing and Retrieving Custom Data in PayPal Webhook Payload in PayPal Payments Standard