Pike13 For Developers
Get Started
Authentication
Core API
Reporting API
Webhooks API
Announcements

Webhooks API Documentation

Visit

Core API resource payload url:

Desk

GET /api/v2/desk/visits/:id

See the core api doc

Resource Attributes

data.visits[0]
idintegerThe visit's ID.
person_idintegerID of the associated person.
event_occurrence_idintegerID of the associated event occurrence.
statestringStatus of the visit. One of ['registered', 'reserved', 'noshowed', 'late_canceled', or 'completed']
registered_attimestampTimestamp for when visit was registered. Typically, this is when the visit was created.
completed_attimestampTimestamp for when visit was marked as complete by a staff member.
noshow_attimestampTimestamp for when visit was marked as no-show by a staff member.
cancelled_attimestampTimestamp for when visit was marked as a late cancel by a staff member.
created_attimestampTimestamp for when visit was created.
updated_attimestampTimestamp for when visit was last updated.
paidbooleanTrue if this visit has been paid for.
paid_for_bystringDescription of the plan used to pay for the visit.
punch_idintegerThe id of the punch if present.
only_staff_can_cancelbooleanTrue if only staff can cancel this visit.
event_occurrenceobject

Details of the associated event_occurrence.

idintegerID of the event occurrence.
namestringName of the event occurrence.
statestringOne of ['reserved', 'active', 'cancelled', 'deleted'].
start_attimestampTimestamp for when event occurrence begins.
end_attimestampTimestamp for when event occurrence ends.
service_idintegerID of the associated service.
event_idintegerID of the associated event.
location_idintegerID of the associated location.
staff_membersarray

Details of the associated list of staff members.

idintegerID of the staff member.
namestringName of the staff member.
has_profilebooleanTrue if staff member has a profile.
personobject

Details of the associated person.

idintegerID of the person.
namestringName of the person.
emailstringEmail of the person.

A Special Note about Visit Topics

The webhook topic 'visit.new' is suggested for most uses instead of 'visit.created'.

The 'visit.new' topic shields users from being exposed to some of the internal state changes that visits go through during their lifecycle. For instance, a new visit object is created in a "reserved" state before the user has paid for their registration. Most users will be interested in a visit once it's been "booked."

visit.new

Triggers when a new visit is created in a state other than "reserved." Also triggers when a visit transitions from "reserved" to "registered", "completed", "noshowed", or "late_cancel."

Payload Example

Visit New Webhook Payload

{
  "topic": "visit.new",
  "business_id": 1,
  "data": {
    "visits": [
      {
        "id": 1,
        "person_id": 1,
        "event_occurrence_id": 1,
        "state": "registered",
        "status": "enrolled",
        "registered_at": "2012-09-03T09:05:01Z",
        "completed_at": null,
        "noshow_at": null,
        "cancelled_at": null,
        "created_at": "2012-09-03T09:05:01Z",
        "paid": false,
        "paid_for_by": null,
        "punch_id": null,
        "only_staff_can_cancel": false,
        "event_occurrence": {
          "id": 1,
          "name": "Appointment A",
          "state": "active",
          "start_at": "2012-09-05T09:05:00Z",
          "end_at": "2012-09-05T09:35:00Z",
          "service_id": 1,
          "event_id": 1,
          "location_id": 2,
          "staff_members": [
            {
              "id": 2,
              "name": "Summer Stiedemann",
              "has_profile": true
            }
          ]
        },
        "person": {
          "id": 1,
          "name": "Andy Graham",
          "email": "graham_andy@pike13.com"
        }
      }
    ]
  }
}

visit.created

Triggers whenever a new visit is created, including those in a pre-booked "reserved" state.

Payload Example

Visit Created Webhook Payload

{
  "topic": "visit.created",
  "business_id": 1,
  "data": {
    "visits": [
      {
        "id": 1,
        "person_id": 1,
        "event_occurrence_id": 1,
        "state": "registered",
        "status": "enrolled",
        "registered_at": "2012-09-03T09:05:01Z",
        "completed_at": null,
        "noshow_at": null,
        "cancelled_at": null,
        "created_at": "2012-09-03T09:05:01Z",
        "updated_at": "2012-09-03T09:05:01Z",
        "paid": false,
        "paid_for_by": null,
        "punch_id": null,
        "only_staff_can_cancel": false,
        "event_occurrence": {
          "id": 1,
          "name": "Appointment A",
          "state": "active",
          "start_at": "2012-09-05T09:05:00Z",
          "end_at": "2012-09-05T09:35:00Z",
          "service_id": 1,
          "event_id": 1,
          "location_id": 2,
          "staff_members": [
            {
              "id": 2,
              "name": "Summer Stiedemann",
              "has_profile": true
            }
          ]
        },
        "person": {
          "id": 1,
          "name": "Andy Graham",
          "email": "graham_andy@pike13.com"
        }
      }
    ]
  }
}

