This code allows you to make an insert of a lead into the Pabau system by making a simple POST request.
Below are a list of the attributes you can currently pass into Pabau.
* = Required
|api_key||Your API key.|
|redirect_link||A URL to redirect to upon successful submission.|
|Lname||Last Name (string)|
|lead_source||This is typically a dropdown option, and you can pass in plaintext the source of the lead (Example: Facebook)|
|telephone||telephone number (string)|
|mobile||Mobile number (string)|
|post_code||Postal Code (string)|
|treatment_interest||Treatment Interest (string)|
|opt_email||Subscribe to email reminders & notifications (1/0)|
|opt_letters||Subscribe to receive letters & mail (1/0)|
|opt_sms||Subscribe to SMS reminders & notifications (1/0)|
|opt_newsletter||Subscribe to receive newsletters (1/0)|
|custom_textarea||Custom comments/notes (this is often used for the inquiry details from the client).|
|location_name||Your location name must match the exact same name as your locations are setup within Pabau (else we will not match to the correct location ID). (string)|
You can also parse custom field data into the lead. Follow this guide and then add the variable taken when editing the custom field into your POST.
Below are a list of error codes presented in the API logs.
* = Required
|1||Lead Successfully created.|