Summarize this documentation using AI
Overview
If you’re using Customer.io as the system that triggers retention messaging, the Pipelines API is the backend path that keeps your event stream (browse, cart, purchase, subscription, returns) clean enough to actually drive repeat purchase and recovery. If you want a second set of eyes on what to instrument first (and what to ignore), you can book a strategy call—most teams don’t need more events, they need the right ones sent consistently.
In practice, Pipelines becomes the “source of truth” for: who a customer is, what they did, and what state they’re in—so your cart recovery, replenishment, and winback flows aren’t guessing.
How It Works
Pipelines is designed for server-side ingestion: your app/backend sends identify-style updates (profile traits) and track-style events (behavior) into Customer.io. Customer.io then uses those events to qualify segments and trigger campaigns/workflows in near real time.
- Authentication: requests are authenticated with your workspace’s API credentials. In most D2C stacks, you’ll store these in your secrets manager and only call Pipelines from trusted services (order service, checkout service, subscription service).
- Core primitives you’ll send:
- Customer updates (traits): email/phone, first_order_date, lifetime_value, last_order_date, subscription_status, loyalty_tier.
- Events: product_viewed, added_to_cart, checkout_started, order_completed, order_refunded, subscription_created, subscription_canceled.
- Idempotency and dedupe: cart and order events are where duplication kills performance. You want stable IDs (cart_id, order_id) so you can dedupe downstream and avoid double-sending recovery messages.
- Timing matters: for cart recovery, “added_to_cart” needs to land within seconds/minutes. For LTV and tiering, batching daily is fine as long as it’s consistent.
Real D2C scenario: a shopper adds a serum to cart, gets distracted, and never checks out. If your backend sends added_to_cart with cart_id, items, and cart_value, you can trigger a 30-minute SMS reminder, then a 20-hour email with social proof—without accidentally messaging people who already converted (because order_completed cancels them out).
Step-by-Step Setup
The fastest path is to instrument a small set of “money events” first (cart, checkout, purchase), validate delivery, then expand into product discovery and reactivation signals.
- Create API credentials and lock them down.
Store the Pipelines credentials in your secrets manager (AWS Secrets Manager, GCP Secret Manager, Vault). Only allow server-to-server calls—don’t ship keys in web/mobile clients. - Pick your canonical customer identifier.
Decide what Customer.io will treat as the stable ID (commonlycustomer_idfrom your commerce platform). If you rely on email as the primary key, expect headaches with email changes and guest checkout merges. - Implement “identify” calls from your customer/account service.
Send traits that power segmentation:email,phone,first_order_date,last_order_date,lifetime_value,accepts_marketing,timezone. - Implement “track” calls for retention triggers.
Start with:added_to_cart(includecart_id, line items, value)checkout_started(includecart_id, shipping country, value)order_completed(includeorder_id, items, revenue, discount_code)
- Add strong IDs to every event payload.
At minimum:event_id(UUID),cart_id,order_id. This is what prevents double-fires from retries, queue replays, or webhook duplicates. - Backfill what you need for segmentation.
If you’re launching winback or replenishment, backfill purchase history and last purchase date so “days since last order” segments aren’t empty for existing customers. - Validate delivery with logging + a replay plan.
Log every failed request with payload + response. Keep a replay queue for 24–72 hours so outages don’t create silent gaps in cart recovery.
When Should You Use This Feature
Pipelines is worth the engineering time when retention performance depends on event accuracy and speed. If you’re trying to run serious cart recovery or post-purchase orchestration, “close enough” event data will show up as wasted sends and suppressed revenue.
- Cart recovery that actually suppresses converters: trigger on
added_to_cartorcheckout_started, cancel whenorder_completedarrives with the samecart_idor customer within a short window. - Repeat purchase and replenishment: trigger based on
order_completed+ SKU metadata (category, replenishable flag, days_to_replenish). - Reactivation (winback) that doesn’t spam active buyers: segment on
last_order_dateand suppress anyone with recent browse/cart events. - Subscription save and churn prevention: send
subscription_canceledandpayment_failedevents so you can run timely save flows.
Operational Considerations
This is where most “it works in dev” implementations fall apart: inconsistent identifiers, missing timestamps, and event ordering issues. If you treat Pipelines like a production data product (not a one-off integration), your retention programs stay stable.
- Segmentation depends on stable traits.
Iflifetime_valueis sometimes a string, sometimes a number, your VIP segments will break silently. Normalize types and enforce a schema in your event producer. - Event ordering is not guaranteed.
Retries and queues can causeorder_completedto arrive beforecheckout_started. Build workflows that can handle out-of-order events (use timestamps and dedupe keys, not “latest event wins” assumptions). - Guest checkout identity resolution.
In many D2C programs, the same person appears as guest first, then creates an account later. Decide how you’ll merge identities (email-based merge, commerce customer_id mapping) so you don’t send winbacks to people who just bought. - Orchestration reality: cancellation logic needs shared keys.
Cart recovery is only clean if the cancel event and trigger event share a join key (cart_idis ideal). If you can’t guarantee that, you’ll need conservative suppression windows (which usually costs revenue). - Data flow ownership.
Pick one service as the source for purchases (order service) and one for carts (cart service). If multiple systems emit the same event type, duplicates are inevitable.
Implementation Checklist
If you run through this list before you ship, you avoid the common failure mode: flows firing, but not driving incremental revenue because the data is messy.
- API credentials stored server-side only; no client exposure
- Canonical customer identifier defined (
customer_idvs email) and documented - Event schema defined for:
added_to_cart,checkout_started,order_completed - Dedupe keys included:
event_id,cart_id,order_id - Consistent timestamps (UTC) included on events
- Backfill plan for historical orders and last_order_date
- Retry + replay strategy for failed API calls
- Monitoring: alert on drop in event volume for key events (cart, checkout, purchase)
Expert Implementation Tips
These are the patterns that tend to produce cleaner triggers and fewer edge-case fires once you scale volume.
- Model cart recovery around a “cart state” object in your backend.
Emit events from state transitions (created → updated → checkout_started → converted). This reduces noisy “added_to_cart” spam from quantity changes. - Send line items with SKU-level metadata.
Retention gets sharper when events includesku,product_id,category,price,replenishable. Then you can do category-specific replenishment and cross-sell without hacks. - Use a single “order_completed” event as the source of truth.
Avoid mixing “payment_captured”, “fulfilled”, “shipped” as purchase proxies. Keep purchase = completed order, then layer fulfillment events separately for post-purchase comms. - Instrument suppression signals, not just triggers.
For winback, addemail_clicked/sms_clickedequivalents if you have them, or at leastsite_session_started. In most retention programs, suppressing recently active browsers improves deliverability and reduces discount leakage.
Common Mistakes to Avoid
Most retention issues blamed on “messaging” are actually data problems upstream. These are the ones that repeatedly cost D2C teams money.
- Triggering cart recovery on client-side events only.
Ad blockers and flaky networks drop events. If revenue depends on it, send server-side or at least confirm server receipt. - No shared key between cart and purchase.
Withoutcart_idor a reliable join strategy, you’ll message converters. That’s how you train customers to wait for discounts. - Over-sending “product_viewed” without a plan.
High-volume browse events can drown your pipeline and make debugging harder. Start with cart/checkout/purchase, then add browse with sampling or only for high-intent pages. - Not backfilling last purchase data.
Winback segments end up empty or wrong, and you either don’t message anyone or you message everyone. - Inconsistent trait types.
Iflifetime_valueis sometimes"123.45"and sometimes123.45, your VIP logic becomes unreliable.
Summary
If you want dependable cart recovery, repeat purchase triggers, and winback segmentation, the Pipelines API needs to be treated like production infrastructure: stable IDs, dedupe, and a tight set of events. Start with the revenue-critical events, validate suppression logic, then expand into richer product and subscription signals.
Implement Cdp with Propel
If you’re already running Customer.io and want your Pipelines implementation to hold up under real retention pressure (dedupe, identity merges, suppression logic, backfills), it’s worth pressure-testing the event plan before you ship. If that’s helpful, you can book a strategy call and we’ll map the minimum viable event schema to the flows that actually drive incremental revenue.