# Loyalty Program Details

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/managers/loyalty-program/list-data:
    get:
      summary: Loyalty Program Details
      deprecated: false
      description: |-
        Retrieves list data relevant to the loyalty program configuration.

        <Accordion title="🔑Scopes" defaultOpen>
            
        `loyalty_program.read` - Loyalty Program Read
         
        </Accordion>
      operationId: get-managers-loyalty-program-list-data
      tags:
        - Default module/Apps/Merchant APIs/Marketing/Loyalty Program
        - Loyalty Program
      parameters:
        - name: Authorization
          in: header
          description: >-
            The Authorization token is a unique key given to the third-party
            application (Partner) by Zid. It is used to authenticate the API
            requests made by the Partner application. The token verifies the
            partner's identity and ensures they have permission to access Zid's
            API but does not provide any specific user or store information. It
            should be included in the header of API requests when the partner
            application needs to access Zid's API.
          required: true
          example: '{{Autherization}}'
          schema:
            type: string
        - name: X-Manager-Token
          in: header
          description: >-
            This token is used to authenticate and access information related to
            the store. It is obtained through an OAuth mechanism and is required
            to perform operations on the store's data. The `X-Manager-Token`
            should be included in the header of API requests that require
            store-related information.
          required: true
          example: '{{Access-Token}}'
          schema:
            type: string
        - name: Accept
          in: header
          description: >-
            Specifies the Media Types acceptable for the client. In this case,
            it signals that the client expects a response in the JSON format.
          required: false
          example: application/json
          schema:
            type: string
            default: application/json
        - name: Accept-Language
          in: header
          description: >-
            Preferred language for the response. Defaults to `en` if not
            specified.
          required: false
          example: en
          schema:
            type: string
            enum:
              - en
              - ar
            examples:
              - en
      responses:
        '200':
          description: Loyalty program list data is retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                x-examples:
                  Example 1:
                    status: object
                    cashback_rules:
                      - id: b1e3ca5d-2a89-4993-89bf-0f31a4b70b00
                        external_id: pos
                        store_id: 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        points_rewarded: 1
                        amount_to_spend: 1
                        available_to: null
                        is_active: false
                        created_at: '2023-12-28T10:32:13.000000Z'
                        updated_at: '2024-08-11T10:59:24.000000Z'
                        deleted_at: null
                      - id: efc450a4-3f09-4544-bcdd-80ddcbde23c8
                        external_id: '15362'
                        store_id: 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        points_rewarded: 1
                        amount_to_spend: 1
                        available_to:
                          tags: []
                          level:
                            levelId: null
                            levelName: null
                        is_active: true
                        created_at: '2023-03-29T10:55:07.000000Z'
                        updated_at: '2024-04-25T14:24:22.000000Z'
                        deleted_at: null
                    redemption_rules:
                      - id: 175ebe13-9070-4e7d-819e-2f8ba5797b1d
                        external_id: null
                        store_id: 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        name: '3'
                        points_to_redeem: 3
                        rule_type: fixed_rate_settings
                        reward:
                          discount_value: 1
                        conditions: null
                        is_active: false
                        created_at: '2023-10-26T10:59:16.000000Z'
                        updated_at: '2024-04-25T19:55:04.000000Z'
                        deleted_at: null
                      - id: 5ac1ca2d-bf05-4e3e-8ded-c9ff4890a5b7
                        external_id: null
                        store_id: 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        name: '4'
                        points_to_redeem: 4
                        rule_type: fixed_rate_settings
                        reward:
                          discount_value: 2
                        conditions: null
                        is_active: false
                        created_at: '2023-08-16T11:47:33.000000Z'
                        updated_at: '2024-04-25T19:55:05.000000Z'
                        deleted_at: null
                      - id: 6c8048bf-2695-4585-8231-e06afb143eff
                        external_id: null
                        store_id: 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        name: '2000'
                        points_to_redeem: 2000
                        rule_type: fixed_rate_settings
                        reward:
                          discount_value: 45
                        conditions: null
                        is_active: false
                        created_at: '2023-06-21T10:19:30.000000Z'
                        updated_at: '2024-04-25T19:55:22.000000Z'
                        deleted_at: null
                      - id: 8c8af498-a938-4a2d-a086-2e3073d630b8
                        external_id: null
                        store_id: 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        name: '5'
                        points_to_redeem: 5
                        rule_type: fixed_rate_settings
                        reward:
                          discount_value: 1
                        conditions: null
                        is_active: false
                        created_at: '2023-07-25T04:16:26.000000Z'
                        updated_at: '2024-04-25T19:55:17.000000Z'
                        deleted_at: null
                      - id: 93ff5cff-9ab5-4b8e-9e5b-98f897fc68b5
                        external_id: null
                        store_id: 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        name: '5001'
                        points_to_redeem: 5001
                        rule_type: fixed_rate_settings
                        reward:
                          discount_value: 80
                        conditions: null
                        is_active: false
                        created_at: '2023-07-19T13:56:26.000000Z'
                        updated_at: '2024-04-25T19:55:16.000000Z'
                        deleted_at: null
                      - id: 9c908710-b055-4b39-a4ed-b1dbd00712fb
                        external_id: null
                        store_id: 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        name: '13'
                        points_to_redeem: 13
                        rule_type: fixed_rate_settings
                        reward:
                          discount_value: 1
                        conditions: null
                        is_active: false
                        created_at: '2023-07-25T04:16:42.000000Z'
                        updated_at: '2024-04-25T19:55:16.000000Z'
                        deleted_at: null
                      - id: b619ef81-6f39-42f8-b91b-fec49247d243
                        external_id: null
                        store_id: 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        name: '3'
                        points_to_redeem: 3
                        rule_type: fixed_rate_settings
                        reward:
                          discount_value: 3
                        conditions: null
                        is_active: false
                        created_at: '2023-07-31T08:44:00.000000Z'
                        updated_at: '2024-04-25T19:55:15.000000Z'
                        deleted_at: null
                      - id: c619148b-aadb-4896-8711-c877fa0cfe56
                        external_id: null
                        store_id: 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        name: '2'
                        points_to_redeem: 2
                        rule_type: fixed_rate_settings
                        reward:
                          discount_value: 1
                        conditions: null
                        is_active: false
                        created_at: '2023-07-25T04:16:50.000000Z'
                        updated_at: '2024-06-12T14:00:24.000000Z'
                        deleted_at: null
                      - id: d37d54a6-46f6-40e7-bf82-e2c0381d1872
                        external_id: null
                        store_id: 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        name: '10000'
                        points_to_redeem: 10000
                        rule_type: fixed_rate_settings
                        reward:
                          discount_value: 140
                        conditions: null
                        is_active: false
                        created_at: '2023-07-24T09:46:22.000000Z'
                        updated_at: '2024-04-25T19:55:10.000000Z'
                        deleted_at: null
                      - id: e76b6d7b-e37f-48c2-914c-16c5b5a9a9a0
                        external_id: null
                        store_id: 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        name: '7'
                        points_to_redeem: 7
                        rule_type: fixed_rate_settings
                        reward:
                          discount_value: 6
                        conditions: null
                        is_active: false
                        created_at: '2023-09-14T11:07:48.000000Z'
                        updated_at: '2024-04-25T19:55:10.000000Z'
                        deleted_at: null
                    total_earned_points: 1271060
                    total_redemed_points: 2004
                    total_pending_points: 51419
                    total_customers_with_points: 48
                    expiration_peroid: 5
                    is_active: true
                    message:
                      type: object
                      code: null
                      name: null
                      description: null
                properties:
                  status:
                    type: string
                    description: Indicates the overall status of the API response.
                  cashback_rules:
                    type: array
                    description: >-
                      The cashback_rules array contains the rules related to
                      earning cashback points.
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: A unique identifier for each specific cashback rule.
                          examples:
                            - b1e3ca5d-2a89-4993-89bf-0f31a4b70b00
                        external_id:
                          type: string
                          description: >-
                            An identifier used by external systems to track or
                            reference the rule.
                          examples:
                            - pos
                        store_id:
                          type: string
                          description: >-
                            The unique identifier of the store where this rule
                            applies.
                          examples:
                            - 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        points_rewarded:
                          type: integer
                          description: >-
                            The number of points awarded for spending a certain
                            amount.
                          examples:
                            - 1
                        amount_to_spend:
                          type: integer
                          description: >-
                            The amount of money that needs to be spent to earn
                            the points.
                          examples:
                            - 1
                        available_to:
                          type: object
                          properties:
                            tags:
                              type: array
                              items:
                                type: string
                            level:
                              type: object
                              properties:
                                levelId:
                                  type: string
                                  nullable: true
                                levelName:
                                  type: string
                                  nullable: true
                              x-apidog-orders:
                                - levelId
                                - levelName
                              x-apidog-ignore-properties: []
                          x-apidog-orders:
                            - tags
                            - level
                          description: >-
                            Specifies if the rule is available to certain tags
                            or levels.
                          required:
                            - tags
                            - level
                          x-apidog-ignore-properties: []
                          nullable: true
                        is_active:
                          type: boolean
                          description: >-
                            A boolean value (true or false) indicating whether
                            the cashback rule is currently active.
                          default: false
                        created_at:
                          type: string
                          description: >-
                            The timestamp indicating when the cashback rule was
                            created.
                          examples:
                            - '2023-12-28T10:32:13.000000Z'
                        updated_at:
                          type: string
                          description: >-
                            The timestamp indicating when the cashback rule was
                            last updated.
                          examples:
                            - '2023-12-28T10:32:13.000000Z'
                        deleted_at:
                          type: 'null'
                          description: >-
                            he timestamp indicating when the cashback rule was
                            deleted, or null if it hasn’t been deleted.
                      x-apidog-orders:
                        - id
                        - external_id
                        - store_id
                        - points_rewarded
                        - amount_to_spend
                        - available_to
                        - is_active
                        - created_at
                        - updated_at
                        - deleted_at
                      x-apidog-ignore-properties: []
                  redemption_rules:
                    type: array
                    description: >-
                      The redemption_rules array contains the rules related to
                      redeeming points for rewards.
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: >-
                            A unique identifier for each specific redemption
                            rule.
                          examples:
                            - efc450a4-3f09-4544-bcdd-80ddcbde23c8
                        external_id:
                          type: string
                          description: >-
                            An identifier used by external systems to track or
                            reference the rule, which may be null.
                          nullable: true
                        store_id:
                          type: string
                          description: >-
                            The unique identifier of the store where this
                            redemption rule applies.
                          examples:
                            - 3dfc16e6-ad19-4126-9c2a-5e4a7fb73051
                        name:
                          type: string
                          description: >-
                            The name given to this redemption rule, which might
                            be numeric or descriptive.
                          examples:
                            - '3'
                        points_to_redeem:
                          type: integer
                          description: >-
                            The number of points required to redeem the
                            specified reward.
                          examples:
                            - 3
                        rule_type:
                          type: string
                          description: ' The type of rule, often defining how the reward is calculated or applied, such as "fixed_rate_settings."'
                          examples:
                            - fixed_rate_settings
                        reward:
                          type: object
                          properties:
                            discount_value:
                              type: integer
                              description: >-
                                The value of the discount or reward that is
                                given when points are redeemed.
                              examples:
                                - 1
                          x-apidog-orders:
                            - discount_value
                          x-apidog-ignore-properties: []
                        conditions:
                          type: 'null'
                          description: >-
                            Any specific conditions or restrictions that apply
                            to this redemption rule, which might be null if
                            there are none.
                        is_active:
                          type: boolean
                          description: >-
                            A boolean value (true or false) indicating whether
                            the redemption rule is currently active.
                          default: false
                        created_at:
                          type: string
                          description: >-
                            The timestamp indicating when the redemption rule
                            was created.
                          examples:
                            - '2023-10-26T10:59:16.000000Z'
                        updated_at:
                          type: string
                          description: >-
                            The timestamp indicating when the redemption rule
                            was last updated.
                          examples:
                            - '2023-04-26T10:59:16.000000Z'
                        deleted_at:
                          type: 'null'
                          description: >-
                            The timestamp indicating when the redemption rule
                            was deleted, or null if it hasn’t been deleted.
                      x-apidog-orders:
                        - id
                        - external_id
                        - store_id
                        - name
                        - points_to_redeem
                        - rule_type
                        - reward
                        - conditions
                        - is_active
                        - created_at
                        - updated_at
                        - deleted_at
                      x-apidog-ignore-properties: []
                  total_earned_points:
                    type: integer
                    description: >-
                      The cumulative number of points that have been earned by
                      all customers within the loyalty program.
                    examples:
                      - 1271060
                  total_redemed_points:
                    type: integer
                    description: >-
                      he total number of points that have been redeemed by
                      customers for rewards.
                    examples:
                      - 2004
                  total_pending_points:
                    type: integer
                    description: >-
                      The number of points that are pending or not yet available
                      for redemption, possibly due to conditions like waiting
                      periods.
                    examples:
                      - 51419
                  total_customers_with_points:
                    type: integer
                    description: >-
                      The total number of customers who have earned points
                      within the loyalty program.
                    examples:
                      - 48
                  expiration_peroid:
                    type: integer
                    description: >-
                      The time period (likely in months or years) after which
                      the earned points expire if not redeemed.
                    examples:
                      - 5
                  is_active:
                    type: boolean
                    description: >-
                      A boolean value (true or false) indicating whether the
                      overall loyalty program is active.
                    default: true
                  message:
                    type: object
                    description: Contains detailed information about the message.
                    properties:
                      type:
                        type: string
                        description: Specifies the type of message.
                      code:
                        type: 'null'
                        description: A specific code representing the type.
                      name:
                        type: 'null'
                        description: A short, human-readable title or name for the message.
                      description:
                        type: 'null'
                        description: >-
                          A detailed description of the message, providing more
                          context.
                    x-apidog-orders:
                      - type
                      - code
                      - name
                      - description
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - status
                  - cashback_rules
                  - redemption_rules
                  - total_earned_points
                  - total_redemed_points
                  - total_pending_points
                  - total_customers_with_points
                  - expiration_peroid
                  - is_active
                  - message
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: OK
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                x-examples:
                  Example 1:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_INVALID
                      name: عذراً
                      description: >-
                        انتهت فترة جلسة استخدام التطبيق، الرجاء تسجيل الدخول مرة
                        أخرى
                properties:
                  status:
                    type: string
                    description: 'Indicates the overall status of the API response. '
                    examples:
                      - '"error"'
                  message:
                    type: object
                    description: Contains detailed information about the error encountered.
                    properties:
                      type:
                        type: string
                        description: Specifies the type of message.
                        examples:
                          - '"error"'
                      code:
                        type: string
                        description: A specific code representing the error type.
                        examples:
                          - '"ERROR_SESSION_INVALID"'
                      name:
                        type: string
                        description: >-
                          A short, human-readable title or name for the error
                          message.
                        examples:
                          - '"عذراً"'
                      description:
                        type: string
                        description: >-
                          A detailed description of the error, providing more
                          context about what went wrong. 
                        examples:
                          - >-
                            "انتهت فترة جلسة استخدام التطبيق، الرجاء تسجيل
                            الدخول مرة أخرى"
                    x-apidog-orders:
                      - type
                      - code
                      - name
                      - description
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - status
                  - message
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Unauthorized
        '500':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status of the error.
                  message:
                    $ref: '#/components/schemas/ResponseEnvelopMessage'
                required:
                  - status
                  - message
                x-apidog-orders:
                  - status
                  - message
                x-apidog-ignore-properties: []
              example:
                status: error
                message:
                  type: error
                  code: MSG_HIDDEN
                  name: Error
                  description: Internal Server Error
          headers: {}
          x-apidog-name: Internal Server error
        x-401:Unauthorized:
          description: ''
          content:
            application/json:
              schema:
                type: object
                description: >-
                  Response returned when the request cannot be authenticated
                  because the required credentials are missing, invalid, or
                  expired.
                properties:
                  status:
                    type: string
                    description: Indicates the overall status of the API response.
                    examples:
                      - error
                  message:
                    type: object
                    description: >-
                      Contains structured details explaining why the request
                      could not be authenticated.
                    properties:
                      type:
                        type: string
                        description: Indicates the category of the response message.
                        examples:
                          - error
                      code:
                        type: string
                        description: >-
                          A machine-readable code identifying the authentication
                          error. Returns null when no specific code is
                          available.
                        examples:
                          - UNAUTHORIZED
                        nullable: true
                      name:
                        type: string
                        description: >-
                          A short, human-readable title describing the
                          authentication error. Returns null when no title is
                          available.
                        examples:
                          - Unauthorized
                        nullable: true
                      description:
                        type: string
                        description: >-
                          A human-readable explanation of why the request could
                          not be authenticated. Returns null when no detailed
                          explanation is available.
                        examples:
                          - >-
                            Authentication credentials are missing, invalid, or
                            expired.
                        nullable: true
                    required:
                      - type
                      - code
                      - name
                      - description
                    x-apidog-orders:
                      - type
                      - code
                      - name
                      - description
                    x-apidog-ignore-properties: []
                required:
                  - status
                  - message
                x-apidog-orders:
                  - status
                  - message
                examples:
                  - status: error
                    message:
                      type: error
                      code: UNAUTHORIZED
                      name: Unauthorized
                      description: >-
                        Authentication credentials are missing, invalid, or
                        expired.
                x-apidog-ignore-properties: []
              examples:
                '1':
                  summary: Example 1
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_MISSING
                      name: Sorry
                      description: Please login first.
                '2':
                  summary: Example 2
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_INVALID
                      name: Sorry
                      description: Login session expired. Please login again.
                '3':
                  summary: Example 3
                  value:
                    status: error
                    message:
                      type: error
                      code: ERROR_SESSION_INVALID
                      name: Sorry
                      description: Invalid authentication
          headers: {}
          x-apidog-name: Unauthorized
      security: []
      x-apidog-folder: Default module/Apps/Merchant APIs/Marketing/Loyalty Program
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/613905/apis/api-9148638-run
components:
  schemas:
    ResponseEnvelopMessage:
      type: object
      properties:
        type:
          type: string
          description: Type of response message returned by the API.
          examples:
            - success
        code:
          type: string
          description: Response code returned by the API, if available.
          examples:
            - MSG_POPUP_OK
          nullable: true
        name:
          type: string
          description: Name or title of the response message, if available.
          examples:
            - Coupons
          nullable: true
        description:
          type: string
          description: Detailed description of the response message, if available.
          examples:
            - Coupons created successfully
          nullable: true
      required:
        - type
        - code
        - name
        - description
      description: Additional response metadata.
      x-apidog-orders:
        - type
        - code
        - name
        - description
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.zid.sa/
    description: Prod Env
security: []

```
