Webhooks API Documentation
Plan
Resource Attributes
| data.plans[0] | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| id | integer | ID for this plan. | |||||||||
| description | string | Description of this plan. | |||||||||
| type | string | Type of this plan. One of ['Pack', 'Prepaid', 'Membership']. | |||||||||
| plan_product_id | integer | ID of product associated with this plan. | |||||||||
| count | integer | Maximium count (limit) for the number of punches for this plan during the 'limit_period'. | |||||||||
| staff_member_id | integer | Staff Member ID for this plan. | |||||||||
| location_id | integer | Location ID for this plan. | |||||||||
| price | string | Price formatted in currency units for this plan. | |||||||||
| price_cents | integer | Price in cents for this plan. | |||||||||
| limit_period | string | Limit period for this plan if any. One of ['weekly', 'monthly']. | |||||||||
| start_date | date | Start date for this plan. | |||||||||
| end_date | date | End date for this plan. | |||||||||
| cancelled_at | timestamp | Timestamp for when this plan was cancelled, if applicable. | |||||||||
| updated_at | timestamp | Timestamp for when this plan was updated. | |||||||||
| created_at | timestamp | Timestamp for when this plan was created. | |||||||||
| people | array | Array of people objects who are on this plan. Empty if there are none.
| |||||||||
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
| data | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| plans | array | Array of one plan updated in the business. | ||||||||||||||||||||||||||||||
| previous | object | Previous values of the resource. The following are supported:
| ||||||||||||||||||||||||||||||
Payload Example
{
"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
{
"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"
}
]
}
]
}
}