API - Leads - Create or Update

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
  rentals: 12345-1-125:12346-1-0|67890-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:

Rentals:

    Use either rental_names or rentals to add rentals. Both use the same structure; rental_names identifies rentals and options by item name, while rentals identifies them by Rental ID.

    - rental_names: Item Name-Qty-Price:Option Name-Qty-Price|Next Item-Qty-Price
    
- rentals12345-1-125:12346-1-0|67890-1-250

    Dashes separate the identifier, quantity, and price. Colons add options or accessories to the preceding rental, and bars separate additional rentals.
    If a name sent through rental_names does not match an existing item, the system creates a Quick Add item.
    
Only specify one of rental_names or rentals, not both. If both are sent, rental_names will be used.

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.

Is this article helpful?
0 0 0