0

I want to create a Callback URL to update the order status when data in JSON format is POST to it.

Post Format Example:

"hash": "43745580XXXXXXXXXXXXXXXXXXXXXX",
"status_feed": [{
        "order_id": "123456",
        "awbno": "1348616939310",
        "pickupdate": "2017-11-27 19:00:00",
        "current_status_desc": "Out for Delivery",
        "current_status": "OOD",
        "from": "GURGAON",
        "to": "BAHARAICH",
        "status_time": "2017-12-09 13:41:00",
        "scans": [{
            "time": "2017-12-09 13:41:00",
            "status": "Out for delivery",
            "location": "Bahraich_Kotwali_D (Uttar Pradesh)"
        }, {
            "time": "2017-12-08 20:44:00",
            "status": "Asked for delay delivery on 2017-12-09",
            "location": "Bahraich_Kotwali_D (Uttar Pradesh)"
        }, {
            "time": "2017-12-08 13:51:00",
            "status": "Out for delivery",
            "location": "Bahraich_Kotwali_D (Uttar Pradesh)"
        }, {
            "time": "2017-12-04 22:04:00",
            "status": "Reattempt - As per NDR instructions",
            "location": "Bahraich_Kotwali_D (Uttar Pradesh)"
        }, {
            "time": "2017-12-02 11:06:00",
            "status": "Asked for delay delivery on 2017-12-03",
            "location": "Bahraich_Kotwali_D (Uttar Pradesh)"
        }, {
            "time": "2017-12-02 10:58:00",
            "status": "Out for delivery",
            "location": "Bahraich_Kotwali_D (Uttar Pradesh)"
        }]
    }
]

Kindly help me with this issue, i am unable to find the right path to do this. I simply need a URL e.g. http://yoursite.com/some-callback-url on which the data in JSON format is posted and order status is updated accordingly.

0

I think the better way to do this, is by using the woo Rest API, have a look to this example (Woocommerce api docs) for updating an order status : https://woocommerce.github.io/woocommerce-rest-api-docs/?php#update-an-order

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.