woocommerce / wc-api-python

A Python wrapper for the WooCommerce API.
https://pypi.org/project/WooCommerce/
MIT License
212 stars 112 forks source link

put order returns 404 #20

Closed smitthakkar96 closed 8 years ago

claudiosanches commented 8 years ago

PUT orders works just fine. And this wrapper could not cause any issue making return 404.

smitthakkar96 commented 8 years ago
    orderId = request.args.get('orderId')
    store = request.args.get('store')
    return jsonify({"response" : LY_api.put('orders/{}'.format(orderId), {"status" : "cancelled"}).json()})

Above is the code which calls api

claudiosanches commented 8 years ago

Your code is wrong, since we don't have any route for PUT orders/ You need to pass an ID.

Here the wrong code:

        return jsonify({"response" : WD_api.put('orders'.format(orderId), {"status" : "cancelled"}).text})
        return WD_api.put('orders', {"status" : "cancelled"}).text

Please read the REST API docs before open issues: https://woocommerce.github.io/woocommerce-rest-api-docs/

smitthakkar96 commented 8 years ago

@claudiosmweb I am passing the Id as you can see in line 3, what is wrong in my code?

claudiosanches commented 8 years ago

@smitthakkar96 Thanks for change the code...

Well maybe passing the wrong ID. Still please understand that this IS NOT an issue in this wrapper, if is returning 404 it's because the WooCommerce REST API is returning 404. And here is not a channel for support about the REST API.