visit.deleted

Triggers when a visit is deleted.

Payload Example

Visit Deleted Webhook Payload

{
  "topic": "visit.deleted",
  "business_id": 1,
  "data": {
    "visits": [
      {
        "id": 1,
        "person_id": 1,
        "event_occurrence_id": 1,
        "state": "registered",
        "status": "enrolled",
        "registered_at": "2012-09-03T09:05:01Z",
        "completed_at": null,
        "noshow_at": null,
        "cancelled_at": null,
        "created_at": "2012-09-03T09:05:01Z",
        "updated_at": "2012-09-03T09:05:01Z",
        "paid": false,
        "paid_for_by": null,
        "punch_id": null,
        "only_staff_can_cancel": false,
        "event_occurrence": {
          "id": 1,
          "name": "Appointment A",
          "state": "active",
          "start_at": "2012-09-05T09:05:00Z",
          "end_at": "2012-09-05T09:35:00Z",
          "service_id": 1,
          "event_id": 1,
          "location_id": 2,
          "staff_members": [
            {
              "id": 2,
              "name": "Summer Stiedemann",
              "has_profile": true
            }
          ]
        },
        "person": {
          "id": 1,
          "name": "Andy Graham",
          "email": "graham_andy@pike13.com"
        }
      }
    ]
  }
}

visit.updated

Triggers when specific fields of a visit are updated.

The specifc list of fields that trigger an update are:

Changes to these fields trigger a notification
statestringStatus of the visit. One of ['registered', 'reserved', 'noshowed', 'late_canceled', or 'completed']
completed_attimestampTimestamp for when visit was marked as complete by a staff member.
noshow_attimestampTimestamp for when visit was marked as no-show by a staff member.
cancelled_attimestampTimestamp for when visit was marked as a late cancel by a staff member.
punch_idintegerThe id of the punch if present.

This topic supports previous values within data:

data
visitsarrayArray of one visit updated in the business.
previousobject

Previous values of the resource. The following are supported:

statestringStatus of the visit. One of ['registered', 'reserved', 'noshowed', 'late_canceled', or 'completed']
completed_attimestampTimestamp for when visit was marked as complete by a staff member.
noshow_attimestampTimestamp for when visit was marked as no-show by a staff member.
cancelled_attimestampTimestamp for when visit was marked as a late cancel by a staff member.
punch_idintegerThe id of the punch if present.
updated_attimestampTimestamp for when visit was last updated.

Payload Example

Visit Updated Webhook Payload

{
  "topic": "visit.updated",
  "business_id": 2,
  "data": {
    "visits": [
      {
        "id": 2,
        "person_id": 3,
        "event_occurrence_id": 2,
        "state": "registered",
        "status": "enrolled",
        "registered_at": "2012-09-03T09:05:00Z",
        "completed_at": null,
        "noshow_at": null,
        "cancelled_at": null,
        "created_at": "2012-09-03T09:05:00Z",
        "updated_at": "2012-09-03T09:06:00Z",
        "paid": false,
        "paid_for_by": null,
        "punch_id": null,
        "only_staff_can_cancel": false,
        "event_occurrence": {
          "id": 2,
          "name": "Appointment A",
          "state": "active",
          "start_at": "2012-09-05T09:05:00Z",
          "end_at": "2012-09-05T09:35:00Z",
          "service_id": 2,
          "event_id": 2,
          "location_id": 4,
          "staff_members": [
            {
              "id": 4,
              "name": "Stanford Donnelly",
              "has_profile": true
            }
          ]
        },
        "person": {
          "id": 3,
          "name": "Ottilie Roberts",
          "email": "ottilie_roberts@pike13.com"
        }
      }
    ],
    "previous": {
      "completed_at": "2012-09-03T09:05:00Z",
      "state": "completed",
      "updated_at": "2012-09-03T09:05:00Z"
    }
  }
}