To create a lead, see example below. To update an existing lead, put the Lead ID in the URL: /api6/leads/234567/?apiKey=XXXXXX and use the below example. Any fields not sent will remain the same.
Request:
All the below are parameters are optional unless in bold. This is not a complete list.
POST /api6/leads/?apiKey=XXXXXX {
customerid: XXXXXX <--- First create a customer record to get this ID OR pass in all the required customer fields into this same call.
locationid: 0
eventname: Birthday Party
eventstarttime: 1442003025 <--- UNIX timestamp (defaults to now if no time sent)
eventendtime: 1442006025 <--- UNIX timestamp (use this or duration below)
eventduration: 1.25 <--- Event duration in hours
eventstartdate_text: 7/25/2015 <-- You can use these instead of the above if preferred
eventstarttime_text: 2:00 pm
eventenddate_text: 7/25/2015 <--- Send it as MM/DD/YYYY unless your account is set as DD/MM/YYYY
eventendtime_text: 4:00 pm <-- Again send with am/pm unless your account is set to use a different time format
eventstreet: 123 Happy St.
eventcity: Harperville
eventstate: OH
eventzip: 44444
eventcountry: United States
taxexempt: Yes / No (defaults to No)
taxrate: 7.25 <--- will auto-calculate if not sent
salestax: 20.15 <-- will auto-calculate if not sent
status: Hold
deliverytype: Drop-Off
surface: Grass
rental_names: Bounce House-1-125:Dora Panel-1-0|Slip & Slide-1-250
staffcost: 0
distcharge: 0
fee: 0
adjust: 10.05 <--- $10.05 discount.
coupon_code: FB Friend <--- coupon code to be applied
recalculate: 0
notes: Has a rabid cat.
additionalnotes1: test
additionalnotes2: test2
venuenotes: It's a park.
venuename: Central Park
venuecontact: John Zimm
guests: 100
referral: Google Adwords
}
Details:
- rental_names above is parsed as follows: Item Name-Qty-Price:Option Name-Qty-Price|Next Item-Qty-Price
where dashes separate quantity and price, colons separates options of that item, and bars separate additional items. If a sent name doesn't match, the system will create it like a Quick Add item.
- recalculate can be set to 0 and you can specify the prices. If it is set to 1 it will override any sent prices.
- coupon_code when recalculate is 0, you must also send cpdiscount with amount of coupon discount, otherwise it will be auto-calculated based on the promotion. Coupon must be setup in Settings->Promotions.
- default values specified in Settings->Optional Fields will be used if nothing is sent for that field.
Response:
201 (Created), recordid containing new ID.
409 (Conflict) if resource already exists, recordid containing duplicate ID.