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

Webhooks API Documentation

Plan

Resource Attributes

data.plans[0]
idintegerID for this plan.
descriptionstringDescription of this plan.
typestringType of this plan. One of ['Pack', 'Prepaid', 'Membership'].
plan_product_idintegerID of product associated with this plan.
countintegerMaximium count (limit) for the number of punches for this plan during the 'limit_period'.
staff_member_idintegerStaff Member ID for this plan.
location_idintegerLocation ID for this plan.
pricestringPrice formatted in currency units for this plan.
price_centsintegerPrice in cents for this plan.
limit_periodstringLimit period for this plan if any. One of ['weekly', 'monthly'].
start_datedateStart date for this plan.
end_datedateEnd date for this plan.
cancelled_attimestampTimestamp for when this plan was cancelled, if applicable.
updated_attimestampTimestamp for when this plan was updated.
created_attimestampTimestamp for when this plan was created.
peoplearray

Array of people objects who are on this plan. Empty if there are none.

idintegerID for this person.
namestringName of this person.
emailstringEmail for this person.

plan.updated

Triggers when specific fields of a plan are updated.

The specifc list of fields that trigger an update are:

Changes to these fields trigger a notification
description
price_cents
count
staff_member_id
limit_period
start_date
end_date
cancelled_at

This topic supports previous values within data:

data
plansarrayArray of one plan updated in the business.
previousobject

Previous values of the resource. The following are supported:

descriptionstringDescription of this plan.
pricestringPrice formatted in currency units for this plan.
price_centsintegerPrice in cents for this plan.
countintegerMaximium count (limit) for the number of punches for this plan during the 'limit_period'.
staff_member_idintegerStaff Member ID for this plan.
limit_periodstringLimit period for this plan if any. One of ['weekly', 'monthly'].
start_datedateStart date for this plan.
end_datedateEnd date for this plan.
cancelled_attimestampTimestamp for when this plan was cancelled, if applicable.
updated_attimestampTimestamp for when this plan was updated.

Payload Example

Plan Updated Webhook Payload

{
  "topic": "plan.updated",
  "business_id": 1,
  "data": {
    "plans": [
      {
        "id": 1,
        "description": "Prepaid plan for 2 people",
        "type": "Prepaid",
        "plan_product_id": 3,
        "count": 1,
        "staff_member_id": null,
        "location_id": null,
        "price_cents": 10000,
        "price": "10,000.00",
        "limit_period": "weekly",
        "start_date": "2014-04-01",
        "end_date": "2014-04-02",
        "cancelled_at": "2012-09-03T08:05:01Z",
        "updated_at": "2012-09-03T09:05:01Z",
        "created_at": "2012-09-03T09:05:01Z",
        "people": [
          {
            "id": 1,
            "name": "Lera Murphy",
            "email": "lera.murphy@pike13.com"
          },
          {
            "id": 2,
            "name": "Derrick Halvorson",
            "email": "halvorson_derrick@pike13.com"
          }
        ]
      }
    ],
    "previous": {
      "description": "previous",
      "price_cents": 111,
      "count": 111,
      "limit_period": "previous",
      "start_date": "2012-09-02",
      "end_date": "2012-09-02",
      "cancelled_at": null,
      "staff_member_id": 111,
      "updated_at": "2012-09-03T08:05:01Z"
    }
  }
}

plan.ended

Triggers when a plan is cancelled or when its end date has passed.

Payload Example

Plan Ended Webhook Payload

{
  "topic": "plan.ended",
  "business_id": 1,
  "data": {
    "plans": [
      {
        "id": 1,
        "description": "Prepaid plan for 2 people",
        "type": "Prepaid",
        "plan_product_id": 3,
        "count": 1,
        "staff_member_id": null,
        "location_id": null,
        "price_cents": 10000,
        "price": "100.00",
        "limit_period": "weekly",
        "start_date": "2012-09-04",
        "end_date": "2012-09-03",
        "cancelled_at": "2012-09-03T16:05:01Z",
        "updated_at": "2012-09-03T16:05:01Z",
        "created_at": "2012-09-03T16:05:01Z",
        "people": [
          {
            "id": 1,
            "name": "Jarrett Jast",
            "email": "jast_jarrett@pike13.com"
          },
          {
            "id": 2,
            "name": "Elissa Keeling",
            "email": "keeling_elissa@pike13.com"
          }
        ]
      }
    ]
  }
}