<!-- https://unlockos.io/manual/line-connection -->

# LINE Integration Help

## Overview

LINE Integration connects your facility's LINE Official Account to UnlockOS. Once connected, guests can perform check-in, check-out, reservations, and other operations directly through LINE.

## Key Features

- 4-step guided setup wizard for LINE Official Account connection
- Automatic rich menu generation and configuration
- Automatic webhook URL setup
- Choose between check-in, reservation, or both services
- Admin notification settings

---

## Prerequisites

The following are required before setting up LINE integration.

| Required | Description |
|----------|-------------|
| LINE Official Account | Create one via LINE Official Account Manager |
| Messaging API | Enable Messaging API on your LINE Official Account |
| Channel ID | Found in LINE Developers Console |
| Channel Secret | Found in LINE Developers Console |
| Channel Access Token | Issue from LINE Developers Console |

---

## Setup Wizard

When LINE is not yet connected, a 4-step wizard is displayed.

### Step 1: Create a LINE Official Account

If you already have a LINE Official Account, select "Yes, I have one" and proceed to Step 2.

If you don't have one, select "No, I'll create one" and follow these steps:

1. Click the "Open LINE Official Account Manager" button
2. Select "Create Account" and choose the free plan
3. Enter your facility name as the account name
4. After creating the account, click "Done, Next" to continue

### Step 2: Enable Messaging API

1. In LINE Official Account Manager, go to "Settings" → "Messaging API"
2. Click "Enable Messaging API"
3. Select a provider and agree to the terms
4. Once enabled, click "Enabled, Next" to continue

### Step 3: Copy & Paste Channel Information

1. Click "Open LINE Developers Console"
2. On the target channel's "Basic settings" tab, find the **Channel ID** and **Channel Secret**
3. On the "Messaging API" tab, issue a **Channel Access Token** (click "Issue")
4. Copy each value and paste it into the corresponding field below

| Input Field | Where to Find |
|-------------|---------------|
| Channel ID | Basic settings tab |
| Channel Secret | Basic settings tab |
| Channel Access Token | Messaging API tab (must issue first) |

To verify the credentials, click the "Test Connection" button. If the Channel Access Token is correct, the LINE bot name will appear and the test will succeed.

#### LINE Login Channel ID / Secret (optional — per-facility LIFF app)

The same screen has two optional fields, **"LINE Login Channel ID (optional)"** and **"Login Channel Secret (optional)"**. These provision a LIFF app (the mini-app guests open from LINE) dedicated to this facility. Fill them in only if either applies:

| Field | Purpose |
|-------|---------|
| LINE Login Channel ID | Enter this if the LIFF app was created on a LINE Login channel. It's the same digits as the part of the LIFF ID before the "-". Leave blank to fall back to the Channel ID (the Messaging API channel). Must belong to the same provider as the Messaging API channel |
| Login Channel Secret | Filling this in lets UnlockOS **automatically create** this facility's own LIFF app during provisioning — no need to configure LIFF manually in LINE Developers Console. Not shown again after it is saved |

If you leave both blank, no facility-specific LIFF app is created, and the facility falls back to the platform's shared LIFF app (the legacy single-facility behavior). If you run LINE integration for more than one facility, entering these fields is recommended so each facility gets its own LIFF app.

Once all fields are filled in, click "Next" to proceed to Step 4.

### Step 4: Service Selection

Select which services this LINE Official Account will provide. At least one selection is required.

| Setting | Description |
|---------|-------------|
| Check-in Configuration | Select an existing check-in configuration from the dropdown. Enables check-in, key display, and check-out features. |
| Reservation Configuration | Select an existing reservation configuration from the dropdown. Enables reservation list and new reservation features. |

You can select either check-in, reservation, or both. Selecting "None" disables that feature.

#### Rich Menu Layout

Whether you configured a check-in setting and/or a reservation setting here determines which feature cells are auto-detected for the rich menu. A live preview is shown at the bottom of the form.

**Every rich menu ends with two fixed cells, "Contact Us" and "Facility Info," in addition to whatever features you selected.** Up to 4 feature cells are supported in total (at this step, up to 2: check-in and reservation), and the layout is chosen automatically based on how many feature cells there are.

| Feature cells | Layout |
|----------------|--------|
| 1 (check-in only, or reservation only) | Half size (3×1). 1 feature cell + Contact Us + Facility Info fill all 3 cells |
| 2 (both check-in and reservation) | Full size (3×2). 2 feature cells + Contact Us + Facility Info fill 4 of 6 cells; the remaining 2 are blank (not tappable) |

To put more features (membership, ticket books, lockers, resident portal, etc. — up to 4 total) on the rich menu, use the "Rich Menu Display Settings" section that appears after connecting (see "Connected State" below).

Review your settings and click "Connect & Auto-Setup" to complete the process. Once connected, the rich menu and webhook will be configured automatically.

