Skip to content

WiFi Vouchers & POS Integration

Overview

CaptiFi's WiFi Voucher system allows you to control guest WiFi access by requiring voucher codes before guests can connect. Combined with the POS (Point of Sale) API integration, venues can automatically generate voucher codes directly from their POS terminal, receipt printer, or ordering system — creating a seamless guest WiFi experience tied to purchases.


Table of Contents

  1. WiFi Access Modes
  2. Configuring Voucher Mode
  3. Managing Vouchers
  4. Creating Vouchers Manually
  5. Voucher Statuses
  6. POS API Integration
  7. API Reference
  8. Bulk Actions & Export
  9. Troubleshooting

WiFi Access Modes

The Voucher & POS Setup page (VoucherAndPosSetup) contains two main configuration sections. The first controls how guests connect to your WiFi network.

Section 1: WiFi Access Mode Toggle

ModeDescription
Open Access (default)Any guest can connect to your WiFi network through the captive portal without a code. The standard splash page flow applies.
Voucher RequiredGuests must enter a valid voucher code on the captive portal before they can access WiFi. Without a code, access is denied.

⚠️ Warning: Enabling Voucher Required mode means that only guests with valid voucher codes will be able to connect to your WiFi network. Make sure you have a process in place to distribute codes (e.g., printed on receipts, handed out by staff, or generated via POS integration) before enabling this mode.

Step-by-Step: Switching to Voucher Mode

  1. Navigate to Dashboard → Voucher & POS Setup.
  2. In the WiFi Access Mode section, toggle from Open Access to Voucher Required.
  3. Read and acknowledge the warning message that appears.
  4. Click Save to apply the change.
  5. Your captive portal will now display a voucher code input field to all guests.

Step-by-Step: Switching Back to Open Access

  1. Navigate to Dashboard → Voucher & POS Setup.
  2. Toggle the WiFi Access Mode back to Open Access.
  3. Click Save.
  4. Guests can now connect without a voucher code. Existing unused vouchers remain in the system but are not required.

Configuring Voucher Mode

Once Voucher Required mode is enabled, you need to ensure vouchers are available for your guests. There are two ways to generate vouchers:


Managing Vouchers

The WiFi Vouchers resource page displays all vouchers across your sites in a searchable, sortable table.

Voucher Table Columns

ColumnDescription
CodeThe unique voucher code (e.g., ABCD1234) that guests enter on the captive portal.
SiteThe site (venue/location) the voucher is assigned to (site.name).
Duration (Hours)How long the WiFi session lasts once the voucher is redeemed (e.g., 2 hours, 24 hours).
Max UsesMaximum number of times the voucher code can be used (default: 1).
Times UsedHow many times the voucher has been redeemed so far.
StatusCurrent status badge — see Voucher Statuses below.
Expires AtThe date/time after which the voucher can no longer be redeemed, regardless of use count.
NotesOptional notes (e.g., "Table 5", "VIP Guest", "Staff lunch").
Created AtTimestamp when the voucher was generated.

Available Actions (Per Voucher)

ActionConditionDescription
RevokeVoucher status is ActiveImmediately invalidates the voucher so it can no longer be used.
Copy CodeAlways availableCopies the voucher code to your clipboard for easy sharing.

Creating Vouchers Manually

You can create vouchers directly from the CaptiFi dashboard using the Create button on the WiFi Vouchers page.

Create Form Fields

FieldTypeRequiredDetails
SiteSelect dropdown (site_id)✅ YesChoose which site/venue this voucher is for.
QuantityNumber (1–100)✅ YesNumber of voucher codes to generate in a single batch.
Duration (Hours)Select dropdown✅ YesSession length options: 1hr, 2hr, 4hr, 8hr, 12hr, 24hr, 48hr, 72hr, 168hr (7 days).
Max UsesNumber✅ YesMaximum redemptions per code. Default: 1.
Expires AtDatetime picker❌ NoOptional expiration date/time. If not set, vouchers remain valid until used or manually revoked.
NotesText❌ NoOptional freeform notes for internal reference.

