# Glofox

> Manage a gym or studio's members and leads, book and cancel classes, mark attendance and read memberships, staff and payments.

App · 24 actions. Web page: https://docs.lodol.com/docs/integrations/glofox

## Actions

### Add note

Add a note, or a record of an email sent by hand, to a lead's history.

**Inputs**

- Member ID (`member_id`, text, required): The member's or lead's Glofox user ID (its _id).
- Type (`type`, text): A note, or an email sent outside Glofox. One of: `NOTE`, `MANUAL_EMAIL` (Manual email). Default: `NOTE`.
- Note (`text`, text): What the note says.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "success": true
  }
}
```

### Book class

Book a member into a class, or onto its waiting list when it's full.

**Inputs**

- Class ID (`class_id`, text, required): The class's ID (its _id, or model_id when that is set), from 'List classes'.
- Member ID (`member_id`, text, required): The member to book.
- Join waiting list (`join_waiting_list`, true/false): Put the member on the waiting list if the class is full.
- Guests (`guests`, number): How many guests the member brings. At least 0.
- Charge (`charge`, true/false): Charge the member for the booking.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "Booking": {
      "_id": "example",
      "event_id": "example",
      "event_name": "example",
      "status": "BOOKED",
      "user_id": "example",
      "user_name": "example"
    },
    "success": true
  }
}
```

### Cancel booking

Cancel a booking.

**Inputs**

- Booking ID (`booking_id`, text, required): The booking's ID (its _id).

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {}
}
```

### Cancel membership

Cancel a member's open-ended recurring membership now, at the end of its billing cycle, or on a date.

**Inputs**

- Member's membership ID (`user_membership_id`, text, required): The member's membership ID (membership.user_membership_id on the member).
- Member ID (`member_id`, text, required): The member whose membership this is.
- When (`when`, text, required): When the membership ends. One of: `NOW`, `END_OF_CYCLE` (End of cycle), `ON_DATE` (On date).
- End date (`end_date`, date): The day it ends, when When is ON_DATE.
- Reason (`reason`, text, required): Why the member is leaving. One of: `MEMBERSHIP_CANCELLATION_PRICE` (Membership cancellation price), `MEMBERSHIP_CANCELLATION_MOVED` (Membership cancellation moved), `MEMBERSHIP_CANCELLATION_NO_USAGE` (Membership cancellation no usage), `MEMBERSHIP_CANCELLATION_CUSTOMER_SERVICE` (Membership cancellation customer service), `MEMBERSHIP_CANCELLATION_EVENT_SCHEDULE` (Membership cancellation event schedule), `MEMBERSHIP_CANCELLATION_CHANGE_MEMBERSHIP` (Membership cancellation change membership).

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "local_planned_end_date": "example"
  }
}
```

### Create lead

Add a person to the studio as a lead, entering the sales funnel, or as a member, skipping it.

**Inputs**

- First name (`first_name`, text, required): First name.
- Last name (`last_name`, text, required): Last name.
- Email (`email`, text, required): Email address.
- Status (`lead_status`, text, required): LEAD for most new leads, COLD for one unlikely to join, or MEMBER to skip the sales funnel. One of: `LEAD`, `COLD`, `MEMBER`.
- Phone (`phone`, text): Phone number.
- Date of birth (`birth_date`, date): Date of birth.
- Emergency contact (`emergency_contact`, text): Emergency contact details, shown on the member's profile.
- Contact source (`contact_source`, text): How the lead first got in touch.
- Marketing source (`marketing_source`, text): Which marketing brought the lead in.
- Email consent (`email_consent`, true/false): Whether the person agrees to marketing email.
- Text message consent (`sms_consent`, true/false): Whether the person agrees to marketing text messages.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "access_barcode": "example",
    "active": true,
    "birth": "example",
    "branch_id": "example",
    "consent": {
      "email": {
        "active": true
      },
      "phone_call": {
        "active": true
      },
      "push": {
        "active": true
      },
      "sms": {
        "active": true
      },
      "whatsapp": {
        "active": true
      }
    },
    "created": 1,
    "email": "example",
    "emergency_contact": "example",
    "first_name": "example",
    "image_url": "example",
    "joined_at": "example",
    "last_name": "example",
    "lead_status": "example",
    "leads": {
      "contact_source": "example",
      "marketing_source": "example"
    },
    "membership": {
      "expiry_date": 1,
      "membership_name": "example",
      "plan_code": "example",
      "plan_name": "example",
      "start_date": 1,
      "status": "example",
      "type": "example",
      "user_membership_id": "example"
    },
    "modified": 1,
    "name": "example",
    "origin_branch_id": "example",
    "phone": "example",
    "type": "example"
  }
}
```

### Find member by email

Find the member or lead with this exact email address. Glofox emails are unique within a studio.

**Inputs**

- Email (`email`, text, required): The full email address to look for.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {}
}
```

