Skip to main content

Documentation Index

Fetch the complete documentation index at: https://help.mathership.com/llms.txt

Use this file to discover all available pages before exploring further.

Lightspeed K-Series

Use the Lightspeed K-Series integration to connect your Lightspeed POS with Bestellfix. The integration can:
  • Connect Lightspeed through OAuth
  • Sync Lightspeed locations
  • Sync Lightspeed items
  • Link locations to storage units
  • Map Lightspeed items to ingredients or recipes
  • Run a 90-day historical migration
  • Run automatic daily transfers
  • Run manual one-day transfers
  • Create inventory ledger entries from POS sales

Overview

The Lightspeed integration follows this setup flow:
  1. Connect Lightspeed
  2. Sync locations
  3. Link each location to a storage unit
  4. Sync items
  5. Map Lightspeed items to ingredients or recipes
  6. Activate the location
  7. Review the 90-day migration
  8. Use automatic or manual transfers

Screenshot

Add screenshot here.

Connect Lightspeed

To connect Lightspeed:
  1. Open ManageIntegrations
  2. Select Lightspeed K-Series
  3. Start the Lightspeed connection flow
  4. Authorize Bestellfix in Lightspeed
  5. Return to Bestellfix
  6. Save the integration
Bestellfix receives an OAuth authorization code from the frontend and exchanges it for Lightspeed tokens. The tokens are stored securely and used for future syncs and transfers.

Required connection data

When the integration is created, Bestellfix needs:
FieldMeaning
company_idThe company that owns the integration
nameInternal name for the integration
codeOAuth authorization code from Lightspeed

Possible connection errors

ErrorMeaning
lightspeed_integration_existsA Lightspeed integration already exists
lightspeed_oauth_exchange_failedThe authorization code could not be exchanged
lightspeed_not_configuredLightspeed OAuth is not configured correctly
unauthorized_company_accessThe company does not belong to the current user

Reauthorize Lightspeed

Use reauthorization when the Lightspeed connection needs fresh authorization. This keeps the existing setup in place. Reauthorization preserves:
  • Locations
  • Storage-unit links
  • Item mappings
  • Transfer history
  • Migration history
To reauthorize:
  1. Open the existing Lightspeed integration
  2. Start the Lightspeed authorization flow again
  3. Submit the new authorization code
  4. Bestellfix replaces the stored tokens

Screenshot

Add screenshot here.

Sync locations

After connecting Lightspeed, sync locations. Locations represent Lightspeed business locations or sales locations. To sync locations:
  1. Open the Lightspeed integration
  2. Click Sync Locations
  3. Wait until the locations are loaded
  4. Review the location list
The location sync fetches locations from Lightspeed and stores them in Bestellfix.

Location list

The location list shows cached Lightspeed locations. Each location can be linked to a Bestellfix storage unit. Typical fields are:
FieldMeaning
Location nameName from Lightspeed
Storage unitLinked Bestellfix storage unit
ActivatedWhether transfers are active
Auto transfer pausedWhether automatic transfer is paused

Screenshot

Add screenshot here.
Each Lightspeed location must be linked to a Bestellfix storage unit before it can be activated. The storage unit tells Bestellfix where inventory should be deducted. To link a storage unit:
  1. Open the Lightspeed location
  2. Choose a storage unit
  3. Save the link
A location cannot be activated without a storage unit. You can remove the storage-unit link again. Do this only if the location should no longer deduct inventory from that storage unit.

Common storage-unit errors

ErrorMeaning
storage_unit_requiredA storage unit must be linked before activation or transfer
storage_unit_company_mismatchThe selected storage unit belongs to another company

Sync items

After syncing locations, sync Lightspeed items. Items are the products or sales items from Lightspeed. To sync items:
  1. Open the Lightspeed integration
  2. Click Sync Items
  3. Wait until the items are loaded
  4. Review the item list
Bestellfix stores the synced items and shows whether each item is mapped.

Item list

The item list is ordered by name and can show mapping information. Typical item states:
StateMeaning
UnmappedThe item has no inventory mapping yet
Mapped to ingredientThe item deducts one ingredient directly
Mapped to recipeThe item deducts recipe ingredients
Subtraction mappingThe item can reverse or subtract depending on setup