---

## Connected State

After LINE integration is complete, the following information and settings are displayed.

### Auto-Setup Status

| Item | Description |
|------|-------------|
| Rich Menu | Status of the menu displayed on guests' LINE screens |
| Webhook URL | Status of the URL that receives notifications from LINE to UnlockOS |
| LIFF Deep Links | Whether the LIFF app's deep links are configured. If provisioning shows "Complete" but this item is not configured, every rich menu button opens as a plain web page instead of the LIFF app |

If "LIFF Deep Links" shows as not configured, a yellow warning message appears. Re-check your Step 3 channel information (and the optional Login Channel ID / Secret) and reconnect.

### Rich Menu Display Settings

Once connected, a "Rich Menu Display Settings" section appears, letting you choose exactly which features appear on the rich menu.

- Selectable features: **Check-in, Reservation, Membership, Ticket Books, Locker, Resident Portal** (only features enabled for the facility are shown)
- You can select **up to 4**, via checkboxes. Features that need a specific configuration (check-in, reservation) also have a dropdown to pick which one
- A **live preview** based on the real cell layout is shown, updating as you change your selection
- If nothing is selected, the menu falls back to auto-detecting from whether a check-in / reservation setting exists (see "Rich Menu Layout" above)
- Regardless of your selection, the trailing **"Contact Us" and "Facility Info" cells are always shown**
- Click **"Save and Regenerate Rich Menu"** after making changes

#### Fixed Cells (Contact Us / Facility Info)

Every rich menu always ends with these two fixed cells, which cannot be turned off from the facility side.

| Cell | What happens on tap |
|------|---------------------|
| Contact Us | Does not open the LIFF app — opens the LINE chat's text input directly. Whatever the guest types goes straight into the chat with the facility's LINE Official Account (UnlockOS does not forward or store it) |
| Facility Info | Does not open the LIFF app — replies in the chat with a card showing the facility's name, address, phone number, and contact email, sourced from [Base Settings](base-settings.md) |

### Admin Notification Settings

Configure conditions under which notifications are sent to the facility administrator via LINE.

| Notification Setting | Description |
|----------------------|-------------|
| Notify admin on check-in | Send notification when a guest checks in |
| Notify admin on check-out | Send notification when a guest checks out |
| Notify admin on payment failure | Send notification when a payment error occurs |

After changing settings, click "Save Notification Settings".

> **Note**: To receive admin notifications, the administrator must have added the LINE Official Account as a friend.

> **This is separate from the "Facility Owner" notifications in [Notification Workflows](notification-workflow.md).** The setting here is the existing mechanism that notifies the admin via LINE on check-in / check-out / payment failure. Owner notifications for reservation events (new reservation, approval pending, payment completed, cancellation, extension) are managed on the Notification Workflows page instead, and currently deliver by Email only.

### Friend Add QR Code

To get the QR code for guests to add your LINE Official Account as a friend, go to "Grow Friends" in LINE Official Account Manager.

### Disconnect

Clicking the "Disconnect" button will remove the LINE integration, rich menu, and webhook settings. You will need to go through the setup wizard again to reconnect.

---

## Guest LIFF App Flow

Once LINE integration is complete, guests tap buttons in the rich menu to interact with the facility. Some buttons launch the LIFF app (LINE in-app browser), while others respond directly within the LINE chat. The following flows describe what guests experience.

### First Time Only: Email Registration

Guests who check in from LINE for the first time are shown an email registration screen.

1. Enter an email address
2. Enter a name (optional — LINE display name is used if omitted)
3. Tap "Next" to proceed to the check-in screen

Registration is required only once. On subsequent visits, guests go directly to the check-in screen.

### Check-in Flow

1. Tap "Check-in" in the rich menu
2. A fee breakdown is displayed (contents vary by plan)
3. Tap "Check In" to confirm
4. After processing, a digital key (QR code or PIN code) is displayed

### Key Display

After check-in, or by tapping "Show Key" in the rich menu, the entry key is sent directly as a LINE message — no app launch required. The key information appears as a rich card in the LINE chat.

The card includes:
- QR code image (scan at the door reader)
- PIN code, if applicable (enter on the keypad next to the door)
- Room / unit name
- Check-in date and time
- Key validity period

If the guest has multiple active check-ins at the same facility, all keys are shown one after another as a carousel of cards.

| Key Type | How to Use |
|----------|-----------|
| QR Code | Hold your smartphone screen up to the reader next to the door |
| PIN Code | Enter the code on the keypad next to the door |

The key is valid only during the active stay. It becomes invalid after check-out.

### Check-out Flow

1. Tap "Check-out" in the rich menu
2. Check-in time and fee breakdown are displayed
3. Tap "Check Out" to confirm
4. A completion screen appears: "Thank you for your stay"

### Contact Us / Facility Info (Fixed Cells)

