{"basePath":"/","definitions":{"dto.BankResponse":{"properties":{"accountBranch":{"type":"string"},"accountBranchCode":{"type":"string"},"accountName":{"type":"string"},"accountNo":{"type":"string"},"accountType":{"type":"integer"},"bankAddress":{"type":"string"},"bankCompany":{"type":"string"},"chartOfAccountCode":{"type":"string"},"chartOfAccountId":{"description":"The four GL fields are all nil together when the money account is not\nlinked to a chart_of_accounts row. GlBalance is signed by the account's\nnormal side (see signedAccountBalance), so a negative value is a real\noverdraft rather than a positive \"amount of overdraft\", and it is only\npopulated by the list endpoint — the single-row reads do not aggregate\nthe ledger.","type":"integer"},"chartOfAccountName":{"type":"string"},"glBalance":{"type":"number"},"id":{"type":"integer"},"kind":{"type":"string"},"swiftCode":{"type":"string"}},"type":"object"},"dto.ChangePurchaseStatusRequest":{"properties":{"note":{"type":"string"},"status":{"type":"string"}},"required":["status"],"type":"object"},"dto.ContactPaginationResponse":{"properties":{"items":{"items":{"$ref":"#/definitions/dto.ContactResponse"},"type":"array"},"pagination":{"$ref":"#/definitions/dto.PaginationResponse"}},"type":"object"},"dto.ContactResponse":{"properties":{"address":{"type":"string"},"avatarUrl":{"type":"string"},"bank":{"$ref":"#/definitions/dto.BankResponse"},"bankQrUrl":{"type":"string"},"branchCode":{"type":"string"},"branchName":{"type":"string"},"branchType":{"type":"string"},"businessType":{"type":"string"},"code":{"type":"string"},"contactName":{"type":"string"},"contactType":{"type":"string"},"countryCode":{"description":"ISO 3166-1 alpha-2 (ABSERP-946)","type":"string"},"createdAt":{"type":"integer"},"createdByName":{"type":"string"},"creditDays":{"type":"integer"},"creditLimit":{"type":"number"},"currency":{"type":"string"},"discordId":{"type":"string"},"email":{"type":"string"},"fax":{"type":"string"},"id":{"type":"integer"},"isActive":{"type":"boolean"},"isForeign":{"type":"boolean"},"lineId":{"type":"string"},"name":{"type":"string"},"paymentTermDays":{"type":"integer"},"phone":{"type":"string"},"postalCode":{"description":"PostalCode / Fax / IsForeign (ABSERP-942, D6).","type":"string"},"remark":{"type":"string"},"shippingInfo":{"type":"string"},"taxId":{"type":"string"},"telegram":{"type":"string"},"website":{"type":"string"},"whatsappId":{"type":"string"}},"type":"object"},"dto.ConvertSalesDocumentRequest":{"properties":{"fromId":{"type":"integer"},"toType":{"enum":["SO","IV","CS","RE","CN","DN"],"type":"string"}},"required":["fromId","toType"],"type":"object"},"dto.CreateExpenseClaimRequest":{"properties":{"claimantUserId":{"description":"ClaimantUserID lets an org admin/owner file a claim on another\nemployee's behalf (v1.2). Omitted, or equal to the caller's own user\nid, means a self-filed claim. The claim is owned by that employee's\nmembership; the caller is recorded in created_by.","example":42,"type":"integer"},"items":{"description":"Items may be empty at create time — the mobile flow creates the\nheader first, then adds lines one category at a time. Submission is\nwhat requires at least one line.","items":{"$ref":"#/definitions/dto.ExpenseClaimItemRequest"},"type":"array"},"note":{"description":"Note is the claimant's free-text message to the approver.","maxLength":2000,"type":"string"},"reimbursementMethod":{"description":"ReimbursementMethod is how the claimant wants to be paid back\n(constant.ExpenseClaimReimbursementMethods). It is a preference the\nrecord-payment dialog defaults to, not what was actually paid.","enum":["bank_transfer","promptpay","cash"],"example":"bank_transfer","type":"string"},"title":{"maxLength":255,"type":"string"}},"required":["title"],"type":"object"},"dto.CreateJournalEntryLineRequest":{"properties":{"accountId":{"type":"integer"},"credit":{"minimum":0,"type":"number"},"debit":{"minimum":0,"type":"number"},"description":{"maxLength":255,"type":"string"}},"required":["accountId"],"type":"object"},"dto.CreateJournalEntryRequest":{"properties":{"description":{"maxLength":255,"type":"string"},"entryDate":{"type":"string"},"lines":{"items":{"$ref":"#/definitions/dto.CreateJournalEntryLineRequest"},"minItems":2,"type":"array"}},"required":["entryDate","lines"],"type":"object"},"dto.CreateProductRequest":{"properties":{"altUnits":{"items":{"$ref":"#/definitions/dto.ProductAltUnitRequest"},"type":"array"},"barcode":{"maxLength":100,"type":"string"},"category":{"maxLength":100,"type":"string"},"code":{"description":"Code is optional (ABSERP-897): blank -\u003e the server generates PROD-0001,\nPROD-0002, ... and returns it in the response.","maxLength":50,"type":"string"},"costPrice":{"minimum":0,"type":"number"},"description":{"type":"string"},"expenseAccount":{"maxLength":100,"type":"string"},"incomeAccount":{"maxLength":100,"type":"string"},"initialStock":{"$ref":"#/definitions/dto.InitialStockRequest"},"name":{"maxLength":255,"type":"string"},"productType":{"enum":["service","nonInventory","inventory"],"type":"string"},"purchaseDescription":{"type":"string"},"purchaseVatType":{"enum":["vatExclusive","vatInclusive","zeroVat","noVat"],"type":"string"},"reorderPoint":{"minimum":0,"type":"number"},"salePrice":{"minimum":0,"type":"number"},"taxRate":{"maximum":100,"minimum":0,"type":"number"},"unit":{"maxLength":100,"type":"string"},"vatType":{"enum":["vatExclusive","vatInclusive","zeroVat","noVat"],"type":"string"}},"required":["name","productType","purchaseVatType","vatType"],"type":"object"},"dto.CreatePurchaseDocRequest":{"properties":{"bankId":{"description":"BankID names the money account (`bank`: cash drawer / bank account /\ne-wallet) the payment is made FROM, so the cash leg of the PV's journal\nentry credits THAT account's GL account instead of the organization's\ndefault one — see resolveMoneyAccountTx.\n\nPV is the only purchase document that moves money, so it is REJECTED with\n400 on PR/PO/GR/PI rather than quietly stored: a purchase order carrying a\nbank account reads as paid to any later reader, and nothing would ever post\nto it. Absent/null keeps the organization's default account.","type":"integer"},"branchId":{"description":"issuing branch (ABSERP-878), see GET /organizations/issuing-branches; absent/null = head office","type":"integer"},"buyerId":{"type":"integer"},"contactId":{"type":"integer"},"currency":{"type":"string"},"docDate":{"type":"integer"},"docType":{"enum":["PR","PO","GR","PI","PV","EX"],"type":"string"},"dueDate":{"type":"integer"},"exchangeRate":{"type":"number"},"internalNotes":{"type":"string"},"items":{"items":{"$ref":"#/definitions/dto.PurchaseItemRequest"},"minItems":1,"type":"array"},"notes":{"type":"string"},"projectId":{"type":"integer"},"refDocId":{"type":"integer"},"refDocType":{"enum":["PR","PO","GR","PI","PV","EX"],"type":"string"},"referenceNo":{"description":"ReferenceNo / ProjectID / BuyerID / ExchangeRate (ABSERP-946 B2): the buyer's own\nfree-text reference, the project the document is charged to (projects.id), the\nbuyer or preparer (employees.id), and THB per 1 unit of the currency (absent = 1,\nwhich is right for THB).","maxLength":100,"type":"string"},"supplierInvoiceDate":{"type":"integer"},"supplierInvoiceNo":{"description":"SupplierInvoiceNo / SupplierInvoiceDate (ABSERP-946 D2): the tax invoice the\nvendor issued, as received. Kept on GR and PI only; ignored on other types.","maxLength":50,"type":"string"},"vatMode":{"description":"VatMode (ABSERP-946 B2): exclusive (default), inclusive or none; see\nPurchaseVatMode*. Absent means exclusive.","enum":["exclusive","inclusive","none"],"type":"string"},"warehouseId":{"description":"WarehouseID (GR only, ABSERP-897): the warehouse the goods are received into.\nAbsent/null = the organization's default warehouse at posting time.","type":"integer"},"whtAmount":{"minimum":0,"type":"number"},"whtRate":{"description":"WhtRate/WhtAmount/WhtSection describe the withholding tax withheld\nfrom the vendor when a Payment Voucher (PV) is paid — see\nCreatePVJournalEntry (accounting.service.go) for the posting split.\nWhtSection is free text (e.g. SERVICE, RENT, CONTRACT_WORK), not an\nenum, mirroring the sales-side WHT fields.","maximum":100,"minimum":0,"type":"number"},"whtSection":{"maxLength":50,"type":"string"}},"required":["currency","docDate","docType","items"],"type":"object"},"dto.CreateSalesDocumentRequest":{"properties":{"bankId":{"description":"BankID names the money account (`bank`: cash drawer / bank account /\ne-wallet) the money is received into, so the cash leg of the journal\nentry posts to THAT account's GL account instead of the\norganization's default one — see resolveMoneyAccountTx.\n\nOnly RE (receipt) and CS (cash sale) move money, so it is REJECTED\nwith 400 on every other type rather than quietly stored: a quotation\ncarrying a bank account would look like a settled document to any\nlater reader, and the field would never be posted anywhere.\n\nAbsent/null keeps the pre-bank_id behaviour: post to the\norganization's default BANK/CASH account.","type":"integer"},"branchId":{"description":"issuing branch (ABSERP-878), see GET /organizations/issuing-branches; absent/null = head office","type":"integer"},"contactId":{"type":"integer"},"currency":{"type":"string"},"discountAmount":{"minimum":0,"type":"number"},"documentType":{"enum":["QT","SO","IV","RE","CS","CN","DN"],"type":"string"},"dueDate":{"type":"string"},"issueDate":{"type":"string"},"items":{"items":{"$ref":"#/definitions/dto.SalesItemRequest"},"minItems":1,"type":"array"},"note":{"type":"string"},"project":{"maxLength":255,"type":"string"},"projectId":{"type":"integer"},"reasonCode":{"maxLength":40,"type":"string"},"reasonText":{"maxLength":500,"type":"string"},"refDocumentId":{"description":"RefDocumentID / ReasonCode / ReasonText (ABSERP-942, credit and debit notes only):\nthe tax invoice (IV/CS) the note adjusts, why it is issued (a code of\nconstant.SalesCreditNoteReasons / SalesDebitNoteReasons) and the explanation,\nrequired for the reason \"other\".","type":"integer"},"restock":{"description":"Restock (credit note only, ABSERP-897): the goods come back into stock when\nthe note completes — open backorders of the referenced document are\ncancelled first, the rest returns at the original cost and COGS is reversed.\nIgnored on every other type.","type":"boolean"},"salesperson":{"maxLength":255,"type":"string"},"salespersonEmployeeId":{"description":"SalespersonEmployeeID picks an employee; the name is stored with the document (Salesperson text\ntyped alongside wins, so a nickname can be used).","type":"integer"},"vatInclusive":{"description":"VatInclusive (ABSERP-942): the line prices already contain VAT.","type":"boolean"},"vatRate":{"minimum":0,"type":"number"},"warehouseId":{"type":"integer"},"whtAmount":{"minimum":0,"type":"number"},"whtManual":{"description":"WhtManual (ABSERP-942): true keeps WhtAmount as typed; otherwise the amount is\nthe sum of the lines' withholding tax when any line carries a rate.","type":"boolean"},"whtRate":{"maximum":100,"minimum":0,"type":"number"}},"required":["contactId","documentType","issueDate","items"],"type":"object"},"dto.ErrorResponse":{"properties":{"errorCode":{"example":"SOMETHING_WENT_WRONG","type":"string"},"errorDescription":{"example":"Something went wrong","type":"string"},"errorInfo":{},"errorMessage":{"example":"Oops, something went wrong!","type":"string"},"errorStack":{"type":"string"},"errorValidation":{"items":{"$ref":"#/definitions/dto.ValidationErrorDetail"},"type":"array"},"statusCode":{"example":500,"type":"integer"}},"type":"object"},"dto.ExpenseClaimItemRequest":{"properties":{"amount":{"type":"number"},"categoryId":{"type":"integer"},"checkinDate":{"type":"integer"},"checkoutDate":{"type":"integer"},"currencyCode":{"description":"CurrencyCode is the ISO 4217 code the claimant actually paid in — a\ntrip that crosses borders can mix currencies across lines, so this\nis per-item, not inherited from the organization.","type":"string"},"description":{"maxLength":2000,"type":"string"},"expenseDate":{"type":"integer"},"hasTaxInvoice":{"type":"boolean"},"paidWith":{"description":"PaidWith is how the claimant settled the vendor\n(constant.ExpenseItemPaidWith*). Required on every write since v1.2;\nrows written before then carry NULL and read back as null.","enum":["cash","personal_card","personal_transfer","company_card"],"example":"cash","type":"string"},"tripDestination":{"maxLength":255,"type":"string"},"tripPurpose":{"maxLength":255,"type":"string"},"vatAmount":{"minimum":0,"type":"number"},"vendorName":{"maxLength":255,"type":"string"}},"required":["amount","categoryId","currencyCode","expenseDate","paidWith"],"type":"object"},"dto.InitialStockRequest":{"properties":{"date":{"type":"string"},"quantity":{"minimum":0.01,"type":"number"},"unitCost":{"minimum":0,"type":"number"}},"required":["date"],"type":"object"},"dto.OrganizationAddress":{"properties":{"alley":{"example":"สุขุมวิท 21","type":"string"},"building":{"example":"อาคารเอ ชั้น 5","type":"string"},"district":{"example":"วัฒนา","type":"string"},"geo":{"$ref":"#/definitions/dto.OrganizationAddressGeo"},"houseNo":{"example":"99/1","type":"string"},"junction":{"example":"","type":"string"},"postcode":{"example":10110,"type":"integer"},"province":{"example":"กรุงเทพมหานคร","type":"string"},"road":{"example":"สุขุมวิท","type":"string"},"subDistrict":{"example":"คลองเตยเหนือ","type":"string"},"villageNo":{"example":"5","type":"string"}},"type":"object"},"dto.OrganizationAddressGeo":{"properties":{"latitude":{"example":13.7367,"type":"number"},"longitude":{"example":100.5605,"type":"number"},"placeId":{"example":"ChIJ...","type":"string"}},"type":"object"},"dto.OrganizationResponse":{"properties":{"activationDate":{"type":"string"},"address":{"$ref":"#/definitions/dto.OrganizationAddress"},"countryCode":{"type":"string"},"createdAt":{"type":"integer"},"currencyCode":{"type":"string"},"hasTaxId":{"description":"HasTaxID (ABSERP-881): whether the organization has a tax id the way the\n50 ทวิ check reads it (tax_id, then juristic_id, trimmed). The 50 ทวิ pages\nwarn on false; the API refuses to generate, send or sign one.","type":"boolean"},"id":{"type":"integer"},"isActive":{"type":"boolean"},"logoUrl":{"type":"string"},"name":{"type":"string"},"nameEn":{"description":"NameEn (ABSERP-607): the optional English name. null = not set.","type":"string"},"owner":{"type":"string"},"standardVatRate":{"description":"StandardVatRate (ABSERP-942): the percent a registered organization\ncharges on a sales document by default. One source for the API and the\nweb form (constant.SalesStandardVatRate).","type":"number"},"subscriptionPlan":{"type":"string"},"taxAddress":{"type":"string"},"taxBranchCode":{"type":"string"},"taxId":{"description":"ABSERP-539: seller details printed on a tax invoice. null = not\nfilled in yet; taxBranchCode null or \"00000\" = head office.","type":"string"},"timezone":{"type":"string"},"timezoneChoices":{"description":"ABSERP-874: the zones of the stored country (never null), whether\nthe stored timezone still has to be chosen among them (several\nzones and the stored one is not one of them), and the stored\nzone's offset right now, e.g. \"+07:00\".","items":{"type":"string"},"type":"array"},"timezoneOffset":{"example":"+07:00","type":"string"},"timezoneSelectionRequired":{"type":"boolean"},"updatedAt":{"type":"integer"},"vatRegistered":{"description":"VatRegistered (ABSERP-897): จด VAT. false = documents carry no VAT and IV/CS\nnever print \"ใบกำกับภาษี\". VatRegisteredAt: unix seconds it was last switched\non (null = never, or classified by the migration backfill).","type":"boolean"},"vatRegisteredAt":{"type":"integer"},"workspaceKey":{"type":"string"}},"type":"object"},"dto.PaginationResponse":{"properties":{"currentPage":{"example":2,"type":"integer"},"nextPage":{"example":3,"type":"integer"},"previousPage":{"example":1,"type":"integer"},"statusAmounts":{"additionalProperties":{"type":"number"},"description":"StatusAmounts is the money counterpart of StatusCounts, set by the\nexpense claim list only: the sum of total_amount per status.","type":"object"},"statusCounts":{"additionalProperties":{"type":"integer"},"description":"StatusCounts is set only by the request lists that show a per-status\ntab or tile (OT, day exchange, shift swap; ABSERP-799). It counts the\nwhole filtered set per status with the status filter left out, so a\ntab's number never depends on how many rows the page loaded.","type":"object"},"totalPages":{"example":10,"type":"integer"},"totalRows":{"example":100,"type":"integer"}},"type":"object"},"dto.ProductAltUnitRequest":{"properties":{"barcode":{"maxLength":100,"type":"string"},"purchasePrice":{"minimum":0,"type":"number"},"ratio":{"minimum":0.0001,"type":"number"},"salePrice":{"minimum":0,"type":"number"},"unit":{"maxLength":100,"type":"string"}},"required":["unit"],"type":"object"},"dto.ProductAltUnitResponse":{"properties":{"barcode":{"type":"string"},"id":{"type":"integer"},"purchasePrice":{"type":"number"},"ratio":{"type":"number"},"salePrice":{"type":"number"},"sortOrder":{"type":"integer"},"unit":{"type":"string"}},"type":"object"},"dto.ProductImageResponse":{"properties":{"id":{"type":"integer"},"sortOrder":{"type":"integer"},"url":{"type":"string"}},"type":"object"},"dto.ProductResponse":{"properties":{"altUnits":{"items":{"$ref":"#/definitions/dto.ProductAltUnitResponse"},"type":"array"},"avgCost":{"type":"number"},"backorderQty":{"description":"open backorders org-wide, base units (ABSERP-897)","type":"number"},"barcode":{"type":"string"},"category":{"type":"string"},"code":{"type":"string"},"costPrice":{"type":"number"},"createdAt":{"type":"integer"},"deletedAt":{"type":"integer"},"description":{"type":"string"},"displayCost":{"description":"list shows + sorts by it: avg cost when the scope (selected warehouse or all) has stock, else costPrice (ABSERP-941)","type":"number"},"displayCostSource":{"description":"\"average\" | \"set\" (typed costPrice; display only)","type":"string"},"expenseAccount":{"type":"string"},"id":{"type":"integer"},"images":{"items":{"$ref":"#/definitions/dto.ProductImageResponse"},"type":"array"},"incomeAccount":{"type":"string"},"isActive":{"type":"boolean"},"name":{"type":"string"},"productType":{"type":"string"},"purchaseDescription":{"type":"string"},"purchaseVatType":{"type":"string"},"reorderPoint":{"type":"number"},"salePrice":{"type":"number"},"stockBalances":{"items":{"$ref":"#/definitions/dto.StockBalanceByWarehouse"},"type":"array"},"stockMovements":{"items":{"$ref":"#/definitions/dto.StockMovementResponse"},"type":"array"},"stockQty":{"type":"number"},"stockValue":{"type":"number"},"taxRate":{"type":"number"},"unit":{"type":"string"},"updatedAt":{"type":"integer"},"vatType":{"type":"string"},"warehouseMinQtys":{"items":{"$ref":"#/definitions/dto.WarehouseMinQtyResponse"},"type":"array"}},"type":"object"},"dto.PurchaseItemRequest":{"properties":{"accountId":{"type":"integer"},"description":{"maxLength":500,"type":"string"},"discountPercent":{"maximum":100,"minimum":0,"type":"number"},"productAltUnitId":{"description":"ProductAltUnitID selects one of the product's alternative units of\nmeasure (product_alt_units). Absent/null means the product's base\nunit. When set, Quantity is expressed in that alt unit and is\nconverted to base units (× ratio) before any stock movement.","type":"integer"},"productId":{"type":"integer"},"quantity":{"type":"number"},"refItemId":{"description":"RefItemID (GR only, ABSERP-897): the PO line (purchase_items.id) this GR line\nreceives. Must belong to the GR's refDocId purchase order.","type":"integer"},"taxRate":{"maximum":100,"minimum":0,"type":"number"},"unit":{"maxLength":20,"type":"string"},"unitPrice":{"minimum":0,"type":"number"},"whtRate":{"description":"WhtRate (ABSERP-946 B2): withholding tax (%) on this line, applied to the line\namount before VAT. 0 = none. Ignored on a payment voucher, whose own header\ncarries the WHT.","maximum":100,"minimum":0,"type":"number"}},"required":["description","quantity","unit"],"type":"object"},"dto.ReceivableLineItem":{"properties":{"description":{"type":"string"},"discount":{"description":"discount percent of the PO line","type":"number"},"ordered":{"type":"number"},"poItemId":{"type":"integer"},"productAltUnitId":{"type":"integer"},"productId":{"type":"integer"},"received":{"type":"number"},"remaining":{"type":"number"},"taxRate":{"type":"number"},"unit":{"type":"string"},"unitPrice":{"type":"number"}},"type":"object"},"dto.ReceivableLinesResponse":{"properties":{"currency":{"type":"string"},"lines":{"items":{"$ref":"#/definitions/dto.ReceivableLineItem"},"type":"array"},"poId":{"type":"integer"},"vendorId":{"type":"integer"}},"type":"object"},"dto.SalesBackorderResponse":{"properties":{"productId":{"type":"integer"},"productName":{"type":"string"},"qtyOpen":{"type":"number"},"qtyOriginal":{"type":"number"},"status":{"description":"open | fulfilled | cancelled","type":"string"},"warehouseId":{"type":"integer"}},"type":"object"},"dto.SalesDocumentPDFData":{"properties":{"document":{"$ref":"#/definitions/dto.SalesDocumentResponse"},"organizationLogo":{"type":"string"},"organizationName":{"type":"string"},"refDocument":{"$ref":"#/definitions/dto.SalesDocumentRef","description":"RefDocument (ABSERP-942, credit / debit notes): the tax invoice the note adjusts,\nas the printed note must name it. Null for other documents or when it is gone."},"seller":{"$ref":"#/definitions/dto.SalesDocumentSeller"}},"type":"object"},"dto.SalesDocumentPaginationResponse":{"properties":{"items":{"items":{"$ref":"#/definitions/dto.SalesDocumentResponse"},"type":"array"},"pagination":{"$ref":"#/definitions/dto.PaginationResponse"}},"type":"object"},"dto.SalesDocumentRef":{"properties":{"documentNumber":{"type":"string"},"documentType":{"type":"string"},"issueDate":{"description":"YYYY-MM-DD","type":"string"}},"type":"object"},"dto.SalesDocumentResponse":{"properties":{"backorders":{"description":"every backorder row of the document, any status","items":{"$ref":"#/definitions/dto.SalesBackorderResponse"},"type":"array"},"bankId":{"description":"money account the payment moved through; null = organization default","type":"integer"},"bankKind":{"description":"cash | bank | e_wallet, so the UI can pick the right icon without a second fetch","type":"string"},"bankName":{"description":"that money account's display name, joined from `bank`; null when BankID is null or the row is gone","type":"string"},"branchId":{"description":"issuing branch (ABSERP-878); null = head office / default","type":"integer"},"canConvert":{"type":"boolean"},"contactAddress":{"type":"string"},"contactBranchCode":{"type":"string"},"contactBranchName":{"type":"string"},"contactBranchType":{"description":"head_office | branch; \"\" when the document has no contact (ABSERP-539)","type":"string"},"contactBusinessType":{"description":"corporation | individual; \"\" when the document has no contact (ABSERP-539)","type":"string"},"contactId":{"type":"integer"},"contactName":{"type":"string"},"contactPerson":{"type":"string"},"contactTaxId":{"type":"string"},"correctAmount":{"type":"number"},"createdAt":{"type":"integer"},"currency":{"type":"string"},"depositOutstandingAmount":{"description":"The part of it still available to net against a future conversion. QT/SO only.","type":"number"},"depositReceivedAmount":{"description":"VAT-inclusive total ever received against this document. QT/SO only.","type":"number"},"differenceAmount":{"type":"number"},"discountAmount":{"type":"number"},"documentNumber":{"type":"string"},"documentType":{"type":"string"},"dueDate":{"type":"string"},"grandTotal":{"type":"number"},"hasBackorder":{"description":"an open backorder exists (ABSERP-897)","type":"boolean"},"id":{"type":"integer"},"issueDate":{"type":"string"},"items":{"items":{"$ref":"#/definitions/dto.SalesItemResponse"},"type":"array"},"note":{"type":"string"},"originalAmount":{"type":"number"},"outstandingAmount":{"type":"number"},"paidAmount":{"type":"number"},"project":{"type":"string"},"projectId":{"type":"integer"},"reasonCode":{"description":"ABSERP-942 (D5), credit / debit notes: the reason, and the value of the referenced\ntax invoice before VAT, the correct value after the note, and their difference\n(the note's own amount before VAT, signed: negative for a credit note).","type":"string"},"reasonText":{"type":"string"},"refDocumentId":{"type":"integer"},"restock":{"description":"credit note only: goods come back into stock (ABSERP-897)","type":"boolean"},"salesperson":{"type":"string"},"salespersonEmployeeId":{"type":"integer"},"signState":{"description":"signing state: null = draft | awaiting_signature | signed | issued | void (ABSERP-496)","type":"string"},"status":{"type":"string"},"subtotalAmount":{"type":"number"},"taxInvoice":{"description":"ABSERP-897: is_tax_invoice snapshot, else IV/CS of a VAT registered org; \"ใบกำกับภาษี\" title only when true","type":"boolean"},"totalAmount":{"type":"number"},"updatedAt":{"type":"integer"},"vatAmount":{"type":"number"},"vatInclusive":{"type":"boolean"},"vatRate":{"type":"number"},"warehouseId":{"type":"integer"},"whtAmount":{"type":"number"},"whtManual":{"type":"boolean"},"whtRate":{"type":"number"}},"type":"object"},"dto.SalesDocumentSeller":{"properties":{"address":{"type":"string"},"branchCode":{"description":"5 digits; null when IsHeadOffice","type":"string"},"branchName":{"description":"BranchName is the resolved branch's name; null for an org without a\nhead office row (legacy orgs whose tax branch code was not 00000).","example":"Head office","type":"string"},"contacts":{"description":"Contacts are the branch channels marked showOnDocuments (never null).","items":{"$ref":"#/definitions/dto.SalesDocumentSellerContact"},"type":"array"},"isHeadOffice":{"description":"true when the branch code is unset or 00000","type":"boolean"},"name":{"type":"string"},"taxId":{"type":"string"}},"type":"object"},"dto.SalesDocumentSellerContact":{"properties":{"channel":{"example":"phone","type":"string"},"display":{"example":"+66 21234567","type":"string"},"href":{"example":"tel:+6621234567","type":"string"},"label":{"example":"Office","type":"string"}},"type":"object"},"dto.SalesItemRequest":{"properties":{"description":{"maxLength":500,"type":"string"},"discountAmount":{"minimum":0,"type":"number"},"discountPercent":{"maximum":100,"minimum":0,"type":"number"},"name":{"maxLength":255,"type":"string"},"productAltUnitId":{"description":"ProductAltUnitID selects one of the product's alternative units of\nmeasure (product_alt_units). Absent/null means the product's base\nunit. When set, Quantity is expressed in that alt unit and is\nconverted to base units (× ratio) before any stock movement.","type":"integer"},"productId":{"type":"integer"},"quantity":{"type":"number"},"remark":{"type":"string"},"sortOrder":{"type":"integer"},"taxType":{"description":"TaxType (ABSERP-942): \"vat\" (the document rate, the default), \"zero\" or \"exempt\".","enum":["vat","zero","exempt"],"type":"string"},"unit":{"type":"string"},"unitPrice":{"minimum":0,"type":"number"},"whtRate":{"description":"WhtRate (ABSERP-942): withholding tax percent of this line; absent / 0 = none.","maximum":15,"minimum":0,"type":"number"}},"required":["name","quantity"],"type":"object"},"dto.SalesItemResponse":{"properties":{"backorderQty":{"description":"BackorderQty is the open backorder (base units) attributed to this line: the\nproduct's open backorder is handed to its lines in order (ABSERP-897).","type":"number"},"description":{"type":"string"},"discountAmount":{"type":"number"},"discountPercent":{"type":"number"},"id":{"type":"integer"},"name":{"type":"string"},"productAltUnitId":{"type":"integer"},"productId":{"type":"integer"},"quantity":{"type":"number"},"remark":{"type":"string"},"sortOrder":{"type":"integer"},"taxType":{"description":"TaxType / WhtRate (ABSERP-942): the line's VAT treatment and withholding percent.","type":"string"},"totalPrice":{"type":"number"},"unit":{"type":"string"},"unitPrice":{"type":"number"},"whtRate":{"type":"number"}},"type":"object"},"dto.StockBalanceByWarehouse":{"properties":{"averageCost":{"type":"number"},"backorderQty":{"description":"BackorderQty: open backorders of this product in this warehouse (base\nunits, ABSERP-897).","type":"number"},"quantity":{"type":"number"},"totalValue":{"type":"number"},"warehouseId":{"type":"integer"},"warehouseName":{"type":"string"}},"type":"object"},"dto.StockMovementResponse":{"properties":{"avgCostAfter":{"type":"number"},"avgCostBefore":{"type":"number"},"createdAt":{"type":"integer"},"createdBy":{"type":"integer"},"fromWarehouseId":{"type":"integer"},"fromWarehouseName":{"type":"string"},"id":{"type":"integer"},"movementType":{"type":"string"},"note":{"type":"string"},"qtyAfter":{"type":"number"},"qtyBefore":{"type":"number"},"quantity":{"type":"number"},"referenceId":{"type":"integer"},"referenceNumber":{"description":"source document number, null when unknown (ABSERP-941)","type":"string"},"referenceType":{"type":"string"},"toWarehouseId":{"type":"integer"},"toWarehouseName":{"type":"string"},"totalCost":{"type":"number"},"unitCost":{"type":"number"},"warehouseId":{"type":"integer"},"warehouseName":{"type":"string"}},"type":"object"},"dto.SuccessResponse":{"properties":{"data":{},"message":{"example":"OK","type":"string"},"success":{"example":true,"type":"boolean"}},"type":"object"},"dto.UpdateExpenseClaimRequest":{"properties":{"note":{"description":"Note is the claimant's free-text message to the approver.","maxLength":2000,"type":"string"},"reimbursementMethod":{"description":"ReimbursementMethod is how the claimant wants to be paid back\n(constant.ExpenseClaimReimbursementMethods). It is a preference the\nrecord-payment dialog defaults to, not what was actually paid.","enum":["bank_transfer","promptpay","cash"],"example":"bank_transfer","type":"string"},"title":{"maxLength":255,"type":"string"}},"type":"object"},"dto.UpdateProductRequest":{"properties":{"altUnits":{"items":{"$ref":"#/definitions/dto.ProductAltUnitRequest"},"type":"array"},"barcode":{"maxLength":100,"type":"string"},"category":{"maxLength":100,"type":"string"},"costPrice":{"minimum":0,"type":"number"},"description":{"type":"string"},"expenseAccount":{"maxLength":100,"type":"string"},"incomeAccount":{"maxLength":100,"type":"string"},"initialStock":{"$ref":"#/definitions/dto.InitialStockRequest"},"isActive":{"type":"boolean"},"name":{"maxLength":255,"type":"string"},"productType":{"enum":["service","nonInventory","inventory"],"type":"string"},"purchaseDescription":{"type":"string"},"purchaseVatType":{"enum":["vatExclusive","vatInclusive","zeroVat","noVat"],"type":"string"},"reorderPoint":{"minimum":0,"type":"number"},"salePrice":{"minimum":0,"type":"number"},"taxRate":{"maximum":100,"minimum":0,"type":"number"},"unit":{"maxLength":100,"type":"string"},"vatType":{"enum":["vatExclusive","vatInclusive","zeroVat","noVat"],"type":"string"}},"type":"object"},"dto.UpdatePurchaseDocRequest":{"properties":{"bankId":{"description":"BankID follows CreatePurchaseDocRequest.BankID: PV only, 400 on any other\ndoc type. Absent leaves the stored choice untouched.","type":"integer"},"branchId":{"description":"draft only; absent keeps, null = head office, a number chooses that branch (ABSERP-878)","type":"integer"},"buyerId":{"type":"integer"},"contactId":{"type":"integer"},"docDate":{"type":"integer"},"dueDate":{"type":"integer"},"exchangeRate":{"type":"number"},"internalNotes":{"type":"string"},"items":{"items":{"$ref":"#/definitions/dto.PurchaseItemRequest"},"minItems":1,"type":"array"},"notes":{"type":"string"},"projectId":{"type":"integer"},"referenceNo":{"description":"ReferenceNo: absent keeps, \"\" clears. ProjectID / BuyerID: absent keeps, null clears,\na number sets. ExchangeRate: absent keeps.","maxLength":100,"type":"string"},"supplierInvoiceDate":{"type":"integer"},"supplierInvoiceNo":{"description":"SupplierInvoiceNo / SupplierInvoiceDate: absent keeps the stored value.","maxLength":50,"type":"string"},"vatMode":{"description":"VatMode: absent keeps the stored mode. Changing it needs the lines in the\nsame request, because every line total and the header totals depend on it.","enum":["exclusive","inclusive","none"],"type":"string"},"warehouseId":{"description":"WarehouseID follows CreatePurchaseDocRequest.WarehouseID (GR/PO). Absent leaves\nthe stored choice untouched.","type":"integer"},"whtAmount":{"minimum":0,"type":"number"},"whtRate":{"maximum":100,"minimum":0,"type":"number"},"whtSection":{"maxLength":50,"type":"string"}},"type":"object"},"dto.UpdateSalesDocumentRequest":{"properties":{"bankId":{"description":"BankID follows CreateSalesDocumentRequest.BankID: RE/CS only, 400 on\nany other type. Absent leaves the stored choice untouched.","type":"integer"},"branchId":{"description":"draft only; absent keeps, null = head office, a number chooses that branch (ABSERP-878)","type":"integer"},"contactId":{"type":"integer"},"currency":{"type":"string"},"discountAmount":{"minimum":0,"type":"number"},"documentType":{"enum":["QT","SO","IV","RE","CS","CN","DN"],"type":"string"},"dueDate":{"type":"string"},"id":{"type":"integer"},"issueDate":{"type":"string"},"items":{"items":{"$ref":"#/definitions/dto.SalesItemRequest"},"minItems":1,"type":"array"},"note":{"type":"string"},"project":{"maxLength":255,"type":"string"},"projectId":{"type":"integer"},"reasonCode":{"maxLength":40,"type":"string"},"reasonText":{"maxLength":500,"type":"string"},"refDocumentId":{"description":"RefDocumentID / ReasonCode / ReasonText follow CreateSalesDocumentRequest (draft notes only).\nAbsent leaves the stored value.","type":"integer"},"restock":{"description":"Restock follows CreateSalesDocumentRequest.Restock (CN only). Absent leaves it.","type":"boolean"},"salesperson":{"maxLength":255,"type":"string"},"salespersonEmployeeId":{"description":"SalespersonEmployeeID picks an employee; the name is stored with the document (Salesperson text\ntyped alongside wins, so a nickname can be used).","type":"integer"},"vatInclusive":{"description":"VatInclusive follows CreateSalesDocumentRequest.VatInclusive. Absent leaves the stored flag.","type":"boolean"},"vatRate":{"minimum":0,"type":"number"},"warehouseId":{"type":"integer"},"whtAmount":{"minimum":0,"type":"number"},"whtManual":{"description":"WhtManual follows CreateSalesDocumentRequest.WhtManual. Absent leaves the stored flag.","type":"boolean"},"whtRate":{"maximum":100,"minimum":0,"type":"number"}},"required":["id"],"type":"object"},"dto.UpdateSalesDocumentStatusRequest":{"properties":{"confirmNegativeStock":{"description":"ConfirmNegativeStock is a per-request override for the \"warn\"\nnegative-stock policy. It MUST be a non-pointer bool: an absent flag\nbinds to false and must never be interpretable as a sticky override.\nIt applies only to this single request — the backend keeps no\n\"already acknowledged\" memory (see products-setting plan §5.3 step 4).","type":"boolean"},"id":{"type":"integer"},"remark":{"type":"string"},"status":{"type":"string"}},"required":["id","status"],"type":"object"},"dto.ValidationErrorDetail":{"properties":{"field":{"example":"ID","type":"string"},"message":{"example":"Key: 'Member.ID' Error:Field validation for 'ID' failed on the 'required' tag","type":"string"},"tag":{"example":"required","type":"string"}},"type":"object"},"dto.WarehouseMinQtyResponse":{"properties":{"createdAt":{"type":"integer"},"minQty":{"type":"number"},"updatedAt":{"type":"integer"},"warehouseId":{"type":"integer"},"warehouseName":{"type":"string"}},"type":"object"}},"host":"api-dev.abserp.app","info":{"contact":{},"description":"ABSERP Open API — เชื่อมต่อระบบภายนอกเข้ากับข้อมูลขององค์กรคุณด้วย API key เดียว (ใบเสนอราคา ใบกำกับภาษี ใบสั่งซื้อ สินค้า ผู้ติดต่อ และบัญชีแยกประเภท) / Integrate external systems with your organization's ABSERP data using a single per-organization API key.","title":"ABSERP Open API","version":"dev-d87a25c9"},"paths":{"/openapi/v1/chart-of-accounts":{"get":{"parameters":[{"description":"Filter by account type (ASSET|LIABILITY|EQUITY|REVENUE|EXPENSE)","in":"query","name":"accountType","type":"string"},{"description":"Filter by active status","in":"query","name":"isActive","type":"boolean"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get chart of accounts","tags":["ChartOfAccount"]}},"/openapi/v1/company":{"get":{"description":"Besides the profile it returns timezoneChoices (zones of the stored country), timezoneSelectionRequired (the country has several zones and the stored timezone is not one of them) and timezoneOffset (offset of the stored zone now, e.g. +07:00) (ABSERP-874).","parameters":[{"description":"Accept-Language header","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.OrganizationResponse"}},"400":{"description":"BadRequest","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"404":{"description":"NotFound","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get Organization By ID Endpoint","tags":["Organization"]}},"/openapi/v1/contacts":{"get":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Search name, code, or tax ID","in":"query","name":"search","type":"string"},{"description":"Filter by client flag","in":"query","name":"isClient","type":"boolean"},{"description":"Filter by supplier flag","in":"query","name":"isSupplier","type":"boolean"},{"description":"Filter by active status","in":"query","name":"isActive","type":"boolean"},{"description":"Page number","in":"query","name":"page","type":"integer"},{"description":"Page size","in":"query","name":"limit","type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ContactPaginationResponse"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"List contacts","tags":["Contacts"]},"post":{"consumes":["multipart/form-data"],"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"in":"formData","maxLength":100,"name":"accountBranch","type":"string"},{"in":"formData","maxLength":20,"name":"accountBranchCode","type":"string"},{"in":"formData","maxLength":255,"name":"accountName","type":"string"},{"in":"formData","maxLength":50,"name":"accountNo","type":"string"},{"in":"formData","name":"accountType","type":"integer"},{"in":"formData","name":"address","type":"string"},{"in":"formData","name":"avatarUrl","type":"string"},{"in":"formData","maxLength":500,"name":"bankAddress","type":"string"},{"in":"formData","maxLength":100,"name":"bankCompany","type":"string"},{"in":"formData","maxLength":10,"name":"branchCode","type":"string"},{"in":"formData","maxLength":100,"name":"branchName","type":"string"},{"enum":["head_office","branch"],"in":"formData","name":"branchType","type":"string"},{"enum":["corporation","individual"],"in":"formData","name":"businessType","type":"string"},{"in":"formData","maxLength":255,"name":"contactName","type":"string"},{"enum":["client","supplier","both"],"in":"formData","name":"contactType","required":true,"type":"string"},{"description":"CountryCode is ISO 3166-1 alpha-2 (TH = Thai); absent keeps TH on create and the stored value on update (ABSERP-946).","in":"formData","name":"countryCode","type":"string"},{"in":"formData","name":"creditDays","type":"integer"},{"in":"formData","minimum":0,"name":"creditLimit","type":"number"},{"in":"formData","name":"currency","type":"string"},{"in":"formData","maxLength":100,"name":"discordID","type":"string"},{"in":"formData","maxLength":191,"name":"email","type":"string"},{"in":"formData","maxLength":30,"name":"fax","type":"string"},{"in":"formData","name":"isForeign","type":"boolean"},{"in":"formData","maxLength":100,"name":"lineID","type":"string"},{"in":"formData","maxLength":255,"name":"name","required":true,"type":"string"},{"in":"formData","name":"paymentTermDays","type":"integer"},{"in":"formData","maxLength":30,"name":"phone","type":"string"},{"in":"formData","maxLength":10,"name":"postalCode","type":"string"},{"in":"formData","name":"remark","type":"string"},{"in":"formData","name":"shippingInfo","type":"string"},{"in":"formData","maxLength":11,"name":"swiftCode","type":"string"},{"in":"formData","maxLength":20,"name":"taxID","type":"string"},{"in":"formData","maxLength":100,"name":"telegram","type":"string"},{"in":"formData","maxLength":255,"name":"website","type":"string"},{"in":"formData","maxLength":100,"name":"whatsappID","type":"string"}],"produces":["application/json"],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.ContactResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"409":{"description":"Conflict","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Create contact","tags":["Contacts"]}},"/openapi/v1/contacts/{id}":{"delete":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Contact ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Delete contact","tags":["Contacts"]},"get":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Contact ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ContactResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get contact by ID","tags":["Contacts"]},"patch":{"consumes":["multipart/form-data"],"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Contact ID","in":"path","name":"id","required":true,"type":"integer"},{"in":"formData","maxLength":100,"name":"accountBranch","type":"string"},{"in":"formData","maxLength":20,"name":"accountBranchCode","type":"string"},{"in":"formData","maxLength":255,"name":"accountName","type":"string"},{"in":"formData","maxLength":50,"name":"accountNo","type":"string"},{"in":"formData","name":"accountType","type":"integer"},{"in":"formData","name":"address","type":"string"},{"in":"formData","maxLength":500,"name":"bankAddress","type":"string"},{"in":"formData","maxLength":100,"name":"bankCompany","type":"string"},{"in":"formData","maxLength":10,"name":"branchCode","type":"string"},{"in":"formData","maxLength":100,"name":"branchName","type":"string"},{"enum":["head_office","branch"],"in":"formData","name":"branchType","type":"string"},{"enum":["corporation","individual"],"in":"formData","name":"businessType","type":"string"},{"in":"formData","maxLength":255,"name":"contactName","type":"string"},{"enum":["client","supplier","both"],"in":"formData","name":"contactType","type":"string"},{"description":"CountryCode is ISO 3166-1 alpha-2 (ABSERP-946); absent keeps the stored value.","in":"formData","name":"countryCode","type":"string"},{"in":"formData","name":"creditDays","type":"integer"},{"in":"formData","minimum":0,"name":"creditLimit","type":"number"},{"in":"formData","name":"currency","type":"string"},{"in":"formData","maxLength":100,"name":"discordID","type":"string"},{"in":"formData","maxLength":191,"name":"email","type":"string"},{"in":"formData","maxLength":30,"name":"fax","type":"string"},{"in":"formData","name":"isActive","type":"boolean"},{"in":"formData","name":"isForeign","type":"boolean"},{"in":"formData","maxLength":100,"name":"lineID","type":"string"},{"in":"formData","maxLength":255,"name":"name","type":"string"},{"in":"formData","name":"paymentTermDays","type":"integer"},{"in":"formData","maxLength":30,"name":"phone","type":"string"},{"in":"formData","maxLength":10,"name":"postalCode","type":"string"},{"in":"formData","name":"remark","type":"string"},{"in":"formData","name":"shippingInfo","type":"string"},{"in":"formData","maxLength":11,"name":"swiftCode","type":"string"},{"in":"formData","maxLength":20,"name":"taxID","type":"string"},{"in":"formData","maxLength":100,"name":"telegram","type":"string"},{"in":"formData","maxLength":255,"name":"website","type":"string"},{"in":"formData","maxLength":100,"name":"whatsappID","type":"string"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Update contact","tags":["Contacts"]}},"/openapi/v1/customers":{"get":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Search name, code, or tax ID","in":"query","name":"search","type":"string"},{"description":"Filter by active status","in":"query","name":"isActive","type":"boolean"},{"description":"Page number","in":"query","name":"page","type":"integer"},{"description":"Page size","in":"query","name":"limit","type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ContactPaginationResponse"}}},"security":[{"ApiKey":[]}],"summary":"List customers (contacts with type=client)","tags":["Customers"]},"post":{"consumes":["multipart/form-data"],"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"in":"formData","maxLength":100,"name":"accountBranch","type":"string"},{"in":"formData","maxLength":20,"name":"accountBranchCode","type":"string"},{"in":"formData","maxLength":255,"name":"accountName","type":"string"},{"in":"formData","maxLength":50,"name":"accountNo","type":"string"},{"in":"formData","name":"accountType","type":"integer"},{"in":"formData","name":"address","type":"string"},{"in":"formData","name":"avatarUrl","type":"string"},{"in":"formData","maxLength":500,"name":"bankAddress","type":"string"},{"in":"formData","maxLength":100,"name":"bankCompany","type":"string"},{"in":"formData","maxLength":10,"name":"branchCode","type":"string"},{"in":"formData","maxLength":100,"name":"branchName","type":"string"},{"enum":["head_office","branch"],"in":"formData","name":"branchType","type":"string"},{"enum":["corporation","individual"],"in":"formData","name":"businessType","type":"string"},{"in":"formData","maxLength":255,"name":"contactName","type":"string"},{"description":"Always \"client\" for this endpoint; any value sent is ignored.","enum":["client","supplier","both"],"in":"formData","name":"contactType","type":"string"},{"description":"CountryCode is ISO 3166-1 alpha-2 (TH = Thai); absent keeps TH on create and the stored value on update (ABSERP-946).","in":"formData","name":"countryCode","type":"string"},{"in":"formData","name":"creditDays","type":"integer"},{"in":"formData","minimum":0,"name":"creditLimit","type":"number"},{"in":"formData","name":"currency","type":"string"},{"in":"formData","maxLength":100,"name":"discordID","type":"string"},{"in":"formData","maxLength":191,"name":"email","type":"string"},{"in":"formData","maxLength":30,"name":"fax","type":"string"},{"in":"formData","name":"isForeign","type":"boolean"},{"in":"formData","maxLength":100,"name":"lineID","type":"string"},{"in":"formData","maxLength":255,"name":"name","required":true,"type":"string"},{"in":"formData","name":"paymentTermDays","type":"integer"},{"in":"formData","maxLength":30,"name":"phone","type":"string"},{"in":"formData","maxLength":10,"name":"postalCode","type":"string"},{"in":"formData","name":"remark","type":"string"},{"in":"formData","name":"shippingInfo","type":"string"},{"in":"formData","maxLength":11,"name":"swiftCode","type":"string"},{"in":"formData","maxLength":20,"name":"taxID","type":"string"},{"in":"formData","maxLength":100,"name":"telegram","type":"string"},{"in":"formData","maxLength":255,"name":"website","type":"string"},{"in":"formData","maxLength":100,"name":"whatsappID","type":"string"}],"produces":["application/json"],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.ContactResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Create customer (contact with type=client)","tags":["Customers"]}},"/openapi/v1/customers/{id}":{"delete":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Contact ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Delete contact","tags":["Contacts"]},"get":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Contact ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ContactResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get contact by ID","tags":["Contacts"]},"patch":{"consumes":["multipart/form-data"],"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Contact ID","in":"path","name":"id","required":true,"type":"integer"},{"in":"formData","maxLength":100,"name":"accountBranch","type":"string"},{"in":"formData","maxLength":20,"name":"accountBranchCode","type":"string"},{"in":"formData","maxLength":255,"name":"accountName","type":"string"},{"in":"formData","maxLength":50,"name":"accountNo","type":"string"},{"in":"formData","name":"accountType","type":"integer"},{"in":"formData","name":"address","type":"string"},{"in":"formData","maxLength":500,"name":"bankAddress","type":"string"},{"in":"formData","maxLength":100,"name":"bankCompany","type":"string"},{"in":"formData","maxLength":10,"name":"branchCode","type":"string"},{"in":"formData","maxLength":100,"name":"branchName","type":"string"},{"enum":["head_office","branch"],"in":"formData","name":"branchType","type":"string"},{"enum":["corporation","individual"],"in":"formData","name":"businessType","type":"string"},{"in":"formData","maxLength":255,"name":"contactName","type":"string"},{"enum":["client","supplier","both"],"in":"formData","name":"contactType","type":"string"},{"description":"CountryCode is ISO 3166-1 alpha-2 (ABSERP-946); absent keeps the stored value.","in":"formData","name":"countryCode","type":"string"},{"in":"formData","name":"creditDays","type":"integer"},{"in":"formData","minimum":0,"name":"creditLimit","type":"number"},{"in":"formData","name":"currency","type":"string"},{"in":"formData","maxLength":100,"name":"discordID","type":"string"},{"in":"formData","maxLength":191,"name":"email","type":"string"},{"in":"formData","maxLength":30,"name":"fax","type":"string"},{"in":"formData","name":"isActive","type":"boolean"},{"in":"formData","name":"isForeign","type":"boolean"},{"in":"formData","maxLength":100,"name":"lineID","type":"string"},{"in":"formData","maxLength":255,"name":"name","type":"string"},{"in":"formData","name":"paymentTermDays","type":"integer"},{"in":"formData","maxLength":30,"name":"phone","type":"string"},{"in":"formData","maxLength":10,"name":"postalCode","type":"string"},{"in":"formData","name":"remark","type":"string"},{"in":"formData","name":"shippingInfo","type":"string"},{"in":"formData","maxLength":11,"name":"swiftCode","type":"string"},{"in":"formData","maxLength":20,"name":"taxID","type":"string"},{"in":"formData","maxLength":100,"name":"telegram","type":"string"},{"in":"formData","maxLength":255,"name":"website","type":"string"},{"in":"formData","maxLength":100,"name":"whatsappID","type":"string"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Update contact","tags":["Contacts"]}},"/openapi/v1/expense-categories":{"get":{"parameters":[{"description":"Filter by active flag","in":"query","name":"isActive","type":"boolean"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}}},"security":[{"ApiKey":[]}],"summary":"List the organization's expense categories","tags":["ExpenseCategory"]}},"/openapi/v1/expense-claims":{"get":{"description":"Approver-side list: only the claims of members the caller may approve expense claims for (request.expense:approve at org or team scope, the team-manager overlay for the managed team, owner/admin everything). 403 for a caller with no such coverage, including a holder of another type's approve key only. Own claims: GET /expense-claims/my.","parameters":[{"description":"Status filter","in":"query","name":"status","type":"string"},{"description":"Claimant membership ID","in":"query","name":"membershipId","type":"integer"},{"description":"Category ID present on a claim line","in":"query","name":"categoryId","type":"integer"},{"description":"Created from (unix)","in":"query","name":"fromDate","type":"integer"},{"description":"Created to (unix)","in":"query","name":"toDate","type":"integer"},{"description":"Search claim number or title","in":"query","name":"search","type":"string"},{"description":"Page","in":"query","name":"page","type":"integer"},{"description":"Limit","in":"query","name":"limit","type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"List expense claims across the organization (admin/owner)","tags":["ExpenseClaim"]},"post":{"parameters":[{"description":"Request payload","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/dto.CreateExpenseClaimRequest"}}],"produces":["application/json"],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Create an expense claim (draft)","tags":["ExpenseClaim"]}},"/openapi/v1/expense-claims/{id}":{"get":{"parameters":[{"description":"Claim ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get an expense claim by ID","tags":["ExpenseClaim"]},"patch":{"parameters":[{"description":"Claim ID","in":"path","name":"id","required":true,"type":"integer"},{"description":"Request payload","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/dto.UpdateExpenseClaimRequest"}}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Update an editable expense claim header","tags":["ExpenseClaim"]}},"/openapi/v1/journal-entries":{"get":{"parameters":[{"description":"Filter by reference type (GR|PI|PV|MANUAL|...)","in":"query","name":"referenceType","type":"string"},{"description":"Filter from entry date (YYYY-MM-DD)","in":"query","name":"fromDate","type":"string"},{"description":"Filter to entry date (YYYY-MM-DD)","in":"query","name":"toDate","type":"string"},{"description":"Page number","in":"query","name":"page","type":"integer"},{"description":"Page size","in":"query","name":"limit","type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get journal entries","tags":["JournalEntry"]},"post":{"parameters":[{"description":"Request payload","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/dto.CreateJournalEntryRequest"}}],"produces":["application/json"],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Create manual journal entry","tags":["JournalEntry"]}},"/openapi/v1/journal-entries/{id}":{"get":{"parameters":[{"description":"Journal entry ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get journal entry by ID","tags":["JournalEntry"]}},"/openapi/v1/products":{"get":{"parameters":[{"description":"Search","in":"query","name":"search","type":"string"},{"description":"Category ID","in":"query","name":"categoryId","type":"integer"},{"description":"Filter by product type: service, nonInventory, inventory","in":"query","name":"productType","type":"string"},{"description":"Scope stock quantities to a specific warehouse","in":"query","name":"warehouseId","type":"integer"},{"description":"Active filter","in":"query","name":"isActive","type":"boolean"},{"description":"Sort field: code, cost, stock (default code)","in":"query","name":"sortBy","type":"string"},{"description":"Sort direction: asc, desc (default asc)","in":"query","name":"sortDir","type":"string"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"400":{"description":"InvalidSortField / InvalidSortDirection","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get products","tags":["Product"]},"post":{"parameters":[{"description":"Request payload","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/dto.CreateProductRequest"}}],"produces":["application/json"],"responses":{"201":{"description":"Created","schema":{"allOf":[{"$ref":"#/definitions/dto.SuccessResponse"},{"properties":{"data":{"$ref":"#/definitions/dto.ProductResponse"}},"type":"object"}]}}},"security":[{"ApiKey":[]}],"summary":"Create product","tags":["Product"]}},"/openapi/v1/products/{id}":{"delete":{"parameters":[{"description":"Product ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}}},"security":[{"ApiKey":[]}],"summary":"Delete product","tags":["Product"]},"get":{"parameters":[{"description":"Product ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get product by ID","tags":["Product"]},"patch":{"parameters":[{"description":"Product ID","in":"path","name":"id","required":true,"type":"integer"},{"description":"Request payload","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/dto.UpdateProductRequest"}}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}}},"security":[{"ApiKey":[]}],"summary":"Update product","tags":["Product"]}},"/openapi/v1/purchase/documents":{"get":{"parameters":[{"description":"Document type (PR/PO/GR/PI/PV)","in":"query","name":"docType","type":"string"},{"description":"Vendor ID","in":"query","name":"vendorId","type":"integer"},{"description":"Status","in":"query","name":"status","type":"string"},{"description":"From date (unix)","in":"query","name":"fromDate","type":"integer"},{"description":"To date (unix)","in":"query","name":"toDate","type":"integer"},{"description":"Search","in":"query","name":"search","type":"string"},{"description":"Page","in":"query","name":"page","type":"integer"},{"description":"Limit","in":"query","name":"limit","type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get purchase documents","tags":["Purchase"]},"post":{"parameters":[{"description":"Request payload","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/dto.CreatePurchaseDocRequest"}}],"produces":["application/json"],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Create purchase document (PR/PO/GR/PI/PV)","tags":["Purchase"]}},"/openapi/v1/purchase/documents/{id}":{"delete":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Document ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Delete a draft purchase document","tags":["Purchase"]},"get":{"parameters":[{"description":"Document ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get purchase document by ID","tags":["Purchase"]},"patch":{"parameters":[{"description":"Document ID","in":"path","name":"id","required":true,"type":"integer"},{"description":"Request payload","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/dto.UpdatePurchaseDocRequest"}}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}}},"security":[{"ApiKey":[]}],"summary":"Update purchase document","tags":["Purchase"]}},"/openapi/v1/purchase/documents/{id}/receivable-lines":{"get":{"parameters":[{"description":"Purchase order ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"allOf":[{"$ref":"#/definitions/dto.SuccessResponse"},{"properties":{"data":{"$ref":"#/definitions/dto.ReceivableLinesResponse"}},"type":"object"}]}},"400":{"description":"PurchaseRefDocInvalid: the document is not a purchase order","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Lines of a purchase order still to receive (ABSERP-897)","tags":["Purchase"]}},"/openapi/v1/purchase/documents/{id}/status":{"patch":{"description":"Approval decisions are made by a person in the app, not through an API key: moving a document to `approved` or `rejected` answers 403. Every other transition allowed by the document's status machine (for example issue, send, paid, posted, cancelled) is available.","parameters":[{"description":"Document ID","in":"path","name":"id","required":true,"type":"integer"},{"description":"Request payload","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/dto.ChangePurchaseStatusRequest"}}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}}},"security":[{"ApiKey":[]}],"summary":"Change purchase document status","tags":["Purchase"]}},"/openapi/v1/sales/convert":{"post":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Request payload","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/dto.ConvertSalesDocumentRequest"}}],"produces":["application/json"],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.SalesDocumentResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Convert document (QT→SO/IV/CS, SO→IV, IV→RE/CN/DN)","tags":["Sales"]}},"/openapi/v1/sales/documents":{"get":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Document type: QT | SO | IV | RE","in":"query","name":"type","type":"string"},{"description":"Status filter","in":"query","name":"status","type":"string"},{"description":"Customer ID filter","in":"query","name":"customerId","type":"integer"},{"description":"Issue date from (YYYY-MM-DD)","in":"query","name":"fromDate","type":"string"},{"description":"Issue date to (YYYY-MM-DD)","in":"query","name":"toDate","type":"string"},{"description":"Search document number or customer name","in":"query","name":"search","type":"string"},{"description":"List documents converted from this source document ID","in":"query","name":"refDocumentId","type":"integer"},{"description":"List the consolidated document this source invoice was rolled up into","in":"query","name":"sourceDocumentId","type":"integer"},{"description":"List the source invoices consolidated into this document","in":"query","name":"consolidatedDocumentId","type":"integer"},{"description":"Page number","in":"query","name":"page","type":"integer"},{"description":"Page size","in":"query","name":"limit","type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SalesDocumentPaginationResponse"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"List all sales documents (filter by type, status, date range)","tags":["Sales"]},"post":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Request payload","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/dto.CreateSalesDocumentRequest"}}],"produces":["application/json"],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.SalesDocumentResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Create sales document (documentType: QT | SO | IV | RE)","tags":["Sales"]}},"/openapi/v1/sales/documents/{id}":{"delete":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Document ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"204":{"description":"No Content"},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Delete a draft sales document","tags":["Sales"]},"get":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Document ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SalesDocumentResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get sales document by ID","tags":["Sales"]},"patch":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Document ID","in":"path","name":"id","required":true,"type":"integer"},{"description":"Request payload","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/dto.UpdateSalesDocumentRequest"}}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Update sales document fields (partial update)","tags":["Sales"]}},"/openapi/v1/sales/documents/{id}/print-data":{"get":{"description":"Returns JSON, NOT a file: the full document (header, contact, line items, totals) together with the organization's name and logo and the tax invoice seller block (`seller`: name, taxId, isHeadOffice/branchCode, address — null when not filled in, ABSERP-539; ABSERP-874: resolved from the head office branch with branchName and contacts (only channels marked showOnDocuments), or from the organization columns when the org has no head office) — everything a renderer needs to lay the document out. Producing the PDF itself is the caller's job.","parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Document ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SalesDocumentPDFData"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get the data needed to render a sales document","tags":["Sales"]}},"/openapi/v1/sales/documents/{id}/status":{"patch":{"description":"Approval decisions are made by a person in the app, not through an API key: moving a document to `approved` or `rejected` answers 403. Every other transition allowed by the document's status machine (for example issue, send, paid, posted, cancelled) is available.","parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Document ID","in":"path","name":"id","required":true,"type":"integer"},{"description":"Request payload","in":"body","name":"data","required":true,"schema":{"$ref":"#/definitions/dto.UpdateSalesDocumentStatusRequest"}}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"400":{"description":"SalesTaxProfileRequired (ABSERP-897: a VAT-registered org issuing an IV/CS without seller tax id and/or address; errorInfo.missing = subset of [taxId, address])","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Update document status (e.g. mark as paid, sent, cancelled)","tags":["Sales"]}},"/openapi/v1/vendors":{"get":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Search name, code, or tax ID","in":"query","name":"search","type":"string"},{"description":"Filter by active status","in":"query","name":"isActive","type":"boolean"},{"description":"Page number","in":"query","name":"page","type":"integer"},{"description":"Page size","in":"query","name":"limit","type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ContactPaginationResponse"}}},"security":[{"ApiKey":[]}],"summary":"List vendors (contacts with type=supplier)","tags":["Vendors"]},"post":{"consumes":["multipart/form-data"],"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"in":"formData","maxLength":100,"name":"accountBranch","type":"string"},{"in":"formData","maxLength":20,"name":"accountBranchCode","type":"string"},{"in":"formData","maxLength":255,"name":"accountName","type":"string"},{"in":"formData","maxLength":50,"name":"accountNo","type":"string"},{"in":"formData","name":"accountType","type":"integer"},{"in":"formData","name":"address","type":"string"},{"in":"formData","name":"avatarUrl","type":"string"},{"in":"formData","maxLength":500,"name":"bankAddress","type":"string"},{"in":"formData","maxLength":100,"name":"bankCompany","type":"string"},{"in":"formData","maxLength":10,"name":"branchCode","type":"string"},{"in":"formData","maxLength":100,"name":"branchName","type":"string"},{"enum":["head_office","branch"],"in":"formData","name":"branchType","type":"string"},{"enum":["corporation","individual"],"in":"formData","name":"businessType","type":"string"},{"in":"formData","maxLength":255,"name":"contactName","type":"string"},{"description":"Always \"supplier\" for this endpoint; any value sent is ignored.","enum":["client","supplier","both"],"in":"formData","name":"contactType","type":"string"},{"description":"CountryCode is ISO 3166-1 alpha-2 (TH = Thai); absent keeps TH on create and the stored value on update (ABSERP-946).","in":"formData","name":"countryCode","type":"string"},{"in":"formData","name":"creditDays","type":"integer"},{"in":"formData","minimum":0,"name":"creditLimit","type":"number"},{"in":"formData","name":"currency","type":"string"},{"in":"formData","maxLength":100,"name":"discordID","type":"string"},{"in":"formData","maxLength":191,"name":"email","type":"string"},{"in":"formData","maxLength":30,"name":"fax","type":"string"},{"in":"formData","name":"isForeign","type":"boolean"},{"in":"formData","maxLength":100,"name":"lineID","type":"string"},{"in":"formData","maxLength":255,"name":"name","required":true,"type":"string"},{"in":"formData","name":"paymentTermDays","type":"integer"},{"in":"formData","maxLength":30,"name":"phone","type":"string"},{"in":"formData","maxLength":10,"name":"postalCode","type":"string"},{"in":"formData","name":"remark","type":"string"},{"in":"formData","name":"shippingInfo","type":"string"},{"in":"formData","maxLength":11,"name":"swiftCode","type":"string"},{"in":"formData","maxLength":20,"name":"taxID","type":"string"},{"in":"formData","maxLength":100,"name":"telegram","type":"string"},{"in":"formData","maxLength":255,"name":"website","type":"string"},{"in":"formData","maxLength":100,"name":"whatsappID","type":"string"}],"produces":["application/json"],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.ContactResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Create vendor (contact with type=supplier)","tags":["Vendors"]}},"/openapi/v1/vendors/{id}":{"delete":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Contact ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Delete contact","tags":["Contacts"]},"get":{"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Contact ID","in":"path","name":"id","required":true,"type":"integer"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ContactResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get contact by ID","tags":["Contacts"]},"patch":{"consumes":["multipart/form-data"],"parameters":[{"description":"Accept-Language","enum":["en","th"],"in":"header","name":"Accept-Language","type":"string"},{"description":"Contact ID","in":"path","name":"id","required":true,"type":"integer"},{"in":"formData","maxLength":100,"name":"accountBranch","type":"string"},{"in":"formData","maxLength":20,"name":"accountBranchCode","type":"string"},{"in":"formData","maxLength":255,"name":"accountName","type":"string"},{"in":"formData","maxLength":50,"name":"accountNo","type":"string"},{"in":"formData","name":"accountType","type":"integer"},{"in":"formData","name":"address","type":"string"},{"in":"formData","maxLength":500,"name":"bankAddress","type":"string"},{"in":"formData","maxLength":100,"name":"bankCompany","type":"string"},{"in":"formData","maxLength":10,"name":"branchCode","type":"string"},{"in":"formData","maxLength":100,"name":"branchName","type":"string"},{"enum":["head_office","branch"],"in":"formData","name":"branchType","type":"string"},{"enum":["corporation","individual"],"in":"formData","name":"businessType","type":"string"},{"in":"formData","maxLength":255,"name":"contactName","type":"string"},{"enum":["client","supplier","both"],"in":"formData","name":"contactType","type":"string"},{"description":"CountryCode is ISO 3166-1 alpha-2 (ABSERP-946); absent keeps the stored value.","in":"formData","name":"countryCode","type":"string"},{"in":"formData","name":"creditDays","type":"integer"},{"in":"formData","minimum":0,"name":"creditLimit","type":"number"},{"in":"formData","name":"currency","type":"string"},{"in":"formData","maxLength":100,"name":"discordID","type":"string"},{"in":"formData","maxLength":191,"name":"email","type":"string"},{"in":"formData","maxLength":30,"name":"fax","type":"string"},{"in":"formData","name":"isActive","type":"boolean"},{"in":"formData","name":"isForeign","type":"boolean"},{"in":"formData","maxLength":100,"name":"lineID","type":"string"},{"in":"formData","maxLength":255,"name":"name","type":"string"},{"in":"formData","name":"paymentTermDays","type":"integer"},{"in":"formData","maxLength":30,"name":"phone","type":"string"},{"in":"formData","maxLength":10,"name":"postalCode","type":"string"},{"in":"formData","name":"remark","type":"string"},{"in":"formData","name":"shippingInfo","type":"string"},{"in":"formData","maxLength":11,"name":"swiftCode","type":"string"},{"in":"formData","maxLength":20,"name":"taxID","type":"string"},{"in":"formData","maxLength":100,"name":"telegram","type":"string"},{"in":"formData","maxLength":255,"name":"website","type":"string"},{"in":"formData","maxLength":100,"name":"whatsappID","type":"string"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"403":{"description":"Forbidden","schema":{"$ref":"#/definitions/dto.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/dto.ErrorResponse"}}},"security":[{"ApiKey":[]}],"summary":"Update contact","tags":["Contacts"]}},"/openapi/v1/warehouses":{"get":{"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}}},"security":[{"ApiKey":[]}],"summary":"Get warehouses","tags":["Warehouse"]}}},"schemes":["https"],"securityDefinitions":{"ApiKey":{"description":"Bearer absk_…  (an organization API key, created in Settings → API keys)","in":"header","name":"Authorization","type":"apiKey"}},"swagger":"2.0"}
