Core API Documentation
Pack product (Passes)
A pack product is a type of non-recurring plan that grants people a fixed number of visits. A pack product is used to create a pack. This endpoint requires owner or manager permission levels.
Desk Only
GET /api/v2/desk/pack_products
Lists all pack products for the business. Paginate using the
REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/pack_products \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"pack_products": [
{
"id": 1,
"count": 10,
"commitment_length": 12,
"commitment_unit": "month",
"location_id": null,
"terms": "Terms and Conditions",
"send_expiration_notifications": true,
"created_at": "2015-07-02T16:45:30Z",
"updated_at": "2015-07-02T16:45:30Z",
"product": {
"id": 2,
"name": "Ten Visit Punchcard",
"description": "A punchcard with ten visits.",
"description_long": "A longer description.",
"price_cents": 10000,
"visibility": "staff",
"suspended": null,
"created_at": "2015-07-02T16:45:30Z",
"updated_at": "2015-07-02T16:45:30Z"
},
"services": [
{
"id": 1,
"name": "Class P"
},
{
"id": 2,
"name": "Class Q"
},
{
"id": 5,
"name": "Class T"
},
{
"id": 6,
"name": "Appointment A"
}
]
},
{
"id": 2,
"count": 1,
"commitment_length": 1,
"commitment_unit": "week",
"location_id": null,
"terms": "Terms and Conditions",
"send_expiration_notifications": true,
"created_at": "2015-07-02T16:45:30Z",
"updated_at": "2015-07-02T16:45:30Z",
"product": {
"id": 3,
"name": "One Visit Punchcard",
"description": "A punchcard with one visit.",
"description_long": "A longer description.",
"price_cents": 1000,
"visibility": "everyone",
"suspended": null,
"created_at": "2015-07-02T16:45:30Z",
"updated_at": "2015-07-02T16:45:30Z"
},
"services": [
{
"id": 1,
"name": "Class P"
},
{
"id": 2,
"name": "Class Q"
}
]
}
]
}
GET /api/v2/desk/pack_products/:id
Returns the details of a pack product.
REQUEST
$ curl https://mybiz.pike13.com/api/v2/desk/pack_products/1 \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE
{
"pack_products": [
{
"id": 1,
"count": 10,
"commitment_length": 12,
"commitment_unit": "month",
"location_id": null,
"terms": "Terms and Conditions",
"send_expiration_notifications": true,
"created_at": "2015-07-02T16:45:30Z",
"updated_at": "2015-07-02T16:45:30Z",
"product": {
"id": 2,
"name": "Ten Visit Punchcard",
"description": "A punchcard with ten visits.",
"description_long": "A longer description.",
"price_cents": 10000,
"visibility": "staff",
"suspended": null,
"created_at": "2015-07-02T16:45:30Z",
"updated_at": "2015-07-02T16:45:30Z"
},
"services": [
{
"id": 1,
"name": "Class P"
},
{
"id": 2,
"name": "Class Q"
},
{
"id": 5,
"name": "Class T"
},
{
"id": 6,
"name": "Appointment A"
}
]
}
]
}
POST /api/v2/desk/pack_products
Creates a pack product.
REQUEST
$ curl -X POST https://mybiz.pike13.com/api/v2/desk/pack_products \
-H "Authorization: Bearer XXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{"pack_product":{"product":{"name": "Ten Visit Punchcard","description": "A punchcard with ten visits.","description_long": "A longer description.","price_cents": "10000","visibility": "staff"},"count":10,"location_id":1,"commitment_length":12,"commitment_unit":"month","terms":"Terms and Conditions","send_expiration_notifications":true, "service_ids": [ 1, 2, 5, 6 ]}}'
RESPONSE
{
"pack_products": [
{
"id": 1,
"count": 10,
"commitment_length": 12,
"commitment_unit": "month",
"location_id": null,
"terms": "Terms and Conditions",
"send_expiration_notifications": true,
"created_at": "2015-07-02T16:45:30Z",
"updated_at": "2015-07-02T16:45:30Z",
"product": {
"id": 2,
"name": "Ten Visit Punchcard",
"description": "A punchcard with ten visits.",
"description_long": "A longer description.",
"price_cents": 10000,
"visibility": "staff",
"suspended": null,
"created_at": "2015-07-02T16:45:30Z",
"updated_at": "2015-07-02T16:45:30Z"
},
"services": [
{
"id": 1,
"name": "Class P"
},
{
"id": 2,
"name": "Class Q"
},
{
"id": 5,
"name": "Class T"
},
{
"id": 6,
"name": "Appointment A"
}
]
}
]
}
Attributes
| product | object | The product from which the pack inherits some properties.
| ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| count | integer | Required. The number of uses this pack product has. | ||||||||||||||||||
| commitment_length | integer | Required. Combined with commitment_unit, this determines how long the pack product is valid. e.g. 12 months. | ||||||||||||||||||
| commitment_unit | string | Required. Combined with commitment_length, this determines how long the pack_product is valid. e.g. 12 months. Possible values: | ||||||||||||||||||
| location_id | integer | If specified, restricts the location where this pack product can be used. Optional. | ||||||||||||||||||
| consider_member | boolean | Is the client considered a member of the business when purchasing this pack product? Optional. Defaults to false. | ||||||||||||||||||
| terms | string | Terms and conditions associated with purchasing this pack product. Optional. | ||||||||||||||||||
| terms_acceptance_required | boolean | Is the client required to accept the terms and conditions? If true, they will be sent an email asking them to accept the terms. Optional. Defaults to false. | ||||||||||||||||||
| terms_acceptance_type | string | If terms acceptance is required, this dictates how the terms are presented and acknowledged. Possible values: | ||||||||||||||||||
| terms_acceptance_at_checkout | boolean | Is the client required to accept the terms and conditions before they can complete the purchase of a pack. Optional. Defaults to false. | ||||||||||||||||||
| send_expiration_notifications | boolean | Send notifcations to the client when the pack is about to expire. Optional. Defaults to true. | ||||||||||||||||||
| service_ids | array | Array of services ids that clients can use with this pack. This does not apply to staff, they can use the pack with any service. When set to an empty array, |
PUT /api/v2/desk/pack_products/:id
Updates a pack product.
REQUEST
$ curl -X PUT https://mybiz.pike13.com/api/v2/desk/pack_products/1 \
-H "Authorization: Bearer XXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{"pack_product":{"product":{"name": "Twelve Visit Punchcard", "description": "A punchcard with twelve visits."},"count":12,"service_ids": [ 1, 2 ]}}'
RESPONSE
{
"pack_products": [
{
"id": 1,
"count": 10,
"commitment_length": 12,
"commitment_unit": "month",
"location_id": null,
"terms": "Terms and Conditions",
"send_expiration_notifications": true,
"created_at": "2015-07-02T16:45:30Z",
"updated_at": "2015-07-02T16:45:30Z",
"product": {
"id": 2,
"name": "Ten Visit Punchcard",
"description": "A punchcard with ten visits.",
"description_long": "A longer description.",
"price_cents": 10000,
"visibility": "staff",
"suspended": null,
"created_at": "2015-07-02T16:45:30Z",
"updated_at": "2015-07-02T16:45:30Z"
},
"services": [
{
"id": 1,
"name": "Class P"
},
{
"id": 2,
"name": "Class Q"
},
{
"id": 5,
"name": "Class T"
},
{
"id": 6,
"name": "Appointment A"
}
]
}
]
}
DELETE /api/v2/desk/pack_products/:id
Destroys a pack product.
REQUEST
$ curl -X DELETE https://mybiz.pike13.com/api/v2/desk/pack_products/1 \
-H "Authorization: Bearer XXXXXXXXXXXXXXX"
RESPONSE