Setup tools
All tool areas. Each tool acts within your access.
Setup
create_entity
Create a legal entity: a business with its own currency, tax registrations, tax rates, fees, and (later) Stripe account. Each location belongs to one. The currency can't change once set, so confirm it. Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
namelegalNamecurrencyOne of USD, CAD, AUD, EUR, GBP
addressaddress.line1address.line2address.cityaddress.regionProvince or state code, e.g. ON
address.postalCodeaddress.countryISO 3166-1 alpha-2, e.g. CA
Output
idnamelegalNamecurrencyaddressaddress.line1address.line2address.cityaddress.regionProvince or state code, e.g. ON
address.postalCodeaddress.countryISO 3166-1 alpha-2, e.g. CA
create_fee
Add a fee an entity charges on every order, such as a service charge: a rate of the discounted subtotal (ratePpm, 3% is 30000) or a fixed amount per order in minor units. Taxed by its tax class, or untaxed without one. Prices shown to guests include it. refundable: false keeps it when staff refund an order (Perfect Bite's service charge). Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
entityIdThe entity's id, from get_setup
nameratePpmParts per million: 13% is 130000
amountMinor units (cents) in the location's currency
taxClassThe tax class that taxes the fee (id or code), or null for an untaxed fee
refundableWhether staff refunds give it back. false keeps it (and its tax) on every refund except Lokl's own, when it couldn't seat a paid order. Orders keep the setting they were placed under
activeposition
Output
identityIdnameratePpmamountMinor units (cents) in the location's currency
taxClassIdrefundableactiveposition
create_location
Create a location (a venue). Give its name and address; the rest is filled in and shown in the preview: the entity (the organization's only one; say which when there are several), a slug for booking links made from the name, and the IANA time zone (from the address's province or state, else the organization's other locations). Schedules are expanded and times shown in the time zone, which can't change once the location has schedules. The entity can't change later. Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
entityIdThe entity's id, from get_setup
nameslugtimeZoneaddressaddress.line1address.line2address.cityaddress.regionProvince or state code, e.g. ON
address.postalCodeaddress.countryISO 3166-1 alpha-2, e.g. CA
Output
identityIdnameslugtimeZoneaddressaddress.line1address.line2address.cityaddress.regionProvince or state code, e.g. ON
address.postalCodeaddress.countryISO 3166-1 alpha-2, e.g. CA
create_resource
Create a resource at a location: a space (a room), equipment, or a staff role. Sessions sharing a resource can't overlap, and its buffers (setup and reset minutes) keep it blocked around each session. Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
locationIdThe location's id, from get_setup
kindnamebufferBeforeMinutesbufferAfterMinutes
Output
idlocationIdkindnamebufferBeforeMinutesbufferAfterMinutes
create_tax_class
Create a tax class (e.g. alcohol) for the whole organization. Products pick a class, and entities or locations set the rates for it (set_tax_rate). Every organization starts with standard and exempt. Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
codename
Output
idcodename
get_setup
Get how the business is set up: its legal entities (currency, tax registrations, tax rates, fees such as a service charge), locations (time zone, address, any tax rates of their own), resources at each location (rooms, equipment, staff roles), and tax classes. Start here before creating products or changing setup. Money is in minor units (cents); rates in parts per million (13% is 130000).
Reads · Members of an organization · Needs setup:read
No input.
Output
entitiesentities[]entities[].identities[].nameentities[].legalNameentities[].currencyentities[].addressentities[].address.line1entities[].address.line2entities[].address.cityentities[].address.regionProvince or state code, e.g. ON
entities[].address.postalCodeentities[].address.countryISO 3166-1 alpha-2, e.g. CA
entities[].taxRegistrationsentities[].taxRegistrations[]entities[].taxRegistrations[].identities[].taxRegistrations[].entityIdentities[].taxRegistrations[].jurisdictionentities[].taxRegistrations[].taxentities[].taxRegistrations[].numberentities[].taxRatesentities[].taxRates[]entities[].taxRates[].identities[].taxRates[].entityIdentities[].taxRates[].locationIdentities[].taxRates[].taxClassIdentities[].taxRates[].nameentities[].taxRates[].ratePpmentities[].feesentities[].fees[]entities[].fees[].identities[].fees[].entityIdentities[].fees[].nameentities[].fees[].ratePpmentities[].fees[].amountMinor units (cents) in the location's currency
entities[].fees[].taxClassIdentities[].fees[].refundableentities[].fees[].activeentities[].fees[].positionlocationslocations[]locations[].idlocations[].entityIdlocations[].namelocations[].sluglocations[].timeZonelocations[].addresslocations[].address.line1locations[].address.line2locations[].address.citylocations[].address.regionProvince or state code, e.g. ON
locations[].address.postalCodelocations[].address.countryISO 3166-1 alpha-2, e.g. CA
locations[].taxRateslocations[].taxRates[]locations[].taxRates[].idlocations[].taxRates[].entityIdlocations[].taxRates[].locationIdlocations[].taxRates[].taxClassIdlocations[].taxRates[].namelocations[].taxRates[].ratePpmlocations[].resourceslocations[].resources[]locations[].resources[].idlocations[].resources[].locationIdlocations[].resources[].kindlocations[].resources[].namelocations[].resources[].bufferBeforeMinuteslocations[].resources[].bufferAfterMinutestaxClassestaxClasses[]taxClasses[].idtaxClasses[].codetaxClasses[].name
remove_tax_rate
Stop charging one tax rate. Removing a location's last rate for a class makes the entity's rates apply there again. Holds already placed keep the tax they were quoted. Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
taxRateIdThe tax rate's id
Output
idremoved
remove_tax_registration
Remove one of an entity's tax registrations, e.g. after deregistering. It no longer shows on receipts. Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
taxRegistrationIdThe tax registration's id
Output
idremoved
set_product_fee
Replace an entity fee for one product with its own rate or amount, waive it (0, e.g. no service charge on gift certificates), or go back to the entity's fee (null). Rates are parts per million (3% is 30000); amounts are minor units. Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
productIdThe product's id, from list_products
feeIdThe fee's id, from get_setup
overrideThe product's own charge: { ratePpm } or { amount }, 0 to waive the fee for this product, or null to go back to the entity's fee
Output
productIdfeeIdratePpmamountMinor units (cents) in the location's currency
usesEntityFee
set_tax_rate
Set one tax's rate for a tax class, for a whole entity (entityId) or at one location (locationId). A location's rates for a class replace the entity's rates for that class there. A class can carry several taxes (GST and PST in BC): call once per tax name. Updates the rate if that tax is already set. Rates are parts per million: 13% is 130000. Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
entityIdThe entity's id, from get_setup
locationIdThe location's id, from get_setup
taxClassA tax class id (txc_...) or code (e.g. standard)
nameratePpmParts per million: 13% is 130000
Output
identityIdlocationIdtaxClassIdnameratePpm
set_tax_registration
Record that an entity is registered to collect a tax in a jurisdiction, with its registration number (e.g. HST in CA-ON, 123456789RT0001). Replaces the number if that tax is already registered there. Receipts and invoices show it. Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
entityIdThe entity's id, from get_setup
jurisdictiontaxnumber
Output
identityIdjurisdictiontaxnumber
update_entity
Rename an entity, or change its legal name or address. Its currency can't change once set. Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
entityIdThe entity's id, from get_setup
namelegalNamecurrencyOnly to confirm it: a currency can't change
addressaddress.line1address.line2address.cityaddress.regionProvince or state code, e.g. ON
address.postalCodeaddress.countryISO 3166-1 alpha-2, e.g. CA
Output
idnamelegalNamecurrencyaddressaddress.line1address.line2address.cityaddress.regionProvince or state code, e.g. ON
address.postalCodeaddress.countryISO 3166-1 alpha-2, e.g. CA
update_fee
Change a fee: its name, its charge (ratePpm or amount; giving one replaces the other), its tax class (null for untaxed), whether staff refunds give it back, whether it's active, or its order on receipts. Holds already placed keep the total they were quoted, and orders the refund terms. Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
feeIdThe fee's id, from get_setup
nameratePpmParts per million: 13% is 130000
amountMinor units (cents) in the location's currency
taxClassA tax class id (txc_...) or code (e.g. standard)
refundableactiveposition
Output
identityIdnameratePpmamountMinor units (cents) in the location's currency
taxClassIdrefundableactiveposition
update_location
Rename a location, or change its slug, time zone, or address. Changing the time zone doesn't move sessions already generated. Its entity can't change. Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
locationIdThe location's id, from get_setup
nameslugtimeZoneaddressaddress.line1address.line2address.cityaddress.regionProvince or state code, e.g. ON
address.postalCodeaddress.countryISO 3166-1 alpha-2, e.g. CA
Output
identityIdnameslugtimeZoneaddressaddress.line1address.line2address.cityaddress.regionProvince or state code, e.g. ON
address.postalCodeaddress.countryISO 3166-1 alpha-2, e.g. CA
update_resource
Rename a resource or change its kind or buffers (setup and reset minutes). New buffers apply to sessions generated from now on. Returns a preview to confirm.
Changes · Members of an organization · Needs setup:write
Input
resourceIdThe resource's id, from get_setup
kindnamebufferBeforeMinutesbufferAfterMinutes
Output
idlocationIdkindnamebufferBeforeMinutesbufferAfterMinutes