> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gameball.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Customer Activities

> Retrieve a log of customer activities within Gameball, including tier changes, campaign rewards, referrals, redemptions, and more.

This API retrieves a log of customer activities within Gameball, identified by `customerId`. The logs detail various actions, such as tier changes, campaign rewards, referrals, redemptions, and more. Specific activity types can be filtered, including events like `TierUpgraded`, `CampaignRewarded`, `ReferralBonusReward`, and `PaymentReward`, providing comprehensive visibility into each customer's engagement history.

<Info>
  **Security**: Requires **apikey** and **secretkey** headers.
</Info>


## OpenAPI

````yaml GET /api/v4.0/integrations/customers/{customerId}/activities
openapi: 3.1.0
info:
  title: Gameball API
  description: >-
    Gameball REST API v4.0 - Complete API reference for integrating loyalty,
    gamification, and customer engagement features
  version: 4.0.0
servers:
  - url: https://api.gameball.co
security:
  - bearerAuth: []
paths:
  /api/v4.0/integrations/customers/{customerId}/activities:
    get:
      summary: Get Customer Activities
      description: >-
        This API retrieves a log of customer activities within Gameball,
        identified by customerId. The logs detail various actions, such as tier
        changes, campaign rewards, referrals, redemptions, and more. Specific
        activity types can be filtered, including events like TierUpgraded,
        CampaignRewarded, ReferralBonusReward, and PaymentReward, providing
        comprehensive visibility into each customer's engagement history.
      operationId: getCustomerActivities
      parameters:
        - name: customerId
          in: path
          required: true
          description: >-
            Unique identifier for the customer that you can reference across the
            customer's whole lifetime. Could be a database ID, random string,
            email, or anything that uniquely identifies the customer.
          schema:
            type: string
        - name: startAfter
          in: query
          required: false
          schema:
            type: integer
            format: int64
            default: 0
          description: >-
            Specifies the page will start after which activity id. Defaults to
            0.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
            maximum: 200
          description: >-
            Specifies the number of activities to return per page. Defaults to
            50, with a maximum limit of 200 transactions per page.
        - name: activityType
          in: query
          required: false
          schema:
            type: string
            enum:
              - TierUpgraded
              - TierDowngraded
              - TierMigration
              - CampaignRewarded
              - SuccessfulAction
              - Referral
              - Referred
              - ReferralBonusReward
              - PaymentReward
              - Refund
              - Redemption
              - Cancel
              - Expiry
              - Migration
              - Lifetime
              - Automation
          description: >-
            Filters activities by a specific type, such as: TierUpgraded
            (Indicates that the customer has been upgraded to a new tier),
            TierDowngraded (Indicates that the customer has been downgraded to a
            lower tier), TierMigration (Represents the migration of the
            customer's tier), CampaignRewarded (Signifies that the customer
            received a reward from a campaign), SuccessfulAction (Denotes
            successful progress by the customer in a campaign), Referral
            (Indicates that the customer referred a friend), Referred (The
            referee received a reward for being referred by the customer),
            ReferralBonusReward (Represents a bonus reward given for a
            referral), PaymentReward (Signifies that the customer received a
            cashback reward), Refund (Points were refunded back to the
            customer), Redemption (Points were redeemed by the customer), Cancel
            (A cashback transaction was canceled), Expiry (Indicates that points
            have expired), Migration (Represents a migration activity that
            occurred), Lifetime (Refers to activities related to lifetime
            coupons), Automation (Activity performed by an automation campaign).
      responses:
        '200':
          description: Customer activities retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerActivitiesResponse'
      security:
        - apiKey: []
          secretKey: []
