How do I? [array enum and hashes] http post request

Hi there,

I can’t seem to understand how to post these values of the stripe session endpoint inside the http node.

enum values: payment_method_types=[“card”]
array hashes: line_items, line_items.price, line_items.price_data
dictionary: automatic_tax, automatic_tax.enabled

docs are here: Stripe API reference – Create a Session

Check the example workflow below. It has the HTTP node configured as you need it. Just change the URL and add the basic authentication with the token.

{
  "nodes": [
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "https://webhook.site/6b33e8d9-de94-4695-b174-14f4b66c5966",
        "options": {
          "bodyContentType": "form-urlencoded"
        },
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "success_url",
              "value": "https://example.com/success"
            },
            {
              "name": "cancel_url",
              "value": "https://example.com/cancel"
            },
            {
              "name": "line_items[0][price]",
              "value": "price_H5ggYwtDq4fbrJ"
            },
            {
              "name": "line_items[0][quantity]",
              "value": "2"
            },
            {
              "name": "mode",
              "value": "payment"
            }
          ]
        }
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        460,
        300
      ]
    }
  ],
  "connections": {}
}
2 Likes

Thanks @RicardoE105!