Klaviyo event payloads can contain nested objects and arrays, such as profile properties, product details, and line items. Implement a recursive function that flattens a JSON-compatible payload into a dictionary of paths to scalar values.
Given payload, a JSON-compatible Python dictionary or list, return a dictionary where:
None, becomes one output entry...For example, {"customer": {"email": "a@example.com"}} becomes {"customer.email": "a@example.com"}.
.def flatten_event_payload(payload):