First signals

Prerequisites

Sending Signals

The simplest way to send a signal is below. For billable attribution of signals, you need to provide both customer and product ids. Though, if not provided, unattributed signals are still saved and are viewable.

1from paid import Paid, Signal, CustomerByExternalId, ProductByExternalId
2
3paid_client = Paid(token="YOUR_PAID_API_KEY")
4
5# ... your business logic ...
6
7# emit a signal that corresponds to a billable event
8res = paid_client.signals.create_signals(
9signals=[
10 Signal(
11 event_name="email_sent",
12 customer=CustomerByExternalId(
13 external_customer_id="<your_external_customer_id>",
14 ),
15 attribution=ProductByExternalId(
16 external_product_id="<your_external_product_id>",
17 ),
18 data={"some_data": "some_value"},
19 )
20],
21)
22
23print(res)