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

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 page parameter.

Show curl example

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.

Show curl example

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.

Show curl example

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

productobject

The product from which the pack inherits some properties.

namestringRequired. How many times this pack product can be used.
price_centsintegerRequired. The cost of the pack product in cents.
visibilitystring

Required. Determines who can see and purchase this pack product. Possible values:

  • Everyone Visible to anyone
  • Members Visible to members and staff
  • Staff Visible to staff
  • New clients Complementary pack given to new clients
descriptionstringBrief description of the pack product.
description_longstringMore verbose description that shows up on more detailed pages.
suspendedbooleanWhen suspended, it cannot be sold. Defaults to false.
countintegerRequired. The number of uses this pack product has.
commitment_lengthintegerRequired. Combined with commitment_unit, this determines how long the pack product is valid. e.g. 12 months.
commitment_unitstringRequired. Combined with commitment_length, this determines how long the pack_product is valid. e.g. 12 months. Possible values: day, week, month.
location_idintegerIf specified, restricts the location where this pack product can be used. Optional.
consider_memberbooleanIs the client considered a member of the business when purchasing this pack product? Optional. Defaults to false.
termsstringTerms and conditions associated with purchasing this pack product. Optional.
terms_acceptance_requiredbooleanIs 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_typestringIf terms acceptance is required, this dictates how the terms are presented and acknowledged. Possible values: checkbox, document. Optional. Default is checkbox.
terms_acceptance_at_checkoutbooleanIs the client required to accept the terms and conditions before they can complete the purchase of a pack. Optional. Defaults to false.
send_expiration_notificationsbooleanSend notifcations to the client when the pack is about to expire. Optional. Defaults to true.
service_idsarrayArray 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, [], will remove all services. When set to null or not included in the request, will not alter the existing services. Will ignore service ids that are invalid. Optional. Defaults to [].
PUT /api/v2/desk/pack_products/:id

Updates a pack product.

Show curl example

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.

Show curl example

REQUEST
$ curl -X DELETE https://mybiz.pike13.com/api/v2/desk/pack_products/1 \
  -H "Authorization: Bearer XXXXXXXXXXXXXXX"

RESPONSE