Webhooks API Documentation
Visit
Core API resource payload url:
Resource Attributes
| data.visits[0] | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | integer | The visit's ID. | ||||||||||||||||||||||||||||||||||||
| person_id | integer | ID of the associated person. | ||||||||||||||||||||||||||||||||||||
| event_occurrence_id | integer | ID of the associated event occurrence. | ||||||||||||||||||||||||||||||||||||
| state | string | Status of the visit. One of ['registered', 'reserved', 'noshowed', 'late_canceled', or 'completed'] | ||||||||||||||||||||||||||||||||||||
| registered_at | timestamp | Timestamp for when visit was registered. Typically, this is when the visit was created. | ||||||||||||||||||||||||||||||||||||
| completed_at | timestamp | Timestamp for when visit was marked as complete by a staff member. | ||||||||||||||||||||||||||||||||||||
| noshow_at | timestamp | Timestamp for when visit was marked as no-show by a staff member. | ||||||||||||||||||||||||||||||||||||
| cancelled_at | timestamp | Timestamp for when visit was marked as a late cancel by a staff member. | ||||||||||||||||||||||||||||||||||||
| created_at | timestamp | Timestamp for when visit was created. | ||||||||||||||||||||||||||||||||||||
| updated_at | timestamp | Timestamp for when visit was last updated. | ||||||||||||||||||||||||||||||||||||
| paid | boolean | True if this visit has been paid for. | ||||||||||||||||||||||||||||||||||||
| paid_for_by | string | Description of the plan used to pay for the visit. | ||||||||||||||||||||||||||||||||||||
| punch_id | integer | The id of the punch if present. | ||||||||||||||||||||||||||||||||||||
| only_staff_can_cancel | boolean | True if only staff can cancel this visit. | ||||||||||||||||||||||||||||||||||||
| event_occurrence | object | Details of the associated event_occurrence.
| ||||||||||||||||||||||||||||||||||||
| person | object | Details of the associated 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
{
"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
{
"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
{
"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 | ||
|---|---|---|
| state | string | Status of the visit. One of ['registered', 'reserved', 'noshowed', 'late_canceled', or 'completed'] |
| completed_at | timestamp | Timestamp for when visit was marked as complete by a staff member. |
| noshow_at | timestamp | Timestamp for when visit was marked as no-show by a staff member. |
| cancelled_at | timestamp | Timestamp for when visit was marked as a late cancel by a staff member. |
| punch_id | integer | The id of the punch if present. |
This topic supports
| data | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| visits | array | Array of one visit updated in the business. | ||||||||||||||||||
| previous | object | Previous values of the resource. The following are supported:
| ||||||||||||||||||
Payload Example
{
"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"
}
}
}