Webhooks API Documentation
Punchcard
Punchcards track the amount of event occurrences the people associated with the punchcard can attend. A new punchcard starts every week if the plan is a weekly plan, every month if the plan is a monthly plan, etc.
Resource Attributes
| data.punchcards[0] | |||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | integer | The punchcard's ID. | |||||||||||||||
| count | integer | The number of punches provided by the punchcard. | |||||||||||||||
| remaining | integer | The number of punches remaining on the punchcard. | |||||||||||||||
| start_date | date | The first day the punchcard is active. | |||||||||||||||
| end_date | date | The last day the punchcard is active. | |||||||||||||||
| people | object |
| |||||||||||||||
| plan | object | Details of the associated plan.
| |||||||||||||||
| updated_at | timestamp | Timestamp for when the punchcard was last updated. | |||||||||||||||
punchcard.started
Triggers when a punchcard becomes active for the current limit period.
Payload Example
Punchcard Started Webhook Payload
{
"topic": "punchcard.started",
"business_id": 1,
"data": {
"punchcards": [
{
"id": 1,
"count": 10,
"remaining": 10,
"start_date": "2012-08-31",
"end_date": "2012-09-06",
"people": [
{
"id": 1,
"name": "Zula Jacobi",
"email": "zula.jacobi@example.com"
}
],
"plan": {
"id": 1,
"name": "Summer Strong",
"description": "",
"type": "Membership",
"count": 1,
"limit_period": "week"
},
"updated_at": "2012-09-03T09:05:02Z"
}
]
}
}
punchcard.updated
Triggers when a certain properties of a punchcard are updated.
The specific list of fields that trigger an update are:
| Changes to these fields trigger a notification |
|---|
| count |
| remaining |
| start_date |
| end_date |
| data | |||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| punchcards | array | Array of one updated punchcard. | |||||||||||||||
| previous | object | Previous values of the resource. The following are supported:
| |||||||||||||||
punchcard.updated
Triggers when a punchcard is updated.
Payload Example
Punchcard Updated Webhook Payload
{
"topic": "punchcard.updated",
"business_id": 80,
"data": {
"punchcards": [
{
"id": 77,
"count": 5,
"remaining": 5,
"start_date": "2012-08-31",
"end_date": "2012-09-02",
"people": [
{
"id": 117,
"name": "Nicholaus Greenholt",
"email": "nicholaus_greenholt@example.com"
}
],
"plan": {
"id": 77,
"name": "MyString",
"description": "MyString",
"type": "Membership",
"count": 1,
"limit_period": "week"
},
"updated_at": "2012-09-03T09:05:46Z"
}
],
"previous": {
"count": 10,
"end_date": "2012-09-06",
"remaining": 10,
"updated_at": "2012-09-03T09:05:02Z"
}
}
}
punchcard.deleted
Triggers when a punchcard is deleted.
Payload Example
Punchcard Deleted Webhook Payload
{
"topic": "punchcard.deleted",
"business_id": 1,
"data": {
"punchcards": [
{
"id": 1,
"count": 10,
"remaining": 10,
"start_date": "2012-08-31",
"end_date": "2012-09-06",
"people": [
{
"id": 1,
"name": "Zula Jacobi",
"email": "zula.jacobi@example.com"
}
],
"plan": {
"id": 1,
"name": "Summer Strong",
"description": "",
"type": "Membership",
"count": 1,
"limit_period": "week"
},
"updated_at": "2012-09-03T09:05:02Z"
}
]
}
}