Step-by-Step: Creating a Batch of Vouchers

  1. Navigate to Dashboard → WiFi Vouchers.
  2. Click the Create button (top right).
  3. Select the Site the vouchers are for.
  4. Set the Quantity (e.g., 10 to generate 10 codes at once).
  5. Choose the Duration (e.g., 4 hours).
  6. Set Max Uses (leave as 1 for single-use codes).
  7. Optionally set an Expires At date if the vouchers should expire by a certain time.
  8. Optionally add Notes (e.g., "Friday evening event").
  9. Click Create.
  10. Your new voucher codes will appear in the table immediately.

💡 Tip: Use the Copy Code action to quickly copy individual codes, or use Bulk Export to download all codes for printing.


Voucher Statuses

Each voucher displays a color-coded status badge:

StatusBadge ColorMeaning
Active🟢 GreenVoucher is valid and available for use.
Used🔵 BlueVoucher has been redeemed the maximum number of times.
Expired🟡 Yellow/AmberThe voucher's expires_at date has passed.
Revoked🔴 RedThe voucher was manually invalidated by an administrator.

Status Lifecycle

Created → Active → Used (max_uses reached)
                 → Expired (expires_at passed)
                 → Revoked (manually invalidated)

POS API Integration

Section 2: POS API Setup

The second section of the Voucher & POS Setup page allows you to connect your Point of Sale system to CaptiFi for automatic voucher generation.

Configuration Fields

FieldDescription
Enable POS APIToggle to enable/disable the POS API integration.
API KeyAuto-generated API key for authenticating POS requests. Includes a Copy button and a Regenerate button.
API EndpointThe endpoint URL your POS system should call (shown on screen).

Step-by-Step: Setting Up POS Integration

  1. Navigate to Dashboard → Voucher & POS Setup.
  2. In the POS API Integration section, toggle Enable POS API to on.
  3. An API Key will be auto-generated and displayed.
  4. Click the Copy button to copy the API key.
  5. Note the API Endpoint URL shown: POST https://app.captifi.io/api/pos/voucher/generate.
  6. Provide the API key and endpoint to your POS system administrator or configure it in your POS software.
  7. Click Save.

⚠️ Security Note: Your API key provides access to generate vouchers on your account. Keep it secure and never expose it in client-side code. If you suspect your key has been compromised, click Regenerate to create a new key (the old key will immediately stop working).


API Reference

Generate Vouchers

Creates one or more WiFi voucher codes programmatically.

Endpoint:

POST https://app.captifi.io/api/pos/voucher/generate

Headers:

Content-Type: application/json

Request Body:

json
{
  "api_key": "your-api-key-here",
  "duration_hours": 2,
  "quantity": 1,
  "notes": "Table 5"
}
ParameterTypeRequiredDescription
api_keystring✅ YesYour POS API key from the dashboard.
duration_hoursinteger✅ YesWiFi session duration in hours (e.g., 1, 2, 4, 8, 12, 24, 48, 72, 168).
quantityinteger❌ NoNumber of voucher codes to generate. Default: 1. Max: 100.
notesstring❌ NoOptional note attached to the voucher(s) (e.g., table number, order ID).

Success Response (200):

json
{
  "success": true,
  "vouchers": [
    {
      "code": "ABCD1234",
      "duration_hours": 2,
      "expires_at": "2025-01-15T14:30:00Z",
      "max_uses": 1
    }
  ]
}
Response FieldTypeDescription
successbooleantrue if voucher(s) were created successfully.
vouchersarrayArray of generated voucher objects.
vouchers[].codestringThe voucher code to give to the guest.
vouchers[].duration_hoursintegerWiFi session duration in hours.
vouchers[].expires_atstring (ISO 8601)When the voucher expires.
vouchers[].max_usesintegerMaximum number of times the code can be redeemed.

Error Responses:

Status CodeMeaning
401Invalid or missing API key.
403POS API is not enabled for this account.
422Validation error (e.g., invalid duration_hours value).
429Rate limit exceeded.

Validate Voucher

Check whether a voucher code is currently valid without redeeming it.

Endpoint:

POST https://app.captifi.io/api/pos/voucher/validate

