API PUT /v2/orders/{order_id} Can't set fulfillment state or order state

I tried to change order state to CANCELED. Error: need to change fulfillment state. I can’t change fulfillment state:

I send the following and get an HTTP_CODE of 200 ( :smile:) and an order object in return that shows no change ( :frowning_face:). I queried the order to verify no change.

Is this a bug?

curl https://connect.squareup.com/v2/orders/{ORDER_ID}\
  -X PUT \
  -H 'Square-Version: 2020-10-28' \
  -H 'Authorization: Bearer TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "order": {
    "location_id":"LOCATION_ID",
    "version":LATEST_VERSION,
    "fulfillment": [
      {
        "state": "CANCELED"
      }
    ]
  }
}'

fulfillment should be fulfillments. It probably is ignoring that field since it’s invalid, and thus not changing anything and returning a 200 since it had no errors.

OK, I corrected my typo. And for future reference here’s what I needed to cancel the fulfillment. Thanks.

curl https://connect.squareup.com/v2/orders/{ORDER_ID}\
  -X PUT \
  -H 'Square-Version: 2020-10-28' \
  -H 'Authorization: Bearer TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "order": {
    "location_id":"LOCATION_ID",
    "version":LATEST_VERSION,
    "fulfillments": [
      {
        "uid": UID,
        "state": "CANCELED"
      }
    ]
  }
}'