Overview
Segments group customers by criteria — purchase history, attributes, and behaviour — so you can target specific offers. These endpoints return the plans, coupons, and product SKUs the authenticated customer is eligible for based on their segment membership.
How It Works
- Define segments - Create segments and attach plans, coupons, or product SKUs to them in the Pelcro dashboard.
- Customers are matched - Pelcro evaluates which customers belong to each segment.
- Query eligibility - Call these endpoints to retrieve what the authenticated customer qualifies for.
Example: Show a returning customer a win-back plan and a segment-specific coupon they alone are eligible for.
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/sdk/customer/plans | Eligible plans |
GET | /api/v1/sdk/customer/coupons | Eligible coupons |
GET | /api/v1/sdk/customer/product_sku | Eligible product SKUs |
Important Behaviors
- Authentication: All three endpoints require a bearer token.
- No eligible items: When the customer qualifies for nothing (or the account has no matching segments), the endpoint returns
404No eligible items found. - Granting segments: Each returned item includes the
segmentsthat make the customer eligible. - Cached briefly: Results are cached for a short period per customer.
