Bad Request 400 Only when trying to update the status of an order

Hey,

What I am trying to do:

Check [i - users who bought], [ii- check users in pending] > If any billing email in group i is in group ii > set status of the user in group ii to trash

  1. I have been trying to update the status of an order to trash and also the billing fields.
    Even though it pulls the data correctly it keeps giving a 400 error when trying to update anything.

  2. When comparing billing emails the output is strange. The resulting output shoudl be that 1 email matches. But it just results everything to true.

What is the error message (if any)?

ERROR: Bad request - please check your parameters

400 - {“code”:“rest_invalid_param”,“message”:“Invalid parameter(s): billing”,“data”:{“status”:400,“params”:{“billing”:“Invalid email address.”},“details”:{“billing”:{“code”:“rest_invalid_email”,“message”:“Invalid email address.”,“data”:null}}}} - Invalid parameter(s): billing

Please share your workflow


Share the output returned by the last node

The Error Message

Information on your n8n setup

  • n8n version: Version 1.27.2

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

hello @vividground

That workflow won’t work.

You’ll need to get all pending orders, then get all completed orders, and then compare each pending order against the completed orders.

Example below

Hi,

We read the the documentation of woocomerce. The update to trash function does not exist the node in n8n has to be updated to the allowed functions. We resorted to the allowed cancel an order status which is allowed and worked.

Thats why the error showed the allowed possible updates to status that can be done.