Screenshot

Add screenshot here.

Map Lightspeed items

Each Lightspeed item must be mapped before it can create inventory movements. You can map an item to:
  • An ingredient
  • A recipe

Map to an ingredient

Use ingredient mapping when the Lightspeed item should deduct one ingredient directly. Example:
Lightspeed itemMapped toQuantity
Cola 0.33lCola bottle1
EspressoCoffee beans0.009

Map to a recipe

Use recipe mapping when the Lightspeed item consists of multiple ingredients. Example:
Lightspeed itemMapped to
Classic BurgerClassic Burger recipe
Pizza MargheritaPizza Margherita recipe
When the item is sold, Bestellfix explodes the recipe and deducts the recipe ingredients.

Mapping fields

FieldMeaning
mapped_object_typeingredient or recipe
mapped_object_idID of the ingredient or recipe
quantityMultiplier used for the mapped object
is_subtractionWhether the mapping is treated as subtraction/reversal logic

Update a mapping

To change a mapping:
  1. Open the Lightspeed item
  2. Select a new ingredient or recipe
  3. Adjust the quantity if needed
  4. Save the mapping
Bestellfix replaces the existing mapping for that item.

Delete a mapping

To delete a mapping:
  1. Open the Lightspeed item
  2. Remove the mapping
  3. Save
After deleting a mapping, the item will no longer create inventory deductions.

Mapping errors

ErrorMeaning
recipe_not_foundThe selected recipe does not exist for this company
ingredient_not_foundThe selected ingredient does not exist for this company
unauthorized_company_accessThe item or integration does not belong to the current user

Activate a location

A Lightspeed location must be activated before migration and transfers can run. Before activation, make sure:
  • The location has a storage unit
  • Important Lightspeed items are mapped
  • Recipes and ingredients are set up correctly
To activate a location:
  1. Open the Lightspeed location
  2. Check the linked storage unit
  3. Click Activate
  4. Bestellfix starts a 90-day migration
Activation sets the location to active and starts the historical migration if no migration is already running.

Screenshot

Add screenshot here.

90-day migration

When a location is activated, Bestellfix creates a 90-day historical migration. The migration processes past Lightspeed sales and creates inventory movements where mappings exist. The migration is useful because it can backfill inventory usage from recent POS sales.

Migration status

You can poll the migration status from the location. Typical migration states are:
StateMeaning
PendingMigration has been created but not started
RunningMigration is currently processing
CompletedMigration finished
CancelledMigration was cancelled
FailedMigration stopped because of an error

Re-run migration

Use Re-run Migration if you added or corrected mappings after activation. A re-run processes the historical period again. Bestellfix prevents starting another migration while one is already pending or running.

Cancel migration

Use Cancel Migration if a migration should stop. Cancellation applies to pending or running migration jobs for the location.

Migration errors

ErrorMeaning
location_not_activatedThe location must be activated first
storage_unit_requiredThe location has no linked storage unit
migration_already_in_progressA migration is already pending or running

Automatic transfer

Lightspeed locations can use automatic transfer. Automatic transfer is intended for regular daily processing. You can pause or resume automatic transfer for each location.

Pause automatic transfer

To pause automatic transfer:
  1. Open the Lightspeed location
  2. Click Toggle Auto Transfer
  3. Confirm that automatic transfer is paused
When paused, the location remains connected but nightly transfer should not run.

Resume automatic transfer

Click Toggle Auto Transfer again to resume automatic transfer. The value switches between paused and active.

Screenshot

Add screenshot here.

Manual transfer

Use manual transfer when you want to process one specific day. Manual transfer is useful for:
  • Testing the integration
  • Reprocessing a day
  • Fixing inventory after mapping changes
  • Checking a specific Lightspeed sales date

Run a manual transfer

To run a manual transfer:
  1. Open the Lightspeed location
  2. Open Manual Transfer
  3. Enter the date
  4. Start the transfer
  5. Review the result
The date should use this format:
DD-MM-YYYY
Example:
20-10-2025
The backend also accepts this format:
YYYY-MM-DD
Example:
2025-10-20

Manual transfer refresh behavior

Manual transfer can use force_refresh. By default, force_refresh is treated as enabled. That means Bestellfix fetches fresh Lightspeed data and recreates the relevant inventory entries for that location and date.

