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

Core API Documentation

Visits

Ties a Person to an Event Occurrence.

Front

GET /api/v2/front/visits/:id

Returns the details of a visit.

Show curl example

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_idintegerThe id of the person.
statestringStatus of the visits. Can be one of the following: "reserved", "registered", "completed", "noshowed", "late_canceled".
event_occurrence_idintegerThe id of the event occurrence.
registered_attimestampWhen registration was completed for this visit. Typically, this is when the visit was created.
completed_attimestampWhen the visit was marked as complete by a staff member.
noshow_attimestampWhen the staff member marked this visit as a no-show.
cancelled_attimestampWhen the visit was marked as a late cancel.
created_attimestampWhen the visit was created.
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.
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 page parameter. The parameters to and from can be used to specify an event occurrence time range.

Parameters

fromtimestampOptional, but must be included if specifying to - Start of time range filter.
totimestampOptional, but must be included if specifying from - End of time range filter.
event_occurrence_idintegerOptional - Scope to an event occurrence.

Show curl example

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.

Show curl example

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_idintegerThe id of the person. Defaults to the current person if a value is not specified.
event_occurrence_idintegerThe 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_enrollmentbooleanRemove the visit from the roster and future visits for the same event occurrence if applicable. Optional, defaults to false.

Show curl example

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.

Show curl example

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_idintegerThe id of the person.
statestringStatus of the visits. Can be one of the following: "reserved", "registered", "completed", "noshowed", "late_canceled".
event_occurrence_idintegerThe id of the event occurrence.
registered_attimestampWhen registration was completed for this visit. Typically, this is when the visit was created.
completed_attimestampWhen the visit was marked as complete by a staff member.
noshow_attimestampWhen the staff member marked this visit as a no-show.
cancelled_attimestampWhen the visit was marked as a late cancel.
created_attimestampWhen the visit was created.
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.
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 page parameter. The parameters to and from can be used to specify an event occurrence time range on the person's visits endpoint.

Parameters

fromtimestampOptional, but must be included if specifying to - Start of time range filter.
totimestampOptional, but must be included if specifying from - End of time range filter.
event_occurrence_idintegerOptional - Scope to an event occurrence.

Show curl example

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.

Show curl example

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.

Show curl example

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_idintegerThe id of the person. Required for states other than "reserved".
event_occurrence_idintegerThe id of the event occurrence. Required.
statestring

Initial state of the visit. Defaults to "registered". Must be one of the following:

reservedRegistration is pending. A spot on the roster is held, but a person_id is not required. This state is typically only used to hold a spot while the client finishes registration.
registeredRegistration is complete. A person is required. This is the default state.
completedPerson has been marked as attended.
noshowedPerson did not show up.
late_canceledPerson canceled outside the cancellation window.
notify_clientbooleanShould the client be notified of this registration or when it is deleted? Write-only. Defaults to true.
restrictionsarray

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.

inside_blackout_windowWill return an error if it's too close to the start time to register.
fullWill return an error if the event occurrence is full.
in_the_pastWill return an error if the event occurrence is in the past.
PUT /api/v2/desk/visits/:id

Updates a visit.

Show curl example

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_idintegerThe id of the person. Can be set, but cannot changed.
state_eventstring

Visits are state machines. They can be transitioned between states by using the write-only state_event attribute. The following transitions can be applied to visits:

registerRegister a person for the visit. Transitions from "reserved" to "registered". Person is required.
completeMark registered person as attended. Transitions from "registered" to "completed".
noshowMark registered person as a no show. Transitions from "registered" to "noshowed".
late_cancelMark the registered person as a late cancel. Transitions from "registered" to "late_canceled".
resetResets from "completed", "noshowed" or "late_canceled" back to "registered".

A 422 Unprocessable Entity with an errors object is returned when the transition cannot be applied. Applying complete to a visit whose event occurrence is canceled returns errors.state_event saying the event has been canceled.

DELETE /api/v2/desk/visits/:id

Destroys a visit and future visits for the same event occurrence.

Parameters

notify_clientbooleanNotify the client. Optional, defaults to true.
remove_recurring_enrollmentbooleanRemove the visit from the roster and future visits for the same event occurrence. Optional, defaults to false.

Show curl example

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.

Show curl example

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.

Show curl example

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_idintegerThe event ID. Required
make_upobject

Make up attributes to build the visit - make up pass. Optional

make_up_reason_idintegerThe Make up reason ID. Required if makeup is sent
free_form_reasonstringIssue Make up pass free form reason. Optional