Core API Documentation
Packs (Passes)
A pack is a type of non-recurring plan that grants people a fixed number of visits.
Desk Only
GET /api/v2/desk/packs/:id
Returns the details of a pack.
REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/packs/1 \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"packs": [
{
"id": 3,
"count": 10,
"person_ids": [
1
],
"description": "10 Pack",
"price_cents": 10000,
"rollover_count": null,
"pack_product_id": 1,
"start_date": "2015-06-24",
"end_date": "2016-06-23",
"staff_member_id": null,
"location_id": null,
"created_at": "2015-06-24T18:41:02Z",
"updated_at": "2015-06-24T18:41:02Z"
}
]
}
POST /api/v2/desk/pack_products/:pack_product_id/packs
Creates a pack.
REQUEST
$ curl -X POST https://mybiz.pike13.com/api/v2/desk/pack_products/1/packs \
-H "Authorization: Bearer XXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{"pack": {"person_ids": [1]}}'
RESPONSE
{
"packs": [
{
"id": 3,
"count": 10,
"person_ids": [
1
],
"description": "10 Pack",
"price_cents": 10000,
"rollover_count": null,
"pack_product_id": 1,
"start_date": "2015-06-24",
"end_date": "2016-06-23",
"staff_member_id": null,
"location_id": null,
"created_at": "2015-06-24T18:41:02Z",
"updated_at": "2015-06-24T18:41:02Z"
}
]
}
Attributes
| person_ids | array | Array of person ids. Required. Including more than one person ID allows clients to share a pack. |
|---|---|---|
| start_date | date | Date the pack becomes effective. Optional. Default to today. |
| end_date | date | Date the pack expires. Defaults to start date plus the pack products expiration period. |
| count | integer | Number of visits the pack can cover. Optional. If not supplied it will default to the pack product definition. |
| description | string | Description of the pack. Optional. |
| price_cents | integer | The cost of the pack in cents. Defaults to the pack product definition. |
| staff_member_id | integer | Staff member id. If set, this pack will only automatically apply to visits where the given staff member is an instructor. |
| location_id | integer | Location id. If set, this pack will only automatically apply to visits at the given location. |
| visits_shared | integer | If a pack applies to multiple people, you can choose whether the visits should be shared among them, or if they should each get their own set of visits. Optional. Defaults to true when plan only applies to one person and false when it applies to multiple people. |
DELETE /api/v2/desk/packs/:id
Destroys a pack. A pack with a closed bill can't be deleted; the response is a
REQUEST
$ curl -X DELETE https://mybiz.pike13.com/api/v2/desk/packs/1 \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE