raduiosifraduiosif MemberComments: 1 Received thanks: 0 Member since: July 2020

Hi,

I was looking thru the shopware 6.0 docs and found the action routes in order to update an order's state ( https://docs.shopware.com/en/shopware-platform-dev-en/admin-api-guide/action-routes ), but the routes are not available in our shopware 6.0 instance, yet the routes are available on our shopware 6.1 instance.

Any idea why, or how I can access or update order status in shopware 6.0?

Answers

  • CallMeAlexCallMeAlex MemberComments: 80 Received thanks: 14 edited December 2020 Member since: January 2020

     

    Hello @raduiosif‍ I am trying to edit the order status, too.

    I‍t was working, but now it doesn't. I used that route.

    Patch:

    api/v2/order/ddeee183fa2d46559f41d7b846386fcb?_response=true

    Json: 

    {
        "stateId":"268EDC7D41334099AD1D456338526C20"
    }

    But currently I am getting this error.

    {
        "errors": [
            {
                "code": "FRAMEWORK__WRITE_CONSTRAINT_VIOLATION",
                "status": "400",
                "detail": "Changing the state-machine-state of this entity is not allowed for scope crud. Either change the state-machine-state via a state-transition or use a different scope.",
                "template": "Changing the state-machine-state of this entity is not allowed for scope {{ scope }}. Either change the state-machine-state via a state-transition or use a different scope.",
                "meta": {
                    "parameters": {
                        "{{ scope }}": "crud"
                    }
                },
                "source": {
                    "pointer": "/0/stateId"
                }
            }
        ]
    }

    Does anyone have an idea?

  • raduiosifraduiosif MemberComments: 1 Received thanks: 0 Member since: July 2020

    Hi @CallMeAlex‍,

    If you are using Shopware 6.1 or above, use the action routes to update the order status (you can find the link above) and not by patching the order's state. The error that you're getting might be related to the fact that you can't change the order state from 'cancel' for example to 'done', first you need to 'reopen' the order in order to mark it as 'done'. Try using another state.

Sign In or Register to comment.