Custom function to add lead from Bookings

Custom function to add lead from Bookings

I would like to write a custom function that will push a lead to the CRM. I need this because there's no option in the standard integration that will push data only from specific consultations; I don't want this to happen for every consultation.

In doing some research, I read that I would need to generate a Lead ID within the function. How do I do that?

    Nederlandse Hulpbronnen