### Get branch

Get the connected studio (branch): its name, address, time zone and contact details.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "about": "example",
    "address": {
      "city": "example",
      "country_code": "example",
      "currency": "example",
      "postal_code": "example",
      "state": "example",
      "street": "example",
      "timezone_id": "example"
    },
    "email": "example",
    "name": "example",
    "namespace": "example",
    "phone": "example",
    "website": "example"
  }
}
```

### Get class

Get one class, course or time slot, with how many are booked and waiting.

**Inputs**

- Class ID (`class_id`, text, required): The class's ID (its _id), from 'List classes'.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "active": true,
    "booked": 1,
    "branch_id": "example",
    "description": "example",
    "duration": 1,
    "facility": "example",
    "is_online": true,
    "level": "example",
    "model": "example",
    "model_id": "example",
    "modified": 1,
    "name": "example",
    "private": true,
    "program_id": "example",
    "size": 1,
    "status": "example",
    "time_start": 1,
    "trainers": [
      "example"
    ],
    "type": "example",
    "waiting": 1
  }
}
```

### Get member

Get one member or lead.

**Inputs**

- Member ID (`member_id`, text, required): The member's or lead's Glofox user ID (its _id).

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "access_barcode": "example",
    "active": true,
    "birth": "example",
    "branch_id": "example",
    "consent": {
      "email": {
        "active": true
      },
      "phone_call": {
        "active": true
      },
      "push": {
        "active": true
      },
      "sms": {
        "active": true
      },
      "whatsapp": {
        "active": true
      }
    },
    "created": 1,
    "email": "example",
    "emergency_contact": "example",
    "first_name": "example",
    "image_url": "example",
    "joined_at": "example",
    "last_name": "example",
    "lead_status": "example",
    "leads": {
      "contact_source": "example",
      "marketing_source": "example"
    },
    "membership": {
      "expiry_date": 1,
      "membership_name": "example",
      "plan_code": "example",
      "plan_name": "example",
      "start_date": 1,
      "status": "example",
      "type": "example",
      "user_membership_id": "example"
    },
    "modified": 1,
    "name": "example",
    "origin_branch_id": "example",
    "phone": "example",
    "type": "example"
  }
}
```

### Get membership

Get one membership and its plans.

**Inputs**

- Membership (`membership_id`, text, required): The membership to read.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "active": true,
    "branch_id": "example",
    "buy_just_once": true,
    "description": "example",
    "name": "example",
    "plans": [
      {
        "code": 1,
        "duration_time_unit": "example",
        "duration_time_unit_count": 1,
        "price": 1,
        "starts_on": "example",
        "type": "example",
        "upfront_fee": 1
      }
    ]
  }
}
```

### Get staff member

Get one staff member.

**Inputs**

