Skip to main content
Question

Stripe - Paths - Code - Click-Up workflow

  • April 24, 2025
  • 1 reply
  • 30 views

Hi everyone,

I'm building a Zap that triggers when a Stripe Checkout session is completed. Based on the product purchased (Basic, Pro, or Custom), the Zap should search ClickUp to see if the lead already exists (matching by name or email).

If the lead exists, it should add a tag like basic_paid, pro_paid, or custom_paid. If not, it should create a new task in the corresponding ClickUp space or list based on the membership type.

Looking for help validating this flow or optimizing the logic.

At the moment I am using code by zapier to try fix this (I am not a coder). Thing is I have added a test sub-task , but my code keeps on returning not found. I know the subtasks is there so why is this happening?

Also if there’s a better alternative on how to make this workflow I am open ears. Here is the code I am currently using. 

Code is in JavaScript.

Input Data = name and email both dynamic pulled from stripe step

Code: 

const name = inputData.name?.toLowerCase() || '';

const email = inputData.email?.toLowerCase() || '';

const searchQuery = name + ' ' + email; // Combine both for broader matching

 

const response = await fetch("https://api.clickup.com/api/v2/task/search", {

  method: "POST",

  headers: {

    "Authorization": "pk_XXXXXXXX_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",

    "Content-Type": "application/json"

  },

  body: JSON.stringify({

    query: searchQuery,

    subtasks: true,

    include_closed: false

  })

});

 

const data = await response.json();

const tasks = data.tasks || [];

 

const match = tasks.find(task => {

  const taskName = task.name?.toLowerCase() || '';

  return taskName.includes(name) || taskName.includes(email);

});

 

Please any help would be amazing.

This post has been edited by a moderator to remove sensitive information. Please remember that this is a public forum and avoid sharing credentials, tokens, or other private details that could compromise your account security.

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • 34032 replies
  • April 24, 2025

Hi ​@l3ns 

I don’t think this is a valid ClickUp API Endpoint: https://api.clickup.com/api/v2/task/search

 

Try using this Zap action: ClickUp - API Request

ClickUp API endpoint documentation for Task Search: https://developer.clickup.com/reference/gettasks