{"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"},"createdAt":{"type":"integer"},"createdByName":{"type":"string"},"creditDays":{"type":"integer"},"creditLimit":{"type":"number"},"currency":{"type":"string"},"discordId":{"type":"string"},"email":{"type":"string"},"id":{"type":"integer"},"isActive":{"type":"boolean"},"lineId":{"type":"string"},"name":{"type":"string"},"paymentTermDays":{"type":"integer"},"phone":{"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":{"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":["code","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"},"contactId":{"type":"integer"},"currency":{"type":"string"},"docDate":{"type":"integer"},"docType":{"enum":["PR","PO","GR","PI","PV"],"type":"string"},"dueDate":{"type":"integer"},"internalNotes":{"type":"string"},"items":{"items":{"$ref":"#/definitions/dto.PurchaseItemRequest"},"minItems":1,"type":"array"},"notes":{"type":"string"},"refDocId":{"type":"integer"},"refDocType":{"enum":["PR","PO","GR","PI","PV"],"type":"string"},"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"},"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"},"vatRate":{"minimum":0,"type":"number"},"warehouseId":{"type":"integer"},"whtAmount":{"minimum":0,"type":"number"},"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":{"formattedAddress":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"placeId":{"type":"string"}},"type":"object"},"dto.OrganizationResponse":{"properties":{"activationDate":{"type":"string"},"address":{"$ref":"#/definitions/dto.OrganizationAddress"},"countryCode":{"type":"string"},"createdAt":{"type":"integer"},"currencyCode":{"type":"string"},"id":{"type":"integer"},"isActive":{"type":"boolean"},"logoUrl":{"type":"string"},"missedCheckinAfterMinutes":{"description":"ABSERP-433: the org's reminder delay overrides; null = system\ndefault (NOTIFY_DEFAULT_MISSED_CHECK{IN,OUT}_AFTER_MINUTES, 15/30).","type":"integer"},"missedCheckoutAfterMinutes":{"type":"integer"},"name":{"type":"string"},"owner":{"type":"string"},"subscriptionPlan":{"type":"string"},"timezone":{"type":"string"},"updatedAt":{"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"},"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"},"barcode":{"type":"string"},"category":{"type":"string"},"code":{"type":"string"},"costPrice":{"type":"number"},"createdAt":{"type":"integer"},"deletedAt":{"type":"integer"},"description":{"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"},"taxRate":{"maximum":100,"minimum":0,"type":"number"},"unit":{"maxLength":20,"type":"string"},"unitPrice":{"minimum":0,"type":"number"}},"required":["description","quantity","unit"],"type":"object"},"dto.SalesDocumentPDFData":{"properties":{"document":{"$ref":"#/definitions/dto.SalesDocumentResponse"},"organizationLogo":{"type":"string"},"organizationName":{"type":"string"}},"type":"object"},"dto.SalesDocumentPaginationResponse":{"properties":{"items":{"items":{"$ref":"#/definitions/dto.SalesDocumentResponse"},"type":"array"},"pagination":{"$ref":"#/definitions/dto.PaginationResponse"}},"type":"object"},"dto.SalesDocumentResponse":{"properties":{"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"},"canConvert":{"type":"boolean"},"contactAddress":{"type":"string"},"contactId":{"type":"integer"},"contactName":{"type":"string"},"contactPerson":{"type":"string"},"contactTaxId":{"type":"string"},"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"},"discountAmount":{"type":"number"},"documentNumber":{"type":"string"},"documentType":{"type":"string"},"dueDate":{"type":"string"},"grandTotal":{"type":"number"},"id":{"type":"integer"},"issueDate":{"type":"string"},"items":{"items":{"$ref":"#/definitions/dto.SalesItemResponse"},"type":"array"},"note":{"type":"string"},"outstandingAmount":{"type":"number"},"paidAmount":{"type":"number"},"project":{"type":"string"},"projectId":{"type":"integer"},"refDocumentId":{"type":"integer"},"signState":{"description":"signing state: null = draft | awaiting_signature | signed | issued | void (ABSERP-496)","type":"string"},"status":{"type":"string"},"subtotalAmount":{"type":"number"},"totalAmount":{"type":"number"},"updatedAt":{"type":"integer"},"vatAmount":{"type":"number"},"vatRate":{"type":"number"},"warehouseId":{"type":"integer"},"whtAmount":{"type":"number"},"whtRate":{"type":"number"}},"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"},"unit":{"type":"string"},"unitPrice":{"minimum":0,"type":"number"}},"required":["name","quantity"],"type":"object"},"dto.SalesItemResponse":{"properties":{"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"},"totalPrice":{"type":"number"},"unit":{"type":"string"},"unitPrice":{"type":"number"}},"type":"object"},"dto.StockBalanceByWarehouse":{"properties":{"averageCost":{"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"},"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"},"contactId":{"type":"integer"},"docDate":{"type":"integer"},"dueDate":{"type":"integer"},"internalNotes":{"type":"string"},"items":{"items":{"$ref":"#/definitions/dto.PurchaseItemRequest"},"minItems":1,"type":"array"},"notes":{"type":"string"},"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"},"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"},"vatRate":{"minimum":0,"type":"number"},"warehouseId":{"type":"integer"},"whtAmount":{"minimum":0,"type":"number"},"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.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":"v2.2.15"},"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":{"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"},{"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":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","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"},{"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","name":"isActive","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","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"},{"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":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","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"},{"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","name":"isActive","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","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":{"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"}],"produces":["application/json"],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.SuccessResponse"}}},"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}/status":{"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.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 — 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":{"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":"Bad Request","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"},{"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":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","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"},{"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","name":"isActive","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","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"}
