# Get a List of Loyalty Programs Active in the Location

The method allows you to get a list of loyalty programs that are active for the specified location.

Endpoint: GET /locations/{location_id}/loyalty/programs/search
Version: 1.0.0
Security: BearerPartnerUser

## Security:

  - `BearerPartnerUser` (unknown)
    http bearer Bearer {PartnerToken}, User {UserToken}

## Path parameters:

  - `location_id` (number, required)
    location ID

## Query parameters:

  - `include` (string)
    The first_transaction_date value adds the date of the first stock transaction to the response.

  - `type` (string)
    Loyalty program type

## Header parameters:

  - `Accept` (string, required)
    application/vnd.api.v2+json

  - `Content-Type` (string, required)
    application/json

  - `Authorization` (string, required)
    Bearer bearer_token, User user_token

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `success` (boolean)
    Execution success status.

  - `data` (array)
    An array of data objects.

  - `data.id` (integer)
    Loyalty Program ID

  - `data.title` (string)
    Share name

  - `data.type` (string)
    Loyalty program type
    Enum: "discount_static", "discount_accumulative_visits", "discount_accumulative_sold", "discount_accumulative_paid", "cashback_static_sold", "cashback_static_paid", "cashback_accumulative_paid", "cashback_accumulative_sold", "cashback_accumulative_paid_visits", "cashback_accumulative_sold_visits", "cashback_sold_visits", "cashback_paid_visits", "package_discount"

  - `data.loyalty_type_id` (integer)
    Loyalty program type ID

  - `data.item_type_id` (integer)
    Identifier of the discount application type

  - `data.service_item_type` (string)
    Type of application to services
    Enum: "any_allowed", "not_allowed", "custom_allowed"

  - `data.good_item_type` (string)
    Type of application to products
    Enum: "any_allowed", "not_allowed", "custom_allowed"

  - `data.value_unit_id` (integer)
    Unit ID of the bonus or discount

  - `data.value_unit` (string)
    Bonus or discount measurement unit (percentage, fixed amount)
    Enum: "percent", "amount"

  - `data.group_id` (integer)
    Chain ID

  - `data.usage_limit` (integer)
    Limit on the number of applications (only for cashback)

  - `data.visit_multiplicity` (integer)
    Multiplicity of application by visits (only for cashback)

  - `data.sold_items_multiplicity` (integer)
    How many services you need to pay to get a discount on promotional services (only for the loyalty program type "Discount by condition")

  - `data.current_package_progress` (integer)
    The current number of uses of the loyalty program

  - `data.allowed_usages_amount` (integer)
    Limitation on the number of allowed uses

  - `data.expiration_timeout` (integer)
    Expiration date of bonuses or discounts

  - `data.expiration_timeout_unit` (string)
    The unit of measurement for the expiration date of bonuses or discounts
    Enum: "day", "week", "month", "year"

  - `data.expiration_notification_timeout` (integer)
    How many days before the bonus or discount expires, you need to send a notification to the client

  - `data.params_source_type` (string)
    Where to get the client's history to calculate the size of the bonus or discount (for accumulation loyalty programs or conditional discounts)
    Enum: "loyalty_card", "active_companies", "chain"

  - `data.history_start_date` (string)
    From what date to take into account the client's history to calculate the size of the bonus or discount (for accumulative loyalty programs or conditional discounts)

  - `data.on_changed_notification_template_id` (integer)
    Notification template ID when changing bonus or discount

  - `data.on_expiration_notification_template_id` (integer)
    Identifier of the notification template when a bonus or discount burns

  - `data.first_transaction_date` (string)
    Date of first stock transaction

  - `meta` (object)
    Metadata (contains the number of objects found)

  - `meta.count` (integer)
    Number of objects found

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Authentication needed.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Access denied.

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object | array)
    Additional response data (empty object or empty array)
    Example: {}

