Documentation

Using Coil

Receipts and Expenses

Preserve originals, classify purchases, link lots, and resolve exact-file duplicates.

Upload in the UI

Ordinary location expenses reduce profit using receipt date and total paid, including tax; they do not reduce commission. Platform fee expenses reduce profit by service-day proration and can reduce opted-in net-share payouts; gross shares are unchanged. Machine defaults only prefill actual invoice amounts. Receipt files belong to the expense record and can be added later. Payout receipts record actual venue payments but are not deducted again from profit. Location expenses cannot be merged or split; use Add File to keep supporting originals together.

Unlinking a lot removes only its receipt association, not inventory.

  1. Open Receipts and select the original image or PDF files. A multi-part receipt should stay together as one receipt record.
  2. To attach another invoice, product, or payment image later, choose Add File on that receipt's row instead of creating a separate receipt.
  3. Classify it as product, expense, or unfiled. Verify the supplier, receipt date, amount, sales tax, and expense type.
  4. For a payment to a location, choose Location payout under Expenses, select the location, and enter the amount actually paid.
  5. For venue operating costs such as delivery rentals, choose Location expense and enter the total paid and description.
  6. For machine software/data/POS invoices, choose Platform fee under Expenses. Add a service-period allocation for each machine, including its actual service location and dates. Machine monthly defaults prefill amounts only. Split multi-machine invoices and make the allocated total match the receipt total.
  7. To deduct the fee from a venue's share, enable Deduct platform fees before net-profit share in that location's settings. This defaults off and does not affect gross-percentage payouts.
  8. A platform-fee receipt can be saved without a file. Use Add File later to attach the invoice original to that same expense.
  9. Deactivate locations that have expense or payout history instead of deleting them. Their recorded location expenses remain in reports.
  10. Use receipt notes to explain why the receipt total differs from tracked lots, such as personal purchases or items intentionally left out of inventory. Notes are explanatory only and do not create inventory or change receipt amount, sales tax, or costs.
  11. For product purchases, select existing products and create the appropriate lots/units, enter an optional best-by date for each lot, or link lots that already exist. Do not receive the same purchase twice.
  12. Review the receipt and linked lots after saving. Keep the original document rather than replacing it with extracted text.
  13. To unlink a lot, edit the receipt, choose Unlink next to that lot, then save the receipt. The lot and its units remain in inventory.

Check for Duplicates

New receipt files store a SHA-256 of their original bytes. Exact hashes detect the same file, not two different photos or scans of the same paper receipt.

Agents can filter list_receipts by supplier, dates, amount, and hash. Older originals may need get_receipt_file once to populate their hash. create_receipt returns created:false and duplicateOf when it finds a matching hash, without creating inventory.

Deleting a receipt preserves linked products, lots, and units. It does not undo stock created by a duplicate purchase. Review inventory separately before assuming the duplicate is fully resolved.

Agent File Uploads

This requires original-file access, a shell or binary HTTP client, and network access to the returned hostname. Attaching a file in chat does not automatically transfer it through MCP. Do not invent base64 or reconstruct an original.

Production URLs use www.usecoil.app by default. Binary bytes go through a bounded Coil upload endpoint into private Blob storage, never as text through MCP. Automation allows 1-3 originals totaling at most 3 MB per receipt. Base64 and multipart API uploads remain available for exact-byte clients.

  1. Have the agent analyze the original and show you its proposed receipt data and purchase items.
  2. After review, request create_receipt_upload with the original filename, MIME type, exact size, and preferably SHA-256.
  3. The agent's shell PUTs the original binary file to the returned one-time URL without following redirects.
  4. Check the returned size/hash, then call create_receipt with files containing the uploadId before its 10-minute expiry. To append the original to an existing receipt instead, call add_receipt_files with its receiptId and the uploadId.
bash
curl --fail --silent --show-error --request PUT \
  --header 'Content-Type: image/png' \
  --data-binary @receipt.png "$UPLOAD_URL"

Originals Stay Private

Treat upload URLs as credentials and keep them out of shared logs and source control. Upload IDs belong to the issuing key/workspace and can be redeemed once. Coil verifies the stored original's size, hash, and file signature at receipt creation; it never fetches arbitrary URLs supplied by an agent.