What happens during transfer

When a Lightspeed transfer runs, Bestellfix:
  1. Fetches Lightspeed sales data for the location and date
  2. Reads sold items
  3. Matches sold items to POS mappings
  4. Explodes recipe mappings into ingredients
  5. Calculates ingredient quantities
  6. Creates inventory ledger entries
  7. Returns a transfer summary

Transfer result

A manual transfer returns a summary. The response can include:
FieldMeaning
dateProcessed report date
successWhether the transfer succeeded
no_dataWhether Lightspeed returned no sales data
log_idTransfer log reference
ledger_idsCreated inventory ledger entry IDs
statsProcessing statistics
errorError message if processing failed

No data result

If Lightspeed has no data for the selected date, the transfer can return no_data. This usually means:
  • No sales were found for that location and date
  • The wrong date was entered
  • The wrong location was selected
  • Lightspeed did not return report data

Transfer errors

ErrorMeaning
date_requiredNo date was provided
invalid_date_formatThe date format is invalid
storage_unit_requiredThe location has no linked storage unit
lightspeed_auth_failedLightspeed authentication failed
lightspeed_api_errorLightspeed API returned an error

Inventory ledger entries

Lightspeed transfers create inventory ledger entries. These entries reduce inventory based on sold POS items. The ledger entries are connected to:
  • Company
  • Ingredient
  • Storage unit
  • Transaction type
  • Quantity
  • Unit cost
  • Value
  • Date
  • Transfer log or source data
See Inventory Ledger for detailed inventory history.

Processing logic

The transfer uses the same inventory logic as other POS integrations. Sold Lightspeed items are processed through POS mappings. If the mapping points to an ingredient, Bestellfix deducts that ingredient directly. If the mapping points to a recipe, Bestellfix explodes the recipe and deducts all recipe ingredients.

Example

Lightspeed saleMappingInventory result
1 × EspressoCoffee beansDeduct coffee beans
2 × Cola 0.33lCola bottleDeduct 2 bottles
1 × BurgerBurger recipeDeduct all burger ingredients

Use this order for a clean Lightspeed setup:
  1. Create storage units
  2. Create ingredients
  3. Create recipes
  4. Connect Lightspeed
  5. Sync locations
  6. Link locations to storage units
  7. Sync items
  8. Map important items first
  9. Activate the location
  10. Check migration status
  11. Run a manual transfer for one test date
  12. Check the inventory ledger
  13. Enable automatic transfer

Testing checklist

Before relying on automatic transfers, test one day manually. Check that:
  • The correct Lightspeed location was used
  • The location has the correct storage unit
  • The correct date was processed
  • Sold items were found
  • Important items are mapped
  • Recipe ingredients were deducted correctly
  • Quantities are correct
  • Ledger entries appear in the correct storage unit

Screenshot

Add screenshot here.

Common problems

Lightspeed connection already exists

Bestellfix returns:
lightspeed_integration_exists
Use the existing integration or reauthorize it instead of creating a second one.

Authorization failed

Bestellfix returns:
lightspeed_oauth_exchange_failed
Start the Lightspeed authorization flow again and submit a fresh authorization code.

Locations are missing

Try:
  1. Re-sync locations
  2. Check the Lightspeed authorization
  3. Reauthorize the integration if needed

Items are missing

Try:
  1. Re-sync items
  2. Check whether locations were synced first
  3. Check the Lightspeed account permissions

Location cannot be activated

Usually this means no storage unit is linked. Fix:
  1. Open the location
  2. Link a storage unit
  3. Save
  4. Activate again

Transfer creates no inventory entries

Check:
  1. The selected date
  2. Whether Lightspeed has sales for that date
  3. Whether items are mapped
  4. Whether recipes contain ingredients
  5. Whether storage units are configured

Some items are skipped

Items can be skipped when they are unmapped or cannot be resolved into ingredients. Fix the item mappings and re-run the manual transfer or migration.

Integrations Overview

Return to the integrations overview.

POS Mapping

Map POS items to ingredients or recipes.

Storage Units

Manage storage units used for Lightspeed deductions.

Inventory Ledger

Review inventory movements created by Lightspeed transfers.