문제

I want to develop new module for changing order status using Api in magento 2.3.5 so can anyone have idea then please share with me. I want to create order status and change it using Api.

도움이 되었습니까?

해결책

Try this params. It is working.

{
    "entity": {
        "entity_id": 1,
        "state":"processing",
        "status": "processing"
    }
}

Check mapping in sales_order_status_state.

Happy Coding.

다른 팁

You can use the rest webservice: http://yoursite.com/index.php/rest/V1/orders

On the body you just have to pass:

{
    "entity": 
    {
        "entity_id": your order id, 
        "state":  your state,
        "status": your status
    }
}

Don't forget to also include in the http header the following fields:

Content-Type: application/json

Authorization: Bearer Your authentication token

Any more help or explanation needed feel free to ask ;)

try this on postman, it's a lot easier to test and debug !

I am using Integromat for automatic change order status. But if I do this API call than I recieve 400: Request method is invalid. I tried to use different methods like PATCH, PUT and still get 400.

My connection is functional, beacause other actions like Find orders is functional. But dont know why this api calls doesnt work(any custom API calls).

URL: /rest//V1/orders/

Header: Content-Type: application/json Authorization: Bearer auth.token

Body:

{
    "entity": {
        "entity_id": xxxxx,
        "state": "processing",
        "status": "prijata_platba"
    }
}

Could you help me with this? Thank you

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top