A business location (location) is a place the business works from: a store, a warehouse, a venue. Many things refer to it by its name, the ID made from its title (main-store). Stock rows, orders, POS tabs, tax rates, shipping and the site's stores all use that ID, never the title.
Sales tax comes from two places:
- Tax rates (
sf_tax_rate), one row per jurisdiction: a state's rate, a city's or a zip code's, each with its own label. They match the customer's address and add up. - The location's flat rate (
taxRate,taxName), used when no tax rate row matches.
- Web checkout charges tax to exempt customers. The exemption is honoured at the POS and by the tax calculator, but not by the site's cart and checkout. Tested: an exempt customer's order was quoted 1.87 of tax.
- Web checkout never taxes shipping, even with a rate that says it covers shipping.
- There are no tax-inclusive prices. Tax is always added on top of the price. A business that shows prices with VAT included can't do that here.
Ask first
- The locations: title, full street address, a phone, the time zone, and opening hours for each day.
- Where it sells from: one place, or several stores the shopper picks from on the site?
- Where orders ship from, if it isn't the only location.
- Sales tax: which states (or countries) the business collects in, the rate for each, and any city, county or zip code rates on top. Whether shipping is taxed. Ask for the rates, never guess them.
- Products that aren't taxed (gift cards never are).
- Exempt customers: who, the reason, and the certificate number.
Steps
1. Business locations: add the place
On screen: Business locations (/business-locations), one record per place (/business-locations?openId=<sk>).
Real action: repo_create with datatype location, or repo_update to change one.
| Field | What to put |
|---|---|
name | the ID: lowercase letters, digits, - and _. The screen makes it from the title and locks it after the first save. Never change it on a location in use: stock, orders and tax rates point to it. |
title | the name people see ("Main Street store") |
type | address for a real place (also website, virtual) |
address | { street1, street2, city, state, zip, country }. State and country as codes (TX, US): the shop's address form saves codes, and tax rates are matched to them. |
phone | the location's phone, as a top-level field data.phone: carriers need it for labels. The screen has no phone field: set it with repo_update, or type it when Ship in one click asks for it. |
timezone | e.g. America/Chicago. Books dates the location's sales and stock movements by this zone. Without it, the business profile's zone is used, else UTC. |
operatingHours | [{ "day": "mon", "open": "09:00", "close": "17:00" }, …, { "day": "sun", "closed": true }]. Days are mon to sun, times 24-hour HH:mm. A close time earlier than the open time means after midnight. |
taxRate, taxName | the flat rate in percent (8.25) and its label (Sales Tax). See step 5. |
status | active or inactive. An inactive location is never picked as the selling location. |
{ "name": "main-store", "title": "Main Street store", "type": "address",
"address": { "street1": "100 Main St", "city": "Dallas", "state": "TX", "zip": "75201", "country": "US" },
"phone": "+12145550100", "timezone": "America/Chicago", "status": "active",
"operatingHours": [{ "day": "mon", "open": "09:00", "close": "18:00" }, { "day": "sun", "closed": true }] }Where the hours are used: the store picker on the site shows them as typed, and Business Made's leave planner counts a location's open days from them. Nothing else reads them. They don't close the shop, and bookings and phone routing keep their own hours.
A location with stock or open tabs can't be deleted (409 LOCATION_IN_USE). Mark it inactive instead.
Hands on: the location's sk and name. Check: it opens in Business locations with the address, the time zone and each day's hours.
2. Storefront › Shipping: where orders ship from
Live carrier rates and labels need a Ship From. It is the shipping configuration's origin ({ "type": "location", "location": "<name>" }), or a product's own shipping.shipsFrom, or, with no origin set, the business's only location. Set it as in Shipping rates and settings (step 3).
The default shipping configuration's origin also matters for tax: when the site isn't serving a store, a web sale is taxed as if made there (step 5).
Check: the default configuration (GET shipping/admin/configs/<name>) has the intended origin.
3. Site Config: which stores the site sells from (optional)
Only for a business with several stores that each sell their own stock. Site Config › Storefront › Regions this site serves lists those locations. It saves data.storefront.businessLocations on the site, as location names.
Once set, every shop request is served for one store. It is the one the shopper picked in the store picker (shown on the store pages, saved in a storeLocation cookie), or the one whose state matches the shipping address, or the first in the list. From then on, that store sets:
- the stock shown and the refusal to oversell (see Stock levels);
- the location filed on the order, and so where its stock is taken from;
- where the cart is taxed (step 5).
A custom page or app picks the store with an x-store-location header, or storeLocation in x-client-info. A name that isn't one of the site's stores is ignored. GET storefront/store-locations returns the stores (name, title, address, phone, timezone, operatingHours) and the selected one. Tested.
Stop: this changes the live shop: what is in stock, what can be bought and where orders are filed. Show the list of stores and wait for yes.
Hands on: the site's sk.
Check: GET storefront/store-locations returns the stores, and selected follows the store chosen.
4. Tax rates: one row per jurisdiction
There is no tax screen in Studio. Rows are made with repo_create (datatype sf_tax_rate), or in Data Explorer (/data-explorer?collection=sf_tax_rate).
| Field | Meaning |
|---|---|
name | the owner's name for it ("Texas state sales tax"). Required. |
taxName | the label on receipts ("TX State") |
rate | percent: 6.25 is 6.25% |
status | active, or inactive to switch it off |
country, state, county, city | each one set must equal the customer's address. country and state as codes (US, TX); county and city as written. Empty = any. |
zipPrefix | the start of the zip code: 752 matches 75201 to 75299 |
jurisdictionType | country, state, county, city, zip or custom, for the owner's reading only |
appliesTo | all (default), goods, services or shipping |
priority | the order rates are applied in, lowest first |
compound | true applies the rate to the price plus the tax already added (tax on tax) |
businessLocationId | only for sales made at that location (its name) |
effectiveFrom, effectiveTo | dates YYYY-MM-DD, inclusive. Empty = always. Use them for a rate change. |
{ "name": "Texas state sales tax", "taxName": "TX State", "rate": 6.25, "status": "active",
"jurisdictionType": "state", "country": "US", "state": "TX", "appliesTo": "all", "priority": 0 }Every row that matches is applied, and they add up. Tested, for one zip code: state 6.25%, plus a zip code row at 2% (priority 1), plus a compound 1% (priority 5), gave 9.3325%. A rate dated to start in 2099 was left out until that date. A row for one location was added only for sales at that location.
Matching is exact text. A row with state: "TX" doesn't match an address that says Texas, and US doesn't match United States. Tested: no rate was found. The site's own address form saves codes, so write the rows in codes. An address typed by staff or imported may not use them.
goods and services don't separate anything yet: a cart line is taxed by both kinds. Only shipping is kept apart (step 7).
Hands on: each row's sk.
Check: GET storefront/tax/rates/resolve?country=US&state=TX&zip=75201 lists the rows that match, in order, with combinedRate. Add businessLocationId=<name> to include a location's own rows, date=YYYY-MM-DD for a future rate, and appliesTo=shipping for the shipping rate.
5. Business locations: the flat rate, and where a web sale is made
A location's taxRate is used when no tax rate row matches the address. On the location form it is under Tax & time zone (Sales tax rate %, Tax label).
The flat rate is charged to any address that no row matches, even another state's or another country's. Tested: with an 8.25% location rate and a Texas address, 8.25% was charged. If the business only collects in some states, give it tax rate rows for those states and no flat rate.
A web sale is taxed at a selling location, found in this order:
- the store the site is serving (step 3);
- the location the default shipping configuration ships from (step 2);
- a location marked
isDefault: true(not on the form: set withrepo_update); - the only active location, when there is just one.
With none of these, a sale whose address matches no row is charged no tax. POS tabs and staff orders use their own location.
Check: POST storefront/tax/calculate (step 7) answers with source (jurisdiction, location, exempt or none) and businessLocationId, the location it used.
6. Customers: tax exempt
On screen: the customer's record, Sales tax section: Tax exempt, Reason, Certificate number (data.taxExempt, data.taxExemptReason, data.taxExemptCertificate).
Real action: call_appengine POST storefront/tax/apply-exemption with { "customerId": "<sk>", "reason": "Resale, TX", "certificate": "<number>" } (or email instead of customerId). POST storefront/tax/remove-exemption clears it. Staff only. Tested.
The exemption covers every sale, everywhere. There is no state, expiry date or product scope.
| Where | Exempt customer charged tax? |
|---|---|
| POS tab for the customer | no |
POST storefront/tax/calculate with customerId | no (taxName: "Tax Exempt") |
| Site cart, checkout and staff quotes | yes: the exemption is not read |
For a web order to an exempt customer, the person refunds the tax afterwards (see Refund, cancel or return an order), or rings the sale up at the POS.
Check: POST storefront/tax/check-exempt with { "customerId": "<sk>" } returns exempt: true, the reason and the certificate. That answer is for staff: a signed-in customer gets only their own status, and anyone else exempt: false (tax.controller.ts).
7. Try it before telling anyone
GET storefront/tax/rates/resolve?country=US&state=TX&zip=75201: the rows and the combined rate.POST storefront/tax/calculatewith the cart and an address, to see the tax as the calculator works it out:
{ "subtotal": 100, "shippingCost": 10,
"shippingAddress": { "country": "US", "state": "TX", "city": "Dallas", "zip": "75201" } }It answers with taxAmount, taxRate (as a fraction: 0.0825), shippingTax, breakdown (one line per rate, shipping lines marked "(shipping)"), source, configured and businessLocationId. configured: false means no rate and no location was found. Tested.
- The real check is a cart.
POST storefront/admin/order/quote(staff) runs the same pricing as the site's checkout: it shows the tax checkout will charge, with no shipping tax and no exemption.
Check: on the site's checkout page, the Tax line shows the amount. The line is hidden when the tax is 0, and it always says "Tax", not the rate's label.
How checkout works out the tax
- The lines that are taxed: all except products with Charge tax on this product off (
data.tax: false) and gift cards. - Their total, less any discount on them.
- The rate: the tax rate rows that match the shipping address (and the selling location), else that location's flat rate, else nothing.
- Each rate's amount is rounded to the cent; the tax is their sum.
- Shipping is not taxed. Tax is added on top of the prices.
Tested: tee 20 + a product with tax off 10 = 30, shipping 15, tax 1.87 (6.25% of 20, plus a zip code rate and a compound rate), so the untaxed product and the shipping were left out.
When something goes wrong
| What happens | Why | Fix |
|---|---|---|
| No tax at checkout | no row matches and no selling location has a rate, or the address uses names instead of codes | step 4 check; set the default Ship From (step 2) or the flat rate (step 5) |
| Tax charged on an out-of-state order | a flat rate on the selling location | step 5 warning |
| An exempt customer was charged tax on the site | web checkout doesn't read exemptions | step 6 |
| Tax isn't on the shipping | web checkout never taxes it | can't be fixed by setup |
| A new rate isn't used | effectiveFrom in the future, status: inactive, or a businessLocationId on the row | step 4 check with date= |
… still has … in stock, so it was not deleted (LOCATION_IN_USE) | stock or open tabs at the location | transfer or count out the stock, or mark the location inactive |
| Carriers refuse the label: "Carriers need a phone number for the sender" | no data.phone on the Ship From location | step 1 |
When it's done
Tell the person:
- each location: ID, address, phone, time zone, hours, flat rate;
- where orders ship from, and which stores the site sells from (if any);
- each tax rate row (label, rate, where it applies), and the rate a sample address gets;
- the exempt customers, and that the site still charges them tax;
- that shipping is never taxed on the site, and prices never include tax.
Open Business locations on the location.
What it can't do yet
- No tax-inclusive (VAT-included) prices. Tax is always added on top.
- Web checkout ignores tax exemptions and never taxes shipping.
- No tax screen in Studio for
sf_tax_rate: rows are kept in Data Explorer or through the API. Nothing ships with ready-made rates, and nothing looks rates up from a tax service. - No "where we collect" switch. A flat rate is charged everywhere no row matches.
goodsandservicesrows aren't told apart on a cart.- Hours don't do anything on their own: no "closed now" on the shop, and bookings don't use them.
- The store picker shows hours as raw text (
mon: 09:00–18:00) and leaves out the zip code. - Tax reports come from Books (Business Made › Books › Tax shows the tax owed), not from here.
Don'ts
- Don't guess a tax rate. Ask for it, or ask the person to check it with their tax authority.
- Don't write
countryorstateon a rate as full names. Use codes. - Don't give the selling location a flat rate when the business collects tax only in some states.
- Don't rename a location's
nameonce stock, orders or rates use it. Change thetitle. - Don't tell an exempt customer they won't be charged tax on the website.
- Don't turn on the site's stores without a yes: it changes what the shop sells and where.