- Staff member (`staff_id`, text, required): The staff member to read.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "active": true,
    "bookable": true,
    "branch_id": "example",
    "description": "example",
    "first_name": "example",
    "image_url": "example",
    "last_name": "example",
    "modified": 1,
    "name": "example",
    "type": "example"
  }
}
```

### List bookings

List the studio's bookings, optionally by status, class or when they were made.

**Inputs**

- Status (`status`, text): Only bookings with this status. One of: `BOOKED`, `WAITING`, `CANCELED`, `RESERVED`, `FAILED`.
- Kind (`event_type`, text): Only bookings of this kind. One of: `events`, `courses`, `facilities`, `users`, `appointments`.
- Class ID (`class_id`, text): Only bookings for this class.
- Made since (`created_since`, date and time): Only bookings made at or after this time.
- Made until (`created_until`, date and time): Only bookings made at or before this time.
- Changed since (`modified_since`, date and time): Only bookings changed at or after this time.
- Page (`page`, number): The page to read, from 1. At least 1.
- Per page (`limit`, number): How many records a page holds. From 1 to 200.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "_id": "example",
        "attended": true,
        "branch_id": "example",
        "canceled_at": "example",
        "course_id": "example",
        "created": "example",
        "event_id": "example",
        "event_name": "example",
        "guest_bookings": 1,
        "is_from_waiting_list": true,
        "is_late_cancellation": true,
        "model": "example",
        "model_id": "example",
        "model_name": "example",
        "modified": "example",
        "paid": true,
        "payment_method": "example",
        "program_id": "example",
        "status": "BOOKED",
        "time_finish": "example",
        "time_slot_id": "example",
        "time_start": "example",
        "type": "example",
        "user_id": "example",
        "user_name": "example"
      }
    ],
    "meta": {
      "limit": 1,
      "page": 1,
      "totalCount": 1
    },
    "success": true
  }
}
```

### List classes

List the classes, courses or appointment and facility time slots that start in a time range.

**Inputs**

- Starts from (`start`, date and time, required): From this time.
- Starts until (`end`, date and time, required): Until this time.
- Kind (`class_type`, text): Classes (the usual), courses, or appointment and facility time slots. One of: `event`, `course`, `timeslot`.
- Sort by (`sort_by`, text): Order. A leading - sorts newest or latest first. One of: `time_start` (Time start), `-time_start` (-time start), `created`, `-created`, `time_finish` (Time finish), `-time_finish` (-time finish).
- Trainers (`trainers`, list): Only classes these trainers lead.
- Private (`private`, true/false): Only private classes (on) or only public ones (off).
- Page (`page`, number): The page to read, from 1. At least 1.
- Per page (`limit`, number): How many records a page holds. From 1 to 200.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "_id": "example",
        "active": true,
        "booked": 1,
        "branch_id": "example",
        "description": "example",
        "duration": 1,
        "facility": "example",
        "is_online": true,
        "level": "example",
        "model": "example",
        "model_id": "example",
        "modified": 1,
        "name": "example",
        "private": true,
        "program_id": "example",
        "size": 1,
        "status": "example",
        "time_start": 1,
        "trainers": [
          "example"
        ],
        "type": "example",
        "waiting": 1
      }
    ],
    "has_more": true,
    "limit": 1,
    "object": "example",
    "page": 1,
    "total_count": 1
  }
}
```

### List contact sources

List the contact sources a lead can be given.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Glofox.

**Example output**

```json
{
  "data": [
    "example"
  ]
}
```

### List credit packs

List a member's class credit packs and how many credits are left.

**Inputs**

- Member ID (`member_id`, text, required): The member whose credit packs to list.
- Page (`page`, number): The page to read, from 1. At least 1.
- Per page (`limit`, number): How many records a page holds. From 1 to 200.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "_id": "example",
        "active": true,
        "available": 1,
        "end_date": 1,
        "membership_id": "example",
        "membership_name": "example",
        "model": "example",
        "num_sessions": 1,
        "start_date": 1,
        "user_id": "example"
      }
    ],
    "has_more": true,
    "limit": 1,
    "object": "example",
    "page": 1,
    "total_count": 1
  }
}
```

### List leads

List the studio's leads, newest first, optionally by status or when they were added.

**Inputs**

