amount field is always signed (negative for refunds and chargebacks), so P&L aggregates are a simple SUM with no per-type sign logic scattered across queries.
How events reach the ledger
Events arrive from three sources:Stripe and QuickBooks webhooks
The Precipiq API has built-in receivers for both. Point your webhook at the Precipiq endpoint, set the
X-Precipiq-Key header on the endpoint configuration, and events land automatically — no code required.SDK-ingested events
For internal systems such as your own billing engine or ops event stream, POST events directly to the REST API. The SDK does not yet wrap this endpoint, so the REST call is the recommended path.
Shape
Ingesting from code
Dedicated SDK methods (
pq.log_financial_event / pq.logFinancialEvent) are planned but not in the current SDK release. Today the REST call above is the recommended approach for code paths outside Stripe and QuickBooks.Event types
| Type | Sign | Typical source |
|---|---|---|
payment | + | Stripe payment_intent.succeeded |
refund | − | Stripe charge.refunded |
chargeback | − | Stripe charge.dispute.created |
cost | − | Internal COGS / API spend |
liability | − | Booked legal/compliance exposure |
other | ± | Caller-supplied |
Idempotency
Every event accepts an optionalexternal_id field. When a Stripe webhook retries the same event (Stripe does this aggressively), the Precipiq receiver returns the existing row and writes no duplicate. Your integration code does not need to track delivery state.