Request Body:

json
{
  "api_key": "your-api-key-here",
  "code": "ABCD1234"
}
ParameterTypeRequiredDescription
api_keystring✅ YesYour POS API key.
codestring✅ YesThe voucher code to validate.

Success Response (200):

json
{
  "valid": true,
  "voucher": {
    "code": "ABCD1234",
    "status": "active",
    "duration_hours": 2,
    "max_uses": 1,
    "times_used": 0,
    "expires_at": "2025-01-15T14:30:00Z"
  }
}

Invalid Voucher Response (200):

json
{
  "valid": false,
  "reason": "expired"
}
Possible reason ValuesDescription
not_foundCode does not exist.
expiredVoucher has passed its expiration date.
usedVoucher has reached its max uses.
revokedVoucher was manually revoked.

Bulk Actions & Export

The WiFi Vouchers table supports bulk operations:

Bulk ActionDescription
Revoke SelectedSelect multiple active vouchers and revoke them all at once. Useful for invalidating a batch of unused codes.
ExportDownload selected or all vouchers as a file for printing, record-keeping, or import into other systems.

Step-by-Step: Bulk Revoking Vouchers

  1. On the WiFi Vouchers page, use the checkboxes to select the vouchers you want to revoke.
  2. Click the Bulk Actions dropdown.
  3. Select Revoke Selected.
  4. Confirm the action.
  5. All selected vouchers will be marked as Revoked.

Step-by-Step: Exporting Vouchers

  1. On the WiFi Vouchers page, optionally filter or select specific vouchers.
  2. Click the Bulk Actions dropdown.
  3. Select Export.
  4. A file will be downloaded containing the voucher codes and their details.

Troubleshooting

Common Issues

IssuePossible CauseSolution
Guests can't connect to WiFiVoucher mode is enabled but no vouchers have been created or distributed.Create vouchers via the dashboard or POS API, then distribute codes to guests.
Voucher code not workingCode may be expired, already used, or revoked.Check the voucher's status in the dashboard. If expired/used, generate a new code.
POS API returning 401Invalid API key.Verify the API key in your POS configuration matches the key shown on the Voucher & POS Setup page. Regenerate if needed.
POS API returning 403POS API not enabled.Go to Voucher & POS Setup and toggle Enable POS API to on.
POS API returning 422Invalid request parameters.Check that duration_hours is a valid value and quantity is between 1 and 100.
API key stopped workingKey was regenerated.If someone regenerated the key in the dashboard, the old key is immediately invalidated. Copy the new key and update your POS configuration.
Bulk revoke not workingNo vouchers selected, or selected vouchers are not in Active status.Ensure you've selected vouchers with an Active status. Already used, expired, or revoked vouchers cannot be revoked again.
Vouchers appear but portal still openWiFi Access Mode may still be set to Open Access.Navigate to Voucher & POS Setup and ensure the mode is set to Voucher Required.

POS Integration Testing

To test your POS integration before going live:

  1. Enable the POS API and copy your API key.
  2. Use a tool like curl, Postman, or your POS system's test mode.
  3. Send a test request:
bash
curl -X POST https://app.captifi.io/api/pos/voucher/generate \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_API_KEY",
    "duration_hours": 1,
    "quantity": 1,
    "notes": "Test voucher"
  }'
  1. Verify the response contains a valid voucher code.
  2. Check the WiFi Vouchers page in the dashboard to confirm the voucher appears.
  3. Optionally validate the code:
bash
curl -X POST https://app.captifi.io/api/pos/voucher/validate \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_API_KEY",
    "code": "ABCD1234"
  }'

Best Practices

  • Set expiration dates on event-specific vouchers to automatically clean up unused codes.
  • Use notes to track where/why vouchers were generated (e.g., table numbers, event names).
  • Monitor the Times Used column to identify if codes are being shared.
  • Regenerate your API key periodically for security.
  • Start with single-use vouchers (max_uses: 1) for maximum control, then adjust as needed.
  • Use batch generation (quantity > 1) to pre-generate codes for busy periods.

CaptiFi — Guest WiFi Marketing Platform