Integration
Client data to GoHighLevel (GHL)
Built, not sending The sync code is in place and runs in dry-run mode: it builds each GHL payload and logs it, but sends nothing until the GHL token and IDs are set in Netlify.
What gets sent
| Source | Fields | Used for |
|---|---|---|
| Quote request form | Name, work email, organization, phone, buyer type, ship-to address, notes, and the list of products and quantities | Create or update the contact and add an Apple quote opportunity |
| Buy now checkout | Product, quantity, order status, and the buyer details Stripe returns | Record the order and move the opportunity to paid |
| Hero email capture | Work email only | Start a contact with the source set to the Apple funnel |
Built
- Sync function
ghl-sync.js: upserts the contact (tagssource:apple-funnelandtype:quoteortype:order) and creates or updates one opportunity with the products and quantities. - Stripe webhook in
checkout.js: a signedcheckout.session.completedmoves the order to the paid stage. Unsigned or stale calls are refused. - Test contacts: any name containing TEST is tagged
test-contactso it can be removed in GHL.
What is needed to connect it
- The GHL location ID for the VSI Apple sub-account (
GHL_LOCATION_ID). - A GHL API token, stored in Netlify as
GHL_TOKEN. It is never written into the site code. - The pipeline ID (
GHL_PIPELINE_ID) and the quote and paid stage IDs (GHL_STAGE_QUOTE,GHL_STAGE_PAID). - The Stripe webhook signing secret (
STRIPE_WEBHOOK_SECRET) for the endpoint that points at the checkout function. - Written approval of the fields above and of how long the data is kept.
Controls
- Only the fields above are sent. Card details are never sent to GHL; payment is handled by Stripe.
- Each contact is tagged with its source, so Apple leads stay separate from other VSI lines.
- Test submissions must use the name TEST so they can be removed from GHL.