Regardless of which features are configured, the rich menu always ends with a "Contact Us" and a "Facility Info" button.

- **Contact Us**: Tapping it opens the LINE chat's text input directly so the guest can type a message to the facility's LINE Official Account (no app opens)
- **Facility Info**: Tapping it replies in the chat with a card showing the facility's name, address, phone number, and contact email (no app opens)

---

### Reservation List and New Reservation

1. Tap "My Reservations" in the rich menu to view the reservation list
2. Each reservation shows the plan name, dates, and status
3. Tap "Make a New Reservation" to open the booking site (booking.unlockos.io) in an external browser

---

## Troubleshooting

### Connection test fails

- **Verify the Channel Access Token**: Re-issue the token from the Messaging API tab in LINE Developers Console and paste it again.
- **Confirm Messaging API is enabled**: Check that it is enabled under "Settings" → "Messaging API" in LINE Official Account Manager.
- **Check for extra whitespace**: Make sure there are no leading or trailing spaces in the pasted token.

### Provisioning fails (rich menu or webhook not configured)

- **Verify the Channel Secret**: Double-check the Channel Secret from the Basic settings tab in LINE Developers Console.
- **Contact support**: Copy the error message and send it to support@unlockos.com.

### Rich menu is not displayed in guests' LINE

- On the connected screen, verify that "Rich Menu" shows "Configured" under Auto-Setup Status.
- The guest may not have added your LINE Official Account as a friend yet. Provide them with the QR code.
- Changes in LINE can take a few minutes to reflect.

### Admin is not receiving notifications

- Confirm that the administrator's LINE account has added the LINE Official Account as a friend.
- Confirm that the relevant notification settings are enabled.

### LIFF app does not open or shows an error

- **"LIFF ID not configured" error**: This is a system configuration issue. Contact support@unlockos.com.
- **"LINE login required" error**: Make sure the guest is tapping the button from within the LINE app. This message appears when accessing the URL directly from an external browser.
- **Blank white screen**: Restart the LINE app and try again.

### Guest check-in fails

- Verify that the guest has completed the one-time email registration.
- Confirm that a check-in configuration is selected in the LINE integration settings (Step 4).
- Confirm that the selected check-in configuration is active and has a valid pricing plan.

### Key is not displayed

- Tapping "Show Key" sends the key as a message in the LINE chat — make sure the guest is looking in their LINE chat history, not in an app.
- If check-in succeeded but no key message appears, the smart lock may not be connected. See [Lock Connection](lock-connection.md).
- If the key card shows but cannot be used at the door, verify the lock connection and that the key has not expired.

### Guest reservations are not displayed

- Confirm that a reservation configuration is selected in the LINE integration settings (Step 4).
- Confirm that the reservation has "confirmed" status.

---

## FAQ

### Q: Can one LINE Official Account be used for multiple facilities?
A: No. Each LINE Official Account can only be linked to one facility. If you manage multiple facilities, create a separate LINE Official Account for each.

### Q: Can I connect a LINE Official Account that already uses Messaging API?
A: Yes, but the existing webhook settings will be overwritten with UnlockOS's webhook URL. Please verify your existing webhook setup before proceeding.

### Q: Can I change the check-in or reservation configuration after LINE is connected?
A: With the current setup, you will need to disconnect and reconfigure to change service selections.

### Q: What can guests do through LINE?
A: Guests tap rich menu buttons to interact with the facility. With a check-in configuration selected, guests can check in, view their digital key (delivered as a Flex Message directly in LINE chat), and check out. With a reservation configuration selected, guests can view their reservation list and make new reservations (redirected to the booking site). Regardless of your selection, the rich menu always ends with "Contact Us" and "Facility Info" buttons that reply via chat or an info card.

### Q: If I run LINE integration at multiple facilities, is the guest's LINE account shared across them?
A: No. Each facility gets its own LIFF app, and a LINE user ID is scoped to the LIFF app (LINE Login channel) that issued it. So the same person is treated as a separate guest account at each facility. Stay history is not carried over between facilities.

### Q: What does a guest need to do the first time they check in via LINE?
A: The first time only, guests must register their email address in the LIFF app. After that, their email is linked to their LINE account and they go directly to the check-in screen on subsequent visits.

### Q: Is the fee shown to guests before check-in?
A: Yes. The check-in confirmation screen shows a breakdown of applicable charges and the total amount before the guest confirms.

### Q: What if I need help with the setup?
A: You can request paid setup assistance using the link at the bottom of the page — it takes you to a contact form (unlockos.io/contact).

---

## Related Pages

- [Lock Connection (KEYVOX & Stripe)](lock-connection.md)
- [Check-in Configuration](checkin-config-form.md)
- [Reservation Settings](reservation.md)
- [LINE Notifications](line-notifications.md)
- [Notification Workflows](notification-workflow.md)
