Help: Using data from a trigger for a POST request

Describe the issue/error/question

I am trying to set up a POST request including data from a previous trigger note. I want to use information about a new order from WooCommerce (trigger) within a POST request towards an API, including information from the WooCommerce Trigger json output (e.g. Name or E-Mail of the customer).

I am really struggling with formulating the POST request with the body parameters, the request body should look like this:

{
  "lockIds": [
    XXX
  ],
  "receiverName": "FIRSTNAME LASTNAME",
  "receiverEmailOrPhoneNumber": "[email protected]",
  "message": "Some random message",
  "permissionType": 1,
  "permissionTimeProfile": {
    "repetitionType": 0,
    "items": [{
       "startDate": "DATESTART",
       "endDate": "DATENEND"
     }]
  }
}

I try to recreate this with the HTTP request Node, but I fail. Name, E-Mail and the dates should be transmitted from the WooCommerce trigger.

What is the error message (if any)?

Bad Request

Please share the workflow

Share the output returned by the last node

"status": "rejected",
"reason": {
"name": "StatusCodeError",
"statusCode": 400,
"error": {
"errorLiteral": "Generic.BadRequest",
"errors": {...}, // 2 keys
"type": "https://xxxxx.de/errors#Generic.BadRequest",
"title": "Validation error",
"status": 400,
"detail": "One or more validation errors occurred",
"extensions": {}

Information on your n8n setup

  • n8n version: 0.172.0
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via: Docker

Hey @bvelte,

It looks like the only thing missing was you didn’t set the inputs to be expressions. Give this a go.