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

# program_events/customer.points_earned

This webhook is triggered when the customer has earned points. It includes an
`available_rewards` array of rewards that are actionable, in stock, enabled, and
affordable by the customer.

To subscribe to this webhook, your access token needs to contain the
read\_customers scope.

<Tip>
  As many customers redeem their points immediately after earning them, and the
  payload includes a list of available rewards, this webhook is only sent after
  a 5 minute delay.
</Tip>

## Payload

<ResponseField name="customer" type="object" required>
  Customer object with the same shape as the [Customers
  API](/api-reference/v2/resources/customers/list-customers#response-customers)
  response
</ResponseField>

<ResponseField name="transaction" type="object" required>
  Transaction object with the same shape as the [Transactions
  API](/api-reference/v2/resources/transactions/list-transactions#response-transactions)
  response. This is the transaction associated with this particular points
  earning event
</ResponseField>

<ResponseField name="available_rewards" type="object[]" required>
  Array of Reward objects with the same shape as the [List Available Rewards
  API](/api-reference/v2/resources/customers/rewards/list-available-rewards#response-rewards)
  response
</ResponseField>

## Example

```json Example theme={null}
{
  "id": "bff1bddb-6cd8-4c2c-9619-18744657053c",
  "topic": "program_events/customer.points_earned",
  "created_at": "2018-01-01T03:00:05.000Z",
  "payload": {
    "properties": {
      "customer": {
        "id": 6932,
        "merchant_id": "2134606599",
        "email": "jessica@example.com",
        "points_approved": 200,
        "points_pending": 300,
        "points_spent": 500,
        "rewards_claimed": 5,
        "rewards_used": 0,
        "properties": {
          "name": "Jessica White"
        },
        "metadata": {},
        "birthday": "1990-01-29",
        "blocked": false,
        "guest": false,
        "enrolled": true,
        "enrolled_at": "2015-12-10T03:00:00.000Z",
        "referral_id": null,
        "referred_by": null,
        "loyalty_tier_membership": null,
        "tier_eligibility": null,
        "insights_segment": "Loyal",
        "referral_url": null,
        "created_at": "2016-12-10T03:00:00.000Z",
        "updated_at": "2018-01-01T03:00:00.000Z"
      },
      "transaction": {
        "id": "5432",
        "points_approved": "1200",
        "points_pending": "0",
        "created_at": "2018-01-01T03:00:05.000Z",
        "activity": {
          "id": "7653",
          "merchant_id": "3452672",
          "value": "50",
          "state": "pending",
          "created_at": "2018-01-01T03:00:05.000Z",
          "rule": {
            "id": "8632145",
            "name": "$purchase",
            "title": "Make a purchase"
          },
        }
      },
      "available_rewards": [
        {
          "id": 121013,
          "kind": "cart_discount_voucher",
          "title": "10% Off",
          "method": "voucher",
          "content": {},
          "site_id": 12,
          "claim_url": "https://email.storerewards.co/track/a3hvr8d1808pvlpvvryt/click?p=2290s8fopfnsd0E/sh7292ksdp0",
          "order_type": "all",
          "point_cost": 500,
          "description": null,
          "target_site": {
            "id": 12,
            "url": "https://www.example.com",
            "name": "Example Store"
          },
          "target_type": "all",
          "usage_limit": 1,
          "discount_type": "percentage",
          "minimum_spend": nil,
          "discount_amount": 100,
          "session_options": nil,
          "target_products": [],
          "max_free_shipping": nil,
          "target_collections": [],
          "max_redemption_amount": 1,
          "min_redemption_amount": 1
        }
      ]
    }
  }
}
```
