Stripe rejecting email as invalid

Hi apologies… please assist if you can

I’m using a webhook in n8n to process form submissions. The form includes a list of children in the children array, each with a parent_email.

I’m trying to extract the parent’s email and pass it into Stripe’s customer_email field. However, I’m running into issues where Stripe rejects the email as invalid — even though it looks fine.

Error message
=======≈====

Stripe returns the following:

Invalid email address: [email protected]\n\n

(There are hidden line breaks at the end of the email)

workflow:

Here’s the key part of the flow:

Webhook node receives JSON with children[0].parent_email

Set node extracts and cleans the email using:

{{ String($json.body.children[0].parent_email).replace(/\s+/g, ‘’).trim() }}

Stripe Checkout Session is created with:

“customer_email”: “{{ $json.parent_email }}”

Share the output returned by the last node

400 Bad Request – Invalid email address: [email protected]\n\n

Information on n8n setup

n8n version: Latest cloud version

Database: SQLite (default)

n8n EXECUTIONS_PROCESS setting: own

Running n8n via: n8n cloud

Operating system: n8n cloud

Please help :folded_hands:

Hi there, can you share your workflow?




Thank You… appreciated
my email is being rejected by the Stripe checkout and when i look at node “set cleaned Email” seems to be pushing out an email with them \n\n\n extra characters…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.