> ## 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.rule_completed

This webhook is triggered when a customer completes an activity by triggering a rule.

To subscribe to this webhook, your access token needs to contain the
`read_customers` and `read_orders` scope.

## 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="activity" type="object" required>
  The activity that was completed. An object with the same shape as the
  [Activities
  API](/api-reference/v2/resources/activities/list-activities#response-activities)
  response
</ResponseField>

<ResponseField name="order" type="object | null">
  The order linked to this activity, if any. An object with the same shape as
  the [Orders API](/api-reference/v2/resources/orders/get-order) response
</ResponseField>

<ResponseField name="social_link" type="string | null">
  If this activity was linked to a social media rule, e.g. "Follow on Instagram",
  this will be the URL of the social media profile that was involved
</ResponseField>

<ResponseField name="review" type="object | null">
  If this activity was linked to a review rule, this will contain information about the review

  <Expandable title="properties" defaultOpen={true}>
    <ResponseField name="kind" type="string" required={true}>
      The kind of review. This is usually the name of the review platform in use
    </ResponseField>

    <ResponseField name="rating" type="number" required={true}>
      Numeric rating of the review
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

```json Example theme={null}
{
  "id": "bff1bddb-6cd8-4c2c-9619-18744657053c",
  "topic": "program_events/customer.rule_completed",
  "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"
      },
      "order": {
        "id": 194572858,
        "total": "45.96",
        "metadata": {},
        "total_tax": "0",
        "created_at": "2021-08-19T05:50:42.797Z",
        "total_paid": "45.96",
        "updated_at": "2021-08-19T05:50:42.797Z",
        "merchant_id": "4158567448655",
        "refund_status": "not_refunded",
        "payment_status": "paid",
        "total_refunded": "0",
        "total_shipping": "5.99",
        "merchant_number": "263961",
        "total_discounts": "10.00",
        "fulfillment_status": "not_fulfilled",
        "cancellation_status": "not_cancelled"
      },
      "activity": {
        "id": 239638566,
        "rule": {
          "id": 149623,
          "name": "$purchase",
          "title": "Make a purchase"
        },
        "state": "pending",
        "value": 1000,
        "merchant_id": null,
        "created_at": "2018-01-01T03:00:05.000Z"
      }
    }
  }
}
```
