Appearance
Overview
NOMA Sync finds or creates constituents and creates gifts in Little Green Light (LGL). LGL constituent and gift data comes only from Givebutter and Square — not from Mailchimp. (Mailchimp subscription status is synced to LGL by LGL’s built-in Mailchimp integration; see Mailchimp Overview.) For full LGL API details see LGL API documentation.
Authentication
- Method: API key (Bearer or header per LGL docs).
- Storage: Stored as Cloudflare Worker secret (
LGL_API_KEY). LGL environment (production vs sandbox) is selectable in Dashboard → Settings.
Constituent (Find or Create)
Search
NOMA Sync searches LGL for an existing constituent by email (normalized: lowercase, trimmed) before creating. This avoids duplicates when the same person donates, buys, or signs up from multiple sources.
Create payload (conceptual)
When no matching constituent is found, NOMA Sync creates one with:
| Field | Givebutter | Square |
|---|---|---|
| first_name | supporter first name | customer given_name or default |
| last_name | supporter last name | customer family_name or default |
| email_addresses | supporter email | customer email or default constituent |
| phone_numbers | supporter phone | customer phone |
| addresses | supporter address | customer address |
For Square orders with no customer, the default constituent (configured in Settings) is used; NOMA Sync finds or creates that constituent in LGL.
Gift (Create)
One gift per Givebutter transaction or Square order. Mailchimp does not create gifts (see Mailchimp Overview for scope).
| Field | Givebutter | Square | Notes |
|---|---|---|---|
| constituent_id | From find-or-create | From find-or-create or default | Required |
| amount | transaction amount | order.total_money (cents → dollars) | Required |
| gift_date | transaction date | order.created_at | Formatted per LGL API |
| source | e.g. "Givebutter" | e.g. "Square Online Store" | Optional |
| external_id | givebutter_{id} | square_order_{id} | Idempotency; LGL rejects duplicate |
| fund_id / campaign_id | From campaign mapping | From type default or location override | From Dashboard Mappings |
| payment_type / gift_type | Auto-detected or mapping | From tender type | LGL payment/gift type by name |
| custom fields | From transaction custom_fields | Optional (line items summary) | Per campaign mapping |
Idempotency
- sync_log: Each sync has
external_id(e.g.givebutter_123,square_order_abc) so the same event is not processed twice. - LGL gift: Same external_id is sent to LGL. If LGL returns 422 "External Gift ID already exists", NOMA Sync treats it as skipped (success), not failure.
Mailchimp and LGL (Not NOMA Sync)
NOMA Sync does not update LGL from Mailchimp webhooks. The Mailchimp webhook in NOMA Sync is audit-only: events (unsubscribe, cleaned, etc.) are verified, parsed, and logged to sync_log (source: mailchimp) for audit. No LGL API calls are made.
Mailchimp ↔ LGL subscription status (Subscribed, Unsubscribed, Bounced, etc.) is handled by LGL’s built-in Mailchimp integration (Settings → Integration → Mailchimp in LGL), which syncs nightly and uses LGL’s “MailChimp Status” category/keywords. NOMA Sync does not duplicate this.
Error Handling
| LGL Response | NOMA Sync behavior |
|---|---|
| 2xx | Success; sync_log written |
| 422 (external_id already exists) | Treated as idempotent; sync_log status skipped |
| 4xx/5xx | Retry with backoff; on final failure, log and alert |
Campaign / Fund Mapping
- Givebutter: Type defaults and campaign overrides (Dashboard → Mappings). See Campaign Mapping.
- Square: Square type default and location overrides (Dashboard → Mappings). See Square Location Overrides.

