# Get a Chain Loyalty Program

Endpoint: GET /chains/{chain_id}/loyalty/programs/{loyalty_program_id}
Version: 1.0.0
Security: BearerPartnerUser

## Security:

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

## Path parameters:

  - `chain_id` (integer, required)
    Chain ID

  - `loyalty_program_id` (integer, required)
    Loyalty Program ID

## Query parameters:

  - `include` (string)
    Include additional resources in the answer

## Header parameters:

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

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

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

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `id` (integer)
    Stock ID

  - `title` (string)
    Share name

  - `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"

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

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

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

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

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

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

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

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

  - `expiration_notification_timeout` (integer)
    How many days before the bonus or discount expires, a notification must be sent to the client

  - `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"

  - `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)

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

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

  - `loyalty_card_types` (array)
    Type of cards for which the loyalty program is valid (on request)

  - `loyalty_card_types.id` (integer)
    Card type identifier

  - `loyalty_card_types.title` (string)
    Card type name

  - `on_changed_notification_template` (object)
    Loyalty notification template
    Example: {"id":12,"type":"small","message_type":"loyalty_discount_expiration","body":"Your discount expires tomorrow"}

  - `on_changed_notification_template.id` (integer)
    Template ID

  - `on_changed_notification_template.type` (string)
    Template option
    Enum: "big", "mid", "small", "custom"

  - `on_changed_notification_template.body` (string)
    Template text

  - `on_changed_notification_template.message_type` (string)
    Message type
    Enum: "loyalty_discount_expiration", "loyalty_cashback_expiration", "loyalty_discount_increased", "loyalty_discount_decreased", "loyalty_card_created", "loyalty_card_withdraw", "loyalty_withdraw_cancelled", "loyalty_card_manual", "loyalty_card_manual_withdraw", "loyalty_card_cashback", "loyalty_card_cashback_cancelled", "loyalty_card_income", "loyalty_discount_changed", "loyalty_cashback_changed", "loyalty_settings_abonement_notification"

  - `rules` (array)
    Rules for determining the value of the bonus or discount (only one rule is allowed for fixed loyalty programs) (on request)

  - `rules.id` (integer)
    Rule ID

  - `rules.parameter` (integer)
    Rule Threshold (0 for Fixed Stock Types)

  - `rules.value` (number)
    The value of the discount or bonus

  - `rules.loyalty_program_id` (integer)
    Loyalty Program ID

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

  - `rules.service_id` (integer)
    Service ID (only for "Discount by condition" loyalty program)

  - `companies` (array)
    Locations where the loyalty program is valid (on request)

  - `companies.id` (number, required)
    location ID

  - `companies.title` (string, required)
    Name of the organization

  - `companies.country` (string, required)
    The name of the country in which the organization is located

  - `companies.country_id` (number, required)
    Country ID

  - `companies.city` (string, required)
    Name of the city where the organization is located

  - `companies.city_id` (number, required)
    City ID

  - `companies.phone` (string, required)
    location phone

  - `companies.timezone` (string, required)
    location time zone

  - `companies.address` (string, required)
    location address

  - `companies.coordinate_lat` (number, required)
    Latitude

  - `companies.coordinate_lng` (number, required)
    Longitude

  - `applicable_items` (array)
    Related entities for selective application of the loyalty program (on request)

  - `applicable_items.id` (integer)
    Related entity ID

  - `applicable_items.title` (string)
    Related entity name

  - `applicable_items.is_service` (boolean)
    Flag: true - service/category of services, false - product/category of products

  - `applicable_items.is_category` (boolean)
    Flag: true - service/product category, false - service/product

## 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: {}

