Skip to main content

Business

Package purchases

Each checkout a client completed for one of your packages, paid or free.

A package purchase is one checkout a client completed for one of your packages, paid or free, with the package's name as it was then and what the client paid. A purchase isn't revenue: renewals and refunds aren't purchases. Purchases made before this API launched aren't recorded.

Attributes

  • idstring

    Its unique ID.

  • clientobject
    Show 2 child attributes
    • idstring

      Its unique ID.

    • namestring
  • packageobject
    Show 2 child attributes
    • idstring

      Its unique ID.

    • namestring

      As it was when bought.

  • amountinteger

    What the client paid at checkout, in the currency's minor units (cents, or thousandths for KWD and BHD), as Stripe's amounts are. 0 for a free package, a free trial or a full discount.

  • currencystring

    ISO 4217, lowercase, e.g. usd.

  • freeboolean

    Whether the package was free. A paid package bought on a free trial or with a full discount is false, with an amount of 0.

  • purchasedAttimestamp
Package purchase object
{
  "id": "6ad6afb04b9e86b14ba019ae",
  "client": {
    "id": "6ad6af41d3199442d31b2743",
    "name": "Jordan Miller"
  },
  "package": {
    "id": "6ad6afd1a10559d0a103c6cf",
    "name": "12-week online coaching"
  },
  "amount": 14900,
  "currency": "usd",
  "free": false,
  "purchasedAt": "2026-10-26T14:32:05.000Z"
}
GET/v1/package-purchases

Packages your clients bought, most recent first. Across every client you can reach (team members with the Standard role only see their assigned clients), or one client's with clientId. To pick up new purchases, read from the newest and stop at one you've seen before. Requires clients:read.

Query parameters

  • clientIdstring

    Only this client's purchases.

  • Only purchases from this day, included, as YYYY-MM-DD, in your own calendar (the timezone in your HubFit settings).

  • Only purchases up to this day, included, as YYYY-MM-DD, in your own calendar.

  • limitinteger

    How many results to return, from 1 to 100.

    Default 25
  • cursorstring

    The nextCursor from the previous page.

Returns

A page of package purchases.

GET /v1/package-purchases
curl -G https://api.hubfit.com/v1/package-purchases \
  -H "Authorization: Bearer $HUBFIT_API_KEY" \
  -d startDate=2026-10-01
Response200 OK
{
  "data": [
    {
      "id": "6ad6afb04b9e86b14ba019ae",
      "client": {
        "id": "6ad6af41d3199442d31b2743",
        "name": "Jordan Miller"
      },
      "package": {
        "id": "6ad6afd1a10559d0a103c6cf",
        "name": "12-week online coaching"
      },
      "amount": 14900,
      "currency": "usd",
      "free": false,
      "purchasedAt": "2026-10-26T14:32:05.000Z"
    }
  ],
  "nextCursor": "eyJpZCI6IjZhZDZhZjNmMjljNTk3ZjE1In0",
  "totalCount": 48
}
GET/v1/package-purchases/{purchaseId}

One package purchase, such as the one a package_purchase.created webhook names. Requires clients:read.

Path parameters

Returns

The package purchase.

GET /v1/package-purchases/{purchaseId}
curl https://api.hubfit.com/v1/package-purchases/6ad6afb04b9e86b14ba019ae \
  -H "Authorization: Bearer $HUBFIT_API_KEY"
Response200 OK
{
  "data": {
    "id": "6ad6afb04b9e86b14ba019ae",
    "client": {
      "id": "6ad6af41d3199442d31b2743",
      "name": "Jordan Miller"
    },
    "package": {
      "id": "6ad6afd1a10559d0a103c6cf",
      "name": "12-week online coaching"
    },
    "amount": 14900,
    "currency": "usd",
    "free": false,
    "purchasedAt": "2026-10-26T14:32:05.000Z"
  }
}

Subscribe a webhook endpoint to hear about these as they happen, instead of polling. An event carries the record's id and its clientId, not the record: fetch it with your key. See Webhooks.