← FlowAccount integration

Working with FlowAccount documents

FlowAccount organizes everything around documents, not journal entries. Each document family has its own endpoint, and the Daslab tools mirror that: every document tool takes a document_type naming the family.

The document families

document_typeWhat it isTypical use
tax_invoicesใบกำกับภาษี — VAT tax invoiceThe standard sales document for VAT-registered businesses
invoicesใบแจ้งหนี้ — invoiceBilling a customer before payment
receiptsใบเสร็จรับเงิน — receiptConfirming money received
billing_notesใบวางบิล — billing noteBatching several invoices for one collection
quotationsใบเสนอราคา — quotationPre-sale pricing
expensesค่าใช้จ่าย — expense recordPurchases and operating costs
purchase_ordersใบสั่งซื้อ — purchase orderOrdering from suppliers

Thai businesses often issue combined documents (e.g. tax invoice/receipt in one). In FlowAccount those live under the family that leads the combination — when a document you expect is missing from one list, check the neighboring family before concluding it doesn't exist.

Reading

  • flowaccount_list_documents returns one page per call (page, page_size, default 20). The response carries total — page until you've covered it when consolidating a period.
  • Lists return summary rows (serial, contact, dates, status, grand total). flowaccount_get_document returns the full body: line items, VAT flags, and discounts.
  • Contacts and products have their own list/get tools; contact codes and product codes are how documents reference them.

Creating

flowaccount_create_document passes your payload to the Open API as-is — Daslab does not compute totals or VAT for you. The reliable workflow:

  1. flowaccount_list_documents for the target family, take a recent document.
  2. flowaccount_get_document on it and copy its field shape — contact fields, publishedOn/dueDate formats, the items array (name, quantity, pricePerUnit, total), and the summary fields (subTotal, isVatInclusive, vatAmount, grandTotal).
  3. Send your new payload with the same shape and your values. Compute the totals yourself and keep them consistent with the line items — the API validates, it does not fix.

Creation requires approval in Daslab, so a job proposes the document and a person confirms before anything lands in the books.

Multi-branch and multi-business patterns

  • One FlowAccount business = one connected account asset. A group running several legal entities connects each, and tools take an accountId to pick the business when more than one is connected.
  • Branch-level consolidation (e.g. daily sales across many outlets) is a read pattern: list the day's receipts/tax invoices, group by whatever field the business uses to mark the branch (document serial prefix, project name, or sales name), and reconcile against POS or storefront totals from the other side.