Using Coil
Sales and Sales Tax
Import vendor sales reports, record sales by hand, track sales tax owed, and match sales to stock.
Import a Vendor Sales Report
Large reports are sent in batches of up to 500 lines. Each line keeps the vendor transaction ID when the report has one, so overlapping date ranges and repeated imports are skipped as duplicates. Without a transaction ID, Coil compares machine, product, time, amount, and quantity.
Report timestamps without a time zone are read in the workspace time zone from Settings (US Eastern by default). A completed refund with the original transaction ID reverses that sale and returns its units to stock; a refund Coil cannot match is held for review instead of being guessed.
Previews also appear under Sales > Imports, where you can review, apply, or discard them yourself.
- Export the transaction-level sales report (CSV or Excel) from the machine's vending platform: one Coil doesn't sync for you. HaHa, VTM, and BuzzBot sales are synced by Coil itself once connected (see below), so you don't need to import them. Don't import Nayax transactions: Nayax processes payments for those same vends, so they would be counted twice. Use the Nayax audit to check sales and record its payouts on the Income page instead.
- Give the file to your agent and ask it to update Coil with what sold. It needs a key with the Sales importer preset (sales:read and sales:write).
- The agent reads the report, drops declined or failed vends, matches each product and machine to your Coil records, and calls preview_sales_import. Nothing is recorded yet.
- Review the preview: units, revenue before tax, sales tax to remit, units needing stock, duplicates, and any blocked lines. Unknown machines or products block the preview; create the machine in Coil or tell the agent which existing record it is. Coil never creates machines or products from a report.
- Approve, and the agent calls apply_sales_import. Matching units are marked sold and the vendor names it matched are saved as mappings, so the next report from that vendor matches automatically.
Sync HaHa Vending Machines
HaHa is the source of truth for what is in each machine and what sold. Coil keeps cost of goods: HaHa's cost fields are never imported.
Run the sync from Settings > Connectors > HaHa Vending, or have an agent run it with run_vending_sync, for a range of up to 31 days. Coil also syncs automatically every hour from 4am to 11pm Eastern, and a nightly catch-up re-checks the last 7 days. Each run imports paid HaHa orders from machines placed at a location as sales, marking specific Coil units sold so revenue, sales tax, card fees, and COGS come from your lots. Partially paid orders are recorded at the amount actually charged, and refunds reverse the sale. Each sale is dated when the item left the machine, so an order HaHa finishes collecting days later is filed on its vend day, which can be in an earlier month. Orders already in Coil are skipped, so overlapping ranges are safe, and a HaHa CSV export matches the same orders.
After sales, Coil matches each machine to HaHa's stock: extra HaHa stock moves in from the warehouse, earliest expiry first. Items on orders HaHa is still settling stay in the machine. If Coil shows more than HaHa, nothing is written off; it's flagged so you can decide whether it's shrink. If the warehouse is short, it's flagged too: record the purchase and the next run moves it in.
Problems show in the banner at the top of the app: a failed sync, HaHa products that need mapping, warehouse shortages, extra units in Coil, and orders still settling after 3 days. Applied sales can be undone from Sales > Imports.
- In HaHa's merchant portal, request open-platform access to get an app key and app secret.
- A workspace owner opens Settings > Connectors > HaHa Vending and enters the app key and secret. Coil checks them with HaHa, encrypts them, and never shows the secret again. Coil only reads from HaHa; it never changes anything there.
- Choose Review machine and product mappings. Coil suggests a match from earlier mappings, exact names, or a machine serial number equal to the HaHa sticker number. Save each suggestion or pick the right Coil record. Your agent can also map items for you.
- Run a dry run from the Sync panel to see what would be imported and moved, then run it for real.
Sync VTM Machines
Run the sync from Settings > Connectors > VTM, or have an agent run it with run_vending_sync, for a range of up to 31 days. Coil also syncs automatically every hour from 4am to 11pm Eastern, and a nightly catch-up re-checks the last 7 days. Each run imports shipped VTM orders from machines placed at a location as sales, one line per pack type in a cart, and skips orders already in Coil. Machines that aren't placed, such as ones in storage holding test stock, are skipped. Pending orders are imported once they ship, and cancelled ones are skipped.
After sales, Coil matches each machine to VTM's stock counts: when you restock in the VTM app, the next run moves those units in from the warehouse, earliest expiry first. If Coil shows more than VTM, nothing is written off; it's flagged so you can decide whether it's shrink. You set stock in VTM; Coil never changes stock there.
Problems show in the banner at the top of the app: a failed sync, VTM products that need mapping, warehouse shortages, extra units in Coil, orders pending more than 3 days, and sales VTM charged without tax. For an older range, pick From and To dates (up to 31 days) and machines in the Sync panel; it's safe to run again because duplicates are skipped.
Your agent can read VTM and change selling prices through Coil, always previewing the change first. VTM owns prices; a Coil product's default sale price is just a suggestion.
- In VTM, create an API key with orders:read, inventory:read, and machines:read. Add inventory:write only if your agent should change selling prices.
- A workspace owner opens Settings > Connectors > VTM and pastes the key. Coil checks it with VTM, encrypts it, and never shows it again.
- Choose Review mappings. Machines match a saved mapping or a Coil serial number equal to the VTM machine number. Map each VTM product name to its Coil product; Coil never guesses products.
- Run a dry run from the Sync panel to see what would be imported and moved, then run it for real.
Sync BuzzBot Machines
- In BuzzBot, create an API key with orders:read, inventory:read, and machines:read. A workspace owner pastes it in Settings > Connectors > BuzzBot. Coil checks it with BuzzBot, encrypts it, and never shows it again.
- Choose Review mappings. Machines match a saved mapping or a Coil serial number equal to the BuzzBot machine number. Map each BuzzBot product name to its Coil product; Coil never guesses them.
- Run the sync from Settings > Connectors > BuzzBot, starting with a dry run if you like, or have an agent run it with run_vending_sync, for a range of up to 31 days. Coil also syncs automatically every hour from 4am to 11pm Eastern, with a nightly catch-up of the last 7 days.
- Delivered orders become sales, with the tax BuzzBot includes in the amount recorded separately, and refunded orders reverse their sale. Partial refunds and statuses Coil doesn't know are flagged for you instead. A refund made more than a week after the sale needs a manual sync covering the sale's date.
- After sales, Coil matches each machine to BuzzBot's counts: when you restock in BuzzBot, the next run moves those units in from the warehouse, earliest expiry first. Warehouse shortfalls and extra units in Coil are flagged in the banner, and nothing is written off. Lanes with no product or no capacity are ignored.
Mark a Test Vend
A test vend, such as one run on install day, is a real vend, so it's imported like any other. Marking it as a test takes it out of revenue, sales tax, cost of goods, and location commission, and returns its units to stock where you chose. The card charge still counts in the Nayax audit and payout checks, because the money really moved, and syncs never import it again.
- Open Sales > Recorded sales and choose Mark as test on the vend.
- Pick where the item went: back into the machine, the warehouse, or another machine.
- Save. The vend moves to Sales > Test vends. Choose Not a test there to turn it back into a sale.
Let an Agent Audit Sales Against Nayax
Nayax readers take the card payments for machines whose sales come from HaHa, VTM, or BuzzBot, so Nayax is a check on those sales, never a source of them. The audit matches each Nayax charge to a recorded sale on the same machine with the same amount at about the same time, then lists vends Nayax charged that Coil is missing, recorded sales with no Nayax charge, and amounts that differ. A VTM cart order with several packs counts as one charge, and declined or unpaid card attempts are listed separately instead of as missing sales. Fix sales from the vending platform's data, not from Nayax.
Nayax only shares each machine's most recent transactions, so the audit reports how far back it could check each machine and leaves older sales unchecked instead of calling them missing. Audit often, such as weekly. Nayax payouts aren't available through its API; record them from the statement on the Income page.
Coil also runs this audit itself every night for the last 7 days and shows real problems in the banner at the top of the app: card charges with no sale in Coil, sales with no card charge, amounts that differ, and Nayax machines that need mapping. It doesn't flag what's expected: machines that aren't placed yet, charges on machines whose sales you import by hand until you import them, or sales a machine logged late after being offline.
- In Nayax Core, open Account Settings > Security and Login > User Tokens, choose Add Token > Lynx Token, and copy it.
- A workspace owner opens Settings > Connectors > Nayax and pastes the token. Coil checks it with Nayax, encrypts it, and never shows it again. A Lynx token has full access to your Nayax account; Coil only reads from it.
- Choose Review machine mappings and match each Nayax machine to its Coil machine. Only mapped machines are audited.
- Give your agent's key the Vending platform sync preset and ask, for example: "Audit the last 7 days of card sales against Nayax."
Record a Few Sales by Hand
- Open Sales > Record sales and choose the location. Optionally choose the machine.
- Enter the date (and optionally the time), then add each product, the quantity, and the total charged.
- If tax was charged on top of the price, enter it in Separate tax. Otherwise leave it blank and Coil backs the tax out of the total.
- Choose Review sales, check the preview, then record the sales.
Which Inventory Units Are Sold
For each sale, Coil sells stock assigned to that machine first, then other stock at the same location, then warehouse stock. Within each group it sells the earliest-expiring lot when all lots have best-by dates, otherwise the oldest purchase first. Stock at other locations is never used.
You do not have to keep machine counts exact. If there is no matching stock at all, the sale is still recorded with its revenue and tax, and it is flagged under Sales > Needs stock with no cost yet. After you receive the missing purchase, choose Match stock to attach units and fill in the cost. The dashboard shows how many sold units are still waiting for stock, and the attention banner names the newest ones and links straight to Needs stock.
Sales Tax
Dashboard and Reports show Sales Tax to Remit for the period and per location. The summary CSV breaks it into tax charged separately and tax backed out of tax-included prices. Sales tax is never counted as revenue or profit.
- Each location uses its own sales tax rate if one is set in Locations, otherwise the workspace default in Settings (6% by default). Set a location rate for machines in another state.
- If the report lists tax separately, that amount is recorded as tax collected and the price is revenue. A $10.00 item with $0.60 tax records $10.00 revenue and $0.60 to remit.
- If no separate tax is shown, the price is treated as tax-included and the tax is backed out. A $2.00 sale at 6% records $1.89 revenue and $0.11 to remit.
- If separately collected tax does not match the location rate, Coil records what was collected and flags the line. It never adjusts collected tax automatically.
- Products marked non-taxable owe no sales tax. Each sale stores the rate it used, so later rate changes do not rewrite past sales.
Card Fees
When a report includes the actual processing fee, Coil uses it. Otherwise it applies the machine's configured card fee. Cash sales have no card fee.
Review Recorded Sales
Sales opens on Recorded sales: every sale in the date range at the top of the page, newest first, with the purchases, units, revenue, and sales tax for everything that matches. Filter by any mix of locations and machines, products, and sources (HaHa, VTM, BuzzBot, manual): type in a filter to narrow its list and check as many as you need. Search by product or order number, or sort oldest first.
Products bought in one purchase, such as several packs in one VTM order or several items taken in one HaHa door opening, are tinted together with a bar down the left and a Bought together row with the purchase's total. Several products entered by hand at the same time count as one purchase.
Undo and Mappings
Undo an entire import from Sales > Imports, or a single sale from Recorded sales. Undone units return to stock and the sale leaves reports, and the same transaction can be imported again. Imports that applied refunds must be undone sale by sale.
Sales > Mappings lists saved vendor names and the Coil product or machine each one maps to. Delete a wrong mapping and correct the import; recorded sales are not changed by deleting a mapping.