components:
  schemas:
    CustomerActivitiesResponse:
      type: object
      properties:
        activities:
          type: array
          description: An array of activity records for the customer
          items:
            type: object
            properties:
              activityId:
                type: number
                description: Unique identifier for the activity
              activityType:
                type: string
                description: >-
                  The type of activity that occurred (e.g., "Balance
                  Adjustment", "Referral"). Available Activity Types:
                  TierUpgraded (Indicates that the customer has been upgraded to
                  a new tier), TierDowngraded (Indicates that the customer has
                  been downgraded to a lower tier), TierMigration (Represents
                  the migration of the customer's tier), CampaignRewarded
                  (Signifies that the customer received a reward from a
                  campaign), BalanceAdjustment (Indicates that points were
                  either rewarded or deducted manually from the customer's
                  balance), SuccessfulAction (Denotes successful progress by the
                  customer in a campaign), Referral (Indicates that the customer
                  referred a friend), Referred (The referee received a reward
                  for being referred by the customer), ReferralBonusReward
                  (Represents a bonus reward given for a referral),
                  PaymentReward (Signifies that the customer received a cashback
                  reward), Refund (Points were refunded back to the customer),
                  Redemption (Points were redeemed by the customer), Cancel (A
                  cashback transaction was canceled), Expiry (Indicates that
                  points have expired), Migration (Represents a migration
                  activity that occurred), Lifetime (Refers to activities
                  related to lifetime coupons), Automation (Activity performed
                  by an automation campaign).
              activityDay:
                type: string
                description: >-
                  The day of the week when the activity took place (e.g.,
                  "Sunday").
              activityDate:
                type: string
                description: The date of the activity (e.g., "October 20, 2024").
              activityTime:
                type: string
                description: The time when the activity occurred (e.g., "19:27:33").
              customerId:
                type: string
                description: >-
                  The unique identifier of the customer associated with the
                  activity.
              email:
                type:
                  - string
                  - 'null'
                description: The email address of the customer.
              phoneNumber:
                type:
                  - string
                  - 'null'
                description: The customer's phone number.
              displayName:
                type:
                  - string
                  - 'null'
                description: The customer's display name.
              transactionId:
                type:
                  - string
                  - 'null'
                description: >-
                  A unique identifier for a transaction in your system (e.g.,
                  order number or invoice number). This ID can be used to
                  reverse, cancel, or refund any reward or redemption
                  transactions in Gameball. It represents the transaction ID
                  related to this activity, if applicable, such as in cases of
                  cashback rewards, points redemption, or balance adjustments.
              isManualActivity:
                type:
                  - boolean
                  - 'null'
                description: >-
                  Indicates whether the activity was manually triggered (true)
                  or not (false). Example: This will be true if the activity is
                  a BalanceAdjustment, when you manually decide to reward the
                  customer with points.
              points:
                type:
                  - number
                  - 'null'
                description: >-
                  The number of points involved in the activity, such as points
                  earned, redeemed, or adjusted.
              score:
                type:
                  - number
                  - 'null'
                description: >-
                  The score involved in the activity, applicable in reward
                  campaigns where the customer earns score. Example: If the
                  customer participates in a campaign and earns 100 score
                  points, the activity will include the score value.
              reason:
                type:
                  - string
                  - 'null'
                description: >-
                  This is the reason manually entered for the activity, if
                  provided. It is typically used when performing a manual
                  activity, such as rewarding points or rewarding a manual
                  reward campaign for a customer. Example: If you manually
                  reward a customer with 100 points for their birthday, you
                  might enter "Birthday reward" as the reason.
              calculatedRedemption:
                type:
                  - number
                  - 'null'
                description: >-
                  The estimated monetary value based on the redemption factor
                  configured by the client and the points involved in this
                  activity. It reflects the potential worth of the points, even
                  if no actual redemption was made.
              actualRedemption:
                type:
                  - number
                  - 'null'
                description: >-
                  The actual monetary value of the redemption, if applicable.
                  This represents the redeemed amount when the activity type is
                  points redemption.
              familyRedemptionAmount:
                type:
                  - number
                  - 'null'
                description: >-
                  The redemption monetary value related to the customer's family
                  wallet, if applicable.
              familyRedemptionPoints:
                type:
                  - number
                  - 'null'
                description: >-
                  The redemption points related to the customer's family wallet,
                  if applicable.
              paymentRewardAmount:
                type:
                  - number
                  - 'null'
                description: >-
                  The amount rewarded in currency from the payment reward. This
                  value reflects the cashback reward provided to the customer.
                  Example: If a customer receives a cashback reward of $10, the
                  paymentRewardAmount will be 10.
              outstandingPoints:
                type:
                  - number
                  - 'null'
                description: >-
                  The number of points currently available from the transaction
                  related to this activity. Example: If a customer earned 100
                  points from a transaction and 20 points have since expired,
                  the outstandingPoints would be 80, representing the points
                  still available for the customer to use.
              rewardThreshold:
                type:
                  - number
                  - 'null'
                description: >-
                  This represents the minimum monetary amount (X value) a
                  customer needs to spend to receive a specific number of reward
                  points (Y points) as cashback reward, based on the configured
                  points settings. It defines the threshold of spending required
                  to earn points in your loyalty program. Example: If
                  rewardThreshold is set to 50.0, it means for every 50 currency
                  units (e.g., 50 USD) spent by the customer, they will earn the
                  configured number of reward points.
              currency:
                type:
                  - string
                  - 'null'
                description: The currency used in the transaction (e.g., "EGP").
              redemptionRewardFactor:
                type:
                  - number
                  - 'null'
                description: >-
                  The factor used to calculate how many points are required for
                  a redemption. This value determines the conversion rate
                  between points and monetary value during a redemption process.
                  Example: If the redemptionRewardFactor is 0.1, then for every
                  10 points, the customer can redeem 1 unit of currency.
              campaignName:
                type:
                  - string
                  - 'null'
                description: >-
                  The name of the rewards campaign associated with the activity.
                  This field will appear for activity types that are tied to a
                  rewards campaign such as CampaignRewarded.
              campaignStartDate:
                type:
                  - string
                  - 'null'
                description: >-
                  The start date of the rewards campaign associated with the
                  activity. This field will appear for activity types that are
                  tied to a rewards campaign such as CampaignRewarded.
              campaignEndDate:
                type:
                  - string
                  - 'null'
                description: >-
                  The end date of the rewards campaign associated with the
                  activity. This field will appear for activity types that are
                  tied to a rewards campaign such as CampaignRewarded.
              campaignEnabled:
                type:
                  - boolean
                  - 'null'
                description: >-
                  Indicates if the associated campaign was enabled during the
                  activity. This field will appear for activity types that are
                  tied to a rewards campaign such as CampaignRewarded.
              tierName:
                type:
                  - string
                  - 'null'
                description: >-
                  The tier name of the customer during the activity. The name of
                  the tier associated with the activity. This is relevant when
                  the activity involves a tier-related event, such as:
                  TierUpgraded, TierDowngraded, TierMigration. Example: if a
                  customer moves from "Silver" to "Gold" in the TierUpgraded
                  activity, "Gold" will be displayed as the associated tier
                  name.
              rewardPoints:
                type:
                  - number
                  - 'null'
                description: The number of points rewarded from the activity.
              rewardFactor:
                type:
                  - number
                  - 'null'
                description: The reward factor used in the calculation of reward points.
              isGuest:
                type:
                  - boolean
                  - 'null'
                description: >-
                  A flag indicating if the individual interacting with your
                  system is a guest (not signed up). Set this to true for guest
                  users; otherwise, they are treated as registered customers by
                  default.
              couponUsed:
                type:
                  - boolean
                  - 'null'
                description: >-
                  Indicates whether the coupon associated with this activity was
                  used or not. This is a boolean value, where true means the
                  coupon was used during the activity, and false means it was
                  not. Example: true if the coupon was successfully applied,
                  false if the coupon was associated with the event but was not
                  used.
              couponType:
                type:
                  - string
                  - 'null'
                description: >-
                  Represents the type of coupon associated with the activity.
                  Example: "percentage_discount", "free_shipping",
                  "fixed_rate_discount".
              couponCode:
                type:
                  - string
                  - 'null'
                description: >-
                  The code of the coupon that was associated with this activity.
                  This is the actual coupon code that was available for use
                  during the activity. Example: "SUMMER20".
              couponGroup:
                type:
                  - string
                  - 'null'
                description: >-
                  Represents the group or campaign to which the coupon is
                  linked. This could be a marketing campaign, product category,
                  or customer segment. Example: "Holiday Campaign", "VIP
                  Customer Group", "Black Friday Sale".
              couponProduct:
                type:
                  - string
                  - 'null'
                description: >-
                  The name of the product associated with the coupon, if the
                  coupon was tied to a specific product. Example: "Wireless
                  Earbuds".
              couponProductId:
                type:
                  - number
                  - 'null'
                description: >-
                  The unique ID of the product associated with the coupon. This
                  ID helps track which specific product was related to the
                  coupon. Example: 123456 for "Wireless Earbuds".
              productVariantName:
                type:
                  - string
                  - 'null'
                description: >-
                  The name of the product variant involved in the event. This
                  would apply if the coupon or activity was specific to a
                  certain variant of a product, such as size or color. Example:
                  "Wireless Earbuds - Black", "T-shirt - Large".
        count:
          type: number
          description: The total number of activities on the current page
        hasMore:
          type: boolean
          description: Whether there are additional logs to be fetched
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKey:
      type: apiKey
      in: header
      name: apikey
    secretKey:
      type: apiKey
      in: header
      name: secretkey

````