- Statuses (`lead_statuses`, list): Only leads with these statuses. One or more of: `LEAD`, `COLD`, `TRIAL`, `NO_SALE_TRIAL` (No sale trial), `TOUR`, `NO_SALE_TOUR` (No sale tour), `MEMBER`.
- Name (`name`, text): Only leads whose name contains this.
- Added since (`created_since`, date and time): Only leads added at or after this time.
- Added until (`created_until`, date and time): Only leads added at or before this time.
- Skip (`skip`, number): How many pages to skip, as Glofox counts them. At least 0.
- Per page (`limit`, number): How many leads a page holds. From 1 to 200.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "_id": "example",
        "access_barcode": "example",
        "active": true,
        "birth": "example",
        "branch_id": "example",
        "consent": {
          "email": {
            "active": true
          },
          "phone_call": {
            "active": true
          },
          "push": {
            "active": true
          },
          "sms": {
            "active": true
          },
          "whatsapp": {
            "active": true
          }
        },
        "created": 1,
        "email": "example",
        "emergency_contact": "example",
        "first_name": "example",
        "image_url": "example",
        "joined_at": "example",
        "last_name": "example",
        "lead_status": "example",
        "leads": {
          "contact_source": "example",
          "marketing_source": "example"
        },
        "membership": {
          "expiry_date": 1,
          "membership_name": "example",
          "plan_code": "example",
          "plan_name": "example",
          "start_date": 1,
          "status": "example",
          "type": "example",
          "user_membership_id": "example"
        },
        "modified": 1,
        "name": "example",
        "origin_branch_id": "example",
        "phone": "example",
        "type": "example"
      }
    ],
    "success": true
  }
}
```

### List marketing sources

List the marketing sources a lead can be given.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Glofox.

**Example output**

```json
{
  "data": [
    {
      "_id": "example",
      "active": true,
      "code": "example",
      "name": "example"
    }
  ]
}
```

### List members

List the studio's clients, a page at a time, optionally only those changed since a time.

**Inputs**

- Active (`active`, text): Active members (the default), inactive members, or both. One of: `true`, `false`, `any`.
- Changed since (`modified_since`, date and time): Only members changed at or after this time.
- Changed until (`modified_until`, date and time): Only members changed at or before this time.
- Page (`page`, number): The page to read, from 1. At least 1.
- Per page (`limit`, number): How many records a page holds. From 1 to 200.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "_id": "example",
        "access_barcode": "example",
        "active": true,
        "birth": "example",
        "branch_id": "example",
        "consent": {
          "email": {
            "active": true
          },
          "phone_call": {
            "active": true
          },
          "push": {
            "active": true
          },
          "sms": {
            "active": true
          },
          "whatsapp": {
            "active": true
          }
        },
        "created": 1,
        "email": "example",
        "emergency_contact": "example",
        "first_name": "example",
        "image_url": "example",
        "joined_at": "example",
        "last_name": "example",
        "lead_status": "example",
        "leads": {
          "contact_source": "example",
          "marketing_source": "example"
        },
        "membership": {
          "expiry_date": 1,
          "membership_name": "example",
          "plan_code": "example",
          "plan_name": "example",
          "start_date": 1,
          "status": "example",
          "type": "example",
          "user_membership_id": "example"
        },
        "modified": 1,
        "name": "example",
        "origin_branch_id": "example",
        "phone": "example",
        "type": "example"
      }
    ],
    "has_more": true,
    "limit": 1,
    "object": "example",
    "page": 1,
    "total_count": 1
  }
}
```

### List memberships

List the memberships the studio sells and their plans.

**Inputs**

- Private (`private`, text): Public memberships, private ones, or both. One of: `true`, `false`, `any`.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "_id": "example",
        "active": true,
        "branch_id": "example",
        "buy_just_once": true,
        "description": "example",
        "name": "example",
        "plans": [
          {
            "code": 1,
            "duration_time_unit": "example",
            "duration_time_unit_count": 1,
            "price": 1,
            "starts_on": "example",
            "type": "example",
            "upfront_fee": 1
          }
        ]
      }
    ],
    "has_more": true,
    "limit": 1,
    "object": "example",
    "page": 1,
    "total_count": 1
  }
}
```

### List notes

List the notes and other interactions on a lead's history.

**Inputs**

- Member ID (`member_id`, text, required): The member's or lead's Glofox user ID (its _id).
- Page (`page`, number, required): The page to read, from 1. At least 1.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "_id": "example",
        "created": "example",
        "description": "example",
        "type": "example"
      }
    ],
    "meta": {
      "pagination": {
        "count": 1,
        "currentPage": 1,
        "perPage": 1
      }
    },
    "success": true
  }
}
```

### List staff

List the studio's staff: admins, receptionists and trainers.

**Inputs**

- Kind (`type`, text): Only staff of this kind. One of: `TRAINER`, `RECEPTION`, `ADMIN`.
- Active (`active`, text): Active staff (the default), inactive staff, or both. One of: `true`, `false`, `any`.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "_id": "example",
        "active": true,
        "bookable": true,
        "branch_id": "example",
        "description": "example",
        "first_name": "example",
        "image_url": "example",
        "last_name": "example",
        "modified": 1,
        "name": "example",
        "type": "example"
      }
    ],
    "has_more": true,
    "limit": 1,
    "object": "example",
    "page": 1,
    "total_count": 1
  }
}
```

### List transactions

List the studio's payments and other transactions in a time range.

**Inputs**

- From (`start`, date and time, required): From this time.
- Until (`end`, date and time, required): Until this time.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "TransactionsList": {
      "details": [
        {
          "_id": "example",
          "amount": 1,
          "created": "example",
          "currency": "example",
          "description": "example",
          "id": "example",
          "metadata": {
            "glofox_event": "example",
            "payment_method": "example"
          },
          "modified": "example",
          "paid": true,
          "sold_by_user_id": "example",
          "transaction_provider_id": "example",
          "transaction_status": "example"
        }
      ]
    }
  }
}
```

### Mark attended

Mark one or more bookings as attended.

**Inputs**

- Booking IDs (`booking_ids`, list, required): The bookings to mark, by their _id.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "model_ids": [
      "example"
    ],
    "success": true
  }
}
```

### Update member

Change a member's or lead's name, email, phone, status, date of birth or emergency contact. Fields left empty keep their value.

**Inputs**

- Member ID (`member_id`, text, required): The member's or lead's Glofox user ID (its _id).
- First name (`first_name`, text): New first name.
- Last name (`last_name`, text): New last name.
- Email (`email`, text): New email address.
- Phone (`phone`, text): New phone number.
- Status (`lead_status`, text): New lead status. One of: `LEAD`, `COLD`, `TRIAL`, `NO_SALE_TRIAL` (No sale trial), `TOUR`, `NO_SALE_TOUR` (No sale tour), `MEMBER`.
- Date of birth (`birth_date`, date): Date of birth.
- Emergency contact (`emergency_contact`, text): Emergency contact details.

**Outputs**

- `data` (object): The response from Glofox.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "access_barcode": "example",
    "active": true,
    "birth": "example",
    "branch_id": "example",
    "consent": {
      "email": {
        "active": true
      },
      "phone_call": {
        "active": true
      },
      "push": {
        "active": true
      },
      "sms": {
        "active": true
      },
      "whatsapp": {
        "active": true
      }
    },
    "created": 1,
    "email": "example",
    "emergency_contact": "example",
    "first_name": "example",
    "image_url": "example",
    "joined_at": "example",
    "last_name": "example",
    "lead_status": "example",
    "leads": {
      "contact_source": "example",
      "marketing_source": "example"
    },
    "membership": {
      "expiry_date": 1,
      "membership_name": "example",
      "plan_code": "example",
      "plan_name": "example",
      "start_date": 1,
      "status": "example",
      "type": "example",
      "user_membership_id": "example"
    },
    "modified": 1,
    "name": "example",
    "origin_branch_id": "example",
    "phone": "example",
    "type": "example"
  }
}
```
