[EVENT] User Update

Called when a user is created and linked to your venue, or that user's profile updates.

This is a type of Webhook Integration event. It will be called when a user is created and linked to your venue, or that user's profile updates.

Here is an example of a payload sent by the webhook endpoint:

{
    "venue": {
        "id": 4,
        "name": "Fake Venue",
        "slug": "fake-venue"
    },
    "user": {
        "id": 12183,
        "email": "[email protected]",
        "confirmed": true,
        "telephone": "+447730539054",
        "firstName": "John",
        "lastName": "Smith",
        "created_at": "2020-08-13T15:05:05+00:00",
        "blocked": false,
        "balances": [
            {
                "id": 28,
                "amount": 100800
            }
        ],
        "memberships": [
            {
                "id": 52,
                "start": "2025-03-07T00:00:00+00:00",
                "end": null,
                "status": "active",
                "billingStatus": "billed",
                "type": {
                    "id": 1,
                    "name": "Gold"
                },
                "paymentStatus": "paid",
                "lastBillingDate": "2025-03-07T08:53:35+00:00",
                "nextBillingDate": "2025-03-12T00:00:00+00:00"
            }
        ],      
        "venueData": {
            "marketingOptIn": false,
            "termsAccepted": 6
        }
    }
}

Standard Fields

Here is a quick breakdown of some of the less obvious fields on the user object:

  • id - Unique integer id for this user.
  • email - Unique email address for the user.
  • confirmed - Whether this user has completed the email confirmation flow.
  • blocked - Whether this user has been blocked from accessing YGB. This field is only likely to be populated if the user has abused their account on the platform.
  • created_at - The date this user joined YGB. This is not necessarily the date that they linked their account to your venue. This date field is in UTC time.

Venue Scoped Fields

The top level venue object will tell you where the event is scoped to.

{
    "venue": {
        "id": 4,
        "name": "Fake Venue",
        "slug": "fake-venue"
    },
  ...
}

If this user has visited multiple of your venues, you will receive an event for each venue, with a different top level venue property. Some of the fields in the user object will be specific for each venue. These special fields are as follows.

Balances

This represents the balances held by this customer, for this venue.

{
  "balances": [
    {
      "id": 28,
      "amount": 100800
    }
  ],
  ...
}

The amount property is an integer value for the lowest currency denomination in your venue's currency (pence, cents, etc). In this example above, the user has £100.80.

Under normal circumstances, you will have a maximum of 1 entry in this array. However, if the customer has no active balance with your venue, the array will be empty.

Memberships

This represents the memberships this customer has for this venue.

{
  "memberships": [
    {
      "id": 52,
      "start": "2025-03-07T00:00:00+00:00",
      "end": null,
      "status": "active",
      "billingStatus": "billed",
      "type": {
        "id": 1,
        "name": "Gold"
      },
      "paymentStatus": "paid",
      "lastBillingDate": "2025-03-07T08:53:35+00:00",
      "nextBillingDate": "2025-03-12T00:00:00+00:00"
    }
  ],  
  ...
}

The start, end, lastBillingDate and nextBillingDate properties are all in standard UTC time. end will be null if no end date has been defined.

The array will be empty if the user don't have any memberships.

Venue Data

venueData holds data specific to the custom columns in your customer section in your admin panel. It will always have at least two fields.

{
   "venueData": {
     "marketingOptIn": false,
     "termsAccepted": 6
   }
}
  1. marketingOptIn which is a boolean field and records whether the customer has opted to receive additional marketing information from you.
  2. termsAccepted which will contain the integer ID of the version of your terms and conditions document that they have accepted. If they have not accepted any of your terms, it will instead be null.