Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opencart API Issue #12355

Open
tktamas opened this issue Jun 1, 2023 · 5 comments
Open

Opencart API Issue #12355

tktamas opened this issue Jun 1, 2023 · 5 comments

Comments

@tktamas
Copy link

tktamas commented Jun 1, 2023

I would like to send an API request to change the status of my order, unfortunately I get the HTTP/1.1 404 Not Found message for all requests except index.php?route=api/account/login&language=en-gb&store_id=0. I would like to use the index.php?route=api/sale/order.load&language=en-gb&store_id=0 request.
The api/account/login call is successful, I get session_id.
The version of Opencart I am using is 4.0.1.1 unfortunately the upgrade is not possible for the moment due to incompatibility of some extensions. Please can you help me to change something or how to send the request correctly?
Thanks in advance for your help.
I used this code now:
`
$url = 'https://***********/index.php?route=api/sale/order.load&language=en-gb&order_id=15';

$curl2 = curl_init();

curl_setopt($curl2, CURLOPT_URL, $url);
curl_setopt($curl2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl2, CURLOPT_HEADER, true);
curl_setopt($curl2, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl2, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl2, CURLOPT_TIMEOUT, 30);
curl_setopt($curl2, CURLOPT_POST, 1);
curl_setopt($curl2, CURLOPT_POSTFIELDS, $request_data);
curl_setopt($curl2, CURLOPT_COOKIE, 'OCSESSID=' . $session_id);

$response = curl_exec($curl2);`

@hayden-t
Copy link
Contributor

hayden-t commented Jul 4, 2023

I have found there are many breaking bugs in 4.0.1.1 as im stuck on it for time being too, though we will upgrade asap once live, unfortunately you wont get any help here from Daniel, and ive found you are best to try comparing code with the latest github for differences in the area you diagnose as being at fault, after stepping through the code bit by bit to find where is stops.

@danielkerr
Copy link
Member

this part does work but u need need to store the session cookie to use again

@tktamas
Copy link
Author

tktamas commented Jul 31, 2023

I'm supposed to do it this way, but it still doesn't work, can you please send me an example code for it?

@danielkerr
Copy link
Member

Yes will look into it. It can be done. U need to store the session is in another session

@danielkerr
Copy link
Member

yes i see i did it wrong. should not be making multiple calls to create an order. i will update it so parts can be updated and make it so within one call u can create an order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants