---
title: "Returns the advanced rules currently available to a customer because of the customer segments they belong to."
method: GET
path: "/v1/pvt/Customer/{id}/segmentrules"
tags: ["Customer"]
---

# Returns the advanced rules currently available to a customer because of the customer segments they belong to.

`GET /v1/pvt/Customer/{id}/segmentrules`

## Request

- Base URL: `https://api.bonifiq.com.br`
- URL: `https://api.bonifiq.com.br/v1/pvt/Customer/{id}/segmentrules`
- Auth: HTTP basic

Use this endpoint to show a customer the benefits and campaigns targeted at their profile, such as on a landing page.
It is a dedicated lookup: the customer data endpoint (`GET /v1/pvt/Customer/{id}`) keeps returning only the customer's segments, not their rules.
            
## Which rules are returned
A rule is listed only when **all** of the following are true:
- the rule is active and the current date is within its validity period (`StartDate` / `EndDate`);
- the rule is restricted to customer segments, and the customer belongs to at least one of those segments;
- that segment is active;
- the rule still has participations left, when it has a participation limit.
            
Draft, paused, scheduled and completed rules are never returned. Rules that are not restricted to segments are not returned either, since they apply to every customer.
            
## Empty list
A customer that does not belong to any active segment, or whose segments have no rule available right now, returns HTTP 200 with an empty `result` list.
The list is also empty when the store's plan does not include advanced rules.
            
## Order conditions
A listed rule is available to the customer, but each order must still meet the rule's own conditions to be rewarded.
`purchaseAmount` (amount spent) and `minimumOrderValue` are returned; the other conditions (such as products, brands, categories, stores, payment methods and sales channels) are not part of this response.
            
## Response
Rules are ordered from the oldest to the newest. Each rule lists in `segments` only the customer's segments that made it available, with the same `name` and `tag` returned by the customer data endpoint.
`cardTitle` and `cardDescription` replicate the rule's `name` and `description`, as the BonifiQ widget does.
If the customer is not found, returns HTTP 404 with `hasError: true` and `errorMessage: "Customer not found"`.

## Path parameters

- `id` string, required

## Response `200`

Customer found; returns the available rules, which may be an empty list.

- BaseExternalApiResponseOfListOfCustomerSegmentRuleResponse: Standard response envelope used by the External API.
  - `ErrorMessage` string, nullable: Error message returned when the request fails validation or processing. For warnings and successful responses, consumers should usually inspect `Result`, `Code` and `Severity` first.
  - `ErrorCode` integer, nullable: Legacy numeric error code derived from internal API errors when available. This field is relevant only for error flows that use `ApiResponseErrorDescription`.
  - `Result` object[], nullable: Business payload returned by the endpoint.
    - `Id` integer: Rule identifier. It is the same value the purchase points report returns as `CampaignId` when `CampaignSource` is `AdvancedRule`.
    - `Name` string: Rule name, as shown in the store's admin panel.
    - `Description` string, nullable: Rule description, as shown in the store's admin panel.
    - `RewardType` 0 | 1: Tipo de recompensa de uma regra avançada (Motor de Regras Avançadas). 0 = Percentage 1 = FixedValue
    - `RewardValue` number: Percentage (eg: `100` for 100%) or fixed amount, according to `RewardType`.
    - `StartDate` string, date-time: When the rule started to be valid (UTC).
    - `EndDate` string, date-time, nullable: When the rule stops being valid (UTC). `null` means the rule has no end date.
    - `PurchaseAmount` CustomerSegmentRulePurchaseAmountResponse: "Amount spent" condition of an advanced rule. Both limits are inclusive and compared with the order total.
      - `MinimumAmount` number: The order total must be at least this amount ("from X").
      - `MaximumAmount` number, nullable: The order total must be at most this amount. `null` means there is no upper limit.
    - `MinimumOrderValue` number, nullable: Minimum order total required for the rule to apply. `null` means there is no minimum.
    - `DaysToGrantPoints` integer, nullable: Days after the order for the benefit to become available. `null` means the loyalty program default is used.
    - `ExpirationDays` integer, nullable: Validity, in days, of the benefit granted by this rule. `null` means the loyalty program default expiration is used.
    - `ShowOnWidgetAndLandingPage` boolean: Whether the store chose to advertise this rule on the BonifiQ widget and landing page. Rules with `false` still apply to the customer's orders; use this flag to mirror the store's choice on your own pages.
    - `CardTitle` string: Title of the rule card, exactly as the BonifiQ widget and landing page show it. It replicates `Name`.
    - `CardDescription` string, nullable: Description of the rule card, exactly as the BonifiQ widget and landing page show it. It replicates `Description`.
    - `IconUrl` string, nullable: Icon of the rule card.
    - `ActionButtonText` string, nullable: Text of the card's call-to-action button. `null` when the store did not configure a button.
    - `ActionButtonUrl` string, nullable: Destination of the card's call-to-action button. `null` when the store did not configure a button.
    - `Segments` object[]: Active segments of the customer that make this rule available to them. A rule may target other segments too; only the ones the customer belongs to are listed.
      - `Name` string: Segment name, as shown in the store's admin panel.
      - `Tag` string: Segment public identifier (slug, unique per store). Use it to reference the segment in integrations.
  - `Code` string, nullable: Endpoint-specific business code formatted as a two-digit string, such as `03` or `07`. This field is available for success, warning and error outcomes.
  - `CodeName` string, nullable: Symbolic enum name associated with `Code`, such as `CheckoutNotFound`.
  - `Severity` 0 | 1 | 2: 0 = Success 1 = Warning 2 = Error
  - `HasWarning` boolean: Convenience flag that is `true` when `Severity` is `Warning`. Warnings are valid `200 OK` business outcomes and should not be handled as transport or validation errors.
  - `HasError` boolean: Indicates whether the request failed and should be handled as an error response. This flag is reserved for real API errors; warnings must keep this property as `false`.

## Changes

- **2026-09-24** `9800ac10876f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/bonifiq/apis/bonifiq-private-apis/changes/v1/pvt/Customer/:id/segmentrules/get.md)

---

[API](https://skmtc.dev/bonifiq/apis/bonifiq-private-apis.md) - [All operations](https://skmtc.dev/bonifiq/apis/bonifiq-private-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/bonifiq/apis/bonifiq-private-apis/revisions/bac0977b23d5?raw)
