Core API Documentation
Visits
Ties a Person to an Event Occurrence.
Front
GET /api/v2/front/visits/:id
Returns the details of a visit.
REQUEST
$ curl https://mybiz.pike13.com/api/v2/front/visits/1 \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"visits": [
{
"id": 1,
"person_id": 1,
"event_occurrence_id": 1,
"status": "enrolled",
"state": "registered",
"registered_at": "2015-06-09T19:23:01Z",
"completed_at": null,
"noshow_at": null,
"cancelled_at": null,
"created_at": "2015-06-09T19:23:01Z",
"paid": false,
"paid_for_by": null,
"event_occurrence": {
"id": 1,
"name": "Class P",
"state": "active",
"start_at": "2015-06-10T07:00:00Z",
"end_at": "2015-06-10T07:30:00Z",
"service_id": 1,
"event_id": 1,
"location_id": 1
},
"person": {
"id": 1,
"name": "Jane Client",
"email": "janeclient@example.com"
}
}
]
}
Attributes
| person_id | integer | The id of the person. |
|---|---|---|
| state | string | Status of the visits. Can be one of the following: "reserved", "registered", "completed", "noshowed", "late_canceled". |
| event_occurrence_id | integer | The id of the event occurrence. |
| registered_at | timestamp | When registration was completed for this visit. Typically, this is when the visit was created. |
| completed_at | timestamp | When the visit was marked as complete by a staff member. |
| noshow_at | timestamp | When the staff member marked this visit as a no-show. |
| cancelled_at | timestamp | When the visit was marked as a late cancel. |
| created_at | timestamp | When the visit was created. |
| 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. |
GET /api/v2/front/people/:person_id/visits
Lists visits for a person. They are sorted by event_occurrence.start_at in ascending order. Paginate using the
Parameters
| from | timestamp | Optional, but must be included if specifying to - Start of time range filter. |
|---|---|---|
| to | timestamp | Optional, but must be included if specifying from - End of time range filter. |
| event_occurrence_id | integer | Optional - Scope to an event occurrence. |
REQUEST
$ curl https://mybiz.pike13.com/api/v2/front/people/1/visits \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"visits": [
{
"id": 1,
"status": "complete",
"registered_at": "2015-01-20T18:42:23Z",
"completed_at": "2015-01-20T18:42:35Z",
"noshow_at": null,
"cancelled_at": null,
"created_at": "2015-01-20T18:42:22Z",
"paid": true,
"paid_for_by": "10 Pack",
"event_occurrence": {
"id": 3,
"name": "Group Workout",
"state": "active",
"start_at": "2015-01-28T07:00:00Z",
"end_at": "2015-01-28T08:00:00Z",
"service_id": 2,
"event_id": 2,
"location_id": 1
}
},
{
"id": 2,
"status": "enrolled",
"registered_at": "2015-01-20T18:42:32Z",
"completed_at": null,
"noshow_at": null,
"cancelled_at": null,
"created_at": "2015-01-20T18:42:32Z",
"paid": false,
"event_occurrence": {
"id": 4,
"name": "Group Workout",
"state": "active",
"start_at": "2015-01-29T07:00:00Z",
"end_at": "2015-01-29T08:00:00Z",
"service_id": 2,
"event_id": 2,
"location_id": 1
}
}
],
"total_count": 2
}
POST /api/v2/front/visits
Creates a visit.
REQUEST
$ curl -X POST https://mybiz.pike13.com/api/v2/front/visits \
-H "Authorization: Bearer XXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{"visit": {"person_id": 1, "event_occurrence_id": 1}}'
RESPONSE
{
"visits": [
{
"id": 1,
"person_id": 1,
"event_occurrence_id": 1,
"status": "enrolled",
"state": "registered",
"registered_at": "2015-06-09T19:23:01Z",
"completed_at": null,
"noshow_at": null,
"cancelled_at": null,
"created_at": "2015-06-09T19:23:01Z",
"paid": false,
"paid_for_by": null,
"event_occurrence": {
"id": 1,
"name": "Class P",
"state": "active",
"start_at": "2015-06-10T07:00:00Z",
"end_at": "2015-06-10T07:30:00Z",
"service_id": 1,
"event_id": 1,
"location_id": 1
},
"person": {
"id": 1,
"name": "Jane Client",
"email": "janeclient@example.com"
}
}
]
}
Attributes
| person_id | integer | The id of the person. Defaults to the current person if a value is not specified. |
|---|---|---|
| event_occurrence_id | integer | The id of the event occurrence. Required. |
When using this endpoint notify_client is set to true. Use the Desk Visit create endpoint if you need to set it to false.
DELETE /api/v2/front/visits/:id
Destroys a visit or future visits for the same event occurrence if the visit is free to cancel.
Parameters
| remove_recurring_enrollment | boolean | Remove the visit from the roster and future visits for the same event occurrence if applicable. Optional, defaults to false. |
|---|
REQUEST
$ curl -X DELETE https://mybiz.pike13.com/api/v2/front/visits/1?remove_recurring_enrollment=true \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
Desk
GET /api/v2/desk/visits/:id
Returns the details of a visit.
REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/visits/1 \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"visits": [
{
"id": 1,
"person_id": 1,
"event_occurrence_id": 1,
"status": "enrolled",
"state": "registered",
"registered_at": "2015-06-09T19:23:01Z",
"completed_at": null,
"noshow_at": null,
"cancelled_at": null,
"created_at": "2015-06-09T19:23:01Z",
"paid": false,
"paid_for_by": null,
"event_occurrence": {
"id": 1,
"name": "Class P",
"state": "active",
"start_at": "2015-06-10T07:00:00Z",
"end_at": "2015-06-10T07:30:00Z",
"service_id": 1,
"event_id": 1,
"location_id": 1
},
"person": {
"id": 1,
"name": "Jane Client",
"email": "janeclient@example.com"
}
}
]
}
Attributes
| person_id | integer | The id of the person. |
|---|---|---|
| state | string | Status of the visits. Can be one of the following: "reserved", "registered", "completed", "noshowed", "late_canceled". |
| event_occurrence_id | integer | The id of the event occurrence. |
| registered_at | timestamp | When registration was completed for this visit. Typically, this is when the visit was created. |
| completed_at | timestamp | When the visit was marked as complete by a staff member. |
| noshow_at | timestamp | When the staff member marked this visit as a no-show. |
| cancelled_at | timestamp | When the visit was marked as a late cancel. |
| created_at | timestamp | When the visit was created. |
| 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. |
GET /api/v2/desk/people/:person_id/visits
GET /api/v2/desk/event_occurrences/:event_occurrence_id/visits
Lists visits for a person or event occurrence. For a person, they are sorted by event_occurrence.start_at in ascending order. Paginate using the
Parameters
| from | timestamp | Optional, but must be included if specifying to - Start of time range filter. |
|---|---|---|
| to | timestamp | Optional, but must be included if specifying from - End of time range filter. |
| event_occurrence_id | integer | Optional - Scope to an event occurrence. |
REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/people/1/visits \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"visits": [
{
"id": 1,
"status": "complete",
"registered_at": "2015-01-20T18:42:23Z",
"completed_at": "2015-01-20T18:42:35Z",
"noshow_at": null,
"cancelled_at": null,
"created_at": "2015-01-20T18:42:22Z",
"paid": true,
"paid_for_by": "10 Pack",
"event_occurrence": {
"id": 3,
"name": "Group Workout",
"state": "active",
"start_at": "2015-01-28T07:00:00Z",
"end_at": "2015-01-28T08:00:00Z",
"service_id": 2,
"event_id": 2,
"location_id": 1
}
},
{
"id": 2,
"status": "enrolled",
"registered_at": "2015-01-20T18:42:32Z",
"completed_at": null,
"noshow_at": null,
"cancelled_at": null,
"created_at": "2015-01-20T18:42:32Z",
"paid": false,
"event_occurrence": {
"id": 4,
"name": "Group Workout",
"state": "active",
"start_at": "2015-01-29T07:00:00Z",
"end_at": "2015-01-29T08:00:00Z",
"service_id": 2,
"event_id": 2,
"location_id": 1
}
}
],
"total_count": 2
}
GET /api/v2/desk/people/:person_id/visits/summary
Lists the first and last completed visit times for a person. Includes both overall first and last visits as well as per service.
REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/people/1/visits/summary \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"summaries": [
{
"person_id": 11,
"first_visited_at": "2015-01-27T09:00:00Z",
"last_visited_at": "2015-01-28T07:00:00Z",
"services_visited_at": [
{
"service_id": 1,
"first_visited_at": "2015-01-28T07:00:00Z",
"last_visited_at": "2015-01-28T07:00:00Z"
},
{
"service_id": 6,
"first_visited_at": "2015-01-27T09:00:00Z",
"last_visited_at": "2015-01-27T09:00:00Z"
}
]
}
]
}
POST /api/v2/desk/visits
Creates a visit.
REQUEST
$ curl -X POST https://mybiz.pike13.com/api/v2/desk/visits \
-H "Authorization: Bearer XXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{"visit": {"person_id": 1, "event_occurrence_id": 1, "restrictions": ["full"]}}'
RESPONSE
{
"visits": [
{
"id": 1,
"person_id": 1,
"event_occurrence_id": 1,
"status": "enrolled",
"state": "registered",
"registered_at": "2015-06-09T19:23:01Z",
"completed_at": null,
"noshow_at": null,
"cancelled_at": null,
"created_at": "2015-06-09T19:23:01Z",
"paid": false,
"paid_for_by": null,
"event_occurrence": {
"id": 1,
"name": "Class P",
"state": "active",
"start_at": "2015-06-10T07:00:00Z",
"end_at": "2015-06-10T07:30:00Z",
"service_id": 1,
"event_id": 1,
"location_id": 1
},
"person": {
"id": 1,
"name": "Jane Client",
"email": "janeclient@example.com"
}
}
]
}
Attributes
| person_id | integer | The id of the person. Required for states other than "reserved". | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| event_occurrence_id | integer | The id of the event occurrence. Required. | ||||||||||
| state | string | Initial state of the visit. Defaults to "registered". Must be one of the following:
| ||||||||||
| notify_client | boolean | Should the client be notified of this registration or when it is deleted? Write-only. Defaults to true. | ||||||||||
| restrictions | array | Staff members can override visit restrictions configured on a service. If you would like certain conditions validated by the server, you can use the "restrictions" attribute. A 422 status with error messages will be returned if any of these restrictions fail. Restrictions can be any or all of the following values.
|
PUT /api/v2/desk/visits/:id
Updates a visit.
REQUEST
$ curl -X PUT https://mybiz.pike13.com/api/v2/desk/visits/1 \
-H "Authorization: Bearer XXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{"visit": {"state_event": "complete"}}'
RESPONSE
{
"visits": [
{
"id": 1,
"person_id": 1,
"event_occurrence_id": 1,
"status": "enrolled",
"state": "completed",
"registered_at": "2015-06-09T19:23:01Z",
"completed_at": "2015-06-09T19:23:01Z",
"noshow_at": null,
"cancelled_at": null,
"created_at": "2015-06-09T19:23:01Z",
"paid": false,
"paid_for_by": null,
"event_occurrence": {
"id": 1,
"name": "Class P",
"state": "active",
"start_at": "2015-06-10T07:00:00Z",
"end_at": "2015-06-10T07:30:00Z",
"service_id": 1,
"event_id": 1,
"location_id": 1
},
"person": {
"id": 1,
"name": "Jane Client",
"email": "janeclient@example.com"
}
}
]
}
Attributes
| person_id | integer | The id of the person. Can be set, but cannot changed. | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| state_event | string |
Visits are state machines. They can be transitioned between states by using the write-only
|
A
DELETE /api/v2/desk/visits/:id
Destroys a visit and future visits for the same event occurrence.
Parameters
| notify_client | boolean | Notify the client. Optional, defaults to true. |
|---|---|---|
| remove_recurring_enrollment | boolean | Remove the visit from the roster and future visits for the same event occurrence. Optional, defaults to false. |
REQUEST
$ curl -X DELETE "https://mybiz.pike13.com/api/v2/desk/visits/1?notify_client=false&remove_recurring_enrollment=true" \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
GET /api/v2/desk/make_ups/reasons
Lists all Business make ups reasons.
REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/make_ups/reasons \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"make_up_reasons": [
{
"id": 1,
"name": "reason 1",
"description": "Reason 1 Description"
},
{
"id": 2,
"name": "reason 2",
"description": "Reason 2 Description"
}
]
}
POST /api/v2/desk/make_ups/generate
Creates a make up pass to a canceled enrollment.
REQUEST
$ curl -X POST https://mybiz.pike13.com/api/v2/desk/make_ups/generate \
-H "Authorization: Bearer XXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{
"visit_id": 6236363,
"make_up": {
"make_up_reason_id": 1,
"free_form_reason": "THIS IS THE REASON"
}
}'
RESPONSE
{
"make_up": {
"id": 1,
"make_up_reason_id": 1,
"free_form_reason": "THIS IS THE REASON",
"staff_mode": true
}
}
Attributes
| visit_id | integer | The event ID. Required | ||||||
|---|---|---|---|---|---|---|---|---|
| make_up | object | Make up attributes to build the visit - make up pass. Optional
|