openapi: 3.0.2
servers:
  - url: https://openapi.flowaccount.com/v1
    description: Production - https://flowaccount.com
  - url: https://openapi.flowaccount.com/test
    description: Sandbox - http://sandbox-new.flowaccount.com
info:
  version: 2-oas3
  title: FlowAccount Open API
#  x-logo:
#    url: img/app-flowaccount.svg
  description: |-
    # Introduction 

    **PostMan Collection** 
      <a href="https://api.postman.com/collections/45983860-979836bd-755e-4f91-8851-b1ae7a231c66?access_key=PMAT-01K1CNK8CM3FASFEGHFQTXQGKK" target="_blank">(Download link)</a>

  termsOfService: https://flowadvance.com/policy/terms-of-use
  contact:
    email: developer_support@flowaccount.com
    url: https://www.flowaccount.com
x-tagGroups:
  - name: Sell Document
    tags:
      - Quotations
      - Billing Notes
      - Tax Invoice
      - Receipt
      - Cash Invoice
  - name: Buy Document
    tags:
      - Purchase Order
      - Receiving Inventory
  - name: Expense Document
    tags:
      - Expenses
      - Withholding Tax
  - name: Journal Entry
    tags:
      - Journal Entry
      - Chart Of Accounts
  - name: Product and Contact
    tags:
      - Product Master
      - Products
      - Contacts
  - name: My Company
    tags:
      - Business Infomation
      - Bank Channel
  - name: Authentication
    tags:
      - Authentication
paths:
  /quotations:
    get:
      tags:
        - Quotations
      summary: Get all quotations documents.
      description: เรียกดูข้อมูลเอกสารใบเสนอราคาทั้งหมดในระบบ
      parameters:
        - in: query
          name: currentPage
          description: 'Query current page document quotations. <br>Example Pattern: <ex>/quotations?currentPage=1 </ex><ex>/quotations?currentPage=1&pageSize=20</ex>'
          schema:
            type: integer
        - in: query
          name: pageSize
          description: 'Query document quotations list amount per page. <br>Example Pattern: <ex> /quotations?pageSize=20 </ex>'
          schema:
            type: integer
        - in: query
          name: searchString
          description: 'Query document by Contact Name or Project Name or Document Serial. <br>Example Pattern: <ex> /quotations?searchString=QT2021010001</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: range
          description: 'Query document range type. <br>0 = all<br>1 = Current Month<br>3 = Previous Month<br>5 = Date Range<br>7 = Current Year<br>9 = Previous Year<br>15 = Fiscal Year<br>Example Query Current Month: <ex> /quotations?pageSize=20&currentPage=1&range=1</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: month
          description: 'Query document by month.<br>Example Query Previous Month: <ex> /quotations?pageSize=20&currentPage=1&range=1&month=5&year=2021</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: year
          description: 'Query document by year.<br>Example Query Previous Year: <ex> /quotations?currentPage=1&pageSize=20&range=9&year=2020</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: startDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /quotations?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: endDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /quotations?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    post:
      tags:
        - Quotations
      summary: Create quotations document.
      description: 'สร้างเอกสารใบเสนอราคา เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รออนุมัติ (awaiting) <br>ข้อมูลการสร้างเอกสารใบเสนอราคา : https://flowaccount.com/ultimateguide/guide/ใบเสนอราคา'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/SimpleDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /quotations/inline:
    post:
      tags:
        - Quotations
      summary: Create quotations document inline discount or inline vat.
      description: 'สร้างเอกสารใบเสนอราคา แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รออนุมัติ (awaiting) <br>ข้อมูลการสร้างเอกสารใบเสนอราคา : https://flowaccount.com/ultimateguide/guide/ใบเสนอราคา'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/InlineDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /quotations/{id}:
    get:
      tags:
        - Quotations
      summary: Get quotations document.
      description: เรียกดูข้อมูลเอกสารใบเสนอราคาตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    put:
      tags:
        - Quotations
      summary: Edit quotations document.
      description: แก้ไขข้อมูลเอกสารใบเสนอราคา ตามเลขที่เอกสารที่ต้องการและเอกสารต้องเป็นสถานะ รออนุมัติ (Awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/UpdateAllDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    delete:
      tags:
        - Quotations
      summary: Delete quotations document.
      description: 'ลบ เอกสารใบเสนอราคาตามเลขที่เอกสารที่ต้องการ <br> ** การลบเอกสาร เอกสารต้องอยู่ในสถานะ รออนุมัติ '
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /quotations/{id}/status/{statusId}:
    post:
      tags:
        - Quotations
      summary: Change status quotations document.
      description: เปลี่ยนสถานะของเอกสารใบเสนอราคา สร้างเอกสารใหม่ครั้งแรกจะได้รับสถานะ รออนุมัติ (awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID เอกสารใช้ recordId
        - name: statusId
          in: path
          required: true
          schema:
            type: string
          description: เปลี่ยนสถานะเอกสารได้ 4 สถานะ <br> awaiting = รออนุมัติ <br> approved = อนุมัติ <br> approvedandprocessed = ดำเนินการแล้ว <br> rejected = ยกเลิก
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /quotations/{id}/attachment:
    post:
      tags:
        - Quotations
      summary: Attachment quotations document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้อง ในเอกสารใบเสนอราคาตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: รูปแบบ file ที่ใช้แนบในเอกสารเป็นแบบ Binary
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /quotations/{id}/attachment/base64:
    post:
      tags: 
        - Quotations
      summary: Base64 attachment quotations document
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้องในรูปแบบ base64 ในเอกสารใบเสนอราคาตามเลขที่เอกสารที่ต้องการ
      parameters: 
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/AttachmentBase64'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentBase64Response'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /quotations/{id}/export-pdf/base64:
    post:
      tags:
        - Quotations
      summary: Export quotation document as PDF
      description: ส่งออกเอกสารใบเสนอราคาเป็นไฟล์ PDF ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการส่งออก
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/ExportPdf'
      responses:
        '200':
          description: PDF content encoded as base64 string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfResponse'
        '400':
          description: 400 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfErrorResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /quotations/email-document:
    post:
      tags:
        - Quotations
      summary: Send email quotations document.
      description: ส่งเอกสารใบเสนอราคา ผ่านทางอีเมล ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEmailResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
      requestBody:
        $ref: '#/components/requestBodies/SendEmailSimple'
  /quotations/sharedocument:
    post:
      tags:
        - Quotations
      summary: Share link quotations document.
      description: แชร์ลิงค์ เอกสารใบเสนอราคาที่ต้องการ จะได้รับลิงค์สำหรับแชร์และเรียกดูเอกสาร
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ShareDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /billing-notes:
    get:
      tags:
        - Billing Notes
      summary: Get all billing notes documents.
      description: เรียกดูข้อมูลเอกสารใบวางบิลทั้งหมดในระบบ
      parameters:
        - in: query
          name: currentPage
          description: 'Query current page document billing notes. <br>Example Pattern: <ex>/billing-notes?currentPage=1 </ex><ex>/billing-notes?currentPage=1&pageSize=20</ex>'
          schema:
            type: integer
        - in: query
          name: pageSize
          description: 'Query document billing notes list amount per page. <br>Example Pattern: <ex> /billing-notes?pageSize=20 </ex>'
          schema:
            type: integer
        - in: query
          name: searchString
          description: 'Query document by Contact Name or Project Name or Document Serial. <br>Example Pattern: <ex> /billing-notes?searchString=BL2021010001</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: range
          description: 'Query document range type. <br>0 = all<br>1 = Current Month<br>3 = Previous Month<br>5 = Date Range<br>7 = Current Year<br>9 = Previous Year<br>15 = Fiscal Year<br>Example Query Current Month: <ex> /billing-notes?pageSize=20&currentPage=1&range=1</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: month
          description: 'Query document by month.<br>Example Query Previous Month: <ex> /billing-notes?pageSize=20&currentPage=1&range=1&month=5&year=2021</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: year
          description: 'Query document by year.<br>Example Query Previous Year: <ex> /billing-notes?currentPage=1&pageSize=20&range=9&year=2020</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: startDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /billing-notes?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: endDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /billing-notes?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    post:
      tags:
        - Billing Notes
      summary: Create billing notes document.
      description: 'สร้างเอกสารใบวางบิล เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอวาบิล (awaiting)
        <br>ข้อมูลการสร้างเอกสารใบวางบิล : https://flowaccount.com/ultimateguide/guide/ใบวางบิล-ใบแจ้งหนี้'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/SimpleDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /billing-notes/inline:
    post:
      tags:
        - Billing Notes
      summary: Create billing notes document inline discount or inline vat.
      description: 'สร้างเอกสารใบวางบิล แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ
        รอวางบิล (awaiting) <br> ข้อมูลการสร้างเอกสารใบวางบิล : https://flowaccount.com/ultimateguide/guide/ใบวางบิล-ใบแจ้งหนี้'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/InlineDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/billing-notes:
    post:
      tags:
        - Billing Notes
      summary: Upgrade quotation document to billing notes document.
      description: 'สร้างเอกสารใบวางบิล เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอวาบิล (awaiting) <br>ข้อมูลการสร้างเอกสารใบวางบิล : https://flowaccount.com/ultimateguide/guide/ใบวางบิล-ใบแจ้งหนี้'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeSimpleDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/billing-notes/inline:
    post:
      tags:
        - Billing Notes
      summary: Upgrade quotation document to billing notes document. inline discount or inline vat.
      description: 'สร้างเอกสารใบวางบิล แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอวางบิล (awaiting) <br>ข้อมูลการสร้างเอกสารใบวางบิล : https://flowaccount.com/ultimateguide/guide/ใบวางบิล-ใบแจ้งหนี้'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeInlineDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /billing-notes/{id}:
    get:
      tags:
        - Billing Notes
      summary: Get billing notes document.
      description: เรียกดูข้อมูลเอกสารใบวางบิลตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    put:
      tags:
        - Billing Notes
      summary: Edit billing notes document.
      description: แก้ไขข้อมูลเอกสารใบวางบิล ตามเลขที่เอกสารที่ต้องการและเอกสารต้องเป็นสถานะ รอวางบิล (Awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/UpdateAllDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    delete:
      tags:
        - Billing Notes
      summary: Delete billing notes document.
      description: 'ลบ เอกสารใบวางบิล ตามเลขที่เอกสารที่ต้องการ <br> ** การลบเอกสาร เอกสารต้องอยู่ในสถานะ รอวางบิล '
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /billing-notes/{id}/status/{statusId}:
    post:
      tags:
        - Billing Notes
      summary: Change status billing notes document.
      description: เปลี่ยนสถานะของเอกสารใบวางบิล สร้างเอกสารใหม่ครั้งแรกจะได้รับสถานะ รอวางบิล (awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID เอกสารใช้ recordId
        - name: statusId
          in: path
          required: true
          schema:
            type: string
          description: เปลี่ยนสถานะเอกสารได้ 4 สถานะ <br> awaiting = รอวางบิล <br> approved = วางบิลแล้ว <br> approvedandprocessed = เปิดบิลแล้ว <br> void = ยกเลิก
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /billing-notes/{id}/attachment:
    post:
      tags:
        - Billing Notes
      summary: Attachment billing notes document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้อง ในเอกสารใบวางบิลตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: รูปแบบ file ที่ใช้แนบในเอกสารเป็นแบบ Binary
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /billing-notes/{id}/attachment/base64:
    post: 
      tags: 
        -  Billing Notes
      summary: Base64 attachment billing notes document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้องในรูปแบบ base64 ในเอกสารใบวางบิลตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/AttachmentBase64'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentBase64Response'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /billing-notes/{id}/export-pdf/base64:
    post:
      tags:
        - Billing Notes
      summary: Export billing notes document as PDF
      description: ส่งออกเอกสารใบวางบิลเป็นไฟล์ PDF ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการส่งออก
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/ExportPdf'
      responses:
        '200':
          description: PDF content encoded as base64 string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfResponse'
        '400':
          description: 400 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfErrorResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /billing-notes/email-document:
    post:
      tags:
        - Billing Notes
      summary: Send email billing notes document.
      description: ส่งเอกสารใบวางบิล ผ่านทางอีเมล ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/SendEmailCoppies'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEmailResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /billing-notes/sharedocument:
    post:
      tags:
        - Billing Notes
      summary: Share link billing notes document.
      description: แชร์ลิงค์ เอกสารใบวางบิลที่ต้องการ จะได้รับลิงค์สำหรับแชร์และเรียกดูเอกสาร
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ShareDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /tax-invoices:
    get:
      tags:
        - Tax Invoice
      summary: Get all tax invoice documents.
      description: เรียกดูข้อมูลเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน ทั้งหมดในระบบ
      parameters:
        - in: query
          name: currentPage
          description: 'Query current page document tax invoices. <br>Example Pattern: <ex>/tax-invoices?currentPage=1 </ex><ex>/tax-invoices?currentPage=1&pageSize=20</ex>'
          schema:
            type: integer
        - in: query
          name: pageSize
          description: 'Query document tax invoices list amount per page. <br>Example Pattern: <ex> /tax-invoices?pageSize=20 </ex>'
          schema:
            type: integer
        - in: query
          name: searchString
          description: 'Query document by Contact Name or Project Name or Document Serial. <br>Example Pattern: <ex> /tax-invoices?searchString=INV2021010001</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: range
          description: 'Query document range type. <br>0 = all<br>1 = Current Month<br>3 = Previous Month<br>5 = Date Range<br>7 = Current Year<br>9 = Previous Year<br>15 = Fiscal Year<br>Example Query Current Month: <ex> /tax-invoices?pageSize=20&currentPage=1&range=1</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: month
          description: 'Query document by month.<br>Example Query Previous Month: <ex> /tax-invoices?pageSize=20&currentPage=1&range=1&month=5&year=2021</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: year
          description: 'Query document by year.<br>Example Query Previous Year: <ex> /tax-invoices?currentPage=1&pageSize=20&range=9&year=2020</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: startDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /tax-invoices?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: endDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /tax-invoices?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    post:
      tags:
        - Tax Invoice
      summary: Create tax invoice document.
      description: 'สร้างเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting) <br> ข้อมูลการสร้างเอกสารใบกำกับภาษี : https://flowaccount.com/ultimateguide/guide/ใบกำกับภาษี'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/SimpleDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /tax-invoices/with-payment:
    post:
      tags:
        - Tax Invoice
      summary: Create tax invoice document with payment.
      description: 'สร้างเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน พร้อมเก็บเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ เก็บเงินแล้ว (paid)<br> ข้อมูลการสร้างเอกสารใบกำกับภาษี : https://flowaccount.com/ultimateguide/guide/ใบกำกับภาษี'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/SimpleDocumentWithPaymentReceiving'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /tax-invoices/inline:
    post:
      tags:
        - Tax Invoice
      summary: Create tax invoice document inline discount or inline vat.
      description: 'สร้างเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting) <br> ข้อมูลการสร้างเอกสารใบกำกับภาษี : https://flowaccount.com/ultimateguide/guide/ใบกำกับภาษี'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/InlineDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /tax-invoices/inline/with-payment:
    post:
      tags:
        - Tax Invoice
      summary: Create tax invoice document inline discount or inline vat with payment.
      description: 'สร้างเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้าพร้อมเก็บเงิน <br>เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ เก็บเงินแล้ว (paid)<br> ข้อมูลการสร้างเอกสารใบกำกับภาษี : https://flowaccount.com/ultimateguide/guide/ใบกำกับภาษี'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/InlineDocumentWithPaymentReceiving'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/tax-invoices:
    post:
      tags:
        - Tax Invoice
      summary: Upgrade quotation or billing notes to tax-invoices document.
      description: 'สร้างเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting) <br> ข้อมูลการสร้างเอกสารใบกำกับภาษี : https://flowaccount.com/ultimateguide/guide/ใบกำกับภาษี'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeSimpleDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/tax-invoices/with-payment:
    post:
      tags:
        - Tax Invoice
      summary: Upgrade quotation or billing notes to tax-invoices document with payment.
      description: 'สร้างเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting) <br> ข้อมูลการสร้างเอกสารใบกำกับภาษี : https://flowaccount.com/ultimateguide/guide/ใบกำกับภาษี'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeSimpleDocumentWithPaymentReceiving'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/tax-invoices/inline:
    post:
      tags:
        - Tax Invoice
      summary: Upgrade quotation or billing notes to tax-invoices inline discount or inline vat.
      description: 'สร้างเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting) <br> ข้อมูลการสร้างเอกสารใบกำกับภาษี : https://flowaccount.com/ultimateguide/guide/ใบกำกับภาษี'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeInlineDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/tax-invoices/inline/with-payment:
    post:
      tags:
        - Tax Invoice
      summary: Upgrade quotation or billing notes to tax-invoices inline discount or inline vat with payment.
      description: 'สร้างเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting) <br> ข้อมูลการสร้างเอกสารใบกำกับภาษี : https://flowaccount.com/ultimateguide/guide/ใบกำกับภาษี'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeInlineDocumentWithPaymentReceiving'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /tax-invoices/{id}:
    get:
      tags:
        - Tax Invoice
      summary: Get tax invoices document.
      description: เรียกดูข้อมูลเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    put:
      tags:
        - Tax Invoice
      summary: Edit tax invoices document.
      description: แก้ไขข้อมูลเอกสารใบกำกับภาษี ตามเลขที่เอกสารที่ต้องการและเอกสารต้องเป็นสถานะ รอดำเนินการ (Awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/UpdateAllDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    delete:
      tags:
        - Tax Invoice
      summary: Delete tax invoices document.
      description: 'ลบ เอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน ตามเลขที่เอกสารที่ต้องการ <br> ** การลบเอกสาร เอกสารต้องอยู่ในสถานะรอดำเนินการ '
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /tax-invoices/{id}/status/{statusId}:
    post:
      tags:
        - Tax Invoice
      summary: Change status tax invoices document.
      description: เปลี่ยนสถานะของเอกสารเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน สร้างเอกสารใหม่ครั้งแรกจะได้รับสถานะ รอดำเนินการ (awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID เอกสารใช้ recordId
        - name: statusId
          in: path
          required: true
          schema:
            type: string
          description: เปลี่ยนสถานะเอกสารได้ 3 สถานะ <br> awaiting = รอดำเนินการ <br> invoicedelivered = รอเก็บเงิน <br> void = ยกเลิก
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /tax-invoices/{id}/payment:
    post:
      tags:
        - Tax Invoice
      summary: Change status is paid tax-invoice document.
      description: เก็บเงิน เอกสารใบกำกับภาษี/ใบเสร็จรับเงิน เปลี่ยนสถานะเป็น เก็บเงินแล้ว
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId หรือ documentId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/PaymentReceivingDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /tax-invoices/{id}/attachment:
    post:
      tags:
        - Tax Invoice
      summary: Attachment tax Invoices document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้อง ในเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: รูปแบบ file ที่ใช้แนบในเอกสารเป็นแบบ Binary
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /tax-invoices/{id}/attachment/base64:
    post:
      tags:
        - Tax Invoice
      summary: Base64 attachment tax Invoices document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้องในรูปแบบ base64 ในเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/AttachmentBase64'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentBase64Response'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /tax-invoices/{id}/export-pdf/base64:
    post:
      tags:
        - Tax Invoice
      summary: Export tax invoice document as PDF
      description: ส่งออกเอกสารใบกำกับภาษีเป็นไฟล์ PDF ตามเลขที่เอกสารที่ต้องการ สามารถเลือกรวมส่วนใบเสร็จรับเงินในเอกสาร PDF เดียวกันได้
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการส่งออก
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/ExportPdfTaxInvoice'
      responses:
        '200':
          description: PDF content encoded as base64 string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfResponse'
        '400':
          description: 400 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfErrorResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /tax-invoices/email-document:
    post:
      tags:
        - Tax Invoice
      summary: Send Email tax invoice document
      description: ส่งเอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน ผ่านทางอีเมล ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEmailResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
      requestBody:
        $ref: '#/components/requestBodies/SendEmailCoppies'
  /tax-invoices/sharedocument:
    post:
      tags:
        - Tax Invoice
      summary: Share link tax invoice document.
      description: แชร์ลิงค์ เอกสารใบกำกับภาษี หรือ ใบกำกับภาษี/ใบเสร็จรับเงิน ที่ต้องการ จะได้รับลิงค์สำหรับแชร์และเรียกดูเอกสาร
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ShareDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /receipts:
    get:
      tags:
        - Receipt
      summary: Get all receipt documents
      description: เรียกดูข้อมูลเอกสารใบเสร็จรับเงิน ทั้งหมดในระบบ
      parameters:
        - in: query
          name: currentPage
          description: 'Query current page document receipts. <br>Example Pattern: <ex>/receipts?currentPage=1 </ex><ex>/receipts?currentPage=1&pageSize=20</ex>'
          schema:
            type: integer
        - in: query
          name: pageSize
          description: 'Query document receipts list amount per page. <br>Example Pattern: <ex> /receipts?pageSize=20 </ex>'
          schema:
            type: integer
        - in: query
          name: searchString
          description: 'Query document by Contact Name or Project Name or Document Serial. <br>Example Pattern: <ex> /receipts?searchString=RE2021010001</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: range
          description: 'Query document range type. <br>0 = all<br>1 = Current Month<br>3 = Previous Month<br>5 = Date Range<br>7 = Current Year<br>9 = Previous Year<br>15 = Fiscal Year<br>Example Query Current Month: <ex> /receipts?pageSize=20&currentPage=1&range=1</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: month
          description: 'Query document by month.<br>Example Query Previous Month: <ex> /receipts?pageSize=20&currentPage=1&range=1&month=5&year=2021</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: year
          description: 'Query document by year.<br>Example Query Previous Year: <ex> /receipts?currentPage=1&pageSize=20&range=9&year=2020</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: startDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /receipts?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: endDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /receipts?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: header
          name: Authorization
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/receipts:
    post:
      tags:
        - Receipt
      summary: Upgrade tax-invoices to receipts document.
      description: 'สร้างเอกสารใบเสร็จรับเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting) <br>ข้อมูลการสร้างเอกสารใบเสร็จรับเงิน : https://flowaccount.com/ultimateguide/guide/ใบเสร็จรับเงิน'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeSimpleDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/receipts/with-payment:
    post:
      tags:
        - Receipt
      summary: Upgrade tax-invoices to receipts document with payment.
      description: 'สร้างเอกสารใบเสร็จรับเงิน พร้อมเก็บเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ เก็บเงินแล้ว (paid)<br>ข้อมูลการสร้างเอกสารใบเสร็จรับเงิน : https://flowaccount.com/ultimateguide/guide/ใบเสร็จรับเงิน'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeSimpleDocumentWithPaymentReceiving'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/receipts/inline:
    post:
      tags:
        - Receipt
      summary: Upgrade tax-invoices to receipts inline discount or inline vat.
      description: 'สร้างเอกสารใบเสร็จรับเงิน แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting) <br>ข้อมูลการสร้างเอกสารใบเสร็จรับเงิน : https://flowaccount.com/ultimateguide/guide/ใบเสร็จรับเงิน'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeInlineDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/receipts/inline/with-payment:
    post:
      tags:
        - Receipt
      summary: Upgrade tax-invoices to receipts inline discount or inline vat with payment.
      description: 'สร้างเอกสารใบเสร็จรับเงิน แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้าพร้อมเก็บเงิน <br>เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ เก็บเงินแล้ว (paid)<br>ข้อมูลการสร้างเอกสารใบเสร็จรับเงิน : https://flowaccount.com/ultimateguide/guide/ใบเสร็จรับเงิน'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeInlineDocumentWithPaymentReceiving'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /receipts/{id}:
    get:
      tags:
        - Receipt
      summary: Get receipt document.
      description: เรียกดูข้อมูลเอกสารใบเสร็จรับเงิน ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    put:
      tags:
        - Receipt
      summary: Edit receipt document.
      description: แก้ไขข้อมูลเอกสารใบเสร็จรับเงิน ตามเลขที่เอกสารที่ต้องการและเอกสารต้องเป็นสถานะ รอดำเนินการ (Awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/UpdateAllDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    delete:
      tags:
        - Receipt
      summary: Delete receipt document.
      description: 'ลบ เอกสารใบเสร็จรับเงิน ตามเลขที่เอกสารที่ต้องการ <br> ** การลบเอกสาร เอกสารต้องอยู่ในสถานะ รอดำเนินการ '
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /receipts/{id}/status/{statusId}:
    post:
      tags:
        - Receipt
      summary: Change status receipt document.
      description: เปลี่ยนสถานะของเอกสารใบเสร็จรับเงิน สร้างเอกสารใหม่ครั้งแรกจะได้รับสถานะ รอดำเนินการ (awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID เอกสารใช้ recordId
        - name: statusId
          in: path
          required: true
          schema:
            type: string
          description: เปลี่ยนสถานะเอกสารได้ 1 สถานะ <br> void = ยกเลิก
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /receipts/{id}/payment:
    post:
      tags:
        - Receipt
      summary: Change status is paid receipt document.
      description: เก็บเงิน เอกสารใบเสร็จรับเงิน (เงินสด) เปลี่ยนสถานะเป็น เก็บเงินแล้ว
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId หรือ documentId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/PaymentReceivingDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /receipts/{id}/attachment:
    post:
      tags:
        - Receipt
      summary: Attachment receipt document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้อง ในเอกสารใบเสร็จรับเงิน ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: รูปแบบ file ที่ใช้แนบในเอกสารเป็นแบบ Binary
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /receipts/{id}/attachment/base64:
    post:
      tags:
        - Receipt
      summary: Base64 attachment receipt document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้องในรูปแบบ base64 ในเอกสารใบเสร็จรับเงิน ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/AttachmentBase64'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentBase64Response'
        '401':
          description: 401 response
        '500':
          description: 500 response     
  /receipts/{id}/export-pdf/base64:
    post:
      tags:
        - Receipt
      summary: Export receipt document as PDF
      description: ส่งออกเอกสารใบเสร็จรับเงินเป็นไฟล์ PDF ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการส่งออก
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/ExportPdf'
      responses:
        '200':
          description: PDF content encoded as base64 string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfResponse'
        '400':
          description: 400 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfErrorResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /receipts/email-document:
    post:
      tags:
        - Receipt
      summary: Send email receipt document.
      description: ส่งเอกสารใบเสร็จรับเงิน ผ่านทางอีเมล ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEmailResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
      requestBody:
        $ref: '#/components/requestBodies/SendEmailCoppies'
  /receipts/sharedocument:
    post:
      tags:
        - Receipt
      summary: Share link receipt document.
      description: แชร์ลิงค์ เอกสารใบเสร็จรับเงิน ที่ต้องการ จะได้รับลิงค์สำหรับแชร์และเรียกดูเอกสาร
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ShareDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /cash-invoices:
    get:
      tags:
        - Cash Invoice
      summary: Get all cash invoices documents
      description: เรียกดูข้อมูลเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (เงินสด) ทั้งหมดในระบบ
      parameters:
        - in: query
          name: currentPage
          description: 'Query current page document cash invoices. <br>Example Pattern: <ex>/cash-invoices?currentPage=1 </ex><ex>/cash-invoices?currentPage=1&pageSize=20</ex>'
          schema:
            type: integer
        - in: query
          name: pageSize
          description: 'Query document cash invoices list amount per page. <br>Example Pattern: <ex> /cash-invoices?pageSize=20 </ex>'
          schema:
            type: integer
        - in: query
          name: searchString
          description: 'Query document by Contact Name or Project Name or Document Serial. <br>Example Pattern: <ex> /cash-invoices?searchString=CA202101001</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: range
          description: 'Query document range type. <br>0 = all<br>1 = Current Month<br>3 = Previous Month<br>5 = Date Range<br>7 = Current Year<br>9 = Previous Year<br>15 = Fiscal Year<br>Example Query Current Month: <ex> /cash-invoices?pageSize=20&currentPage=1&range=1</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: month
          description: 'Query document by month.<br>Example Query Previous Month: <ex> /cash-invoices?pageSize=20&currentPage=1&range=1&month=5&year=2021</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: year
          description: 'Query document by year.<br>Example Query Previous Year: <ex> /cash-invoices?currentPage=1&pageSize=20&range=9&year=2020</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: startDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /cash-invoices?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: endDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /cash-invoices?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: header
          name: Authorization
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    post:
      tags:
        - Cash Invoice
      summary: Create cash invoices document.
      description: 'สร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting)<br>ข้อมูลการสร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) : https://flowaccount.com/ultimateguide/guide/ขายสด'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/CASimpleDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /cash-invoices/with-payment:
    post:
      tags:
        - Cash Invoice
      summary: Create cash invoices document with payment.
      description: 'สร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) พร้อมเก็บเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ เก็บเงินแล้ว (paid)<br>ข้อมูลการสร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) : https://flowaccount.com/ultimateguide/guide/ขายสด'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/SimpleDocumentWithPaymentReceiving'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /cash-invoices/inline:
    post:
      tags:
        - Cash Invoice
      summary: Create cash invoices document inline discount or inline vat.
      description: 'สร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (เงินสด) แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting)<br>ข้อมูลการสร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) : https://flowaccount.com/ultimateguide/guide/ขายสด'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/CAInlineDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /cash-invoices/inline/with-payment:
    post:
      tags:
        - Cash Invoice
      summary: Create cash invoices document inline discount or inline vat with payment.
      description: 'สร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (เงินสด) แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้าพร้อมเก็บเงิน <br>เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ เก็บเงินแล้ว (paid)<br>ข้อมูลการสร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) : https://flowaccount.com/ultimateguide/guide/ขายสด'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/InlineDocumentWithPaymentReceiving'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/cash-invoices:
    post:
      tags:
        - Cash Invoice
      summary: Upgrade quotation to cash invoices document.
      description: 'สร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting)<br>ข้อมูลการสร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) : https://flowaccount.com/ultimateguide/guide/ขายสด'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeSimpleCADocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/cash-invoices/with-payment:
    post:
      tags:
        - Cash Invoice
      summary: Upgrade quotation to cash invoices document with payment.
      description: 'สร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) พร้อมเก็บเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ เก็บเงินแล้ว (paid)<br>ข้อมูลการสร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) : https://flowaccount.com/ultimateguide/guide/ขายสด'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeSimpleDocumentWithPaymentReceiving'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/cash-invoices/inline:
    post:
      tags:
        - Cash Invoice
      summary: Upgrade quotation to  cash invoices document inline discount or inline vat.
      description: 'สร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (เงินสด) แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting)<br>ข้อมูลการสร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) : https://flowaccount.com/ultimateguide/guide/ขายสด'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeInlineCADocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/cash-invoices/inline/with-payment:
    post:
      tags:
        - Cash Invoice
      summary: Upgrade quotation to  cash invoices document inline discount or inline vat with payment.
      description: 'สร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (เงินสด) แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้าพร้อมเก็บเงิน <br>เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ เก็บเงินแล้ว (paid)<br>ข้อมูลการสร้างเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) : https://flowaccount.com/ultimateguide/guide/ขายสด'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeInlineDocumentWithPaymentReceiving'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /cash-invoices/{id}:
    get:
      tags:
        - Cash Invoice
      summary: Get cash invoices document.
      description: เรียกดูข้อมูลเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (เงินสด) ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    put:
      tags:
        - Cash Invoice
      summary: Edit cash invoices document.
      description: แก้ไขข้อมูลเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน(เงินสด) ตามเลขที่เอกสารที่ต้องการเอกสารต้องเป็นสถานะ รอดำเนินการ (Awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/UpdateAllCADocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    delete:
      tags:
        - Cash Invoice
      summary: Delete cash invoices document.
      description: 'ลบ เอกสารใบกำกับ/ใบเสร็จรับเงิน (เงินสด) ตามเลขที่เอกสารที่ต้องการ <br> ** การลบเอกสาร เอกสารต้องอยู่ในสถานะ รอดำเนินการ '
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /cash-invoices/{id}/status/{statusId}:
    post:
      tags:
        - Cash Invoice
      summary: Change status cash invoices document.
      description: เปลี่ยนสถานะของเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน(เงินสด) สร้างเอกสารใหม่ครั้งแรกจะได้รับสถานะ รอดำเนินการ (awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID เอกสารใช้ recordId
        - name: statusId
          in: path
          required: true
          schema:
            type: string
          description: เปลี่ยนสถานะเอกสารได้ 3 สถานะ <br> awaiting = รอดำเนินการ <br> invoicedelivered = รอเก็บเงิน <br> void = ยกเลิก
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /cash-invoices/{id}/payment:
    post:
      tags:
        - Cash Invoice
      summary: Change status is paid cash invoices document.
      description: เก็บเงิน เอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (เงินสด) เปลี่ยนสถานะเป็น เก็บเงินแล้ว
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId หรือ documentId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/PaymentReceivingDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /cash-invoices/{id}/attachment:
    post:
      tags:
        - Cash Invoice
      summary: Attachment cash invoices document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้อง ในเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: รูปแบบ file ที่ใช้แนบในเอกสารเป็นแบบ Binary
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /cash-invoices/{id}/attachment/base64:
    post:
      tags:
        - Cash Invoice
      summary: Base64 attachment cash invoices document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้องในรูปแบบ base64 ในเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน (ขายสด) ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/AttachmentBase64'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentBase64Response'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /cash-invoices/{id}/export-pdf/base64:
    post:
      tags:
        - Cash Invoice
      summary: Export cash invoice document as PDF
      description: ส่งออกเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน(เงินสด)เป็นไฟล์ PDF ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการส่งออก
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/ExportPdf'
      responses:
        '200':
          description: PDF content encoded as base64 string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfResponse'
        '400':
          description: 400 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfErrorResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /cash-invoices/email-document:
    post:
      tags:
        - Cash Invoice
      summary: Send email cash invoices document.
      description: ส่งเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน(เงินสด) ผ่านทางอีเมล ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEmailResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
      requestBody:
        $ref: '#/components/requestBodies/SendEmailCoppies'
  /cash-invoices/sharedocument:
    post:
      tags:
        - Cash Invoice
      summary: Share link cash invoices document.
      description: แชร์ลิงค์ เอกสารใบกำกับภาษี/ใบเสร็จรับเงิน(เงินสด) ที่ต้องการ จะได้รับลิงค์สำหรับแชร์และเรียกดูเอกสาร
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ShareDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases-orders:
    get:
      tags:
        - Purchase Order
      summary: Get all purchase order documents.
      description: เรียกดูข้อมูลเอกสารใบสั่งซื้อทั้งหมดในระบบ
      parameters:
        - in: query
          name: currentPage
          description: 'Query current page document purchase orders. <br>Example Pattern: <ex>/purchases-orders?currentPage=1 </ex><ex>/purchases-orders?currentPage=1&pageSize=20</ex>'
          schema:
            type: integer
        - in: query
          name: pageSize
          description: 'Query document purchase orders list amount per page. <br>Example Pattern: <ex> /purchases-orders?pageSize=20 </ex>'
          schema:
            type: integer
        - in: query
          name: searchString
          description: 'Query document by Contact Name or Project Name or Document Serial. <br>Example Pattern: <ex> /purchases-orders?searchString=PO2021010001</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: range
          description: 'Query document range type. <br>0 = all<br>1 = Current Month<br>3 = Previous Month<br>5 = Date Range<br>7 = Current Year<br>9 = Previous Year<br>15 = Fiscal Year<br>Example Query Current Month: <ex> /purchases-orders?pageSize=20&currentPage=1&range=1</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: month
          description: 'Query document by month.<br>Example Query Previous Month: <ex> /purchases-orders?pageSize=20&currentPage=1&range=1&month=5&year=2021</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: year
          description: 'Query document by year.<br>Example Query Previous Year: <ex> /purchases-orders?currentPage=1&pageSize=20&range=9&year=2020</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: startDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /purchases-orders?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: endDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /purchases-orders?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: header
          name: Authorization
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    post:
      tags:
        - Purchase Order
      summary: Create purchase order document.
      description: 'สร้างเอกสารใบสั่งซื้อ เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รออนุมัติ (awaiting) <br> ข้อมูลการสร้างเอกสารสั่งซื้อ : https://flowaccount.com/ultimateguide/guide/ใบสั่งซื้อ'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/SimpleDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases-orders/inline:
    post:
      tags:
        - Purchase Order
      summary: Create purchase order document inline discount or inline vat.
      description: 'สร้างเอกสารใบสั่งซื้อ แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รออนุมัติ (awaiting) <br> ข้อมูลการสร้างเอกสารสั่งซื้อ : https://flowaccount.com/ultimateguide/guide/ใบสั่งซื้อ'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/InlineDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response]
  /upgrade/purchases-orders:
    post:
      tags:
        - Purchase Order
      summary: Upgrade quotaion to purchase order document.
      description: 'สร้างเอกสารใบสั่งซื้อ เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รออนุมัติ (awaiting) <br> ข้อมูลการสร้างเอกสารสั่งซื้อ : https://flowaccount.com/ultimateguide/guide/ใบสั่งซื้อ'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeSimpleDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/purchases-orders/inline:
    post:
      tags:
        - Purchase Order
      summary: Upgrade quotaion to purchase order document inline discount or inline vat.
      description: 'สร้างเอกสารใบสั่งซื้อ แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รออนุมัติ (awaiting) <br> ข้อมูลการสร้างเอกสารสั่งซื้อ : https://flowaccount.com/ultimateguide/guide/ใบสั่งซื้อ'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeInlineDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases-orders/{id}:
    get:
      tags:
        - Purchase Order
      summary: Get purchase order document.
      description: เรียกดูข้อมูลเอกสารใบสั่งซื้อตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    put:
      tags:
        - Purchase Order
      summary: Edit purchase order document.
      description: แก้ไขข้อมูลเอกสารใบสั่งซื้อ ตามเลขที่เอกสารที่ต้องการเอกสารต้องเป็นสถานะ รออนุมัติ (Awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/UpdateAllDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    delete:
      tags:
        - Purchase Order
      summary: Delete purchase order document.
      description: 'ลบ เอกสารใบสั่งซื้อ ตามเลขที่เอกสารที่ต้องการ <br> ** การลบเอกสาร เอกสารต้องอยู่ในสถานะ รออนุมัติ '
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases-orders/{id}/status/{statusId}:
    post:
      tags:
        - Purchase Order
      summary: Change status purchase order document.
      description: เปลี่ยนสถานะของเอกสารใบสั่งซื้อ สร้างเอกสารใหม่ครั้งแรกจะได้รับสถานะ รออนุมัติ (awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID เอกสารใช้ recordId
        - name: statusId
          in: path
          required: true
          schema:
            type: string
          description: เปลี่ยนสถานะเอกสารได้ 4 สถานะ <br> awaiting = รออนุมัติ <br> approved = อนุมัติ <br> approvedandprocessed = ดำเนินการแล้ว <br> void = ยกเลิก
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases-orders/{id}/attachment:
    post:
      tags:
        - Purchase Order
      summary: Attachment purchase order document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้อง ในเอกสารใบสั่งซื้อตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: รูปแบบ file ที่ใช้แนบในเอกสารเป็นแบบ Binary
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases-orders/{id}/attachment/base64:
    post:
      tags:
        - Purchase Order
      summary: Base64 attachment purchase order document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้องในรูปแบบ base64 ในเอกสารใบสั่งซื้อตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/AttachmentBase64'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentBase64Response'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases-orders/{id}/export-pdf/base64:
    post:
      tags:
        - Purchase Order
      summary: Export purchase order document as PDF
      description: ส่งออกเอกสารใบสั่งซื้อเป็นไฟล์ PDF ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการส่งออก
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/ExportPdf'
      responses:
        '200':
          description: PDF content encoded as base64 string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfResponse'
        '400':
          description: 400 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfErrorResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases-orders/email-document:
    post:
      tags:
        - Purchase Order
      summary: Send email purchase order document.
      description: ส่งเอกสารใบสั่งซื้อ ผ่านทางอีเมล ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/SendEmailCoppies'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEmailResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases-orders/sharedocument:
    post:
      tags:
        - Purchase Order
      summary: Share link purchase order document.
      description: แชร์ลิงค์ เอกสารใบสั่งซื้อที่ต้องการ จะได้รับลิงค์สำหรับแชร์และเรียกดูเอกสาร
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ShareDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases:
    get:
      tags:
        - Receiving Inventory
      summary: Get all receiving inventory documents.
      description: เรียกดูข้อมูลเอกสารใบรับสินค้าทั้งหมดในระบบ
      parameters:
        - in: query
          name: currentPage
          description: 'Query current page document purchases. <br>Example Pattern: <ex>/purchases?currentPage=1 </ex><ex>/purchases?currentPage=1&pageSize=20</ex>'
          schema:
            type: integer
        - in: query
          name: pageSize
          description: 'Query document purchases list amount per page. <br>Example Pattern: <ex> /purchases?pageSize=20 </ex>'
          schema:
            type: integer
        - in: query
          name: searchString
          description: 'Query document by Contact Name or Project Name or Document Serial. <br>Example Pattern: <ex> /purchases?searchString=RI2021010001</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: range
          description: 'Query document range type. <br>0 = all<br>1 = Current Month<br>3 = Previous Month<br>5 = Date Range<br>7 = Current Year<br>9 = Previous Year<br>15 = Fiscal Year<br>Example Query Current Month: <ex> /purchases?pageSize=20&currentPage=1&range=1</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: month
          description: 'Query document by month.<br>Example Query Previous Month: <ex> /purchases?pageSize=20&currentPage=1&range=1&month=5&year=2021</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: year
          description: 'Query document by year.<br>Example Query Previous Year: <ex> /purchases?currentPage=1&pageSize=20&range=9&year=2020</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: startDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /purchases?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: endDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /purchases?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: header
          name: Authorization
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    post:
      tags:
        - Receiving Inventory
      summary: Create receiving inventory document.
      description: 'สร้างเอกสารใบรับสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รออนุมัติ (awaiting) <br> ข้อมูลการสร้างเอกสารใบรับสินค้า : https://flowaccount.com/ultimateguide/guide/ใบรับสินค้า'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/SimpleDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases/with-payment:
    post:
      tags:
        - Receiving Inventory
      summary: Create receiving inventory document with payment.
      description: 'สร้างเอกสารใบรับสินค้า พร้อมชำระเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ ชำระเงินแล้ว (paid)<br> ข้อมูลการสร้างเอกสารใบรับสินค้า : https://flowaccount.com/ultimateguide/guide/ใบรับสินค้า'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/SimpleDocumentWithPaymentPaid'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases/inline:
    post:
      tags:
        - Receiving Inventory
      summary: Create receiving inventory document inline discount or inline vat.
      description: 'สร้างเอกสารใบรับสินค้า แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รออนุมัติ (awaiting)<br> ข้อมูลการสร้างเอกสารใบรับสินค้า : https://flowaccount.com/ultimateguide/guide/ใบรับสินค้า'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/InlineDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases/inline/with-payment:
    post:
      tags:
        - Receiving Inventory
      summary: Create receiving inventory document inline discount or inline vat with payment.
      description: 'สร้างเอกสารใบรับสินค้า แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า พร้อมชำระเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ ชำระเงินแล้ว (paid)<br> ข้อมูลการสร้างเอกสารใบรับสินค้า : https://flowaccount.com/ultimateguide/guide/ใบรับสินค้า'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/InlineDocumentWithPaymentPaid'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/purchases:
    post:
      tags:
        - Receiving Inventory
      summary: Upgrade purchase order to receiving inventory document.
      description: 'สร้างเอกสารใบรับสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รออนุมัติ (awaiting) <br> ข้อมูลการสร้างเอกสารใบรับสินค้า : https://flowaccount.com/ultimateguide/guide/ใบรับสินค้า'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeSimpleDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/purchases/with-payment:
    post:
      tags:
        - Receiving Inventory
      summary: Upgrade purchase order to receiving inventory document with payment.
      description: 'สร้างเอกสารใบรับสินค้า พร้อมชำระเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ ชำระเงินแล้ว (paid)<br> ข้อมูลการสร้างเอกสารใบรับสินค้า : https://flowaccount.com/ultimateguide/guide/ใบรับสินค้า'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeSimpleDocumentWithPaymentPaid'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/purchases/inline:
    post:
      tags:
        - Receiving Inventory
      summary: Upgrade purchase order to receiving inventory document inline discount or inline vat.
      description: 'สร้างเอกสารใบรับสินค้า แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รออนุมัติ (awaiting)<br> ข้อมูลการสร้างเอกสารใบรับสินค้า : https://flowaccount.com/ultimateguide/guide/ใบรับสินค้า'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeInlineDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /upgrade/purchases/inline/with-payment:
    post:
      tags:
        - Receiving Inventory
      summary: Upgrade purchase order to receiving inventory document inline discount or inline vat with payment.
      description: 'สร้างเอกสารใบรับสินค้า แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า พร้อมชำระเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ ชำระเงินแล้ว (paid)<br> ข้อมูลการสร้างเอกสารใบรับสินค้า : https://flowaccount.com/ultimateguide/guide/ใบรับสินค้า'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/UpgradeInlineDocumentWithPaymentPaid'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InlineDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases/{id}:
    get:
      tags:
        - Receiving Inventory
      summary: Get receiving inventory document.
      description: เรียกดูข้อมูลเอกสารใบรับสินค้าตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    put:
      tags:
        - Receiving Inventory
      summary: Edit receiving inventory document.
      description: แก้ไขข้อมูลเอกสารใบรับสินค้า ตามเลขที่เอกสารที่ต้องการเอกสารต้องเป็นสถานะ รออนุมัติ (Awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/UpdateAllDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    delete:
      tags:
        - Receiving Inventory
      summary: Delete receiving inventory document.
      description: 'ลบ เอกสารใบรับสินค้า ตามเลขที่เอกสารที่ต้องการ <br> ** การลบเอกสาร เอกสารต้องอยู่ในสถานะ รออนุมัติ '
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases/{id}/status/{statusId}:
    post:
      tags:
        - Receiving Inventory
      summary: Change status receiving inventory document.
      description: เปลี่ยนสถานะของเอกสารใบรับสินค้า สร้างเอกสารใหม่ครั้งแรกจะได้รับสถานะ รออนุมัติ (awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID เอกสารใช้ recordId
        - name: statusId
          in: path
          required: true
          schema:
            type: string
          description: เปลี่ยนสถานะเอกสารได้ 3 สถานะ <br> awaiting = รออนุมัติ <br> approved = อนุมัติ <br> void = ยกเลิก
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases/{id}/payment:
    post:
      tags:
        - Receiving Inventory
      summary: Change status is paid receiving inventory document.
      description: ขำระเงิน เอกสารใบรับสินค้าเปลี่ยนสถานะเป็น ชำระเงินแล้ว
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId หรือ documentId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/PaymentPaidDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases/{id}/attachment:
    post:
      tags:
        - Receiving Inventory
      summary: Attachment receiving inventory document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้อง ในเอกสารใบรับสินค้าตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: รูปแบบ file ที่ใช้แนบในเอกสารเป็นแบบ Binary
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases/{id}/attachment/base64:
    post:
      tags:
        - Receiving Inventory
      summary: Base64 attachment receiving inventory document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้องในรูปแบบ base64 ในเอกสารใบรับสินค้าตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการแนบ
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/AttachmentBase64'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentBase64Response'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases/{id}/export-pdf/base64:
    post:
      tags:
        - Receiving Inventory
      summary: Export receiving inventory document as PDF
      description: ส่งออกเอกสารใบรับสินค้าเป็นไฟล์ PDF ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการส่งออก
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/ExportPdf'
      responses:
        '200':
          description: PDF content encoded as base64 string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfResponse'
        '400':
          description: 400 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfErrorResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases/email-document:
    post:
      tags:
        - Receiving Inventory
      summary: Send email receiving inventory document.
      description: ส่งเอกสารใบรับสินค้า ผ่านทางอีเมล ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/SendEmailCoppies'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEmailResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /purchases/sharedocument:
    post:
      tags:
        - Receiving Inventory
      summary: Share link receiving inventory document.
      description: แชร์ลิงค์ เอกสารใบรับสินค้าที่ต้องการ จะได้รับลิงค์สำหรับแชร์และเรียกดูเอกสาร
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ShareDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /expenses:
    get:
      tags:
        - Expenses
      summary: Get list all expenses documents.
      description: เรียกดูข้อมูลเอกสารค่าใช้จ่ายทั้งหมดในระบบ
      parameters:
        - in: query
          name: currentPage
          description: 'Query current page expenses document. <br>Example Pattern: <ex>/expenses?currentPage=1 </ex><ex>/expenses?currentPage=1&pageSize=20</ex>'
          schema:
            type: integer
        - in: query
          name: pageSize
          description: 'Query expenses document list amount per page. <br>Example Pattern: <ex> /expenses?pageSize=20 </ex>'
          schema:
            type: integer
        - in: query
          name: searchString
          description: 'Query document by Contact Name or Project Name or Document Serial. <br>Example Pattern: <ex> /expenses?searchString=EXP2021010001</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: range
          description: 'Query document range type. <br>0 = all<br>1 = Current Month<br>3 = Previous Month<br>5 = Date Range<br>7 = Current Year<br>9 = Previous Year<br>15 = Fiscal Year<br>Example Query Current Month: <ex> /expenses?pageSize=20&currentPage=1&range=1</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: month
          description: 'Query document by month.<br>Example Query Previous Month: <ex> /expenses?pageSize=20&currentPage=1&range=1&month=5&year=2021</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: year
          description: 'Query document by year.<br>Example Query Previous Year: <ex> /expenses?currentPage=1&pageSize=20&range=9&year=2020</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: startDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /expenses?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: endDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /expenses?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: header
          name: Authorization
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllExpenseDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    post:
      tags:
        - Expenses
      summary: Create expenses document.
      description: 'สร้างเอกสารค่าใช้จ่าย เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting)<br> ข้อมูลการสร้างเอกสารค่าใช้จ่าย : https://flowaccount.com/ultimateguide/guide/บันทึกค่าใช้จ่าย'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ExpenseSimpleDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseSimpleDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /expenses/with-payment:
    post:
      tags:
        - Expenses
      summary: Create expenses document with payment.
      description: 'สร้างเอกสารค่าใช้จ่าย พร้อมชำระเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ ชำระเงินแล้ว (paid)<br> ข้อมูลการสร้างเอกสารค่าใช้จ่าย : https://flowaccount.com/ultimateguide/guide/บันทึกค่าใช้จ่าย'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ExpenseSimpleDocumentPaymentPaid'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseSimpleDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /expenses/inline:
    post:
      tags:
        - Expenses
      summary: Create expenses document inline discount or inline vat.
      description: 'สร้างเอกสารค่าใช้จ่าย แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ รอดำเนินการ (awaiting)<br> ข้อมูลการสร้างเอกสารค่าใช้จ่าย : https://flowaccount.com/ultimateguide/guide/บันทึกค่าใช้จ่าย'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ExpenseInlineDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseInlineDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /expenses/inline/with-payment:
    post:
      tags:
        - Expenses
      summary: Create expenses document inline discount or inline vat with payment.
      description: 'สร้างเอกสารค่าใช้จ่าย แบบส่วนลด หรือ ภาษี แยกตามรายการสินค้า พร้อมชำระเงิน เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ ชำระเงินแล้ว (paid)<br> ข้อมูลการสร้างเอกสารค่าใช้จ่าย : https://flowaccount.com/ultimateguide/guide/บันทึกค่าใช้จ่าย'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ExpenseInlineDocumentWithPaymentPaid'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseInlineDocumentWithPaymentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /expenses/{id}:
    get:
      tags:
        - Expenses
      summary: Get expenses document.
      description: เรียกดูข้อมูลเอกสารค่าใช้จ่ายตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllExpenseDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    put:
      tags:
        - Expenses
      summary: Edit expenses document.
      description: แก้ไขข้อมูลเอกสารค่าใช้จ่าย ตามเลขที่เอกสารที่ต้องการเอกสารต้องเป็นสถานะ รอดำเนินการ (Awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/UpdateAllExpenseDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    delete:
      tags:
        - Expenses
      summary: Delete expenses document.
      description: 'ลบ เอกสารค่าใช้จ่าย ตามเลขที่เอกสารที่ต้องการ <br> ** การลบเอกสาร เอกสารต้องอยู่ในสถานะ รอดำเนินการ '
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /expenses/{id}/status/{statusId}:
    post:
      tags:
        - Expenses
      summary: Change status expenses document.
      description: เปลี่ยนสถานะของเอกสารค่าใช้จ่าย สร้างเอกสารใหม่ครั้งแรกจะได้รับสถานะ รอดำเนินการ (awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID เอกสารใช้ recordId
        - name: statusId
          in: path
          required: true
          schema:
            type: string
          description: เปลี่ยนสถานะเอกสารได้ 4 สถานะ <br> awaiting = รอดำเนินการ <br> approved = อนุมัติ <br> received = รับใบเสร็จแล้ว <br> void = ยกเลิก
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /expenses/{id}/payment:
    post:
      tags:
        - Expenses
      summary: Change status is paid expenses document.
      description: ชำระเงิน เอกสารค่าใช้จ่ายเปลี่ยน สถานะเป็น ชำระเงินแล้ว
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId หรือ documentId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/PaymentPaidDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /expenses/{id}/attachment:
    post:
      tags:
        - Expenses
      summary: Attachment to expenses document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้อง ในเอกสารค่าใช้จ่ายตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /expenses/{id}/attachment/base64:
    post:
      tags:
        - Expenses
      summary: Base64 attachment to expenses document.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้องในรูปแบบ base64 ในเอกสารค่าใช้จ่ายตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/AttachmentBase64'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentBase64Response'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /expenses/{id}/export-pdf/base64:
    post:
      tags:
        - Expenses
      summary: Export expenses document as PDF
      description: ส่งออกเอกสารค่าใช้จ่ายเป็นไฟล์ PDF ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: documentId หรือ recordId ของเอกสารที่ต้องการส่งออก
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/ExportPdf'
      responses:
        '200':
          description: PDF content encoded as base64 string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfResponse'
        '400':
          description: 400 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExportPdfErrorResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /expenses/email-document:
    post:
      tags:
        - Expenses
      summary: Send email expenses document.
      description: ส่งเอกสารค่าใช้จ่าย ผ่านทางอีเมล ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEmailResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
      requestBody:
        $ref: '#/components/requestBodies/SendEmailSimple'
  /expenses/sharedocument:
    post:
      tags:
        - Expenses
      summary: Share link expenses document.
      description: แชร์ลิงค์ เอกสารค่าใช้จ่าย ที่ต้องการ จะได้รับลิงค์สำหรับแชร์และเรียกดูเอกสาร
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ShareDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /expenses/categories/business:
    get:
      tags:
        - Expenses
      summary: Business categories expenses document.
      description: เรียกดูข้อมูลหมวดหมู่เอกสารค่าใช้จ่าย (สำหรับนักธุรกิจ)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessCategory'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /expenses/categories/accounting:
    get:
      tags:
        - Expenses
      summary: Accounting categories expenses document.
      description: เรียกดูข้อมูลหมวดหมู่เอกสารค่าใช้จ่าย (สำหรับนักบัญชี)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessCategory'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /withholding-taxes:
    get:
      tags:
        - Withholding Tax
      summary: Get all withholding tax documents.
      description: เรียกดูข้อมูลเอกสารใบหัก ณ ที่จ่ายทั้งหมดในระบบ
      parameters:
        - in: query
          name: currentPage
          description: 'Query current page document withholding tax. <br>Example Pattern: <ex>/withholding-taxes?currentPage=1 </ex><ex>/withholding-taxes?currentPage=1&pageSize=20</ex>'
          schema:
            type: integer
        - in: query
          name: pageSize
          description: 'Query document withholding tax list amount per page. <br>Example Pattern: <ex> /withholding-taxes?pageSize=20 </ex>'
          schema:
            type: integer
        - in: query
          name: searchString
          description: 'Query document by Contact Name or Project Name or Document Serial. <br>Example Pattern: <ex> /withholding-taxes?searchString=WHT2021010001</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: range
          description: 'Query document range type. <br>0 = all<br>1 = Current Month<br>3 = Previous Month<br>5 = Date Range<br>7 = Current Year<br>9 = Previous Year<br>15 = Fiscal Year<br>Example Query Current Month: <ex> /expenses?pageSize=20&currentPage=1&range=1</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: month
          description: 'Query document by month.<br>Example Query Previous Month: <ex> /expenses?pageSize=20&currentPage=1&range=1&month=5&year=2021</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: year
          description: 'Query document by year.<br>Example Query Previous Year: <ex> /expenses?currentPage=1&pageSize=20&range=9&year=2020</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: startDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /expenses?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: endDate
          description: 'Query document by startDate to endDate.<br>Example Query Date Range: <ex> /expenses?currentPage=1&pageSize=20&range=5&startDate=2021-05-20&endDate=2021-05-22</ex>'
          required: false
          schema:
            type: string
        - in: header
          name: Authorization
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllWithholidingTaxDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    post:
      tags:
        - Withholding Tax
      summary: Create withholding tax document.
      description: 'สร้างเอกสารใบหัก ณ ที่จ่าย เมื่อสร้างสำเร็จสถานะเอกสารจะอยู่ในสถานะ ดำเนินการแล้ว (issued) <br> <br> ข้อมูลการสร้างเอกสาร หัก ณ ที่จ่าย : https://flowaccount.com/ultimateguide/guide/ภาษีเงินได้-หัก-ณ-ที่จ่าย'
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithholidingTaxDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
      requestBody:
        $ref: '#/components/requestBodies/WithholidingTaxDocument'
  /withholding-taxes/{id}:
    get:
      tags:
        - Withholding Tax
      summary: Get withholding tax document.
      description: เรียกดูข้อมูลเอกสารใบหัก ณ ที่จ่าย ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId หรือ documentId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllWithholidingTaxDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    put:
      tags:
        - Withholding Tax
      summary: Edit withholding tax document.
      description: แก้ไขข้อมูลเอกสารใบหัก ณ ที่จ่าย ตามเลขที่เอกสารที่ต้องการเอกสารต้องเป็นสถานะ รอดำเนินการ (Awaiting)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/UpdateWithholidingTaxDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithholidingTaxDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    delete:
      tags:
        - Withholding Tax
      summary: Delete withholding tax document.
      description: 'ลบ เอกสารใบหัก ณ ที่จ่าย ตามเลขที่เอกสารที่ต้องการ <br> ** การลบเอกสาร เอกสารต้องอยู่ในสถานะ รอดำเนินการ '
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: ID เอกสารใช้ recordId
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /withholding-taxes/{id}/status/{statusId}:
    post:
      tags:
        - Withholding Tax
      summary: Change status withholding tax document.
      description: เปลี่ยนสถานะของเอกสารใบหัก ณ ที่จ่าย สร้างเอกสารใหม่ครั้งแรกจะได้รับสถานะ ดำเนินการแล้ว (processed)
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: ID เอกสารใช้ recordId
        - name: statusId
          in: path
          required: true
          schema:
            type: string
          description: เปลี่ยนสถานะเอกสารได้ 3 สถานะ <br> awaiting = รอดำเนินการ <br> processed = ดำเนินการแล้ว <br> void = ยกเลิก
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithholidingTaxDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /withholding-taxes/{id}/attachment:
    post:
      tags:
        - Withholding Tax
      summary: Attachment withholding tax.
      description: แนบไฟล์ รูปภาพ หรือ เอกสารที่เกี่ยวข้อง ในเอกสารใบหัก ณ ที่จ่าย ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /withholding-taxes/email-document:
    post:
      tags:
        - Withholding Tax
      summary: Send email withholding tax.
      description: ส่งเอกสารใบหัก ณ ที่จ่าย ผ่านทางอีเมล ตามเลขที่เอกสารที่ต้องการ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendEmailResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
      requestBody:
        $ref: '#/components/requestBodies/SendEmailSimple'
  /withholding-taxes/sharedocument:
    post:
      tags:
        - Withholding Tax
      summary: Share link withholding tax.
      description: แชร์ลิงค์ เอกสารใบหัก ณ ที่จ่าย ที่ต้องการ จะได้รับลิงค์สำหรับแชร์และเรียกดูเอกสาร
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ShareDocument'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShareDocumentResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /journal-entries/draft:
    post:
      tags:
        - Journal Entry
      summary: Draft Journals
      description: Draft of Journals includes with Journal Voucher (JV), Purchase Voucher (UV), Sales Voucher (SV), Payment Voucher (PV) and Receipt Voucher (RV)
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JournalEntryRequest'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentList'
              example: >
                {
                  "data": {
                    "recordId": 200271145,
                    "companyId": 1561530,
                    "documentSerial": "Draft JV4",
                    "status": 1,
                    "description": "test description",
                    "documentDate": "2024-02-06",
                    "createdOn": "2024-02-06T04:25:30.979",
                    "postedDate": null,
                    "approvedOn": null,
                    "documentType": 51,
                    "debit": 107.0,
                    "credit": 107.0,
                    "remarks": "test remark",
                    "note": "test note",
                    "reference": "DOC000001",
                    "contactId": 39742343,
                    "contactName": "@new test branch",
                    "bookOfAccounts": [
                      {
                        "debitCredit": 1,
                        "chartOfAccountId": 138199446,
                        "value": 107.0,
                        "rowNumber": 0,
                        "description": "test description",
                        "displayName": "11111 / เงินสดในมือ"
                      },
                      {
                        "debitCredit": 3,
                        "chartOfAccountId": 138199648,
                        "value": 100.0,
                        "rowNumber": 1,
                        "description": "test description",
                        "displayName": "41110 / รายได้จากการขายสินค้า"
                      },
                      {
                        "debitCredit": 3,
                        "chartOfAccountId": 138199609,
                        "value": 7.0,
                        "rowNumber": 2,
                        "description": "test description",
                        "displayName": "27111 / ภาษีขาย ภ.พ. 30"
                      }
                      ],
                    "isSystemDocument": false,
                    "isLockingPeriod": false,
                    "referenceDocument": []
                  },
                  "status": true,
                  "message": "",
                  "code": 0
                }
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
  /journal-entries/approve:
    post:
      tags:
        - Journal Entry
      summary: Approved Journals
      description: Approved Journals includes with Journal Voucher (JV), Purchase Voucher (UV), Sales Voucher (SV), Payment Voucher (PV) and Receipt Voucher (RV)
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JournalEntryRequest'
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentList'
              example: >
                {
                  "data": {
                    "recordId": 200673684,
                    "companyId": 1561530,
                    "documentSerial": "JV2024020002",
                    "status": 1,
                    "description": "test description",
                    "documentDate": "2024-02-06",
                    "createdOn": "2024-02-07T04:04:17.254",
                    "postedDate": "2024-02-07T04:04:17.254",
                    "approvedOn": "2024-02-07T04:04:17.254",
                    "documentType": 51,
                    "debit": 107.0,
                    "credit": 107.0,
                    "remarks": "test remark",
                    "note": "test note",
                    "reference": "DOC000001",
                    "contactId": 39742343,
                    "contactName": "@new test branch",
                    "bookOfAccounts": [
                      {
                        "debitCredit": 1,
                        "chartOfAccountId": 138199446,
                        "value": 107.0,
                        "rowNumber": 0,
                        "description": "test description",
                        "displayName": "11111 / เงินสดในมือ"
                      },
                      {
                        "debitCredit": 3,
                        "chartOfAccountId": 138199648,
                        "value": 100.0,
                        "rowNumber": 1,
                        "description": "test description",
                        "displayName": "41110 / รายได้จากการขายสินค้า"
                      },
                      {
                        "debitCredit": 3,
                        "chartOfAccountId": 138199609,
                        "value": 7.0,
                        "rowNumber": 2,
                        "description": "test description",
                        "displayName": "27111 / ภาษีขาย ภ.พ. 30"
                      }
                      ],
                    "isSystemDocument": false,
                    "isLockingPeriod": false,
                    "referenceDocument": []
                  },
                  "status": true,
                  "message": "",
                  "code": 0
                }
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
  /journal-entries/{id}/{status}:
    post:
      tags:
        - Journal Entry
      summary: Change status Journals
      description: เปลี่ยนสถานะของสมุดรายวัน
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: integer
            format: int64
          example: 12345
          description: ID เอกสารใช้ recordId
        - name: status
          in: path
          required: true
          schema:
            type: string
          example: awaiting
          description: |-
            เปลี่ยนสถานะเอกสารได้ 3 สถานะ 
            - awaiting = รอดำเนินการ
            - approve = อนุมัติ / อนุมัติแล้ว
            - void = ยกเลิก
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                type: object
                properties:
                  data: 
                    type: boolean
                  status:
                    type: boolean
                  message:
                    type: string
                  code:
                    type: number
              example: >
                {
                  "data": true,
                  "status": true,
                  "message": "",
                  "code": 0
                }
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data: 
                    type: boolean
                  status:
                    type: boolean
                  message:
                    type: string
                  code:
                    type: number
              examples:
                InvalidStatus:
                  summary: Invalid status
                  value:
                    data: null
                    status: false
                    message: Cannot Reset JournalEntry due to an invalid status
                    code: 21003
                NotFound:
                  summary: Journal entry not found
                  value:
                    data: null
                    status: false
                    message: JournalEntry not found
                    code: 21001
                UnableToSave:
                  summary: Unable to save
                  value:
                    data: null
                    status: false
                    message: DocumentIsUnableToSaveDueThisDocumentStatusIsAlreadyChange
                    code: 70000
        '401':
          description: Unauthorized
  /chart-of-accounts/accounts:
    get:
      tags:
        - Chart Of Accounts
      summary: Get list of ChartOfAccounts
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                  message:
                    type: string
                  code:
                    type: number
                  data:
                    type: object
                    properties:
                      total:
                        type: number
                        format: integer
                        description: total accounts
                      accounts:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              description: Chart Of Account Id
                            code:
                              type: number
                              description: Chart Of Account Code
                            category:
                              type: string
                              enum:
                                - Asset
                                - Liabilities
                                - Equity
                                - Revenue
                                - Expenses
                            nameLocal:
                              type: string
                              description: Display name in Thai
                            nameForeign:
                              type: string
                              description: Display name in English
                            descriptionLocal:
                              type: string
                              description: Description in Thai (if have)
                            descriptionForeign:
                              type: string
                              description: Description in English (if have)
              example: >
                {
                  "status": true,
                  "message": "",
                  "code": 0,
                  "data": {
                    "total": 241,
                    "accounts": [
                        {
                          "id": 2707445,
                          "code": "11111",
                          "category": "Assets", 
                          "nameLocal": "เงินสดในมือ",
                          "nameForeign": "Cash on Hand",
                          "descriptionLocal": null,
                          "descriptionForeign": null
                        },
                        {
                          "id": 2707876,
                          "code": "11112",
                          "category": "Assets", 
                          "nameLocal": "เงินสดคงเหลือ",
                          "nameForeign": "Cash",
                          "descriptionLocal": null,
                          "descriptionForeign": null
                        }
                    ]
                  }
                }
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
  /product-masters:
    get:
      tags:
        - Product Master
      summary: Get all Product Masters
      parameters:
        - in: query
          name: currentPage
          description: 'Query current page products item. <br> Example Pattern:
            <ex>/products?currentPage=1 </ex>
            <ex>/products?currentPage=1&pageSize=20</ex>'
          schema:
            type: integer
            default: 1
        - in: query
          name: pageSize
          description: 'Query products list amount per page. <br>Example Pattern:
            <ex> /products?pageSize=20 </ex>'
          schema:
            type: integer
            default: 20
        - in: query
          name: sortBy
          description: 'Product Sort By (Encode)
            <br> **name**:
            <br> name = Product master name
            <br> type = Product master type
            <br> productCode = Product master Code / SKU
            <br> categoryId = Product master category
            <br> **sortOrder**:
            <br> asc = Ascending
            <br> desc = Descending
            <br> Example Pattern: <ex> /products?sortBy=[{''name'':''productCode'',''sortOrder'':''asc''}]</ex>'
          schema:
            type: string
            default: [{'name':'name','sortOrder':'asc'}]
        - in: query
          name: filter
          description: 'Product Filter (Encode)
            <br> **columnName**:
            <br> name = Product master name
            <br> type = Product master type
            <br> productCode = Product master Code / SKU
            <br> categoryId = Product master category
            <br> Example Pattern:
            <ex> /products?filter=[{''columnName'':''categoryId'',''columnValue'':''517727'',''columnPredicateOperator'':''And''}]</ex>'
          schema:
            type: string
        - in: query
          name: searchString
          description: 'Query products name or code. <br>Example Pattern: <ex> /products?searchString=001 product </ex>'
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListOfProductMasterResponse'
        '400':
          description: Error code and message will describe the error
        '401':
          description: 401 response
        '500':
          description: 500 response
    post:
      tags:
        - Product Master
      summary: Create Product Master
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/ProductMaster'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductMasterResponse'
        '400':
          description: Error code and message will describe the error
        '401':
          description: 401 response
        '500':
          description: 500 response
  /product-masters/{id}:
    get:
      tags:
        - Product Master
      summary: Get Product Master by Id
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: เลข Id ของ Product master
          schema:
            type: integer
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductMasterResponse'
        '400':
          description: Error code and message will describe the error
        '401':
          description: 401 response
        '500':
          description: 500 response
    put:
      tags:
        - Product Master
      summary: Update Product Master
      parameters:
        - name: Authorization
          in: header
          required: true
          description: เลข Id Product
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/ProductMasterUpdate'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductMasterResponse'
        '400':
          description: Error code and message will describe the error
        '401':
          description: 401 response
        '500':
          description:
            500 response
    delete:
      tags:
        - Product Master
      summary: Delete Product Master
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: เลข Id Contact
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '400':
          description: Error code and message will describe the error
        '401':
          description: 401 response
        '500':
          description: 500 response
  /products:
    get:
      tags:
        - Products
      summary: Get list all products.
      parameters:
        - in: query
          name: currentPage
          description: 'Query current page products item. <br>Example Pattern: <ex>/products?currentPage=1 </ex><ex>/products?currentPage=1&pageSize=20</ex>'
          schema:
            type: integer
        - in: query
          name: pageSize
          description: 'Query products list amount per page. <br>Example Pattern: <ex> /products?pageSize=20 </ex>'
          schema:
            type: integer
        - in: query
          name: sortBy
          description: 'Product Sort By Example (Encode) Pattern: <ex> /products?sortBy=[{''name'':''productCode'',''sortOrder'':''asc''}]</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: filter
          description: 'Product Filter Example (Encode) Pattern: <br> name = Product Name <br> productCode = Product Code / SKU <br> barcode = Product Barcode <br> categoryId = Product Category<br> <ex> /products?filter=[{''columnName'':''categoryId'',''columnValue'':''517727'',''columnPredicateOperator'':''And''}]</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: searchString
          description: 'Query products name or code. <br>Example Pattern: <ex> /products?searchString=001 product </ex>'
          required: false
          schema:
            type: integer
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    post:
      tags:
        - Products
      summary: Create products.
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      requestBody:
        $ref: '#/components/requestBodies/Product'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /products/{id}:
    get:
      tags:
        - Products
      summary: Get products.
      parameters:
        - name: Authorization
          in: header
          required: true
          description: เลข Id Product
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    put:
      tags:
        - Products
      summary: Update products.
      parameters:
        - name: Authorization
          in: header
          required: true
          description: เลข Id Product
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/Product'
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    delete:
      tags:
        - Products
      summary: Delete products.
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: เลข Id Contact
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /contacts:
    get:
      tags:
        - Contacts
      summary: Get list all contacts.
      parameters:
        - in: query
          name: currentPage
          description: 'Query current page contacts. <br>Example Pattern: <ex>/contacts?currentPage=1 </ex><ex>/contacts?currentPage=1&pageSize=20</ex>'
          schema:
            type: integer
        - in: query
          name: pageSize
          description: 'Query contacts list amount per page. <br>Example Pattern: <ex> /contacts?pageSize=20 </ex>'
          schema:
            type: integer
        - in: query
          name: sortBy
          description: Contact Sort By Example (Encode) Pattern:<br> namelocal = Sort By Contact Name <br> contactPerson = Sort By Contact Person <br> email = Sort By Email <br> phone2 = Sort By Contact Mobile <br> contactType = Sort By Contact Type <br> contactCode = Sort By Contact Code <br><ex> /contacts?sortBy=[{'name':'contactPerson','sortOrder':'desc'}]</ex>
          required: false
          schema:
            type: string
        - in: query
          name: filter
          description: 'Contact Filter Example (Encode) Pattern: <ex> /contacts?filter=[{''columnName'':''contactType'',''columnValue'':''3'',''columnPredicateOperator'':''And''}]</ex>'
          required: false
          schema:
            type: string
        - in: query
          name: searchString
          description: 'Query contact name or code. <br>Example Pattern: <ex> /contacts?searchString=001 contact </ex>'
          required: false
          schema:
            type: integer
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    post:
      tags:
        - Contacts
      summary: Create contacts
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
      requestBody:
        $ref: '#/components/requestBodies/Contact'
  /contacts/{id}:
    get:
      tags:
        - Contacts
      summary: Get contacts.
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: เลข Id Contact
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    put:
      tags:
        - Contacts
      summary: Update contacts.
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: เลข Id Contact
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
      requestBody:
        $ref: '#/components/requestBodies/Contact'
    delete:
      tags:
        - Contacts
      summary: Delete contacts.
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
        - name: id
          in: path
          required: true
          description: เลข Id Contact
          schema:
            type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /token:
    post:
      tags:
        - Authentication
      summary: Generate Access Token
      parameters:
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
            default: application/x-www-form-urlencoded
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                grant_type:
                  type: string
                scope:
                  type: string
                client_id:
                  type: string
                client_secret:
                  type: string
                guid:
                  type: string
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /company/info:
    get:
      tags:
        - Business Infomation
      summary: Get business infomation
      description: เรียกดูข้อมูลธรุกิจ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyInfoResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    put:
      tags:
        - Business Infomation
      summary: Edit business infomation
      description: แก้ไขข้อมูลธรุกิจ
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyInfoResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
      requestBody:
        $ref: '#/components/requestBodies/CompanyInfo'
  /bank-channel/bank-accounts:
    get:
      tags:
        - Bank Channel
      summary: Get list All Bank Account
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllBankAccountResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
    post:
      tags:
        - Bank Channel
      summary: Create Bank account.
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankAccountResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
      requestBody:
        $ref: '#/components/requestBodies/BankAccount'
  /bank-channel/cheque:
    get:
      tags:
        - Bank Channel
      summary: Get list All Bank Cheque
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllBankChequeResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /bank-channel/credit-card:
    get:
      tags:
        - Bank Channel
      summary: Get list All My Credit Card
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllCreditCardResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /bank-channel/petty-cash:
    get:
      tags:
        - Bank Channel
      summary: Get list All Petty Cash
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllPettyCashResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /bank-channel/other-channels:
    get:
      tags:
        - Bank Channel
      summary: Get list All Other Channels
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AllOtherChannelsResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
  /settings/documents-remark:
    get:
      tags:
        - Business Infomation
      summary: Get Documents Remark Setting
      description: เรียกดูข้อมูลการตั้งค่าหมายเหตุเอกสารทุกเอกสาร
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            default: Bearer accessToken
      responses:
        '200':
          description: 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentsRemarkResponse'
        '401':
          description: 401 response
        '500':
          description: 500 response
components:
  requestBodies:
    SimpleDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleDocument'
      required: true
    CASimpleDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CASimpleDocument'
      required: true
    SimpleDocumentWithPaymentReceiving:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleDocumentWithPaymentReceiving'
      required: true
    SimpleDocumentWithPaymentPaid:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SimpleDocumentWithPaymentPaid'
      required: true
    InlineDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InlineDocument'
      required: true
    CAInlineDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CAInlineDocument'
      required: true
    InlineDocumentWithPaymentReceiving:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InlineDocumentWithPaymentReceiving'
      required: true
    InlineDocumentWithPaymentPaid:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InlineDocumentWithPaymentPaid'
      required: true
    UpdateAllDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateAllDocument'
      required: true
    UpdateAllCADocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateAllCADocument'
      required: true
    UpgradeSimpleDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpgradeSimpleDocument'
      required: true
    UpgradeSimpleCADocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpgradeSimpleCADocument'
      required: true
    UpgradeInlineDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpgradeInlineDocument'
    UpgradeInlineCADocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpgradeInlineCADocument'
      required: true
    UpgradeSimpleDocumentWithPaymentReceiving:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpgradeSimpleDocumentWithPaymentReceiving'
      required: true
    UpgradeInlineDocumentWithPaymentReceiving:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpgradeInlineDocumentWithPaymentReceiving'
      required: true
    UpgradeSimpleDocumentWithPaymentPaid:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpgradeSimpleDocumentWithPaymentPaid'
      required: true
    UpgradeInlineDocumentWithPaymentPaid:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpgradeInlineDocumentWithPaymentPaid'
      required: true
    UpdateAllExpenseDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateAllExpenseDocument'
      required: true
    ExpenseSimpleDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExpenseSimpleDocument'
      required: true
    ExpenseSimpleDocumentPaymentPaid:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExpenseSimpleDocumentWithPaymentPaid'
      required: true
    ExpenseInlineDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExpenseInlineDocument'
      required: true
    ExpenseInlineDocumentWithPaymentPaid:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExpenseInlineDocumentWithPaymentPaid'
      required: true
    PaymentReceivingDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PaymentReceivingDocument'
      required: true
    PaymentPaidDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PaymentPaidDocument'
      required: true
    Contact:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Contact'
      required: true
    ProductMaster:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProductMasterType'
    ProductMasterUpdate:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProductMasterTypeUpdate'
    Product:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProductType'
      required: true
    SendEmailSimple:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SendEmailSimple'
      required: true
    SendEmailCoppies:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SendEmailCoppies'
      required: true
    ShareDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ShareDocument'
      required: true
    WithholidingTaxDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WithholidingTaxDocument'
      required: true
    UpdateWithholidingTaxDocument:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateWithholidingTaxDocument'
      required: true
    BankAccount:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/BankAccount'
      required: true
    CompanyInfo:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CompanyInfo'
      required: true
    AttachmentBase64:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AttachmentBase64'
      required: true
    ExportPdf:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExportPdfRequest'
      required: true
    ExportPdfTaxInvoice:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ExportPdfTaxInvoiceRequest'
      required: true
            
  schemas:
    AuthenResponse:
      type: object
      properties:
        access_token:
          type: string
        expires_in:
          type: integer
        token_type:
          type: string
        refresh_token:
          type: string
        error:
          type: string
    Document:
      type: object
      properties:
        contactCode:
          type: string
          description: รหัส ลูกค้า/ผู้จำหน่าย
          example: '001'
        contactId:
          type: integer
          format: int64
          description: เลขที่ผู้ติดต่อ Id ลูกค้า/ผู้จำหน่าย
        contactName:
          type: string
          description: 'ชื่อ ลูกค้า/ผู้จำหน่าย <br> <ex>Example: บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ</ex>'
          example: บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ
        contactAddress:
          type: string
          description: ที่อยู่ ลูกค้า/ผู้จำหน่าย
          example: 'ที่อยู่ ลูกค้า/ผู้จำหน่าย'
        contactTaxId:
          type: string
          description: 'เลขประจำตัวผู้เสียภาษี ลูกค้า หรือ ผู้จำหน่าย/ลูกค้า <br> (ถ้ามีจำเป็นต้องครบ 13 หลัก)
            <br> <ex>Example: 1234567890123 </ex>'
          example: '1234567890123'
        contactBranch:
          type: string
          description: สำนักงาน/สาขา
          example: 'สำนักงาน/สาขา'
        contactPerson:
          type: string
          description: ชื่อผู้ติดต่อ
          example: 'ลูกค้า'
        contactEmail:
          type: string
          description: 'อีเมลผู้ติดต่อ <br> <ex>Example: contact@email.com</ex>'
          example: contact@email.com
        contactNumber:
          type: string
          description: 'เบอร์มือถือผู้ติดต่อ <br> <ex>Example: 099-999-9999</ex>'
          example: 099-999-9999
        contactZipCode:
          type: string
          description: รหัสไปรษณีย์ติดต่อ
          example: '12345'
        contactGroup:
          type: integer
          description: ประผู้ติดต่อ <br> 1 = บุคคลธรรมดา <br> 3 = นิติบุคคล
          default: 1
        publishedOn:
          type: string
          format: date
          description: 'วันที่เอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
          example: '2021-01-01'
          default: currentDate
        creditType:
          type: integer
        creditDays:
          type: integer
        dueDate:
          type: string
          format: date
        salesName:
          type: string
          description: 'ชื่อผู้สร้างเอกสาร หรือ ชื่อพนักงานขาย <br> <ex>Example: sale@email.com or Mr.Sale Shop</ex>'
          example: พนักงาน ขายหน้าร้าน
        projectName:
          type: string
          description: ชื่อโปรเจค <br> Project name (ชื่อโปรเจค) will be displayed as Project Details in the document
          example: 'project A'
        reference:
          type: string
          description: 'เลขที่อ้างอิง หรือ เลขที่เอกสารที่เกี่ยวข้อง
            <br> Reference is an information to be declared in the document, not the system document reference
            <br> <ex>Example: INV2020010001</ex>'
          example: INV2020010001
        isVatInclusive:
          type: boolean
          default: false
          description: 'Activate function of inclusive Vat for pricePerUnit
            <li> Input **true** when pricePerUnit in items is included Vat
            <li> Input **false** when pricePerUnit in items is not included Vat (excluded Vat)'
          example: false
        useReceiptDeduction:
          type: boolean
          description: เปิดใช้งานฟังก์ชั่น ปรับลดท้ายเอกสาร <br> (เฉพาะเอกสารใบกำกับภาษี / ใบเสร็จรับเงิน และ ใบเสร็จรับเงิน)
          default: false
        subTotal:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** <br>
            มูลค่ารวมเป็นเงิน <br> The value should be the sum of pricePerUnit'
          default: 0
          example: 100.01
        discountPercentage:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 4 digits** <br>
            มูลค่าส่วนลดเป็นเปอร์เซ็นต์'
          default: 0
          example: 100.0001
        discountAmount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** <br>
            มูลค่าส่วนลดเป็นจำนวน (บาท)'
          default: 0
          example: 100.01
        totalAfterDiscount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** <br>
            มูลค่าหลังหักส่วนลด <br> The value should be the result of subTotal deducted by discountAmount'
          default: 0
          example: 10.51
        isVat:
          type: boolean
          default: false
          description: 'Activate function of document Vat calculation
            <li> Input **true**  when Vat is calculated, isVatInclusive could be input as both true or false
            <li> Input **false** when Vat is not calculated, isVatInclusive must be input as false only'
          example: false
        isManualVat:
          type: boolean
          default: false
          description: 'Activate function of manual VAT customization
            <li> Input **true** when vatRate of document is not 7%
            <li> Input **false** when vatRate of document is 7%'
          example: false
        vatAmount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits**
            <br> The value should not exceed than totalAfterDiscount
            <br> If isVat is false, vatAmount must be input as 0 only'
          default: 0.00
          example: 10.51
        grandTotal:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** <br>
            จำนวนเงินรวมทั้งสิ้น (รวมภาษีมูลค่าเพิ่ม 7% แล้ว)
            <br> The value should be the result of totalAfterDiscount deducted by VatAmount'
          default: 0
          example: 321.01
        documentShowWithholdingTax:
          type: boolean
          description: แสดงหรือไม่แสดง หัก ณ ที่จ่ายท้ายเอกสาร
          default: false
        documentWithholdingTaxPercentage:
          type: number
          format: decimal
          description: ภาษี ณ ที่จ่าย (%)
            <br> If documentShowWithholdingTax is false, documentWithholdingTaxPercentage must be input as 0 only
          default: 0
        documentWithholdingTaxAmount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** <br>
            มูลค่าภาษีหัก ณ ที่จ่าย
            <br> The value of this field will be calculated by system according to the value in
            documentWithholdingTaxPercentage, the manual value will not be displayed in the document.
            <br> If documentShowWithholdingTax is false, documentWithholdingTaxAmount must be input as 0 only'
          default: 0
        documentDeductionType:
          type: integer
          description: ประเภทรายการปรับลด <br> 1 = ส่วนลดพิเศษ <br> 3 = ค่านายหน้าและส่วนแบ่งการขาย
            <br> 5 = ค่าดำเนินการ <br> 7 = ปัดเศษ <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)
          default: 0
        documentDeductionAmount:
          type: number
          format: decimal
          description: จำนวนเงินยอดรายการปรับลด <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)
          default: 0
        remarks:
          type: string
          description: หมายเหตุเอกสาร
          example: 'remarks'
        internalNotes:
          type: string
          description: โน๊ตภายในบริษัท
          example: 'note'
        showSignatureOrStamp:
          type: boolean
          description: ลายเซ็นอิเล็กทรอนิกส์และตรายาง
          default: true
        externalDocumentId:
          type: string
          description: 'รหัสเอกสารอ้างอิงจากระบบภายนอก
            <br> <ex>Example: platform-123456</ex>'
          example: 'platform-123456'
      required:
        - contactName
        - isVatInclusive
        - totalAfterDiscount
        - isVat
        - grandTotal
        - subTotal
    InlineDocumentFields:
      type: object
      properties:
        discountType:
          type: integer
          description: รูปแบบส่วนลดในเอกสาร กรณีใช้รูปแบบ Inline ส่วนลด หรือ ภาษี แยกตามรายการสินค้า
            <br> สามารถเลือกรูปแบบส่วนลดได้ <br> 1 =  เปอร์เซ็นต์ <br> 3 = จำนวน (บาท)
            <br> Related to discountAmount in items
          default: 1
        useInlineDiscount:
          type: boolean
          description: Activate function of inline discount or discount by item
            <br> useInlineDiscount will be a fixed value as **true**
            <br> Related to discountAmount in items
          default: true
        useInlineVat:
          type: boolean
          description: Activate function of inline Vat or Vat by item
            <br> Related to vatRate in items
          default: false
        exemptAmount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** <br>
            Amount that is to be free from taxation
            <br> Related to vatableAmount
            <br> Tips: when useInlineVat is true, exemptAmount should be sum of total in items which vatRate is 0 or -1'
          default: 0.00
          example: 10.51
        vatableAmount:
          type: number
          format: decimal
          nullable: true
          description: '**Limit decimal places to no more than 2 digits** <br>
            Amount that is subject to taxation
            <br> The value will be automatically calculated by the system.
            <li> If isVatInclusive is **true**, vatableAmount is ( totalAfterDiscount - ExemptAmount ) - vatAmount
            <li> If isVatInclusive is **false**, vatableAmount is totalAfterDiscount - exemptAmount'
          default: 0.00
          example: 10.51
    DateFields:
      type: object
      properties:
        creditType:
          type: integer
          description: รูปแบบเครดิต <br> 1 = เครดิต (วัน) <br> 3 = เงินสด  <br> 5 = เครดิต (ไม่แสดงวันที่ครบกำหนด)
          default: 1
        creditDays:
          type: integer
          description: 'จำนวนวันที่ให้เครดิต <br> If creditType is 3 (เงินสด), creditDays will be a fixed value as 0
            <br> <ex>Example: 30</ex>'
          default: 0
          example: 30
        dueDate:
          type: string
          format: date
          description: 'Format yyyy-MM-dd
            <br> dueDate will be calculated based on publishedOn and creditDays when creditDays is inclueded in payload.
            If not, creditDays will be calculated by dueDate and publishedOn.
            <li> e.g. input creditType as 1 (เครดิตวัน), publishedOn as "2021-01-01" and creditDays is "30",
            then dueDate will be displayed as "2021-01-31" after the calculation
            <li> e.g. input creditType as 1 (เครดิตวัน), publishedOn as "2021-01-01" and dueDate as "2021-01-20",
            then creditDays will be displayed as "19" after the calculation
            <br> <ex>Example: 2021-01-01</ex>'
          example: '2021-01-31'
    DateWithPaymentFields:
      type: object
      properties:
        creditType:
          type: integer
          description: creditType will be a fixed value as 3 (เงินสด)
          default: 3
        creditDays:
          type: integer
          description: 'จำนวนวันที่ให้เครดิต <br> creditDays will be a fixed value as 0'
          default: 0
        dueDate:
          type: string
          description: 'Format yyyy-MM-dd
            <br> dueDate will be displayed as publishedOn
            <br> <ex>Example: 2021-01-01</ex>'
          example: '2021-01-01'
    SimpleDocument:
      allOf:
        - type: object
          properties:
            recordId:
              type: integer
              format: int64
              description: Document Id (to be deprecated) <br> Input as 0 only
              default: 0
        - $ref: '#/components/schemas/Document'
        - $ref: '#/components/schemas/DateFields'
        - type: object
          properties:
            documentStructureType:
              type: string
              nullable: true
              description: 'Input "SimpleDocument"'
              example: 'SimpleDocument'
            saleAndPurchaseChannel:
              type: string
              description: ช่องทางการขาย สำหรับ Account ที่เชื่อมต่อกับ E-commerce เมนู My Platform <br>1. Lazada <br> 2. Shopee
              example: ''
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Simple
              items:
                $ref: '#/components/schemas/SimpleProductItem'
      required:
        - items
    InlineDocument:
      allOf:
        - type: object
          properties:
            recordId:
              type: integer
              format: int64
              description: Document Id (to be deprecated) <br> Input as 0 only
              default: 0
        - $ref: '#/components/schemas/Document'
        - $ref: '#/components/schemas/DateFields'
        - $ref: '#/components/schemas/InlineDocumentFields'
        - type: object
          properties:
            documentStructureType:
              type: string
              nullable: true
              description: 'Input "InlineDocument"'
              example: 'InlineDocument'
            saleAndPurchaseChannel:
              type: string
              description: ช่องทางการขาย สำหรับ Account ที่เชื่อมต่อกับ E-commerce เมนู My Platform <br>1. Lazada <br> 2. Shopee
              example: ''
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Inline
              items:
                $ref: '#/components/schemas/InlineProductItem'
          required:
            - items
    CASimpleDocument:
      allOf:
        - type: object
          properties:
            recordId:
              type: integer
              format: int64
              description: Document Id (to be deprecated) <br> Input as 0 only
              default: 0
        - $ref: '#/components/schemas/Document'
        - $ref: '#/components/schemas/DateWithPaymentFields'
        - type: object
          properties:
            documentStructureType:
              type: string
              nullable: true
              description: 'Input "SimpleDocument"'
              example: SimpleDocument
            saleAndPurchaseChannel:
              type: string
              description: ช่องทางการขาย สำหรับ Account ที่เชื่อมต่อกับ E-commerce เมนู My Platform <br>1. Lazada <br> 2. Shopee
              example: ''
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Simple
              items:
                $ref: '#/components/schemas/SimpleProductItem'
      required:
        - items
    CAInlineDocument:
      allOf:
        - type: object
          properties:
            recordId:
              type: integer
              format: int64
              description: Document Id (to be deprecated) <br> Input as 0 only
              default: 0
        - $ref: '#/components/schemas/Document'
        - $ref: '#/components/schemas/DateWithPaymentFields'
        - type: object
          properties:
            documentStructureType:
              type: string
              nullable: true
              description: 'Input "InlineDocument"'
              example: InlineDocument
            saleAndPurchaseChannel:
              type: string
              description: ช่องทางการขาย สำหรับ Account ที่เชื่อมต่อกับ E-commerce เมนู My Platform <br>1. Lazada <br> 2. Shopee
              example: ''
        - $ref: '#/components/schemas/InlineDocumentFields'
        - type: object
          properties:
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Inline
              items:
                $ref: '#/components/schemas/InlineProductItem'
          required:
            - items
    PaymentReceivingInSellDocument:
      type: object
      properties:
        paymentMethod:
          type: integer
          format: int64
          default: 1
        paymentDate:
          type: string
          format: date
          description: 'วันที่รับชำระเงิน / วันที่ชำระเงิน รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
          example: '2021-01-01'
        collected:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits**
            <br> จำนวนเงินยอดรับสุทธิ <br> (The value cannot be 0)
            <br> <ex> Example : 100.00 </ex>'
          example: 100.00
        paymentDeductionType:
          type: integer
          format: int64
          description: 'ประเภทรายการปรับลด: <br> 1 = ส่วนลดพิเศษ <br> 3 = ค่านายหน้าและส่วนแบ่งการขาย
            <br> 5 = ค่าดำเนินการ <br> 7 = ปัดเศษ <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)'
          example: 0
        paymentDeductionAmount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits**
            <br> จำนวนเงินยอดรายการปรับลด <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)'
          default: 0
        withheldPercentage:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 4 digits**
            <br> เปอร์เซ็น หัก ณ ที่จ่าย <br> 0.5 = 0.5% <br> 0.75 = 0.75% <br> 1 = 1% <br> 1.5 = 1.5% <br> 2 = 2%
            <br> 3 = 3% <br> 5 = 5% <br> 10 = 10% <br> 15 = 15% <br> -1 = จำนวนเงิน
            <red>(สำหรับเอกสารที่ใช้ภาษีแยกตามรายการสินค้า ต้องใช้เป็นจำนวนเงิน)</red>'
          example: 0
        withheldAmount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits**
            <br> จำนวน ยอดหัก ณ ที่จ่าย <br> The value should be related with collected and withheldPercentage'
          default: 0
        paymentRemarks:
          type: string
          description: หมายเหตุ การรับชำระเงิน หรือ ชำระเงิน
          example: DocumentWithPayment
        remainingCollectedType:
          type: integer
          format: int64
          description: 'สาเหตุเงินขาด เงินเกิน <br> 51 = เงินขาดหรือเงินกิน <br> 55 = ค่าธรรมเนียมธนาคาร
            <br> Input when collected is different to grandTotal'
          default: 0
        remainingCollected:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits**
            <br> จำนวน ยอดเงินขาด หรือ เงินเกิน
            <br> The value should be related with collected and grandTotal'
          default: 0.00
          example: 100.01
      required:
        - paymentDate
        - collected
    PaymentMethodReceivingCheque:
      type: object
      properties:
        chequeDate:
          type: string
          format: date
          description: 'วันที่หน้าเช็ค รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
          example: '2021-01-01'
        chequeNumber:
          type: string
          description: 'เลขที่เช็คธนาคาร <br> <ex>Example: 122-122-122</ex>'
          example: 122-122-122
        chequeBankAccountId:
          type: integer
          format: int64
          example: 1
      required:
        - chequeDate
        - chequeBankAccountId
    PaymentMethodReceivingTransfer:
      type: object
      properties:
        transferBankAccountId:
          type: integer
          format: int64
          description: 'ธนาคารที่ใช้รับชำระเงิน ธนาคารที่ชำระเงิน <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)
            <br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)<br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
            <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank)<br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
            <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank)<br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
            <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya)<br> 10 = ธนาคารออมสิน - (Government Savings Bank)
            <br> 11 = ธนาคารธนชาต - (Thanachart Bank)<br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
            <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank)<br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)<br> 19 = ธนาคารทิสโก้ - (Tisco Bank)
            <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
            <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
            <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank)
            <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
            <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China
            <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
            <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
            <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
            <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
            <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
            <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank)
            <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
            <br> The value should be related with the bank name of bankAccountId'
          default: 0
        bankAccountId:
          type: integer
          format: int64
          description: 'id of bank account <br> The value is able to GET by
            go to section MyCompany > Bank Channel > Get list all Bank Account 
            <a href="https://developers.flowaccount.com/api-reference#tag/bank-channel/get/bank-channel/bank-accounts" target="_blank">(link)</a> ,
            <br> the field name is `bankAccountId`
            <br> <ex>Example: 12345</ex>'
          example: '12345'
      required:
      - bankAccountId
    PaymentMethodReceivingOtherChannel:
      type: object
      properties:
        otherChannelId:
          type: integer
          format: int64
          description: 'id บัญชีช่องทางอื่น ๆ
            <br> The value is able to GET by go to section MyCompany > Bank Channel > Get list All Other Channels
            <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/get/bank-channel/other-channels" target="_blank">(link)</a> ,
            <br> the field name is `otherChannelsId`
            <ex> Example: 1234 </ex>'
          example: 1234
        otherChannelPaymentChannel:
          type: integer
          format: int64
          description: 'ประเภทช่องทางอื่น ๆ <br> 1 = เครื่องบันทึกเงินสด (POS) <br> 3 = ช่องทางรับชำระออนไลน์ (Payment Gateway)
            <br> 5 = เครื่องรูดบัตรเครดิต(EDC) <br> 7 = ร้านค้าออนไลน์ (Online shop/E-Commerce)
            <br> The value is related to otherChannelId
            <ex> Example: 1 </ex>'
          default: 0
        otherChannelName:
          type: string
          description: 'ชื่อเครื่อง/เลขซีเรียล/ชื่อผู้ให้บริการ/ชื่อ Market place 
            <br> The value is related to otherChannelId
            <ex> Example: Wongnai POS </ex>'
          example: Wongnai POS
      required:
      - otherChannelId
    PaymentMethodPaidCreditCard:
      type: object
      properties:
        paymentMethod:
          type: integer
          description: ประเภทการชำระเงิน <br> 7 = บัตรเครดิตจ่าย
            <br> Required user to setup credit card channel before using Credit Card Payment Method in FlowAccount website,
            go to MyCompany > Banking Channel > Add Account > Credit Card
          example: 7
        creditCardBankAccountId:
          type: integer
          format: int64
          description: ธนาคารที่ชำระด้วยบัตรเครดิต <br>  1 = ธนาคารกรุงเทพ - (Bangkok Bank)
            <br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)<br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
            <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank)<br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
            <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank)<br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
            <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya)<br> 10 = ธนาคารออมสิน - (Government Savings Bank)
            <br> 11 = ธนาคารธนชาต - (Thanachart Bank)<br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
            <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank)<br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)<br> 19 = ธนาคารทิสโก้ - (Tisco Bank)
            <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
            <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
            <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank)
            <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
            <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
            <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
            <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
            <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
            <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
            <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
            <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank)
            <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
            <br> The value should be related with the bank name of creditCardId
          default: 0
          example: 1
        creditCardId:
          type: integer
          format: int64
          description: 'id of credit card <br> The value is able to GET by go to
            section MyCompany > Bank Channel > Get list All My Credit Card​
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/get/bank-channel/credit-card" target="_blank">(link)</a> ,
            <br> the field name is `creditCardId`
            <ex>Example: 1234</ex>'
          default: 0
          example: 1234
      required:
        - creditCardBankAccountId
        - creditCardId
    PaymentMethodPaidPettyCash:
      type: object
      properties:
        paymentMethod:
          type: integer
          description: ประเภทการชำระเงิน <br> 11 = เงินสดย่อย
            <br> Required user to setup petty cash channel before using Credit Card Payment Method in FlowAccount website,
            go to MyCompany > Banking Channel > Add Account > Petty Cash
          example: 11
        pettyCashId:
          type: integer
          format: int64
          description: 'id of petty cash <br> The value is able to GET by go to
            section MyCompany>Bank Channel > Get list all Petty Cash
            <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/get/bank-channel/petty-cash" target="_blank">(link)</a> ,
            <br> the field name is `pettyCashId`
            <ex>Example: 1234</ex>'
          default: 0
          example: 1234
        pettyCashName:
          type: string
          description: 'ชื่อบัญชีเงินสดย่อย 
            <br> The value should be related with the bank name of pettyCashId
            <br> <ex> Example : บัญชีเงินสดย่อยสำหรับซื้ออุปกรณ์สำนักงาน </ex>'
      required:
        - pettyCashId
    PaymentReceivingInBuyDocument:
      type: object
      properties:
        paymentMethod:
          type: integer
          format: int64
          default: 1
        paymentDate:
          type: string
          format: date
          description: 'วันที่รับชำระเงิน / วันที่ชำระเงิน รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
          example: '2021-01-01'
        collected:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** 
            <br> จำนวนเงินยอดรับสุทธิ <br> (The value cannot be 0)
            <br> <ex> Example : 100.00 </ex>'
          example: 100.00
        withheldPercentage:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 4 digits**
            <br> เปอร์เซ็น หัก ณ ที่จ่าย <br> 0.5 = 0.5% <br> 0.75 = 0.75% <br> 1 = 1% <br> 1.5 = 1.5% <br> 2 = 2%
            <br> 3 = 3% <br> 5 = 5% <br> 10 = 10% <br> 15 = 15% <br> -1 = จำนวนเงิน
            <red>(สำหรับเอกสารที่ใช้ภาษีแยกตามรายการสินค้า ต้องใช้เป็นจำนวนเงิน)</red>'
          example: 0
        withheldAmount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits**
            <br> จำนวน ยอดหัก ณ ที่จ่าย <br> The value should be related with collected and withheldPercentage'
          default: 0
        paymentRemarks:
          type: string
          description: หมายเหตุ การรับชำระเงิน หรือ ชำระเงิน
          example: DocumentWithPayment
        remainingCollectedType:
          type: integer
          format: int64
          description: 'สาเหตุเงินขาด เงินเกิน <br> 51 = เงินขาดหรือเงินกิน <br> 55 = ค่าธรรมเนียมธนาคาร
            <br> Input when collected is different to grandTotal'
          default: 0
        remainingCollected:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits**
            <br> จำนวน ยอดเงินขาด หรือ เงินเกิน
            <br> The value should be related with collected and grandTotal'
          default: 0.00
          example: 100.01
      required:
        - paymentDate
        - collected
    SimpleDocumentWithPayment:
      allOf:
        - $ref: '#/components/schemas/Document'
        - $ref: '#/components/schemas/DateWithPaymentFields'
        - type: object
          properties:
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Simple
              items:
                $ref: '#/components/schemas/SimpleProductItem'
            documentPaymentStructureType:
              type: string
              nullable: true
          required:
            - items
    InlineDocumentWithPayment:
      allOf:
        - $ref: '#/components/schemas/Document'
        - $ref: '#/components/schemas/DateWithPaymentFields'
        - $ref: '#/components/schemas/InlineDocumentFields'
        - type: object
          properties:
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Inline
              items:
                $ref: '#/components/schemas/InlineProductItem'
            documentPaymentStructureType:
              type: string
              nullable: true
          required:
            - items
    SimpleDocumentWithPaymentReceiving:
      oneOf:
        - $ref: '#/components/schemas/SimpleDocumentWithPaymentReceivingCash'
        - $ref: '#/components/schemas/SimpleDocumentWithPaymentReceivingCheque'
        - $ref: '#/components/schemas/SimpleDocumentWithPaymentReceivingTransfer'
        - $ref: '#/components/schemas/SimpleDocumentWithPaymentReceivingOtherChannel'
    SimpleDocumentWithPaymentReceivingCash:
      title: SimpleDocumentWithPaymentReceivingCash
      allOf:
        - $ref: '#/components/schemas/SimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมรับชำระเงิน ด้วยเงินสด
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 1 = เงินสด
              example: 1
    SimpleDocumentWithPaymentReceivingCheque:
      title: SimpleDocumentWithPaymentReceivingCheque
      allOf:
        - $ref: '#/components/schemas/SimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingCheque'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมรับชำระเงิน ด้วยเช็ค
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 3 = เช็ค
                <br> Required user to setup cheque banking channel before using Cheque Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Cheque
              example: 3
            chequeBankAccountId:
              type: integer
              description: ธนาคารที่ระบุหน้าเช็ค <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)
                <br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
                <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank) <br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
                <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank) <br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
                <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya) <br> 10 = ธนาคารออมสิน - (Government Savings Bank)
                <br> 11 = ธนาคารธนชาต - (Thanachart Bank) <br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
                <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank) <br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)
                <br> 19 = ธนาคารทิสโก้ - (Tisco Bank) 
                <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
                <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
                <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank
                <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
                <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
                <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
                <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
                <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
                <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
                <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
                <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) 
                <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
    SimpleDocumentWithPaymentReceivingTransfer:
      title: SimpleDocumentWithPaymentReceivingTransfer
      allOf:
        - $ref: '#/components/schemas/SimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingTransfer'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมรับชำระเงิน ด้วยการโอนเงิน
            paymentMethod:
              type: integer
              description: 'ประเภทการเก็บเงิน <br> 5 = โอนเงิน
                <br> Required user to setup bank account before using Transfer Payment Method.
                <br> To setup banking channel, go to section MyCompany > Bank Channel > Create Bank Account
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/post/bank-channel/bank-accounts" target="_blank">(link)</a>
                <br> or in FlowAccount website, go to MyCompany > Banking Channel > Add Account > Bank Account'
              example: 5
    SimpleDocumentWithPaymentReceivingOtherChannel:
      title: SimpleDocumentWithPaymentReceivingOtherChannel
      allOf:
        - $ref: '#/components/schemas/SimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingOtherChannel'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมรับชำระเงิน ด้วยช่องทางอื่น ๆ
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 13 = ช่องทางอื่น ๆ EDC, POS, Payment Gateway, Online Shop/E-Commerce
                <br> Required user to setup other channels before using OtherChannel Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Other Channels > Select Payment Channel as EDC,
                POS, Online Payment Gateway or Online shop/E-Commerce
              example: 13
    SimpleDocumentWithPaymentPaid:
      oneOf:
        - $ref: '#/components/schemas/SimpleDocumentWithPaymentPaidCash'
        - $ref: '#/components/schemas/SimpleDocumentWithPaymentPaidCheque'
        - $ref: '#/components/schemas/SimpleDocumentWithPaymentPaidTransfer'
        - $ref: '#/components/schemas/SimpleDocumentWithPaymentPaidCreditCard'
        - $ref: '#/components/schemas/SimpleDocumentWithPaymentPaidPettyCash'
        - $ref: '#/components/schemas/SimpleDocumentWithPaymentPaidOtherChannel'
    SimpleDocumentWithPaymentPaidCash:
      title: SimpleDocumentWithPaymentPaidCash
      allOf:
        - $ref: '#/components/schemas/SimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยเงินสด
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 1 = เงินสด
              example: 1
    SimpleDocumentWithPaymentPaidCheque:
      title: SimpleDocumentWithPaymentPaidCheque
      allOf:
        - $ref: '#/components/schemas/SimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingCheque'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยเช็ค
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 3 = บัญชีเช็คจ่าย
                <br> Required user to setup cheque banking channel before using Cheque Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Cheque
              example: 3
            chequeBankAccountId:
              type: integer
              description: ธนาคารที่ระบุหน้าเช็ค <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)
                <br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
                <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank) <br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
                <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank) <br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
                <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya) <br> 10 = ธนาคารออมสิน - (Government Savings Bank)
                <br> 11 = ธนาคารธนชาต - (Thanachart Bank) <br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
                <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank) <br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)
                <br> 19 = ธนาคารทิสโก้ - (Tisco Bank) 
                <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
                <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
                <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank
                <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
                <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
                <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
                <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
                <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
                <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
                <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
                <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) 
                <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
                <br> The value should be related with the bank name of bankAccountId
              example: 1
            bankAccountId:
              type: integer
              format: int64
              description: 'เลข id บัญชีธนาคารที่ใช้ชำระเงิน <br><red>สามารถ GET มาได้จาก My Company > Bank Account </red><br> <ex>Example: 12345</ex>'
              default: 0
              example: '12345'
            bankChequeId:
              type: integer
              format: int64
              description: 'id of cheque <br> The value is able to GET by go to section MyCompany > Bank Channel > Get list all Bank Cheque
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/get/bank-channel/cheque" target="_blank">(link)</a> ,
                <br> the field name is `bankChequeId`
                <br> <ex>Example: 1234</ex>'
              default: 0
              example: '1234'
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยเช็ค <br> <ex> Example : 100.0000 </ex>'
              default: 0
          required:
            - bankAccountId
            - bankChequeId
    SimpleDocumentWithPaymentPaidTransfer:
      title: SimpleDocumentWithPaymentPaidTransfer
      allOf:
        - $ref: '#/components/schemas/SimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingTransfer'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยการโอนเงิน
            paymentMethod:
              type: integer
              description: 'ประเภทการชำระเงิน <br> 5 = โอนเงิน
                <br> Required user to setup bank account before using Transfer Payment Method.
                <br> To setup banking channel, go to section MyCompany > Bank Channel > Create Bank Account
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/post/bank-channel/bank-accounts" target="_blank">(link)</a>
                <br> or in FlowAccount website, go to MyCompany > Banking Channel > Add Account > Bank Account'
              example: 5
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยการโอนเงิน <ex> Example : 100.0000 </ex>'
              default: 0
    SimpleDocumentWithPaymentPaidCreditCard:
      title: SimpleDocumentWithPaymentPaidCreditCard
      allOf:
        - $ref: '#/components/schemas/SimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodPaidCreditCard'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยบัตรเครดิต
    SimpleDocumentWithPaymentPaidPettyCash:
      title: SimpleDocumentWithPaymentPaidPettyCash
      allOf:
        - $ref: '#/components/schemas/SimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodPaidPettyCash'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยเงินสดย่อย
    SimpleDocumentWithPaymentPaidOtherChannel:
      title: SimpleDocumentWithPaymentPaidOtherChannel
      allOf:
        - $ref: '#/components/schemas/SimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingOtherChannel'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยช่องทางอื่น ๆ
            paymentMethod:
              type: integer
              description: ชำระเงิน ช่องทางอื่น ๆ ได้แก่ เครื่องบันทึกเงินสด (POS), เครื่องรูดบัตรเครดิต (EDC),
                ช่องทางรับชำระออนไลน์ (Payment Gateway), ร้านค้าออนไลน์ (Online shop/E-Commerce)
                <br> Required user to setup other channels before using OtherChannel Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Other Channels > Select Payment Channel as EDC,
                POS, Online Payment Gateway or Online shop/E-Commerce
              example: 13
    InlineDocumentWithPaymentReceiving:
      oneOf:
        - $ref: '#/components/schemas/InlineDocumentWithPaymentReceivingCash'
        - $ref: '#/components/schemas/InlineDocumentWithPaymentReceivingCheque'
        - $ref: '#/components/schemas/InlineDocumentWithPaymentReceivingTransfer'
        - $ref: '#/components/schemas/InlineDocumentWithPaymentReceivingOtherChannel'
    InlineDocumentWithPaymentReceivingCash:
      title: InlineDocumentWithPaymentReceivingCash
      allOf:
        - $ref: '#/components/schemas/InlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยเงินสด
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 1 = เงินสด
              example: 1
    InlineDocumentWithPaymentReceivingCheque:
      title: InlineDocumentWithPaymentReceivingCheque
      allOf:
        - $ref: '#/components/schemas/InlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingCheque'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยเช็ค
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 3 = เช็ค
                <br> Required user to setup cheque banking channel before using Cheque Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Cheque
              example: 3
            chequeBankAccountId:
              type: integer
              description: ธนาคารที่ระบุหน้าเช็ค <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)
                <br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
                <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank) <br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
                <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank) <br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
                <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya) <br> 10 = ธนาคารออมสิน - (Government Savings Bank)
                <br> 11 = ธนาคารธนชาต - (Thanachart Bank) <br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
                <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank) <br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)
                <br> 19 = ธนาคารทิสโก้ - (Tisco Bank) 
                <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
                <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
                <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank
                <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
                <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
                <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
                <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
                <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
                <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
                <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
                <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) 
                <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
    InlineDocumentWithPaymentReceivingTransfer:
      title: InlineDocumentWithPaymentReceivingTransfer
      allOf:
        - $ref: '#/components/schemas/InlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingTransfer'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยการโอนเงิน
            paymentMethod:
              type: integer
              description: 'ประเภทการเก็บเงิน <br> 5 = โอนเงิน
                <br> Required user to setup bank account before using Transfer Payment Method.
                <br> To setup banking channel, go to section MyCompany > Bank Channel > Create Bank Account
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/post/bank-channel/bank-accounts" target="_blank">(link)</a>
                <br> or in FlowAccount website, go to MyCompany > Banking Channel > Add Account > Bank Account'
              example: 5
    InlineDocumentWithPaymentReceivingOtherChannel:
      title: InlineDocumentWithPaymentReceivingOtherChannel
      allOf:
        - $ref: '#/components/schemas/InlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingOtherChannel'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยช่องทางอื่น ๆ
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 13 = ช่องทางอื่น ๆ EDC, POS, Payment Gateway, Online Shop/E-Commerce
                <br> Required user to setup other channels before using OtherChannel Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Other Channels > Select Payment Channel as EDC,
                POS, Online Payment Gateway or Online shop/E-Commerce
              example: 13
    InlineDocumentWithPaymentPaid:
      oneOf:
        - $ref: '#/components/schemas/InlineDocumentWithPaymentPaidCash'
        - $ref: '#/components/schemas/InlineDocumentWithPaymentPaidCheque'
        - $ref: '#/components/schemas/InlineDocumentWithPaymentPaidTransfer'
        - $ref: '#/components/schemas/InlineDocumentWithPaymentPaidCreditCard'
        - $ref: '#/components/schemas/InlineDocumentWithPaymentPaidPettyCash'
        - $ref: '#/components/schemas/InlineDocumentWithPaymentPaidOtherChannel'
    InlineDocumentWithPaymentPaidCash:
      title: InlineDocumentWithPaymentPaidCash
      allOf:
        - $ref: '#/components/schemas/InlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยเงินสด
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 1 = เงินสด
              example: 1
    InlineDocumentWithPaymentPaidCheque:
      title: InlineDocumentWithPaymentPaidCheque
      allOf:
        - $ref: '#/components/schemas/InlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingCheque'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยเช็ค
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 3 = บัญชีเช็คจ่าย
                <br> Required user to setup cheque banking channel before using Cheque Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Cheque
              example: 3
            chequeBankAccountId:
              type: integer
              description: ธนาคารที่ระบุหน้าเช็ค <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)
                <br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
                <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank) <br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
                <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank) <br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
                <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya) <br> 10 = ธนาคารออมสิน - (Government Savings Bank)
                <br> 11 = ธนาคารธนชาต - (Thanachart Bank) <br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
                <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank) <br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)
                <br> 19 = ธนาคารทิสโก้ - (Tisco Bank) 
                <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
                <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
                <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank
                <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
                <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
                <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
                <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
                <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
                <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
                <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
                <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) 
                <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
                <br> The value should be related with the bank name of bankAccountId
            bankAccountId:
              type: integer
              format: int64
              description: 'เลข id บัญชีธนาคารที่ใช้ชำระเงิน <br><red>สามารถ GET มาได้จาก My Company > Bank Account </red><br> <ex>Example: 12345</ex>'
              default: 0
              example: '12345'
            bankChequeId:
              type: integer
              format: int64
              description: 'id of cheque <br> The value is able to GET by go to section MyCompany > Bank Channel > Get list all Bank Cheque
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/get/bank-channel/cheque" target="_blank">(link)</a> ,
                <br> the field name is `bankChequeId`
                <br> <ex>Example: 1234</ex>'
              default: 0
              example: '1234'
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยเช็ค <br> <ex> Example : 100.0000 </ex>'
              default: 0
          required:
            - bankAccountId
            - bankChequeId
    InlineDocumentWithPaymentPaidTransfer:
      title: InlineDocumentWithPaymentPaidTransfer
      allOf:
        - $ref: '#/components/schemas/InlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingTransfer'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยการโอนเงิน
            paymentMethod:
              type: integer
              description: 'ประเภทการชำระเงิน <br> 5 = โอนเงิน
                <br> Required user to setup bank account before using Transfer Payment Method.
                <br> To setup banking channel, go to section MyCompany > Bank Channel > Create Bank Account
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/post/bank-channel/bank-accounts" target="_blank">(link)</a>
                <br> or in FlowAccount website, go to MyCompany > Banking Channel > Add Account > Bank Account'
              example: 5
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยการโอนเงิน <ex> Example : 100.0000 </ex>'
              default: 0
    InlineDocumentWithPaymentPaidCreditCard:
      title: InlineDocumentWithPaymentPaidCreditCard
      allOf:
        - $ref: '#/components/schemas/InlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodPaidCreditCard'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมชำระเงิน ด้วยบัตรเครดิต
    InlineDocumentWithPaymentPaidPettyCash:
      title: InlineDocumentWithPaymentPaidPettyCash
      allOf:
        - $ref: '#/components/schemas/InlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodPaidPettyCash'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมชำระเงิน ด้วยเงินสดย่อย
    InlineDocumentWithPaymentPaidOtherChannel:
      title: InlineDocumentWithPaymentPaidOtherChannel
      allOf:
        - $ref: '#/components/schemas/InlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingOtherChannel'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยช่องทางอื่น ๆ
            paymentMethod:
              type: integer
              description: ชำระเงิน ช่องทางอื่น ๆ ได้แก่ เครื่องบันทึกเงินสด (POS), เครื่องรูดบัตรเครดิต (EDC),
                ช่องทางรับชำระออนไลน์ (Payment Gateway), ร้านค้าออนไลน์ (Online shop/E-Commerce)
                <br> Required user to setup other channels before using OtherChannel Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Other Channels > Select Payment Channel as EDC,
                POS, Online Payment Gateway or Online shop/E-Commerce
              example: 13
    UpdateDocument:
      allOf:
        - type: object
          properties:
            recordId:
              type: integer
              format: int64
              description: Document Id (to be deprecated) <br> Input as 0 only
              default: 0
            companyName:
              type: string
            companyNameEn:
              type: string
            companyAddress:
              type: string
            companyAddressEn:
              type: string
            companyTaxId:
              type: string
            companyBranch:
              type: string
            companyBranchEn:
              type: string
            companyPhone:
              type: string
            companyMobile:
              type: string
            companyFax:
              type: string
            companyWebsite:
              type: string
        - $ref: '#/components/schemas/Document'
        - type: object
          properties:
            documentStructureType:
              type: string
              example: UpdateSimpleDocument
            documentReference:
              type: array
              description: สำหรับอัพเกรดเอกสาร โดยอ้างอิงเอกสารต้นทาง (ยกเว้นเอกสารใบเสนอราคา)
                <br> Input when the document was created as an upgrade document,
                the reference document data should not be changed
              items:
                $ref: '#/components/schemas/DocumentReference'
          required:
            - documentStructureType
    CompanyV3Document:
      type: object
      properties:
        companyName:
          type: string
          description: ชื่อบริษัท <br> (to be deprecated) <br> The value is based on company setting
        companyNameEn:
          type: string
          description: ชื่อบริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br> (to be deprecated)
              <br> The value is based on company setting
        companyAddress:
          type: string
          description: ที่อยู่บริษัท <br> (to be deprecated) <br> The value is based on company setting
        companyAddressEn:
          type: string
          description: ที่อยู่บริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br> (to be deprecated) <br> The value is based on company setting
        companyTaxId:
          type: string
          description: 'เลขประจำตัวผู้เสียภาษี บริษัท <br> (to be deprecated) <br> The value is based on company setting
            <br><ex>Example: 0105558096348</ex>'
        companyBranch:
          type: string
          description: 'ชื่อ และ รหัสสาขา <br> (to be deprecated) <br> The value is based on company setting
            <br><ex>Example: สำนักงานใหญ่ 00000</ex>'
        companyBranchEn:
          type: string
          description: 'ชื่อ และ รหัสสาขา ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br> (to be deprecated) <br> The value is based on company setting
            <br><ex>Example: Head Office 00000</ex>'
        companyPhone:
          type: string
          description: 'เบอร์โทรสำนักงาน <br> (to be deprecated) <br> The value is based on company setting
            <br><ex>Example: 02-999-9999</ex>'
        companyMobile:
          type: string
          description: 'เบอร์โทรศัพท์มือถือ <br> (to be deprecated) <br> The value is based on company setting
            <br><ex>Example: 099-999-9999</ex>'
        companyFax:
          type: string
          description: 'เบอร์โทรสาร <br> (to be deprecated) <br> The value is based on company setting
            <br><ex>Example: 02-999-9999 ต่อ 1</ex>'
        companyWebsite:
          type: string
          description: 'เว็บไซต์ <br> (to be deprecated) <br> The value is based on company setting
            <br><ex>Example: www.flowaccount.com</ex>'
    UpdateAllDocument:
      oneOf:
        - $ref: '#/components/schemas/UpdateSimpleDocument'
        - $ref: '#/components/schemas/UpdateInlineDocument'
    UpdateSimpleDocument:
      title: UpdateSimpleDocument
      allOf:
        - $ref: '#/components/schemas/UpdateDocument'
        - $ref: '#/components/schemas/CompanyV3Document'
        - $ref: '#/components/schemas/DateFields'
        - type: object
          properties:
            documentStructureType:
              enum: 
                - UpdateSimpleDocument
                - UpdateInlineDocument
              description: Input "UpdateSimpleDocument"
                <br> to update simple document (the document without inline discount or inline vat)
              example: UpdateSimpleDocument
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Simple
              items:
                $ref: '#/components/schemas/SimpleProductItem'
          required:
            - items
            - documentStructureType
    UpdateInlineDocument:
      title: UpdateInlineDocument
      allOf:
        - $ref: '#/components/schemas/UpdateDocument'
        - $ref: '#/components/schemas/CompanyV3Document'
        - $ref: '#/components/schemas/DateFields'
        - $ref: '#/components/schemas/InlineDocumentFields'
        - type: object
          properties:
            documentStructureType:
              enum: 
                - UpdateSimpleDocument
                - UpdateInlineDocument
              description: Input "UpdateInlineDocument"
                <br> to update inline document(the document with inline discount or inline vat)
              example: UpdateInlineDocument
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Inline
              items:
                $ref: '#/components/schemas/InlineProductItem'
          required:
            - items
            - documentStructureType
    CompanyV1Document:
      type: object
      properties:
        companyName:
          type: string
          description: ชื่อบริษัท <br> (to be deprecated) <br> The value should be the same as company setting
            <br> The value is able to GET by <br> go to section MyCompany > Business Information > Get business information
            <a href="https://developers.flowaccount.com/api-reference/#tag/business-infomation/get/company/info" target="_blank">(link)</a> ,
            the field name is `compnayName`
        companyNameEn:
          type: string
          description: ชื่อบริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br> (to be deprecated)
            <br> The value should be the same as company setting
            <br> The value is able to GET by <br> go to section MyCompany > Business Information > Get business information
            <a href="https://developers.flowaccount.com/api-reference/#tag/business-infomation/get/company/info" target="_blank">(link)</a> ,
            the field name is `companyNameEn`
        companyAddress:
          type: string
          description: ที่อยู่บริษัท <br> (to be deprecated)
            <br> The value should be the same as company setting
            <br> The value is able to GET by <br> go to section MyCompany > Business Information > Get business information
            <a href="https://developers.flowaccount.com/api-reference/#tag/business-infomation/get/company/info" target="_blank">(link)</a> ,
            the field name is `companyAddress`
        companyAddressEn:
          type: string
          description: ที่อยู่บริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br> (to be deprecated)
            <br> The value should be the same as company setting
            <br> The value is able to GET by <br> go to section MyCompany > Business Information > Get business information
            <a href="https://developers.flowaccount.com/api-reference/#tag/business-infomation/get/company/info" target="_blank">(link)</a> ,
            the field name is `companyAddressEn`
        companyTaxId:
          type: string
          description: 'เลขประจำตัวผู้เสียภาษี บริษัท <br> (to be deprecated)
            <br> The value should be the same as company setting
            <br> The value is able to GET by <br> go to section MyCompany > Business Information > Get business information
            <a href="https://developers.flowaccount.com/api-reference/#tag/business-infomation/get/company/info" target="_blank">(link)</a> ,
            the field name is `companyTaxId`
            <br><ex>Example: 0105558096348</ex>'
        companyBranch:
          type: string
          description: 'ชื่อ และ รหัสสาขา <br> (to be deprecated)
            <br> The value should be the same as company setting
            <br> The value is able to GET by <br> go to section MyCompany > Business Information > Get business information
            <a href="https://developers.flowaccount.com/api-reference/#tag/business-infomation/get/company/info" target="_blank">(link)</a> ,
            the field name is `companyBranch`
            <br><ex>Example: สำนักงานใหญ่ 00000</ex>'
        companyBranchEn:
          type: string
          description: 'ชื่อ และ รหัสสาขา ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br> (to be deprecated)
            <br> The value should be the same as company setting
            <br> The value is able to GET by <br> go to section MyCompany > Business Information > Get business information
            <a href="https://developers.flowaccount.com/api-reference/#tag/business-infomation/get/company/info" target="_blank">(link)</a> ,
            the field name is `companyBranchEn`
            <br><ex>Example: Head Office 00000</ex>'
        companyPhone:
          type: string
          description: 'เบอร์โทรสำนักงาน <br> (to be deprecated)
            <br> The value should be the same as company setting
            <br> The value is able to GET by <br> go to section MyCompany > Business Information > Get business information
            <a href="https://developers.flowaccount.com/api-reference/#tag/business-infomation/get/company/info" target="_blank">(link)</a> ,
            the field name is `companyPhone`
            <br><ex>Example: 02-999-9999</ex>'
        companyMobile:
          type: string
          description: 'เบอร์โทรศัพท์มือถือ <br> (to be deprecated)
            <br> The value should be the same as company setting
            <br> The value is able to GET by <br> go to section MyCompany > Business Information > Get business information
            <a href="https://developers.flowaccount.com/api-reference/#tag/business-infomation/get/company/info" target="_blank">(link)</a> ,
            the field name is `companyMobile`
            <br><ex>Example: 099-999-9999</ex>'
        companyFax:
          type: string
          description: 'เบอร์โทรสาร <br> (to be deprecated)
            <br> The value should be the same as company setting
            <br> The value is able to GET by <br> go to section MyCompany > Business Information > Get business information
            <a href="https://developers.flowaccount.com/api-reference/#tag/business-infomation/get/company/info" target="_blank">(link)</a> ,
            the field name is `companyFax`
            <br><ex>Example: 02-999-9999 ต่อ 1</ex>'
        companyWebsite:
          type: string
          description: 'เว็บไซต์ <br> (to be deprecated)
            <br> The value should be the same as company setting
            <br> The value is able to GET by <br> go to section MyCompany > Business Information > Get business information
            <a href="https://developers.flowaccount.com/api-reference/#tag/business-infomation/get/company/info" target="_blank">(link)</a> ,
            the field name is `companyWebsite`
            <br><ex>Example: www.flowaccount.com</ex>'
    UpdateAllCADocument:
      oneOf:
        - $ref: '#/components/schemas/UpdateSimpleCADocument'
        - $ref: '#/components/schemas/UpdateInlineCADocument'
    UpdateSimpleCADocument:
      title: UpdateSimpleDocument
      allOf:
        - $ref: '#/components/schemas/UpdateDocument'
        - $ref: '#/components/schemas/CompanyV1Document'
        - $ref: '#/components/schemas/DateWithPaymentFields'
        - type: object
          properties:
            documentStructureType:
              enum: 
                - UpdateSimpleDocument
                - UpdateInlineDocument
              description: Input "UpdateSimpleDocument"
                <br> to update simple document (the document without inline discount or inline vat)
              example: UpdateSimpleDocument
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Simple
              items:
                $ref: '#/components/schemas/SimpleProductItem'
          required:
            - publishedOn
            - items
            - documentStructureType
    UpdateInlineCADocument:
      title: UpdateInlineDocument
      allOf:
        - $ref: '#/components/schemas/UpdateDocument'
        - $ref: '#/components/schemas/CompanyV1Document'
        - $ref: '#/components/schemas/DateWithPaymentFields'
        - $ref: '#/components/schemas/InlineDocumentFields'
        - type: object
          properties:
            documentStructureType:
              enum: 
                - UpdateSimpleDocument
                - UpdateInlineDocument
              description: Input "UpdateInlineDocument"
                <br> to update inline document(the document with inline discount or inline vat)
              example: UpdateInlineDocument
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Inline
              items:
                $ref: '#/components/schemas/InlineProductItem'
          required:
            - publishedOn
            - items
            - documentStructureType
    UpgradeDocument:
      allOf:
        - type: object
          properties:
            recordId:
              type: integer
              format: int64
              description: Document Id <br> (to be deprecated) <br> Input as 0 only
              default: 0
        - $ref: '#/components/schemas/CompanyV3Document'
        - $ref: '#/components/schemas/Document'
        - $ref: '#/components/schemas/DateFields'
        - type: object
          properties:
            documentReference:
              type: array
              description: สำหรับอัพเกรดเอกสาร โดยอ้างอิงเอกสารต้นทาง (ยกเว้นเอกสารใบเสนอราคา)
              items:
                $ref: '#/components/schemas/DocumentReference'
          required:
            - documentReference
    UpgradeSimpleDocument:
      allOf:
        - $ref: '#/components/schemas/UpgradeDocument'
        - type: object
          properties:
            documentStructureType:
              type: string
              nullable: true
              description: 'Input "UpgradeSimpleDocument"'
              example: 'UpgradeSimpleDocument'
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Simple
              items:
                $ref: '#/components/schemas/SimpleProductItem'
      required:
        - items
    UpgradeInlineDocument:
      allOf:
        - $ref: '#/components/schemas/UpgradeDocument'
        - $ref: '#/components/schemas/InlineDocumentFields'
        - type: object
          properties:
            documentStructureType:
              type: string
              nullable: true
              description: 'Input "UpgradeInlineDocument"'
              example: 'UpgradeInlineDocument'
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Inline
              items:
                $ref: '#/components/schemas/InlineProductItem'
      required:
        - items
    UpgradeCADocument:
      allOf:
        - type: object
          properties:
            recordId:
              type: integer
              format: int64
              description: Document Id <br> (to be deprecated) <br> Input as 0 only
              default: 0
        - $ref: '#/components/schemas/CompanyV3Document'
        - $ref: '#/components/schemas/Document'
        - $ref: '#/components/schemas/DateWithPaymentFields'
        - type: object
          properties:
            documentReference:
              type: array
              description: สำหรับอัพเกรดเอกสาร โดยอ้างอิงเอกสารต้นทาง (ยกเว้นเอกสารใบเสนอราคา)
              items:
                $ref: '#/components/schemas/DocumentReference'
          required:
            - documentReference
    UpgradeSimpleCADocument:
      allOf:
        - $ref: '#/components/schemas/UpgradeCADocument'
        - type: object
          properties:
            documentStructureType:
              type: string
              nullable: true
              description: 'Input "UpgradeSimpleDocument"'
              example: 'UpgradeSimpleDocument'
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Simple
              items:
                $ref: '#/components/schemas/SimpleProductItem'
      required:
        - items
    UpgradeInlineCADocument:
      allOf:
        - $ref: '#/components/schemas/UpgradeCADocument'
        - $ref: '#/components/schemas/InlineDocumentFields'
        - type: object
          properties:
            documentStructureType:
              type: string
              nullable: true
              description: 'Input "UpgradeInlineDocument"'
              example: 'UpgradeInlineDocument'
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Inline
              items:
                $ref: '#/components/schemas/InlineProductItem'
      required:
        - items
    UpgradeDocumentWithPayment:
      allOf:
        - type: object
          properties:
            companyName:
              type: string
              description: ชื่อบริษัท <br> (to be deprecated) <br> The value is based on company setting
            companyNameEn:
              type: string
              description: ชื่อบริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br> (to be deprecated)
                  <br> The value is based on company setting
            companyAddress:
              type: string
              description: ที่อยู่บริษัท <br> (to be deprecated) <br> The value is based on company setting
            companyAddressEn:
              type: string
              description: ที่อยู่บริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br> (to be deprecated) <br> The value is based on company setting
            companyTaxId:
              type: string
              description: 'เลขประจำตัวผู้เสียภาษี บริษัท <br> (to be deprecated) <br> The value is based on company setting
                <br><ex>Example: 0105558096348</ex>'
            companyBranch:
              type: string
              description: 'ชื่อ และ รหัสสาขา <br> (to be deprecated) <br> The value is based on company setting
                <br><ex>Example: สำนักงานใหญ่ 00000</ex>'
            companyBranchEn:
              type: string
              description: 'ชื่อ และ รหัสสาขา ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br> (to be deprecated) <br> The value is based on company setting
                <br><ex>Example: Head Office 00000</ex>'
            companyPhone:
              type: string
              description: 'เบอร์โทรสำนักงาน <br> (to be deprecated) <br> The value is based on company setting
                <br><ex>Example: 02-999-9999</ex>'
            companyMobile:
              type: string
              description: 'เบอร์โทรศัพท์มือถือ <br> (to be deprecated) <br> The value is based on company setting
                <br><ex>Example: 099-999-9999</ex>'
        - $ref: '#/components/schemas/Document'
        - $ref: '#/components/schemas/DateWithPaymentFields'
        - type: object
          properties:
            documentReference:
              type: array
              description: สำหรับอัพเกรดเอกสาร โดยอ้างอิงเอกสารต้นทาง (ยกเว้นเอกสารใบเสนอราคา)
              items:
                $ref: '#/components/schemas/DocumentReference'
          required:
            - documentReference
    UpgradeSimpleDocumentWithPayment:
      allOf:
        - $ref: '#/components/schemas/UpgradeDocumentWithPayment'
        - type: object
          properties:
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Simple
              items:
                $ref: '#/components/schemas/SimpleProductItem'
            documentPaymentStructureType:
              type: string
              nullable: true
      required:
        - items
    UpgradeInlineDocumentWithPayment:
      allOf:
        - $ref: '#/components/schemas/UpgradeDocumentWithPayment'
        - $ref: '#/components/schemas/InlineDocumentFields'
        - type: object
          properties:
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Inline
              items:
                $ref: '#/components/schemas/InlineProductItem'
            documentPaymentStructureType:
              type: string
              nullable: true
          required:
            - items
    UpgradeSimpleDocumentWithPaymentReceiving:
      oneOf:
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPaymentReceivingCash'
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPaymentReceivingCheque'
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPaymentReceivingTransfer'
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPaymentReceivingOtherChannel'
    UpgradeSimpleDocumentWithPaymentReceivingCash:
      title: UpgradeSimpleDocumentWithPaymentReceivingCash
      allOf:
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมรับชำระเงิน ด้วยเงินสด
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 1 = เงินสด
              example: 1
    UpgradeSimpleDocumentWithPaymentReceivingCheque:
      title: UpgradeSimpleDocumentWithPaymentReceivingCheque
      allOf:
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingCheque'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมรับชำระเงิน ด้วยเช็ค
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 3 = เช็ค
                <br> Required user to setup cheque banking channel before using Cheque Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Cheque
              example: 3
            chequeBankAccountId:
              type: integer
              description: ธนาคารที่ระบุหน้าเช็ค <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)
                <br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
                <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank) <br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
                <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank) <br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
                <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya) <br> 10 = ธนาคารออมสิน - (Government Savings Bank)
                <br> 11 = ธนาคารธนชาต - (Thanachart Bank) <br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
                <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank) <br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)
                <br> 19 = ธนาคารทิสโก้ - (Tisco Bank) 
                <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
                <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
                <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank
                <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
                <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
                <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
                <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
                <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
                <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
                <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
                <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) 
                <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
    UpgradeSimpleDocumentWithPaymentReceivingTransfer:
      title: UpgradeSimpleDocumentWithPaymentReceivingTransfer
      allOf:
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingTransfer'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมรับชำระเงิน ด้วยการโอนเงิน
            paymentMethod:
              type: integer
              description: 'ประเภทการเก็บเงิน <br> 5 = โอนเงิน
                <br> Required user to setup bank account before using Transfer Payment Method.
                <br> To setup banking channel, go to section MyCompany > Bank Channel > Create Bank Account
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/post/bank-channel/bank-accounts" target="_blank">(link)</a>
                <br> or in FlowAccount website, go to MyCompany > Banking Channel > Add Account > Bank Account'
              example: 5
    UpgradeSimpleDocumentWithPaymentReceivingOtherChannel:
      title: UpgradeSimpleDocumentWithPaymentReceivingOtherChannel
      allOf:
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingOtherChannel'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมรับชำระเงิน ด้วยช่องทางอื่น ๆ
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 13 = ช่องทางอื่น ๆ EDC, POS, Payment Gateway, Online Shop/E-Commerce
                <br> Required user to setup other channels before using OtherChannel Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Other Channels > Select Payment Channel as EDC,
                POS, Online Payment Gateway or Online shop/E-Commerce
              example: 13
    UpgradeSimpleDocumentWithPaymentPaid:
      oneOf:
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPaymentPaidCash'
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPaymentPaidCheque'
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPaymentPaidTransfer'
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPaymentPaidCreditCard'
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPaymentPaidPettyCash'
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPaymentPaidOtherChannel'
    UpgradeSimpleDocumentWithPaymentPaidCash:
      title: UpgradeSimpleDocumentWithPaymentPaidCash
      allOf:
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยเงินสด
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 1 = เงินสด
              example: 1
    UpgradeSimpleDocumentWithPaymentPaidCheque:
      title: UpgradeSimpleDocumentWithPaymentPaidCheque
      allOf:
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingCheque'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยเช็ค
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 3 = บัญชีเช็คจ่าย
                <br> Required user to setup cheque banking channel before using Cheque Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Cheque
              example: 3
            chequeBankAccountId:
              type: integer
              description: ธนาคารที่ระบุหน้าเช็ค <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)
                <br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
                <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank) <br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
                <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank) <br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
                <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya) <br> 10 = ธนาคารออมสิน - (Government Savings Bank)
                <br> 11 = ธนาคารธนชาต - (Thanachart Bank) <br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
                <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank) <br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)
                <br> 19 = ธนาคารทิสโก้ - (Tisco Bank) 
                <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
                <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
                <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank
                <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
                <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
                <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
                <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
                <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
                <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
                <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
                <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) 
                <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
                <br> The value should be related with the bank name of bankAccountId
              example: 1
            bankAccountId:
              type: integer
              format: int64
              description: 'เลข id บัญชีธนาคารที่ใช้ชำระเงิน <br><red>สามารถ GET มาได้จาก My Company > Bank Account </red><br> <ex>Example: 12345</ex>'
              default: 0
              example: '12345'
            bankChequeId:
              type: integer
              format: int64
              description: 'id of cheque <br> The value is able to GET by go to sectionMyCompany > Bank Channel > Get list all Bank Cheque
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/get/bank-channel/cheque" target="_blank">(link)</a> ,
                <br> the field name is `bankChequeId`
                <br> <ex>Example: 1234</ex>'
              default: 0
              example: '1234'
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยเช็ค <br> <ex> Example : 100.0000 </ex>'
              default: 0
          required:
            - bankAccountId
            - bankChequeId
    UpgradeSimpleDocumentWithPaymentPaidTransfer:
      title: UpgradeSimpleDocumentWithPaymentPaidTransfer
      allOf:
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingTransfer'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยการโอนเงิน
            paymentMethod:
              type: integer
              description: 'ประเภทการชำระเงิน <br> 5 = โอนเงิน
                <br> Required user to setup bank account before using Transfer Payment Method.
                <br> To setup banking channel, go to section MyCompany > Bank Channel > Create Bank Account
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/post/bank-channel/bank-accounts" target="_blank">(link)</a>
                <br> or in FlowAccount website, go to MyCompany > Banking Channel > Add Account > Bank Account'
              example: 5
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยการโอนเงิน <ex> Example : 100.0000 </ex>'
              default: 0
    UpgradeSimpleDocumentWithPaymentPaidCreditCard:
      title: UpgradeSimpleDocumentWithPaymentPaidCreditCard
      allOf:
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodPaidCreditCard'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยบัตรเครดิต
    UpgradeSimpleDocumentWithPaymentPaidPettyCash:
      title: UpgradeSimpleDocumentWithPaymentPaidPettyCash
      allOf:
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodPaidPettyCash'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยเงินสดย่อย
    UpgradeSimpleDocumentWithPaymentPaidOtherChannel:
      title: UpgradeSimpleDocumentWithPaymentPaidOtherChannel
      allOf:
        - $ref: '#/components/schemas/UpgradeSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingOtherChannel'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยช่องทางอื่น ๆ
            paymentMethod:
              type: integer
              description: ชำระเงิน ช่องทางอื่น ๆ ได้แก่ เครื่องบันทึกเงินสด (POS), เครื่องรูดบัตรเครดิต (EDC),
                ช่องทางรับชำระออนไลน์ (Payment Gateway), ร้านค้าออนไลน์ (Online shop/E-Commerce)
                <br> Required user to setup other channels before using OtherChannel Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Other Channels > Select Payment Channel as EDC,
                POS, Online Payment Gateway or Online shop/E-Commerce
              example: 13
    UpgradeInlineDocumentWithPaymentReceiving:
      oneOf:
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPaymentReceivingCash'
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPaymentReceivingCheque'
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPaymentReceivingTransfer'
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPaymentReceivingOtherChannel'
    UpgradeInlineDocumentWithPaymentReceivingCash:
      title: UpgradeInlineDocumentWithPaymentReceivingCash
      allOf:
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยเงินสด
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 1 = เงินสด
              example: 1
    UpgradeInlineDocumentWithPaymentReceivingCheque:
      title: UpgradeInlineDocumentWithPaymentReceivingCheque
      allOf:
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingCheque'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยเช็ค
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 3 = เช็ค
                <br> Required user to setup cheque banking channel before using Cheque Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Cheque
              example: 3
            chequeBankAccountId:
              type: integer
              description: ธนาคารที่ระบุหน้าเช็ค <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)
                <br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
                <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank) <br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
                <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank) <br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
                <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya) <br> 10 = ธนาคารออมสิน - (Government Savings Bank)
                <br> 11 = ธนาคารธนชาต - (Thanachart Bank) <br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
                <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank) <br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)
                <br> 19 = ธนาคารทิสโก้ - (Tisco Bank) 
                <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
                <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
                <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank
                <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
                <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
                <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
                <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
                <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
                <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
                <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
                <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) 
                <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
    UpgradeInlineDocumentWithPaymentReceivingTransfer:
      title: UpgradeInlineDocumentWithPaymentReceivingTransfer
      allOf:
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingTransfer'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยการโอนเงิน
            paymentMethod:
              type: integer
              description: 'ประเภทการเก็บเงิน <br> 5 = โอนเงิน
                <br> Required user to setup bank account before using Transfer Payment Method.
                <br> To setup banking channel, go to section MyCompany > Bank Channel > Create Bank Account
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/post/bank-channel/bank-accounts" target="_blank">(link)</a>
                <br> or in FlowAccount website, go to MyCompany > Banking Channel > Add Account > Bank Account'
              example: 5
    UpgradeInlineDocumentWithPaymentReceivingOtherChannel:
      title: UpgradeInlineDocumentWithPaymentReceivingOtherChannel
      allOf:
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInSellDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingOtherChannel'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยช่องทางอื่น ๆ
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 13 = ช่องทางอื่น ๆ EDC, POS, Payment Gateway, Online Shop/E-Commerce
                <br> Required user to setup other channels before using OtherChannel Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Other Channels > Select Payment Channel as EDC,
                POS, Online Payment Gateway or Online shop/E-Commerce
              example: 13
    UpgradeInlineDocumentWithPaymentPaid:
      oneOf:
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPaymentPaidCash'
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPaymentPaidCheque'
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPaymentPaidTransfer'
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPaymentPaidCreditCard'
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPaymentPaidPettyCash'
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPaymentPaidOtherChannel'
    UpgradeInlineDocumentWithPaymentPaidCash:
      title: UpgradeInlineDocumentWithPaymentPaidCash
      allOf:
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยเงินสด
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 1 = เงินสด
              example: 1
    UpgradeInlineDocumentWithPaymentPaidCheque:
      title: UpgradeInlineDocumentWithPaymentPaidCheque
      allOf:
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingCheque'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยเช็ค
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 3 = บัญชีเช็คจ่าย
                <br> Required user to setup cheque banking channel before using Cheque Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Cheque
              example: 3
            chequeBankAccountId:
              type: integer
              description: ธนาคารที่ระบุหน้าเช็ค <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)
                <br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
                <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank) <br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
                <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank) <br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
                <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya) <br> 10 = ธนาคารออมสิน - (Government Savings Bank)
                <br> 11 = ธนาคารธนชาต - (Thanachart Bank) <br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
                <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank) <br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)
                <br> 19 = ธนาคารทิสโก้ - (Tisco Bank) 
                <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
                <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
                <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank
                <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
                <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
                <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
                <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
                <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
                <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
                <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
                <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) 
                <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
                <br> The value should be related with the bank name of bankAccountId
            bankAccountId:
              type: integer
              format: int64
              description: 'เลข id บัญชีธนาคารที่ใช้ชำระเงิน <br><red>สามารถ GET มาได้จาก My Company > Bank Account </red><br> <ex>Example: 12345</ex>'
              default: 0
              example: '12345'
            bankChequeId:
              type: integer
              format: int64
              description: 'id of cheque <br> The value is able to GET by go to sectionMyCompany > Bank Channel > Get list all Bank Cheque
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/get/bank-channel/cheque" target="_blank">(link)</a> ,
                <br> the field name is `bankChequeId`
                <br> <ex>Example: 1234</ex>'
              default: 0
              example: '1234'
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยเช็ค <br> <ex> Example : 100.0000 </ex>'
              default: 0
          required:
            - bankAccountId
            - bankChequeId
    UpgradeInlineDocumentWithPaymentPaidTransfer:
      title: UpgradeInlineDocumentWithPaymentPaidTransfer
      allOf:
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingTransfer'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยการโอนเงิน
            paymentMethod:
              type: integer
              description: 'ประเภทการชำระเงิน <br> 5 = โอนเงิน
                <br> Required user to setup bank account before using Transfer Payment Method.
                <br> To setup banking channel, go to section MyCompany > Bank Channel > Create Bank Account
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/post/bank-channel/bank-accounts" target="_blank">(link)</a>
                <br> or in FlowAccount website, go to MyCompany > Banking Channel > Add Account > Bank Account'
              example: 5
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยการโอนเงิน <ex> Example : 100.0000 </ex>'
              default: 0
    UpgradeInlineDocumentWithPaymentPaidCreditCard:
      title: UpgradeInlineDocumentWithPaymentPaidCreditCard
      allOf:
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodPaidCreditCard'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมชำระเงิน ด้วยบัตรเครดิต
    UpgradeInlineDocumentWithPaymentPaidPettyCash:
      title: UpgradeInlineDocumentWithPaymentPaidPettyCash
      allOf:
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodPaidPettyCash'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมชำระเงิน ด้วยเงินสดย่อย
    UpgradeInlineDocumentWithPaymentPaidOtherChannel:
      title: UpgradeInlineDocumentWithPaymentPaidOtherChannel
      allOf:
        - $ref: '#/components/schemas/UpgradeInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingOtherChannel'
        - type: object
          properties:
            documentPaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมรับชำระเงิน ด้วยช่องทางอื่น ๆ
            paymentMethod:
              type: integer
              description: ชำระเงิน ช่องทางอื่น ๆ ได้แก่ เครื่องบันทึกเงินสด (POS), เครื่องรูดบัตรเครดิต (EDC),
                ช่องทางรับชำระออนไลน์ (Payment Gateway), ร้านค้าออนไลน์ (Online shop/E-Commerce)
                <br> Required user to setup other channels before using OtherChannel Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Other Channels > Select Payment Channel as EDC,
                POS, Online Payment Gateway or Online shop/E-Commerce
              example: 13
    APIResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
          example: true
        message:
          type: string
          description: error message
          example: ""
        code:
          type: integer
          description: error code
          example: 0
        data:
          type: object
          description: ข้อมูลเอกสาร
    DataResponse:
      type: object
      properties:
        status:
          type: string
          description: (to be changed to integer) <br> เลขสถานะเอกสารฉบับนี้
        statusString:
          type: string
          description: ชื่อสถานะเอกสารฉบับนี้
        documentType:
          type: string
          description: (to be changed to integer) <br> เลขประเภทเอกสารฉบับนี้
          example: '3'
        allowDelete:
          type: string
          description: (to be changed to boolean) <br> สามารถลบเอกสาร :<br> true = ลบได้ <br> false = ลบไม่ได้
          example: 'false'
        recordId:
          type: integer
          format: int64
          description: id ของเอกสาร
        documentId:
          type: integer
          format: int64
          description: id ของเอกสาร
        documentSerial:
          type: string
          description: เลขที่เอกสาร
        contactCode:
          type: string
        contactId:
          type: integer
          format: int64
          description: เลขที่ผู้ติดต่อ Id ลูกค้า/ผู้จำหน่าย
        contactName:
          type: string
        contactAddress:
          type: string
        contactTaxId:
          type: string
          description: 'เลขประจำตัวผู้เสียภาษี ลูกค้า หรือ ผู้จำหน่าย/ลูกค้า <br> (ถ้ามีจำเป็นต้องครบ 13 หลัก) <br> <ex>Example: 1234567890123 </ex>'
          example: '1234567890123'
        contactBranch:
          type: string
          description: สำนักงาน/สาขา
          example: 'สำนักงาน/สาขา'
        contactPerson:
          type: string
          description: ชื่อผู้ติดต่อ
          example: 'ลูกค้า'
        contactEmail:
          type: string
          description: 'อีเมลผู้ติดต่อ'
        contactNumber:
          type: string
          description: 'เบอร์มือถือผู้ติดต่อ <br> <ex>Example: 099-999-9999</ex>'
          example: 099-999-9999
        contactZipCode:
          type: string
          description: รหัสไปรษณีย์ติดต่อ
          example: '12345'
        contactGroup:
          type: string
          description: (to be changed to integer) <br> ประผู้ติดต่อ <br> 1 = บุคคลธรรมดา <br> 3 = นิติบุคคล
          default: '1'
        publishedOn:
          type: string
          format: date
          description: 'วันที่เอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
          example: '2021-01-01'
          default: currentDate
        creditType:
          type: string
          description: (to be changed to integer) <br> รูปแบบเครดิต <br> 1 = เครดิต (วัน) <br> 3 = เงินสด  <br> 5 = เครดิต (ไม่แสดงวันที่ครบกำหนด)
          default: '1'
        creditDays:
          type: string
          description: '(to be changed to integer) <br> จำนวนวันที่ให้เครดิต <br> <ex>Example: 30</ex>'
          default: '0'
          example: '30'
        dueDate:
          type: string
          format: date
          description: 'วันครบกำหนดเอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
          example: '2021-01-31'
        salesName:
          type: string
          description: 'ชื่อผู้สร้างเอกสาร หรือ ชื่อพนักงานขาย <br> <ex>Example: sale@email.com or Mr.Sale Shop</ex>'
          example: พนักงาน ขายหน้าร้าน
        projectName:
          type: string
          description: ชื่อโปรเจค
          example: 'project A'
        reference:
          type: string
          description: 'เลขที่อ้างอิง หรือ เลขที่เอกสารที่เกี่ยวข้อง <br> <ex>Example: INV2020010001</ex>'
          example: INV2020010001
        isVatInclusive:
          type: string
          description: (to be changed to boolean) <br> มูลค่าเอกสารรวมภาษีแล้วหรือไม่
          default: 'false'
        useReceiptDeduction:
          type: string
          description: (to be changed to boolean) <br> เปิดใช้งานฟังก์ชั่น ปรับลดท้ายเอกสาร <br> (เฉพาะเอกสารใบกำกับภาษี / ใบเสร็จรับเงิน และ ใบเสร็จรับเงิน)
          default: 'false'
        subTotal:
          type: string
          description: (to be changed to number <decimal>) <br> มูลค่ารวมเป็นเงิน
          default: '0'
        discountPercentage:
          type: string
          description: (to be changed to integer) <br> มูลค่าส่วนลดเป็นเปอร์เซ็นต์
          default: '0'
        discountAmount:
          type: string
          description: (to be changed to number <decimal>) <br> มูลค่าส่วนลดเป็นจำนวน (บาท)
          default: '0'
        totalAfterDiscount:
          type: string
          description: (to be changed to number <decimal>) <br> มูลค่าหลังหักส่วนลด
          default: '0'
        totalWithoutVat:
          type: string
          description: (to be changed to number <decimal>) <br> มูลค่าไม่รวมภาษีมูลค่าเพิ่ม
          default: '0'
        isVat:
          type: string
          description: (to be changed to boolean) <br> มูลค่าหลังหักส่วนลด มีภาษีมูลค่าเพิ่ม 7%
          default: 'false'
        isManualVat:
          type: boolean
          description: (to be changed to boolean) <br> กำหนดค่าภาษีมูลค่าเพิ่มเอง
          default: false
        vatAmount:
          type: string
          description: (to be changed to number <decimal>) <br> ภาษีมูลค่าเพิ่ม
          default: '0'
        grandTotal:
          type: string
          description: (to be changed to number <decimal>) <br> จำนวนเงินรวมทั้งสิ้น (รวมภาษีมูลค่าเพิ่ม 7% แล้ว)
          default: '0'
        documentShowWithholdingTax:
          type: string
          description: (to be changed to boolean) <br> แสดงหรือไม่แสดง หัก ณ ที่จ่ายท้ายเอกสาร
          default: 'false'
        documentWithholdingTaxPercentage:
          type: string
          description: (to be changed to number <decimal>) <br> ภาษี ณ ที่จ่าย (%)
          default: '0'
        documentDeductionType:
          type: string
          description: (to be changed to integer) <br> ประเภทรายการปรับลด <br> 1 = ส่วนลดพิเศษ <br> 3 = ค่านายหน้าและส่วนแบ่งการขาย
            <br> 5 = ค่าดำเนินการ <br> 7 = ปัดเศษ <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)
          default: '0'
        documentDeductionAmount:
          type: string
          description: (to be changed to number <decimal>) <br> จำนวนเงินยอดรายการปรับลด <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)
          default: '0'
        remarks:
          type: string
          description: หมายเหตุเอกสาร
          example: 'remarks'
        internalNotes:
          type: string
          description: โน๊ตภายในบริษัท
          example: 'note'
        showSignatureOrStamp:
          type: string
          description: (to be changed to boolean) <br> ลายเซ็นอิเล็กทรอนิกส์และตรายาง
          default: 'true'
        saleAndPurchaseChannel:
          type: string
          description: ช่องทางการขาย สำหรับ Account ที่เชื่อมต่อกับ E-commerce เมนู My Platform <br>1. Lazada <br> 2. Shopee
          example: ''
        discountType:
          type: string
          default: '1'
        useInlineDiscount:
          type: boolean
        useInlineVat:
          type: string
          default: 'false'
        exemptAmount:
          type: string
          default: '0'
        vatableAmount:
          type: string
          description: (to be changed to number <decimal>) <br> ยอดขายที่คิดภาษีมูลค่าเพิ่ม
          default: '0'
        items:
          type: array
          items:
            type: object
        referencedToMe:
          type: array
          description: ข้อมูลเอกสารปลายทางที่อ้างอิง ถึง เอกสารฉบับนี้
          items:
            $ref: '#/components/schemas/ReferencedToMe'
        referencedByMe:
          type: array
          description: เอกสารต้นทางที่อ้างอิง ถึง เอกสารฉบับนี้
          items:
                $ref: '#/components/schemas/ReferencedByMe'
        payments:
          type: object
          description: 'ข้อมูลการเก็บเงินและจ่ายเงินของเอกสาร <br> ข้อมูลการเก็บเงิน: <br>1. ใบกำกับภาษี/ใบเสร็จรับเงิน (Tax Invoice)
            <br> 2. ใบเสร็จรับเงิน (Receipt) <br> 3. ใบกำกับภาษี/ใบเสร็จรับเงิน (Cash Invoice) <br> ข้อมูลการจ่ายเงิน:
            <br>1. เอกสารใบรับสินค้า (Receiving Inventory)'
          properties:
            paymentDate:
              type: string
              format: date
              description: 'วันที่รับชำระเงิน รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
              example: ''
            collected:
              type: string
              description: (to be changed to number <decimal>) <br> จำนวนเงินยอดรับสุทธิ
              example: '0'
            paymentDeductionType:
              type: string
              description: '(to be changed to integer) <br> ประเภทรายการปรับลด: <br> 1 = ส่วนลดพิเศษ <br> 3 = ค่านายหน้าและส่วนแบ่งการขาย
                <br> 5 = ค่าดำเนินการ <br> 7 = ปัดเศษ <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)'
              example: ''
            paymentDeductionAmount:
              type: string
              description: (to be changed to number <decimal>) <br> จำนวนเงินยอดรายการปรับลด <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)
              default: '0'
            withheldPercentage:
              type: string
              description: (to be changed to decimal) <br> เปอร์เซ็น หัก ณ ที่จ่าย
              example: ''
            withheldAmount:
              type: string
              description: (to be changed to number <decimal>) <br> จำนวน ยอดหัก ณ ที่จ่าย
              default: '0'
            paymentCharge:
              type: string
              description: (to be changed to number <decimal>) <br> ค่าธรรมเนียม ที่ชำระโดยการโอนเงิน หรือ เช็ค <br> (เฉพาะเอกสารค่าใช้จ่าย)
              default: '0'
            paymentMethod:
              type: string
              description: '(to be changed to integer) <br> วิธีการชำระ: <br> 1 = เงินสด <br> 3 = เช็ค <br> 5 = โอนเงิน <br> 7 = เครดิต'
              default: '1'
            paymentChannel:
              type: string
              description: 'ช่องทางการชำระเงิน: <br> - เงินสด (Cash) <br> - โอนเงิน (Transfer) - ชื่อธนาคาร (Bank Name)
                <br> - เช็ค (Cheque) <br> - บัตรเครดิต (Credit card)'
              example: 'เงินสด'
            bankAccountType:
              type: string
              description: '(to be changed to integer) <br> ประเภทบัญชีธนาคาร: <br> 1 = ออมทรัพย์ <br> 3 = กระแสรายวัน <br> 7 = ฝากประจำ'
              example: '1'
            bankAccountName:
              type: string
              description: ชื่อธนาคาร
              example: ''
            bankAccountNumber:
              type: string
              description: เลขที่ธนาคาร / บัตรเคดิต
              example: ''
            chequeDate:
              type: string
              format: date
              description: 'วันที่หน้าเช็ค รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
              example: ''
            chequeNumber:
              type: string
              description: เลขที่เช็คธนาคาร
              example: ''
            paymentRemarks:
              type: string
              description: หมายเหตุ การรับชำระเงิน หรือ ชำระเงิน
              example: ''
            remainingCollectedType:
              type: string
              description: '(to be changed to integer) <br> สาเหตุเงินขาดเงินเกิน: <br> 51 = เงินขาดหรือเงินกิน <br> 55 = ค่าธรรมเนียมธนาคาร '
              example: ''
            remainingCollected:
              type: string
              description: (to be changed to number <decimal>) <br> จำนวน ยอดเงินขาด หรือ เงินเกิน
              default: '0'
            creditCardBankAccountId:
              type: string
              description: (to be changed to integer) <br> ธนาคารที่ชำระด้วยบัตรเครดิต <br>  1 = ธนาคารกรุงเทพ - (Bangkok Bank)
                <br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)<br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)
                <br> 4 = ธนาคารทหารไทย - (TMB Bank)<br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank)
                <br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)<br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank)
                <br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)<br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya)
                <br> 10 = ธนาคารออมสิน - (Government Savings Bank)<br> 11 = ธนาคารธนชาต - (Thanachart Bank)
                <br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)<br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank)
                <br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)<br> 19 = ธนาคารทิสโก้ - (Tisco Bank)
                <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
                <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
                <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank)
                <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
                <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
                <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
                <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
                <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
                <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
                <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
                <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank)
                <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
              example: ''
            pettyCashId:
              type: string
              description: '(to be changed to integer) <br> id บัญชีเงินสดย่อย <br> <ex> Example : 1234 </ex>'
              example: ''
            pettyCashName:
              type: string
              description: 'ชื่อบัญชีเงินสดย่อย <br> <ex> Example : บัญชีเงินสดย่อยสำหรับซื้ออุปกรณ์สำนักงาน </ex>'
              example: ''
            bankChequeId:
              type: string
              description: '(to be changed to integer) <br> id บัญชีเช็คจ่าย <br> <ex>Example: 1234</ex>'
            creditCardId:
              type: string
              description: (to be changed to integer) <br> เลข id บัตรเครดิตจ่าย
              example: ''
            creditCardNumber:
              type: string
              description: 'เลขบัตรเครดิต 4 ตัวท้าย <br> <ex>Example: 1234</ex>'
              example: ''
            otherChannelId:
              type: string
              description: '(to be changed to integer) <br> id บัญชีช่องทางอื่น ๆ <ex> Example: 1234 </ex>'
              example: ''
            otherChannelName:
              type: string
              description: 'ชื่อเครื่อง/เลขซีเรียล/ชื่อผู้ให้บริการ/ชื่อ Market place <ex> Example: Wongnai POS </ex>'
              example: ''
            otherChannelPaymentChannel:
              type: string
              description: '(to be changed to integer) <br> ประเภทช่องทางอื่น ๆ <br> 1 = เครื่องบันทึกเงินสด (POS) <br> 3 = ช่องทางรับชำระออนไลน์ (Payment Gateway)
                <br> 5 = เครื่องรูดบัตรเครดิต(EDC) <br> 7 = ร้านค้าออนไลน์ (Online shop/E-Commerce)<ex> Example: 1 </ex>'
              example: ''
        company:
          type: object
          description: ข้อมูลบริษัทของคุณในเอกสาร
          properties:
            companyName:
              type: string
              description: ชื่อบริษัท
            companyNameEn:
              type: string
              description: ชื่อบริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ)
            companyAddress:
              type: string
              description: ที่อยู่บริษัท
            companyAddressEn:
              type: string
              description: ที่อยู่บริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ)
            companyTaxId:
              type: string
              description: 'เลขประจำตัวผู้เสียภาษี บริษัท <br><ex>Example: 0105558096348</ex>'
            companyBranch:
              type: string
              description: 'ชื่อ และ รหัสสาขา <br><ex>Example: สำนักงานใหญ่ 00000</ex>'
            companyBranchEn:
              type: string
              description: 'ชื่อ และ รหัสสาขา ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br><ex>Example: Head Office 00000</ex>'
            companyPhone:
              type: string
              description: 'เบอร์โทรสำนักงาน <br><ex>Example: 02-999-9999</ex>'
            companyMobile:
              type: string
              description: 'เบอร์โทรศัพท์มือถือ <br><ex>Example: 099-999-9999</ex>'
            companyFax:
              type: string
              description: 'เบอร์โทรสาร <br><ex>Example: 02-999-9999 ต่อ 1</ex>'
            companyWebsite:
              type: string
              description: 'เว็บไซต์ <br><ex>Example: www.flowaccount.com</ex>'
        isDelete:
          type: string
          description: '(to be changed to boolean) <br> เอกสารถูกลบแล้ว : <br> true : ถูกลบแล้ว <br> false : ยังไม่ถูกลบ'
          example: 'false'
    BaseDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/DataResponse'
        - type: object
          properties:
            contactCode:
              type: string
              description: รหัส ลูกค้า/ผู้จำหน่าย
              example: '001'
            contactId:
              type: integer
              format: int64
              description: เลขที่ผู้ติดต่อ Id ลูกค้า/ผู้จำหน่าย
            contactName:
              type: string
              description: 'ชื่อ ลูกค้า/ผู้จำหน่าย <br> <ex>Example: บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ</ex>'
              example: บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ
            contactAddress:
              type: string
              description: ที่อยู่ ลูกค้า/ผู้จำหน่าย
              example: 'ที่อยู่ ลูกค้า/ผู้จำหน่าย'
            contactTaxId:
              type: string
              description: 'เลขประจำตัวผู้เสียภาษี ลูกค้า หรือ ผู้จำหน่าย/ลูกค้า <br> (ถ้ามีจำเป็นต้องครบ 13 หลัก) <br> <ex>Example: 1234567890123 </ex>'
              example: '1234567890123'
            contactEmail:
              example: contact@email.com
            externalDocumentId:
              type: string
              description: รหัสเอกสารอ้างอิงจากระบบภายนอก
              example: 'platform-123456'
    DocumentResponse:
      allOf:
        - $ref: '#/components/schemas/APIResponse'
        - type: object
          properties:
            data:
              allOf:
                - $ref: '#/components/schemas/BaseDocumentResponse'
                - type: object
                  properties:
                    discountType:
                      type: string
                      description: (to be changed to integer) <br> รูปแบบส่วนลดในเอกสาร กรณีใช้รูปแบบ Inline ส่วนลด หรือ ภาษี แยกตามรายการสินค้า
                        <br> สามารถเลือกรูปแบบส่วนลดได้ <br> 1 =  เปอร์เซ็นต์ <br> 3 = จำนวน (บาท)
                        <br> (For SimpleDocument, always 1)
                      example: '1'
                    useInlineDiscount:
                      type: string
                      description: '(to be changed to boolean) <br> inline discount ใช้งานส่วนลด แยกตามรายการสินค้า
                        <br> (SimpleDocument : always false <br> InlineDocument : always true)'
                      example: 'false'
                    useInlineVat:
                      type: string
                      description: '(to be changed to boolean) <br> inline vat ใช้งานส่วนลดและภาษี แยกตามรายการสินค้า
                        <br> (SimpleDocument : always false)'
                      example: 'false'
                    exemptAmount:
                      type: string
                      description: (to be changed to number <decimal>) <br> ยอดขายที่ยกเว้นภาษีมูลค่าเพิ่ม <br> (For SimpleDocument, always 0)
                      example: '0'
                    items:
                      type: array
                      description: รายการสินค้า
                      items:
                        $ref: '#/components/schemas/ProductItemResponse'
    SimpleDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/APIResponse'
        - type: object
          properties:
            data:
              allOf:
                - $ref: '#/components/schemas/BaseDocumentResponse'
                - type: object
                  properties:
                    discountType:
                      type: string
                      description: (to be changed to integer) <br> รูปแบบส่วนลดในเอกสาร กรณีใช้รูปแบบ Inline ส่วนลด หรือ ภาษี แยกตามรายการสินค้า
                        <br> สามารถเลือกรูปแบบส่วนลดได้ <br> 1 =  เปอร์เซ็นต์ <br> 3 = จำนวน (บาท)
                        <br> (For SimpleDocument, always 1)
                      example: '1'
                    useInlineDiscount:
                      type: string
                      description: (to be changed to boolean) <br> inline discount ใช้งานส่วนลด แยกตามรายการสินค้า
                        <br> (For SimpleDocument, always false)
                      example: 'false'
                    useInlineVat:
                      type: string
                      description: (to be changed to boolean) <br> inline vat ใช้งานส่วนลดและภาษี แยกตามรายการสินค้า
                        <br> (For SimpleDocument, always false)
                      example: 'false'
                    exemptAmount:
                      type: string
                      description: (to be changed to number <decimal>) <br> ยอดขายที่ยกเว้นภาษีมูลค่าเพิ่ม <br> (For SimpleDocument, always 0)
                      example: '0'
                    items:
                      type: array
                      description: รายการสินค้าใช้งานสำหรับเอกสาร Simple Document
                      items:
                        $ref: '#/components/schemas/ProductItemResponse'
    InlineDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/APIResponse'
        - type: object
          properties:
            data:
              allOf:
                - $ref: '#/components/schemas/BaseDocumentResponse'
                - type: object
                  properties:
                    discountType:
                      type: string
                      description: (to be changed to integer) <br> รูปแบบส่วนลดในเอกสาร กรณีใช้รูปแบบ Inline ส่วนลด หรือ ภาษี แยกตามรายการสินค้า
                        <br> สามารถเลือกรูปแบบส่วนลดได้ <br> 1 =  เปอร์เซ็นต์ <br> 3 = จำนวน (บาท)
                      example: '1'
                    useInlineDiscount:
                      type: string
                      description: (to be changed to boolean) <br> inline discount ใช้งานส่วนลด แยกตามรายการสินค้า
                      example: 'true'
                    useInlineVat:
                      type: string
                      description: (to be changed to boolean) <br> inline vat ใช้งานส่วนลดและภาษี แยกตามรายการสินค้า
                      example: 'false'
                    exemptAmount:
                      type: string
                      description: (to be changed to number <decimal>) <br> ยอดขายที่ยกเว้นภาษีมูลค่าเพิ่ม
                      example: '0'
                    items:
                      type: array
                      description: รายการสินค้าใช้งานสำหรับเอกสาร Inline Document
                      items:
                        $ref: '#/components/schemas/ProductItemResponse'
    SimpleDocumentWithPaymentResponse:
      allOf:
        - $ref: '#/components/schemas/SimpleDocumentResponse'
        - type: object
          properties:
            data:
              properties:
                creditType:
                  example: '3'
                creditDays:
                  example: '0'
                dueDate:
                  example: '2021-01-01'
                payments:
                  properties:
                    paymentDate:
                      example: '2021-01-01'
                    collected:
                      example: '100.00'
                    paymentMethod:
                      example: '1'
                    paymentChannel:
                      example: 'เงินสด'
                    paymentRemarks:
                      example: DocumentWithPayment
    InlineDocumentWithPaymentResponse:
      allOf:
        - $ref: '#/components/schemas/InlineDocumentResponse'
        - type: object
          properties:
            data:
              properties:
                creditType:
                  example: '3'
                creditDays:
                  example: '0'
                dueDate:
                  example: '2021-01-01'
                payments:
                  properties:
                    paymentDate:
                      example: '2021-01-01'
                    collected:
                      example: '100.00'
                    paymentMethod:
                      example: '1'
                    paymentChannel:
                      example: 'เงินสด'
                    paymentRemarks:
                      example: DocumentWithPayment
    GetDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/APIResponse'
        - type: object
          properties:
            data:
              type: object
              properties:
                totalDocument:
                  type: string
                  description: (to be changed to integer) <br> จำนวนเอกสาร
                  example: '1'
                list:
                  type: array
                  description: ข้อมูลรายละเอียดของเอกสาร
                  items:
                    allOf:
                      - $ref: '#/components/schemas/BaseDocumentResponse'
                      - type: object
                        properties:
                          discountType:
                            type: string
                            description: (to be changed to integer) <br> รูปแบบส่วนลดในเอกสาร กรณีใช้รูปแบบ Inline ส่วนลด หรือ ภาษี แยกตามรายการสินค้า
                              <br> สามารถเลือกรูปแบบส่วนลดได้ <br> 1 =  เปอร์เซ็นต์ <br> 3 = จำนวน (บาท)
                              <br> (For SimpleDocument, always 1)
                            example: '1'
                          useInlineDiscount:
                            type: string
                            description: '(to be changed to boolean) <br> inline discount ใช้งานส่วนลด แยกตามรายการสินค้า
                              <br> (SimpleDocument : always false <br> InlineDocument : always true)'
                            example: 'false'
                          useInlineVat:
                            type: string
                            description: '(to be changed to boolean) <br> inline vat ใช้งานส่วนลดและภาษี แยกตามรายการสินค้า
                              <br> (SimpleDocument : always false)'
                            example: 'false'
                          exemptAmount:
                            type: string
                            description: (to be changed to number <decimal>) <br> ยอดขายที่ยกเว้นภาษีมูลค่าเพิ่ม <br> (For SimpleDocument, always 0)
                            example: '0'
                          items:
                            type: array
                            description: รายการสินค้า
                            items:
                              $ref: '#/components/schemas/ProductItemResponse'
    AllDocumentResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: object
          description: ข้อมูลเอกสาร
          properties:
            list:
              type: array
              description: ข้อมูลรายละเอียดของเอกสาร
              items:
                type: object
                properties:
                  recordId:
                    type: integer
                    format: int64
                    description: id ของเอกสาร
                    default: 0
                  documentId:
                    type: integer
                    format: int64
                    description: id ของเอกสาร
                    default: 0
                  documentSerial:
                    type: string
                    description: เลขที่เอกสาร
                  contactCode:
                    type: string
                    description: รหัส ลูกค้า/ผู้จำหน่าย
                  contactId:
                    type: integer
                    format: int64
                    description: เลขที่ผู้ติดต่อ Id ลูกค้า/ผู้จำหน่าย
                  contactName:
                    type: string
                    description: 'ชื่อ ลูกค้า/ผู้จำหน่าย <br> <ex>Example: บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ</ex>'
                    example: บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ
                  contactAddress:
                    type: string
                    description: ที่อยู่ ลูกค้า/ผู้จำหน่าย
                  contactTaxId:
                    type: string
                    description: 'เลขประจำตัวผู้เสียภาษี ลูกค้า หรือ ผู้จำหน่าย/ลูกค้า <br> (ถ้ามีจำเป็นต้องครบ 13 หลัก) <br> <ex>Example: 1234567890123 </ex>'
                    example: '1234567890123'
                  contactBranch:
                    type: string
                    description: สำนักงาน/สาขา
                  contactPerson:
                    type: string
                    description: ชื่อผู้ติดต่อ
                  contactEmail:
                    type: string
                    description: 'อีเมลผู้ติดต่อ <br> <ex>Example: contact@email.com</ex>'
                    example: contact@email.com
                  contactNumber:
                    type: string
                    description: 'เบอร์มือถือผู้ติดต่อ <br> <ex>Example: 099-999-9999</ex>'
                    example: 099-999-9999
                  contactZipCode:
                    type: string
                    description: รหัสไปรษณีย์ติดต่อ
                  contactGroup:
                    type: integer
                    description: ประผู้ติดต่อ <br> 1 = บุคคลธรรมดา <br> 3 = นิติบุคคล
                    default: 1
                  publishedOn:
                    type: string
                    format: date
                    description: 'วันที่เอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
                    example: '2021-01-01'
                  creditType:
                    type: integer
                    description: รูปแบบเครดิต <br> 1 = เครดิต (วัน) <br> 3 = เงินสด  <br> 5 = เครดิต (ไม่แสดงวันที่ครบกำหนด)
                    default: 1
                  creditDays:
                    type: integer
                    description: 'จำนวนวันที่ให้เครดิต <br> <ex>Example: 30</ex>'
                    default: 0
                    example: 30
                  dueDate:
                    type: string
                    format: date
                    description: 'วันครบกำหนดเอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
                    example: '2021-01-01'
                  salesName:
                    type: string
                    description: 'ชื่อผู้สร้างเอกสาร หรือ ชื่อพนักงานขาย <br> <ex>Example: sale@email.com or Mr.Sale Shop</ex>'
                    default: อีเมล หรือ ชื่อผู้สร้างเอกสาร
                    example: พนักงาน ขายหน้าร้าน
                  projectName:
                    type: string
                    description: ชื่อโปรเจค
                  reference:
                    type: string
                    description: 'เลขที่อ้างอิง หรือ เลขที่เอกสารที่เกี่ยวข้อง <br> <ex>Example: INV2020010001</ex>'
                    example: INV2020010001
                  isVatInclusive:
                    type: boolean
                    description: มูลค่าเอกสารรวมภาษีแล้วหรือไม่
                    default: false
                  discountType:
                    type: integer
                    description: รูปแบบส่วนลดในเอกสาร กรณีใช้รูปแบบ Inline ส่วนลด หรือ ภาษี แยกตามรายการสินค้า <br> สามารถเลือกรูปแบบส่วนลดได้ <br> 1 =  เปอร์เซ็นต์ <br> 3 = จำนวน (บาท)
                    default: 1
                  useInlineDiscount:
                    type: boolean
                    description: inline discount ใช้งานส่วนลด แยกตามรายการสินค้า
                    default: true
                  useInlineVat:
                    type: boolean
                    description: inline vat ใช้งานส่วนลดและภาษี แยกตามรายการสินค้า
                  useReceiptDeduction:
                    type: boolean
                    description: เปิดใช้งานฟังก์ชั่น ปรับลดท้ายเอกสาร <br> (เฉพาะเอกสารใบกำกับภาษี / ใบเสร็จรับเงิน และ ใบเสร็จรับเงิน)
                    default: false
                  subTotal:
                    type: number
                    format: decimal
                    description: มูลค่ารวมเป็นเงิน
                    default: 0
                  discountPercentage:
                    type: integer
                    description: มูลค่าส่วนลดเป็นเปอร์เซ็นต์
                    default: 0
                  discountAmount:
                    type: number
                    format: decimal
                    description: มูลค่าส่วนลดเป็นจำนวน (บาท)
                    default: 0
                  totalAfterDiscount:
                    type: number
                    format: decimal
                    description: มูลค่าหลังหักส่วนลด
                  totalWithoutVat:
                    type: number
                    format: decimal
                    description: มูลค่าไม่รวมภาษีมูลค่าเพิ่ม
                  exemptAmount:
                    type: number
                    nullable: true
                    format: decimal
                    description: ยอดขายที่ยกเว้นภาษีมูลค่าเพิ่ม
                    default: 0
                  vatableAmount:
                    type: number
                    nullable: true
                    format: decimal
                    description: ยอดขายที่คิดภาษีมูลค่าเพิ่ม
                    default: 0
                  isVat:
                    type: boolean
                    description: มูลค่าหลังหักส่วนลด มีภาษีมูลค่าเพิ่ม 7%
                    default: false
                  isManualVat:
                    type: boolean
                    description: กำหนดค่าภาษีมูลค่าเพิ่มเอง
                    default: false
                  vatAmount:
                    type: number
                    format: decimal
                    description: ภาษีมูลค่าเพิ่ม
                  grandTotal:
                    type: number
                    format: decimal
                    description: จำนวนเงินรวมทั้งสิ้น (รวมภาษีมูลค่าเพิ่ม 7% แล้ว)
                  documentShowWithholdingTax:
                    type: boolean
                    description: แสดงหรือไม่แสดง หัก ณ ที่จ่ายท้ายเอกสาร
                    default: false
                  documentWithholdingTaxPercentage:
                    type: number
                    format: decimal
                    description: ภาษี ณ ที่จ่าย (%)
                    default: 0
                  documentDeductionType:
                    type: integer
                    description: ประเภทรายการปรับลด <br> 1 = ส่วนลดพิเศษ <br> 3 = ค่านายหน้าและส่วนแบ่งการขาย <br> 5 = ค่าดำเนินการ <br> 7 = ปัดเศษ <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)
                    default: 0
                  documentDeductionAmount:
                    type: number
                    format: decimal
                    description: จำนวนเงินยอดรายการปรับลด <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)
                    default: 0
                  remarks:
                    type: string
                    description: หมายเหตุเอกสาร
                  internalNotes:
                    type: string
                    description: โน๊ตภายในบริษัท
                  showSignatureOrStamp:
                    type: boolean
                    description: ลายเซ็นอิเล็กทรอนิกส์และตรายาง
                    default: true
                  items:
                    type: array
                    description: รายการสินค้าใช้งานสำหรับเอกสาร Inline Document
                    items:
                      $ref: '#/components/schemas/InlineProductItem'
                  referencedToMe:
                    type: array
                    description: ข้อมูลเอกสารปลายทางที่อ้างอิง ถึง เอกสารฉบับนี้
                    items:
                      $ref: '#/components/schemas/ReferencedToMe'
                  referencedByMe:
                    type: array
                    description: เอกสารต้นทางที่อ้างอิง ถึง เอกสารฉบับนี้
                    items:
                      $ref: '#/components/schemas/ReferencedByMe'
                  payments:
                    type: object
                    description: 'ข้อมูลการเก็บเงินและจ่ายเงินของเอกสาร <br> ข้อมูลการเก็บเงิน: <br>1. ใบกำกับภาษี/ใบเสร็จรับเงิน (Tax Invoice) <br> 2. ใบเสร็จรับเงิน (Receipt) <br> 3. ใบกำกับภาษี/ใบเสร็จรับเงิน (Cash Invoice) <br> ข้อมูลการจ่ายเงิน: <br>1. เอกสารใบรับสินค้า (Receiving Inventory)'
                    properties:
                      paymentDate:
                        type: string
                        format: date
                        description: 'วันที่รับชำระเงิน รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
                        example: '2021-01-01'
                      collected:
                        type: number
                        format: decimal
                        description: จำนวนเงินยอดรับสุทธิ
                        default: 0
                      paymentDeductionType:
                        type: integer
                        format: int64
                        description: 'ประเภทรายการปรับลด: <br> 1 = ส่วนลดพิเศษ <br> 3 = ค่านายหน้าและส่วนแบ่งการขาย <br> 5 = ค่าดำเนินการ <br> 7 = ปัดเศษ <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)'
                        default: 0
                      paymentDeductionAmount:
                        type: number
                        format: decimal
                        description: จำนวนเงินยอดรายการปรับลด <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)
                        default: 0
                      withheldPercentage:
                        type: number
                        format: decimal
                        description: เปอร์เซ็น หัก ณ ที่จ่าย
                        default: 0
                      withheldAmount:
                        type: number
                        format: decimal
                        description: จำนวน ยอดหัก ณ ที่จ่าย
                        default: 0
                      paymentCharge:
                        type: number
                        format: decimal
                        description: ค่าธรรมเนียม ที่ชำระโดยการโอนเงิน หรือ เช็ค <br> (เฉพาะเอกสารค่าใช้จ่าย)
                        default: 0
                      paymentMethod:
                        type: integer
                        description: 'วิธีการชำระ: <br> 1 = เงินสด <br> 3 = เช็ค <br> 5 = โอนเงิน <br> 7 = เครดิต'
                        default: 0
                      paymentChannel:
                        type: string
                        description: 'ช่องทางการชำระเงิน: <br> - เงินสด (Cash) <br> - โอนเงิน (Transfer) - ชื่อธนาคาร (Bank Name) <br> - เช็ค (Cheque) <br> - บัตรเครดิต (Credit card)'
                      bankAccountType:
                        type: integer
                        description: 'ประเภทบัญชีธนาคาร: <br> 1 = ออมทรัพย์ <br> 3 = กระแสรายวัน <br> 7 = ฝากประจำ'
                      bankAccountName:
                        type: string
                        description: ชื่อธนาคาร
                      bankAccountNumber:
                        type: string
                        description: เลขที่ธนาคาร / บัตรเคดิต
                      chequeDate:
                        type: string
                        format: date
                        description: 'วันที่หน้าเช็ค รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
                        example: '2021-01-01'
                      chequeNumber:
                        type: string
                        description: เลขที่เช็คธนาคาร
                      creditCardBankAccountId:
                        type: integer
                        format: int64
                        description: ธนาคารที่ชำระด้วยบัตรเครดิต <br>  1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)<br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)<br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank)<br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)<br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank)<br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)<br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya)<br> 10 = ธนาคารออมสิน - (Government Savings Bank)<br> 11 = ธนาคารธนชาต - (Thanachart Bank)<br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)<br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank)<br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)<br> 19 = ธนาคารทิสโก้ - (Tisco Bank)<br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives) <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand) <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank)<br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)<br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)<br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)<br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)<br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)<br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)<br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)<br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
                        default: 0
                      paymentRemarks:
                        type: string
                        description: หมายเหตุ การรับชำระเงิน หรือ ชำระเงิน
                      remainingCollectedType:
                        type: integer
                        format: int64
                        description: 'สาเหตุเงินขาดเงินเกิน: <br> 51 = เงินขาดหรือเงินกิน <br> 55 = ค่าธรรมเนียมธนาคาร '
                        default: 0
                      remainingCollected:
                        type: number
                        format: decimal
                        description: จำนวน ยอดเงินขาด หรือ เงินเกิน
                        default: 0
                      pettyCashId:
                        type: integer
                        format: int64
                        description: 'id บัญชีเงินสดย่อย <br> <ex> Example : 1234 </ex>'
                        default: 0
                      pettyCashName:
                        type: string
                        description: 'ชื่อบัญชีเงินสดย่อย <br> <ex> Example : บัญชีเงินสดย่อยสำหรับซื้ออุปกรณ์สำนักงาน </ex>'
                      bankChequeId:
                        type: integer
                        format: int64
                        description: 'id บัญชีเช็คจ่าย <br> <ex>Example: 1234</ex>'
                        default: 0
                      creditCardId:
                        type: integer
                        format: int64
                        description: 'id บัญชีบัตรเครดิตจ่าย <br> <ex>Example: 1234</ex>'
                        default: 0
                      creditCardNumber:
                        type: string
                        description: 'เลขบัตรเครดิต 4 ตัวท้าย <br> <ex>Example: 1234</ex>'
                      otherChannelId:
                        type: integer
                        format: int64
                        description: 'id บัญชีช่องทางอื่น ๆ <ex> Example: 1234 </ex>'
                        default: 0
                      otherChannelPaymentChannel:
                        type: integer
                        format: int64
                        description: 'ประเภทช่องทางอื่น ๆ <br> 1 = เครื่องบันทึกเงินสด (POS) <br> 3 = ช่องทางรับชำระออนไลน์ (Payment Gateway) <br> 5 = เครื่องรูดบัตรเครดิต(EDC) <br> 7 = ร้านค้าออนไลน์ (Online shop/E-Commerce)<ex> Example: 1 </ex>'
                        default: 0
                      otherChannelName:
                        type: string
                        description: 'ชื่อเครื่อง/เลขซีเรียล/ชื่อผู้ให้บริการ/ชื่อ Market place <ex> Example: Wongnai POS </ex>'
                  company:
                    type: object
                    description: ข้อมูลบริษัทของคุณในเอกสาร
                    properties:
                      companyName:
                        type: string
                        description: ชื่อบริษัท
                      companyNameEn:
                        type: string
                        description: ชื่อบริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ)
                      companyAddress:
                        type: string
                        description: ที่อยู่บริษัท
                      companyAddressEn:
                        type: string
                        description: ที่อยู่บริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ)
                      companyTaxId:
                        type: string
                        description: 'เลขประจำตัวผู้เสียภาษี บริษัท <br><ex>Example: 0105558096348</ex>'
                      companyBranch:
                        type: string
                        description: 'ชื่อ และ รหัสสาขา <br><ex>Example: สำนักงานใหญ่ 00000</ex>'
                      companyBranchEn:
                        type: string
                        description: 'ชื่อ และ รหัสสาขา ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br><ex>Example: Head Office 00000</ex>'
                      companyPhone:
                        type: string
                        description: 'เบอร์โทรสำนักงาน <br><ex>Example: 02-999-9999</ex>'
                      companyMobile:
                        type: string
                        description: 'เบอร์โทรศัพท์มือถือ <br><ex>Example: 099-999-9999</ex>'
                      companyFax:
                        type: string
                        description: 'เบอร์โทรสาร <br><ex>Example: 02-999-9999 ต่อ 1</ex>'
                      companyWebsite:
                        type: string
                        description: 'เว็บไซต์ <br><ex>Example: www.flowaccount.com</ex>'
                  status:
                    type: integer
                    description: เลขสถานะเอกสารฉบับนี้
                  statusString:
                    type: integer
                    description: ชื่อสถานะเอกสารฉบับนี้
                  documentType:
                    type: integer
                    description: เลขประเภทเอกสารฉบับนี้
                  allowDelete:
                    type: boolean
                    description: สามารถลบเอกสาร :<br> true = ลบได้ <br> false = ลบไม่ได้
                  saleAndPurchaseChannel:
                    type: string
                    description: ช่องทางการขาย สำหรับ Account ที่เชื่อมต่อกับ E-commerce เมนู My Platform <br>1. Lazada <br> 2. Shopee
                    default: 0
                  externalDocumentId:
                    type: string
                    description: รหัสเอกสารอ้างอิงจากระบบภายนอก
            totalDocument:
              type: string
              description: จำนวนเอกสาร
    DeleteResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: object
          description: data success
          properties:
            deleteStatus:
              type: string
              description: ' Status Delete Document or Product or Contact'
    ProductItem:
      type: object
      description: รายการสินค้า
      properties:
        id:
          type: integer
          format: int64
          description: id ของรายการสินค้า <br> if provided, `name` and `type` will automatically assign values based on the provided id.
            <br> The value is able to GET by <br> go to section ProductMaster > Get all Product Master/Get Product Master by Id,
            the field name is `id` in `productLists`
        type:
          type: integer
          description: ประเภทสินค้า <br> 1 = บริการ (service) <br> 3 = สินค้าไม่นับสต๊อก (non inventory) <br> 5 = สินค้านับสต๊อก (inventory)
          default: 1
        name:
          type: string
          description: ชื่อสินค้า
          example: 'Service'
        description:
          type: string
          description: รายละเอียดสินค้า
          example: 'Type service'
        quantity:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 4 digits** <br> จำนวนสินค้า'
          example: 1.1234
        unitName:
          type: string
          maxLength: 10
          description: หน่วยสินค้า
          example: 'บริการ'
        pricePerUnit:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 4 digits** <br>
            ราคาสินค้าต่อหน่วย'
          example: 100.0001
        total:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** <br> 
            ราคารวมสินค้า <br>Should be the result of pricePerUnit multiplied by quantity'
          example: 100.01
        sellChartOfAccountCode:
          type: string
          description: 'เลือกลงบันทึกบัญชีรายได้ สำหรับเอกสารฝั่งขาย<br>โดยปกติระบบจะ Default 41110 ให้อยู่แล้ว
            ยกเว้นต้องการแก้ไขบัญชีการลงบันทึกบัญชีที่ต้องการ โดยใช้เลข Code ผังบัญชี<br> <ex>Example: 41110</ex>'
          example: "41210"
        buyChartOfAccountCode:
          type: string
          description: 'เลือกลงบันทึกบัญชีค่าใช้จ่าย สำหรับเอกสารฝั่งซื้อ<br>โดยปกติระบบจะ Default 51111.01 ให้อยู่แล้ว
            ยกเว้นต้องการแก้ไขบัญชีการลงบันทึกบัญชีที่ต้องการ โดยใช้เลข Code ผังบัญชี<br> <ex>Example: 51111.01</ex>'
          example: ""
      required:
        - name
        - quantity
        - pricePerUnit
        - total
        - documentStructureType
    SimpleProductItem:
      allOf:
        - $ref: '#/components/schemas/ProductItem'
    InlineProductItem:
      allOf:
        - $ref: '#/components/schemas/ProductItem'
        - type: object
          description: ข้อมุลรายการสินค้า ใช้งานส่วนลดหรือภาษีแยกตามรายการสินค้า
          properties:
            discountAmount:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 2 digits** <br>
                จำนวนส่วนลดสินค้า'
              default: 0
              example: 100.01
            vatRate:
              type: integer
              description: รูปแบบภาษี <br> 7 = ภาษี 7% <br> 0 = ภาษี 0% <br> -1 = ยกเว้นภาษี
              default: 7
    ProductItemResponse:
      type: object
      description: รายการสินค้า
      properties:
        id:
          type: integer
          format: int64
          description: id ของรายการสินค้า
        type:
          type: string
          description: (to be changed to number <decimal>) <br> ประเภทสินค้า <br> 1 = บริการ (service) <br> 3 = สินค้าไม่นับสต๊อก (non inventory)
            <br> 5 = สินค้านับสต๊อก (inventory)
          default: 1
        name:
          type: string
          description: ชื่อสินค้า
          example: 'Service'
        description:
          type: string
          description: รายละเอียดสินค้า
          example: 'Type service'
        quantity:
          type: string
          description: (to be changed to number <decimal>) <br> จำนวนสินค้า
          example: '1'
        unitName:
          type: string
          maxLength: 7
          description: หน่วยสินค้า
          example: 'บริการ'
        pricePerUnit:
          type: string
          description: (to be changed to number <decimal>) <br> ราคาสินค้าต่อหน่วย
          example: '100'
        total:
          type: string
          description: (to be changed to number <decimal>) <br> ราคารวมสินค้า
          example: '100'
        sellChartOfAccountCode:
          type: string
          description: 'เลือกลงบันทึกบัญชีรายได้ สำหรับเอกสารฝั่งขาย<br>โดยปกติระบบจะ Default 41110 ให้อยู่แล้ว
            ยกเว้นต้องการแก้ไขบัญชีการลงบันทึกบัญชีที่ต้องการ โดยใช้เลข Code ผังบัญชี<br> <ex>Example: 41110</ex>'
          example: "41210"
        buyChartOfAccountCode:
          type: string
          description: 'เลือกลงบันทึกบัญชีค่าใช้จ่าย สำหรับเอกสารฝั่งซื้อ<br>โดยปกติระบบจะ Default 51111.01 ให้อยู่แล้ว
            ยกเว้นต้องการแก้ไขบัญชีการลงบันทึกบัญชีที่ต้องการ โดยใช้เลข Code ผังบัญชี<br> <ex>Example: 51111.01</ex>'
          example: ""
        vatRate:
          type: string
          description: (to be changed to integer) <br> รูปแบบภาษี <br> 7 = ภาษี 7% <br> 0 = ภาษี 0% <br> -1 = ยกเว้นภาษี
            <br> (For SimpleDocument, always 7)
          default: '7'
        discountAmount:
          type: string
          description: (to be changed to number <decimal>) <br> จำนวนส่วนลดสินค้า <br> (For SimpleDocument, always 0)
          default: '0'
    DocumentReference:
      type: object
      description: ข้อมูลเอกสารต้นทาง ที่ต้องการอัพเกรดเป็นเอกสารที่ต้องการ
      properties:
        recordId:
          type: integer
          format: int64
          description: recordId ของเอกสารต้นทาง
        referenceDocumentSerial:
          type: string
          description: 'เลขที่เอกสารต้นทาง <br> <ex>Example: QT20200101</ex>'
          example: QT20200101
        referenceDocumentType:
          type: integer
          format: int64
          description: 'เลขประเภทของเอกสารต้นทาง <br> Purchase Orders = 1 <br> Quotaions = 3 <br> Billing Notes = 5
            <br> Tax Invoices = 7 <br> <ex>Example: 3</ex>'
          example: 3
      required:
        - recordId
        - referenceDocumentSerial
        - referenceDocumentType
    ReferencedToMe:
      type: object
      properties:
        referenceId:
          type: string
          description: (to be changed to integer) <br> ID เอกสารฉบับนี้
        referenceDocumentType:
          type: string
          description: (to be changed to integer) <br> ประเภทของเอกสารฉบับนี้
        referenceDocumentSerial:
          type: string
          description: เลขที่เอกสารฉบับนี้
        documentId:
          type: string
          description: (to be changed to integer) <br> ID เอกสารปลายทางที่อ้างอิง ถึง เอกสารฉบับนี้
        documentSerial:
          type: string
          description: (to be changed to integer) <br> เลขที่เอกสารปลายทางที่อ้างอิง ถึง เอกสารฉบับนี้
        type:
          type: string
          description: (to be changed to integer)
          default: '1'
    ReferencedByMe:
      type: object
      properties:
        referenceId:
          type: string
          description: (to be changed to integer) <br> ID เอกสารฉบับนี้
        referenceDocumentType:
          type: string
          description: (to be changed to integer) <br> ประเภทของเอกสารฉบับนี้
        referenceDocumentSerial:
          type: string
          description: เลขที่เอกสารฉบับนี้
        documentId:
          type: string
          description: (to be changed to integer) <br> ID เอกสารต้นทางที่อ้างอิง ถึง เอกสารฉบับนี้
        documentSerial:
          type: string
          description: (to be changed to integer) <br> เลขที่เอกสารต้นทางที่อ้างอิง ถึง เอกสารฉบับนี้
        type:
          type: string
          description: (to be changed to integer)
          default: '1'
    StatusDocument:
      type: object
      properties:
        status:
          type: integer
          description: เลขสถานะเอกสารฉบับนี้
        statusString:
          type: integer
          description: ชื่อสถานะเอกสารฉบับนี้
        documentType:
          type: integer
          description: เลขประเภทเอกสารฉบับนี้
        allowDelete:
          type: boolean
          description: สามารถลบเอกสาร :<br> true = ลบได้ <br> false = ลบไม่ได้
    PaymentReceivingDocument:
      oneOf:
        - $ref: '#/components/schemas/PaymentReceivingCash'
        - $ref: '#/components/schemas/PaymentReceivingCheque'
        - $ref: '#/components/schemas/PaymentReceivingTransfer'
        - $ref: '#/components/schemas/PaymentReceivingOtherChannel'
    PaymentReceiving:
      type: object
      properties:
        paymentStructureType:
          type: string
          nullable: true
          enum:
            - PaymentReceivingCash
            - PaymentReceivingCheque
            - PaymentReceivingTransfer
            - PaymentReceivingOtherChannel
        documentId:
          type: integer
          format: int64
          description: id of document (to be deprecated)
        paymentMethod:
          type: integer
          format: int64
          default: 1
        paymentDate:
          type: string
          format: date
          description: 'วันที่รับชำระเงิน / วันที่ชำระเงิน รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
          example: '2021-01-01'
        collected:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** <br>
            จำนวนเงินยอดรับสุทธิ <br> (The value cannot be 0)
            <br> <ex> Example : 100.00 </ex>'
          example: 100.00
        paymentDeductionType:
          type: integer
          format: int64
          description: ประเภทรายการปรับลด <br> 1 = ส่วนลดพิเศษ <br> 3 = ค่านายหน้าและส่วนแบ่งการขาย <br> 5 = ค่าดำเนินการ <br> 7 = ปัดเศษ <br>
          default: 0
        paymentDeductionAmount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits**
            <br> จำนวนเงินยอดรายการปรับลด <br> <ex> Example : 100.00 </ex>'
          default: 0
        withheldPercentage:
          type: number
          format: deciaml
          description: '**Limit decimal places to no more than 4 digits**
            <br> เปอร์เซ็น หัก ณ ที่จ่าย <br> 0.5 = 0.5% <br> 0.75 = 0.75% <br> 1 = 1% <br> 1.5 = 1.5% <br> 2 = 2%
            <br> 3 = 3% <br> 5 = 5% <br> 10 = 10% <br> 15 = 15% <br> -1 = จำนวนเงิน
            <red>(สำหรับเอกสารที่ใช้ภาษีแยกตามรายการสินค้า ต้องใช้เป็นจำนวนเงิน)</red>'
          default: 0
        withheldAmount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits**
            <br> จำนวน ยอดหัก ณ ที่จ่าย <br> The value should be related with collected and withheldPercentage'
          default: 0
        paymentRemarks:
          type: string
          description: หมายเหตุ การรับชำระเงิน หรือ ชำระเงิน
          example: DocumentWithPayment
        remainingCollectedType:
          type: integer
          format: int64
          description: 'สาเหตุเงินขาด เงินเกิน <br> 51 = เงินขาดหรือเงินกิน <br> 55 = ค่าธรรมเนียมธนาคาร
            <br> Input when collected is different to grandTotal'
          default: 0
        remainingCollected:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits**
            <br> จำนวน ยอดเงินขาด หรือ เงินเกิน
            <br> The value should be related with collected and grandTotal'
          default: 0.00
          example: 100.01
      required:
        - paymentDate
        - collected
    PaymentReceivingCash:
      title: PaymentReceivingCash
      allOf:
        - $ref: '#/components/schemas/PaymentReceiving'
        - type: object
          properties:
            paymentStructureType:
              description: รับชำระเงิน ด้วยเงินสด
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 1 = เงินสด
              example: 1
    PaymentReceivingCheque:
      title: PaymentReceivingCheque
      allOf:
        - $ref: '#/components/schemas/PaymentReceiving'
        - $ref: '#/components/schemas/PaymentMethodReceivingCheque'
        - type: object
          properties:
            paymentStructureType:
              description: รับชำระเงิน ค้วยเช็ค
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 3 = เช็ค
                <br> Required user to setup cheque banking channel before using Cheque Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Cheque
              example: 3
            chequeBankAccountId:
              type: integer
              description: ธนาคารที่ระบุหน้าเช็ค <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)
                <br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
                <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank) <br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
                <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank) <br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
                <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya) <br> 10 = ธนาคารออมสิน - (Government Savings Bank)
                <br> 11 = ธนาคารธนชาต - (Thanachart Bank) <br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
                <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank) <br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)
                <br> 19 = ธนาคารทิสโก้ - (Tisco Bank) 
                <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
                <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
                <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank
                <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
                <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
                <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
                <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
                <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
                <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
                <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
                <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) 
                <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
    PaymentReceivingTransfer:
      title: PaymentReceivingTransfer
      allOf:
        - $ref: '#/components/schemas/PaymentReceiving'
        - $ref: '#/components/schemas/PaymentMethodReceivingTransfer'
        - type: object
          properties:
            paymentStructureType:
              description: รับชำระเงิน ด้วยการโอนเงิน
            paymentMethod:
              type: integer
              description: 'ประเภทการเก็บเงิน <br> 5 = โอนเงิน
                <br> Required user to setup bank account before using Transfer Payment Method.
                <br> To setup banking channel, go to section MyCompany > Bank Channel > Create Bank Account
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/post/bank-channel/bank-accounts" target="_blank">(link)</a>
                <br> or in FlowAccount website, go to MyCompany > Banking Channel > Add Account > Bank Account'
              example: 5
    PaymentReceivingOtherChannel:
      title: PaymentReceivingOtherChannel
      allOf:
        - $ref: '#/components/schemas/PaymentReceiving'
        - $ref: '#/components/schemas/PaymentMethodReceivingOtherChannel'
        - type: object
          properties:
            paymentStructureType:
              description: รับชำระเงิน ช่องทางอื่น ๆ ได้แก่ เครื่องบันทึกเงินสด (POS), เครื่องรูดบัตรเครดิต (EDC),
                ช่องทางรับชำระออนไลน์ (Payment Gateway), ร้านค้าออนไลน์ (Online shop/E-Commerce)
            paymentMethod:
              type: integer
              description: ประเภทการเก็บเงิน <br> 13 = ช่องทางอื่น ๆ EDC, POS, Payment Gateway, Online Shop/E-Commerce
                <br> Required user to setup other channels before using OtherChannel Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Other Channels > Select Payment Channel as EDC,
                POS, Online Payment Gateway or Online shop/E-Commerce
              example: 13
    PaymentPaidDocument:
      oneOf:
        - $ref: '#/components/schemas/PaymentPaidCash'
        - $ref: '#/components/schemas/PaymentPaidCheque'
        - $ref: '#/components/schemas/PaymentPaidTransfer'
        - $ref: '#/components/schemas/PaymentPaidCreditCard'
        - $ref: '#/components/schemas/PaymentPaidPettyCash'
        - $ref: '#/components/schemas/PaymentPaidOtherChannel'
    PaymentPaid:
      type: object
      properties:
        paymentStructureType:
          type: string
          nullable: true
        documentId:
          type: integer
          format: int64
          description: id เอกสาร <br> (deprecated soon)
        paymentMethod:
          type: integer
          format: int64
          default: 1
        paymentDate:
          type: string
          format: date
          description: 'วันที่รับชำระเงิน / วันที่ชำระเงิน รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
          example: '2021-01-01'
        collected:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** 
            <br> จำนวนเงินยอดรับสุทธิ <br> (The value cannot be 0)
            <br> <ex> Example : 100.00 </ex>'
          default: 0
          example: 100
        withheldPercentage:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 4 digits**
            <br> เปอร์เซ็น หัก ณ ที่จ่าย <br> 0.5 = 0.5% <br> 0.75 = 0.75% <br> 1 = 1% <br> 1.5 = 1.5% <br> 2 = 2%
            <br> 3 = 3% <br> 5 = 5% <br> 10 = 10% <br> 15 = 15% <br> -1 = จำนวนเงิน
            <red>(สำหรับเอกสารที่ใช้ภาษีแยกตามรายการสินค้า ต้องใช้เป็นจำนวนเงิน)</red>'
          default: 0
        withheldAmount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits**
            <br> จำนวน ยอดหัก ณ ที่จ่าย <br> <ex> Example : 100.00 </ex>'
          default: 0
        paymentRemarks:
          type: string
          description: หมายเหตุ การรับชำระเงิน หรือ ชำระเงิน
          example: DocumentWithPayment
        remainingCollectedType:
          type: integer
          format: int64
          description: 'สาเหตุเงินขาด เงินเกิน <br> 51 = เงินขาดหรือเงินกิน <br> 55 = ค่าธรรมเนียมธนาคาร '
          default: 0
        remainingCollected:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits**
            <br> จำนวน ยอดเงินขาด หรือ เงินเกิน <br> <ex> Example : 100.00 </ex>'
          default: 0
      required:
        - paymentDate
        - collected
    PaymentPaidCash:
      title: PaymentPaidCash
      allOf:
        - $ref: '#/components/schemas/PaymentPaid'
        - type: object
          properties:
            paymentStructureType:
              description: ชำระเงิน ด้วยเงินสด
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 1 = เงินสด
              example: 1
    PaymentPaidCheque:
      title: PaymentPaidCheque
      allOf:
        - $ref: '#/components/schemas/PaymentPaid'
        - $ref: '#/components/schemas/PaymentMethodReceivingCheque'
        - type: object
          properties:
            paymentStructureType:
              description: ชำระเงิน ด้วยเช็ค
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 3 = บัญชีเช็คจ่าย
                <br> Required user to setup cheque banking channel before using Cheque Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Cheque
              example: 3
            chequeBankAccountId:
              type: integer
              description: ธนาคารที่ระบุหน้าเช็ค <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)
                <br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
                <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank) <br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
                <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank) <br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
                <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya) <br> 10 = ธนาคารออมสิน - (Government Savings Bank)
                <br> 11 = ธนาคารธนชาต - (Thanachart Bank) <br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
                <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank) <br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)
                <br> 19 = ธนาคารทิสโก้ - (Tisco Bank) 
                <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
                <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
                <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank
                <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
                <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
                <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
                <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
                <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
                <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
                <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
                <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) 
                <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
                <br> The value should be related with the bank name of bankAccountId
            bankAccountId:
              type: integer
              format: int64
              description: 'เลข id บัญชีธนาคารที่ใช้ชำระเงิน <br><red>สามารถ GET มาได้จาก My Company > Bank Account </red><br> <ex>Example: 12345</ex>'
              default: 0
              example: '12345'
            bankChequeId:
              type: integer
              format: int64
              description: 'id of cheque <br> The value is able to GET by go to sectionMyCompany > Bank Channel > Get list all Bank Cheque
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/get/bank-channel/cheque" target="_blank">(link)</a> ,
                <br> the field name is `bankChequeId`
                <br> <ex>Example: 1234</ex>'
              default: 0
              example: '1234'
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยเช็ค <br> <ex> Example : 100.0000 </ex>'
              default: 0
          required:
            - bankAccountId
            - bankChequeId
    PaymentPaidTransfer:
      title: PaymentPaidTransfer
      allOf:
        - $ref: '#/components/schemas/PaymentPaid'
        - $ref: '#/components/schemas/PaymentMethodReceivingTransfer'
        - type: object
          properties:
            paymentStructureType:
              description: ชำระเงิน ด้วยการโอนเงิน
            paymentMethod:
              type: integer
              description: 'ประเภทการชำระเงิน <br> 5 = โอนเงิน
                <br> Required user to setup bank account before using Transfer Payment Method.
                <br> To setup banking channel, go to section MyCompany > Bank Channel > Create Bank Account
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/post/bank-channel/bank-accounts" target="_blank">(link)</a>
                <br> or in FlowAccount website, go to MyCompany > Banking Channel > Add Account > Bank Account'
              example: 5
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยการโอนเงิน <ex> Example : 100.0000 </ex>'
              default: 0
    PaymentPaidCreditCard:
      title: PaymentPaidCreditCard
      allOf:
        - $ref: '#/components/schemas/PaymentPaid'
        - $ref: '#/components/schemas/PaymentMethodPaidCreditCard'
        - type: object
          properties:
            paymentStructureType:
              description: ชำระเงิน ด้วยบัญชีบัตรเครดิตจ่าย
    PaymentPaidPettyCash:
      title: PaymentPaidPettyCash
      allOf:
        - $ref: '#/components/schemas/PaymentPaid'
        - $ref: '#/components/schemas/PaymentMethodPaidPettyCash'
        - type: object
          properties:
            paymentStructureType:
              description: ชำระเงิน ด้วยเงินสดย่อย
    PaymentPaidOtherChannel:
      title: PaymentPaidOtherChannel
      allOf:
        - $ref: '#/components/schemas/PaymentPaid'
        - $ref: '#/components/schemas/PaymentMethodReceivingOtherChannel'
        - type: object
          properties:
            paymentStructureType:
              description: ชำระเงิน ช่องทางอื่น ๆ ได้แก่ เครื่องบันทึกเงินสด (POS), เครื่องรูดบัตรเครดิต (EDC),
                ช่องทางรับชำระออนไลน์ (Payment Gateway), ร้านค้าออนไลน์ (Online shop/E-Commerce)
            paymentMethod:
              type: integer
              description: ชำระเงิน ช่องทางอื่น ๆ ได้แก่ เครื่องบันทึกเงินสด (POS), เครื่องรูดบัตรเครดิต (EDC),
                ช่องทางรับชำระออนไลน์ (Payment Gateway), ร้านค้าออนไลน์ (Online shop/E-Commerce)
                <br> Required user to setup other channels before using OtherChannel Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Other Channels > Select Payment Channel as EDC,
                POS, Online Payment Gateway or Online shop/E-Commerce
              example: 13
    ExpenseDocument:
      type: object
      properties:
        contactCode:
          type: string
          description: รหัส ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
          example: '001'
        contactId:
          type: integer
          format: int64
          description: เลขที่ผู้ติดต่อ Id ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
        contactName:
          type: string
          description: ชื่อ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
          example: บริษัท ผู้จำหน่าย จำกัด
        contactAddress:
          type: string
          description: ที่อยู่ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
          example: 'ที่อยู่ ผู้จำหน่าย'
        contactTaxId:
          type: string
          description: 'เลขประจำตัวผู้เสียภาษี ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า <br> (ถ้ามีจำเป็นต้องครบ 13 หลัก) <br> <ex>Example: 1234567890123 </ex>'
          example: '1234567890123'
        contactBranch:
          type: string
          description: สำนักงาน/สาขา
          example: 'สำนักงาน/สาขา'
        contactPerson:
          type: string
          description: ชื่อผู้ติดต่อ
          example: 'ผู้จำหน่าย'
        contactEmail:
          type: string
          description: 'อีเมลผู้ติดต่อ <br> <ex>Example: supplier@email.com</ex>'
          example: supplier@email.com
        contactNumber:
          type: string
          description: 'เบอร์มือถือผู้ติดต่อ <br> <ex>Example: 099-999-9999</ex>'
          example: 099-999-9999
        contactZipCode:
          type: string
          description: รหัสไปรษณีย์ติดต่อ
          example: '12345'
        contactGroup:
          type: integer
          default: 1
          description: ประผู้ติดต่อ <br> 1 = บุคคลธรรมดา <br> 3 = นิติบุคคล
        publishedOn:
          type: string
          format: date
          description: 'วันที่เอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
          example: '2021-01-01'
          default: currentDate
        creditType:
          type: integer
        creditDays:
          type: integer
        dueDate:
          type: string
          format: date
        salesName:
          type: string
          description: 'ชื่อผู้สร้างเอกสาร หรือ ชื่อพนักงานขาย <br> <ex>Example: sale@email.com or Mr.Sale Shop</ex>'
          example: พนักงาน ขายหน้าร้าน
        projectName:
          type: string
          description: ชื่อโปรเจค <br> Project name (ชื่อโปรเจค) will be displayed as Project Details in the document
          example: 'project A'
        reference:
          type: string
          description: 'เลขที่อ้างอิง หรือ เลขที่เอกสารที่เกี่ยวข้อง
            <br> Reference is an information to be declared in the document, not the system document reference
            <br> <ex>Example: INV2020010001</ex>'
          example: INV2020010001
        isVatInclusive:
          type: boolean
          description: 'Activate function of inclusive Vat for pricePerUnit
            <li> Input **true** when pricePerUnit in items is included Vat
            <li> Input **false** when pricePerUnit in items is not included Vat (excluded Vat)'
          default: false
        isManualVat:
          type: boolean
          default: false
          description: 'Activate function of manual VAT customization
            <li> Input **true** when vatRate of document is not 7%
            <li> Input **false** when vatRate of document is 7%'
          example: false
        expenseCategoryView:
          type: integer
          description: 'แสดงหมวดหมู่ค่าใช้จ่าย: <br> 1 = แสดงหมวดหมู่มุมมองนักบัญชี <br> 3 = แสดงหมวดหมู่มุมมองนักธุรกิจ'
          default: 3
        subTotal:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** <br>
            มูลค่ารวมเป็นเงิน <br> The value should be the sum of pricePerUnit'
          default: 0
          example: 100.01
        discountPercentage:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 4 digits** <br>
            มูลค่าส่วนลดเป็นเปอร์เซ็นต์'
          default: 0
          example: 100.0001
        discountAmount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** <br>
            มูลค่าส่วนลดเป็นจำนวน (บาท)'
          default: 0
          example: 100.01
        totalAfterDiscount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** <br>
            มูลค่าหลังหักส่วนลด <br> The value should be the result of subTotal deducted by discountAmount'
          default: 0
          example: 10.51
        isVat:
          type: boolean
          description: 'Activate function of document Vat calculation
            <li> Input **true**  when Vat is calculated, isVatInclusive could be input as both true or false
            <li> Input **false** when Vat is not calculated, isVatInclusive must be input as false only'
          default: false
        vatAmount:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits**
            <br> The value should not exceed than totalAfterDiscount
            <br> If isVat is false, vatAmount must be input as 0 only'
          default: 0.00
          example: 10.51
        grandTotal:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** <br>
            จำนวนเงินรวมทั้งสิ้น (รวมภาษีมูลค่าเพิ่ม 7% แล้ว)
            <br> The value should be the result of totalAfterDiscount deducted by VatAmount'
          default: 0
          example: 321.01
        remarks:
          type: string
          description: หมายเหตุเอกสาร
          example: 'remarks'
        internalNotes:
          type: string
          description: โน๊ตภายในบริษัท
          example: 'note'
        showSignatureOrStamp:
          type: boolean
          description: ลายเซ็นอิเล็กทรอนิกส์และตรายาง
          default: true
        externalDocumentId:
          type: string
          description: 'รหัสเอกสารอ้างอิงจากระบบภายนอก
            <br> <ex>Example: platform-123456</ex>'
          example: 'platform-123456'
      required:
        - contactName
        - isVatInclusive
        - totalAfterDiscount
        - isVat
        - grandTotal
        - subTotal
    ExpenseSimpleDocument:
      allOf:
        - $ref: '#/components/schemas/ExpenseDocument'
        - $ref: '#/components/schemas/DateFields'
        - type: object
          properties:
            expenseStructureType:
              type: string
              description: The value should input as “ExpenseSimpleDocument”
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Simple Expense
              items:
                $ref: '#/components/schemas/ExpenseSimpleProductItem'
          required:
            - items
    ExpenseSimpleDocumentWithPayment:
      allOf:
        - $ref: '#/components/schemas/ExpenseDocument'
        - $ref: '#/components/schemas/DateWithPaymentFields'
        - type: object
          properties:
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Simple Expense
              items:
                $ref: '#/components/schemas/ExpenseSimpleProductItem'
            expensePaymentStructureType:
              type: string
              nullable: true
          required:
            - items
    ExpenseSimpleDocumentWithPaymentPaid:
      oneOf:
        - $ref: '#/components/schemas/ExpenseSimpleDocumentWithPaymentPaidCash'
        - $ref: '#/components/schemas/ExpenseSimpleDocumentWithPaymentPaidCheque'
        - $ref: '#/components/schemas/ExpenseSimpleDocumentWithPaymentPaidTransfer'
        - $ref: '#/components/schemas/ExpenseSimpleDocumentWithPaymentPaidCreditCard'
        - $ref: '#/components/schemas/ExpenseSimpleDocumentWithPaymentPettyCash'
        - $ref: '#/components/schemas/ExpenseSimpleDocumentWithPaymentPaidOtherChannel'
    ExpenseSimpleDocumentWithPaymentPaidCash:
      title: ExpenseSimpleDocumentWithPaymentPaidCash
      allOf:
        - $ref: '#/components/schemas/ExpenseSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - type: object
          properties:
            expensePaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยเงินสด
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 1 = เงินสด
              example: 1
    ExpenseSimpleDocumentWithPaymentPaidCheque:
      title: ExpenseSimpleDocumentWithPaymentPaidCheque
      allOf:
        - $ref: '#/components/schemas/ExpenseSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingCheque'
        - type: object
          properties:
            expensePaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยเช็ค
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 3 = บัญชีเช็คจ่าย
                <br> Required user to setup cheque banking channel before using Cheque Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Cheque
              example: 3
            chequeBankAccountId:
              type: integer
              format: int64
              description: ธนาคารที่ระบุหน้าเช็ค <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)
                <br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
                <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank) <br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
                <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank) <br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
                <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya) <br> 10 = ธนาคารออมสิน - (Government Savings Bank)
                <br> 11 = ธนาคารธนชาต - (Thanachart Bank) <br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
                <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank) <br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)
                <br> 19 = ธนาคารทิสโก้ - (Tisco Bank) 
                <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
                <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
                <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank
                <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
                <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
                <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
                <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
                <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
                <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
                <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
                <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) 
                <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
                <br> The value should be related with the bank name of bankAccountId<br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
              example: 1
            bankAccountId:
              type: integer
              format: int64
              description: 'เลข id บัญชีธนาคารที่ใช้ชำระเงิน <br>
                <red>สามารถ GET มาได้จาก My Company > Bank Account </red><br> <ex>Example: 12345</ex>'
              default: 0
              example: '12345'
            bankChequeId:
              type: integer
              format: int64
              description: 'id of cheque <br> The value is able to GET by go to sectionMyCompany > Bank Channel > Get list all Bank Cheque
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/get/bank-channel/cheque" target="_blank">(link)</a> ,
                <br> the field name is `bankChequeId`
                <br> <ex>Example: 1234</ex>'
              default: 0
              example: '1234'
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยเช็ค <br> <ex> Example : 100.0000 </ex>'
              default: 0
          required:
            - bankAccountId
            - bankChequeId
    ExpenseSimpleDocumentWithPaymentPaidTransfer:
      title: ExpenseSimpleDocumentWithPaymentPaidTransfer
      allOf:
        - $ref: '#/components/schemas/ExpenseSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingTransfer'
        - type: object
          properties:
            expensePaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยการโอนเงิน
            paymentMethod:
              type: integer
              description: 'ประเภทการชำระเงิน <br> 5 = โอนเงิน
                <br> Required user to setup bank account before using Transfer Payment Method.
                <br> To setup banking channel, go to section MyCompany > Bank Channel > Create Bank Account
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/post/bank-channel/bank-accounts" target="_blank">(link)</a>
                <br> or in FlowAccount website, go to MyCompany > Banking Channel > Add Account > Bank Account'
              example: 5
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยการโอนเงิน <ex> Example : 100.0000 </ex>'
              default: 0
          required:
          - bankAccountId
    ExpenseSimpleDocumentWithPaymentPaidCreditCard:
      title: ExpenseSimpleDocumentWithPaymentPaidCreditCard
      allOf:
        - $ref: '#/components/schemas/ExpenseSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodPaidCreditCard'
        - type: object
          properties:
            expensePaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยบัตรเครดิต
    ExpenseSimpleDocumentWithPaymentPettyCash:
      title: ExpenseSimpleDocumentWithPaymentPettyCash
      allOf:
        - $ref: '#/components/schemas/ExpenseSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodPaidPettyCash'
        - type: object
          properties:
            expensePaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยเงินสดย่อย
    ExpenseSimpleDocumentWithPaymentPaidOtherChannel:
      title: ExpenseSimpleDocumentWithPaymentPaidOtherChannel
      allOf:
        - $ref: '#/components/schemas/ExpenseSimpleDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingOtherChannel'
        - type: object
          properties:
            expensePaymentStructureType:
              description: สร้างเอกสารแบบ Simple พร้อมชำระเงิน ด้วยช่องทางอื่น ๆ
            paymentMethod:
              type: integer
              description: ชำระเงิน ช่องทางอื่น ๆ ได้แก่ เครื่องบันทึกเงินสด (POS), เครื่องรูดบัตรเครดิต (EDC),
                ช่องทางรับชำระออนไลน์ (Payment Gateway), ร้านค้าออนไลน์ (Online shop/E-Commerce)
                <br> Required user to setup other channels before using OtherChannel Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Other Channels > Select Payment Channel as EDC,
                POS, Online Payment Gateway or Online shop/E-Commerce
              example: 13
    ExpenseInlineDocument:
      allOf:
        - $ref: '#/components/schemas/ExpenseDocument'
        - $ref: '#/components/schemas/DateFields'
        - $ref: '#/components/schemas/InlineDocumentFields'
        - type: object
          properties:
            expenseStructureType:
              type: string
              description: The value should input as “ExpenseInlineDocument”
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Inline Expense
              items:
                $ref: '#/components/schemas/ExpenseInlineProductItem'
          required:
            - publishedOn
            - items
    ExpenseInlineDocumentWithPayment:
      allOf:
        - $ref: '#/components/schemas/ExpenseDocument'
        - $ref: '#/components/schemas/DateWithPaymentFields'
        - $ref: '#/components/schemas/InlineDocumentFields'
        - type: object
          properties:
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Inline Expense
              items:
                $ref: '#/components/schemas/ExpenseInlineProductItem'
            expensePaymentStructureType:
              type: string
              nullable: true
          required:
            - items
            - publishedOn
            - dueDate
    ExpenseInlineDocumentWithPaymentPaid:
      oneOf:
        - $ref: '#/components/schemas/ExpenseInlineDocumentWithPaymentPaidCash'
        - $ref: '#/components/schemas/ExpenseInlineDocumentWithPaymentPaidCheque'
        - $ref: '#/components/schemas/ExpenseInlineDocumentWithPaymentPaidTransfer'
        - $ref: '#/components/schemas/ExpenseInlineDocumentWithPaymentPaidCreditCard'
        - $ref: '#/components/schemas/ExpenseInlineDocumentWithPaymentPaidPettyCash'
        - $ref: '#/components/schemas/ExpenseInlineDocumentWithPaymentPaidOtherChannel'
    ExpenseInlineDocumentWithPaymentPaidCash:
      title: ExpenseInlineDocumentWithPaymentPaidCash
      allOf:
        - $ref: '#/components/schemas/ExpenseInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - type: object
          properties:
            expensePaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมชำระเงิน ด้วยเงินสด
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 1 = เงินสด
              example: 1
    ExpenseInlineDocumentWithPaymentPaidCheque:
      title: ExpenseInlineDocumentWithPaymentPaidCheque
      allOf:
        - $ref: '#/components/schemas/ExpenseInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingCheque'
        - type: object
          properties:
            expensePaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมชำระเงิน ด้วยเช็ค
            paymentMethod:
              type: integer
              description: ประเภทการชำระเงิน <br> 3 = บัญชีเช็คจ่าย
                <br> Required user to setup cheque banking channel before using Cheque Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Cheque
              example: 3
            chequeBankAccountId:
              type: integer
              format: int64
              description: ธนาคารที่ระบุหน้าเช็ค <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)
                <br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)
                <br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank) <br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)
                <br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank) <br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)
                <br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya) <br> 10 = ธนาคารออมสิน - (Government Savings Bank)
                <br> 11 = ธนาคารธนชาต - (Thanachart Bank) <br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)
                <br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank) <br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)
                <br> 19 = ธนาคารทิสโก้ - (Tisco Bank) 
                <br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives)
                <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand)
                <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank
                <br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)
                <br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)
                <br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)
                <br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)
                <br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)
                <br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)
                <br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)
                <br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) 
                <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
                <br> The value should be related with the bank name of bankAccountId<br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
              example: 1
            bankAccountId:
              type: integer
              format: int64
              description: 'เลข id บัญชีธนาคารที่ใช้ชำระเงิน <br>
                <red>สามารถ GET มาได้จาก My Company > Bank Account </red><br> <ex>Example: 12345</ex>'
              default: 0
              example: '12345'
            bankChequeId:
              type: integer
              format: int64
              description: 'id of cheque <br> The value is able to GET by go to sectionMyCompany > Bank Channel > Get list all Bank Cheque
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/get/bank-channel/cheque" target="_blank">(link)</a> ,
                <br> the field name is `bankChequeId`
                <br> <ex>Example: 1234</ex>'
              default: 0
              example: '1234'
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยเช็ค <br> <ex> Example : 100.0000 </ex>'
              default: 0
          required:
            - bankAccountId
            - bankChequeId
    ExpenseInlineDocumentWithPaymentPaidTransfer:
      title: ExpenseInlineDocumentWithPaymentPaidTransfer
      allOf:
        - $ref: '#/components/schemas/ExpenseInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingTransfer'
        - type: object
          properties:
            expensePaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมชำระเงิน ด้วยการโอนเงิน
            paymentMethod:
              type: integer
              description: 'ประเภทการชำระเงิน <br> 5 = โอนเงิน
                <br> Required user to setup bank account before using Transfer Payment Method.
                <br> To setup banking channel, go to section MyCompany > Bank Channel > Create Bank Account
                <a href="https://developers.flowaccount.com/api-reference/#tag/bank-channel/post/bank-channel/bank-accounts" target="_blank">(link)</a>
                <br> or in FlowAccount website, go to MyCompany > Banking Channel > Add Account > Bank Account'
              example: 5
            paymentCharge:
              type: number
              format: decimal
              description: '**Limit decimal places to no more than 4 digits**
                <br> ค่าธรรมเนียม ที่ชำระโดยการโอนเงิน <ex> Example : 100.0000 </ex>'
              default: 0
          required:
            - bankAccountId
    ExpenseInlineDocumentWithPaymentPaidCreditCard:
      title: ExpenseInlineDocumentWithPaymentPaidCreditCard
      allOf:
        - $ref: '#/components/schemas/ExpenseInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodPaidCreditCard'
        - type: object
          properties:
            expensePaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมชำระเงิน ด้วยบัตรเครดิต
    ExpenseInlineDocumentWithPaymentPaidPettyCash:
      title: ExpenseInlineDocumentWithPaymentPaidPettyCash
      allOf:
        - $ref: '#/components/schemas/ExpenseInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodPaidPettyCash'
        - type: object
          properties:
            expensePaymentStructureType:
              type: string
              nullable: true
              description: สร้างเอกสารแบบ Inline พร้อมชำระเงิน ด้วยเงินสดย่อย
    ExpenseInlineDocumentWithPaymentPaidOtherChannel:
      title: ExpenseInlineDocumentWithPaymentPaidOtherChannel
      allOf:
        - $ref: '#/components/schemas/ExpenseInlineDocumentWithPayment'
        - $ref: '#/components/schemas/PaymentReceivingInBuyDocument'
        - $ref: '#/components/schemas/PaymentMethodReceivingOtherChannel'
        - type: object
          properties:
            expensePaymentStructureType:
              description: สร้างเอกสารแบบ Inline พร้อมชำระเงิน ด้วยช่องทางอื่น ๆ
            paymentMethod:
              type: integer
              description: ชำระเงิน ช่องทางอื่น ๆ ได้แก่ เครื่องบันทึกเงินสด (POS), เครื่องรูดบัตรเครดิต (EDC),
                ช่องทางรับชำระออนไลน์ (Payment Gateway), ร้านค้าออนไลน์ (Online shop/E-Commerce)
                <br> Required user to setup other channels before using OtherChannel Payment Method in FlowAccount website,
                <br> go to MyCompany > Banking Channel > Add Account > Other Channels > Select Payment Channel as EDC,
                POS, Online Payment Gateway or Online shop/E-Commerce
              example: 13
    UpdateExpenseDocument:
      allOf:
        - $ref: '#/components/schemas/CompanyV1Document'
        - $ref: '#/components/schemas/ExpenseDocument'
        - $ref: '#/components/schemas/DateFields'
        - type: object
          properties:
            expenseStructureType:
              type: string
              nullable: true
              example: UpdateExpenseSimpleDocument
          required:
            - companyName
            - companyAddress
            - companyBranch
            - publishedOn
            - subTotal
    UpdateAllExpenseDocument:
      oneOf:
        - $ref: '#/components/schemas/UpdateExpenseSimpleDocument'
        - $ref: '#/components/schemas/UpdateExpenseInlineDocument'
    UpdateExpenseSimpleDocument:
      title: UpdateExpenseSimpleDocument
      allOf:
        - $ref: '#/components/schemas/UpdateExpenseDocument'
        - type: object
          properties:
            expenseStructureType:
              description: Input "UpdateExpenseSimpleDocument"
              required: true
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Simple Expense
              items:
                $ref: '#/components/schemas/ExpenseSimpleProductItem'
          required:
            - items
    UpdateExpenseInlineDocument:
      title: UpdateExpenseInlineDocument
      allOf:
        - $ref: '#/components/schemas/UpdateExpenseDocument'
        - $ref: '#/components/schemas/DateFields'
        - $ref: '#/components/schemas/InlineDocumentFields'
        - type: object
          properties:
            expenseStructureType:
              description: Input "UpdateExpenseInlineDocument"
              required: true
            items:
              type: array
              description: รายการสินค้าใช้งานสำหรับเอกสาร Inline Expense
              items:
                $ref: '#/components/schemas/ExpenseInlineProductItem'
          required:
            - items
    ExpenseResponse:
      allOf:
        - $ref: '#/components/schemas/DataResponse'
        - type: object
          properties:
            contactCode:
              type: string
              description: รหัส ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
              example: '001'
            contactId:
              type: integer
              format: int64
              description: เลขที่ผู้ติดต่อ Id ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
            contactName:
              type: string
              description: ชื่อ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
              example: บริษัท ผู้จำหน่าย จำกัด
            contactAddress:
              type: string
              description: ที่อยู่ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
              example: 'ที่อยู่ ผู้จำหน่าย'
            contactEmail:
              example: supplier@email.com
    ExpenseProductItemResponse:
      type: object
      properties:
        systemCode:
          type: integer
          description: เลขที่ system code หมวดหมู่ค่าใช้จ่าย (เลือกใช้ หมวดหมู่ค่าใช้จ่ายสำหรับธุรกิจ)
          example: '1001'
        categoryId:
          type: integer
          description: 'เลขที่ id หมวดหมู่ค่าใช้จ่าย (เลือกใช้ หมวดหมู่ค่าใช้จ่ายสำหรับธุรกิจ) <br> <ex>Example: 40238</ex>'
          example: '40238'
        description:
          type: string
          description: รายละเอียดค่าใช้จ่าย
        nameLocal:
          type: string
          description: 'ชื่อหมวดหมู่ค่าใช้จ่าย <br> <ex>Example: การตลาดและโฆษณา</ex>'
          example: การตลาดและโฆษณา
        nameForeign:
          type: string
          description: 'ชื่อหมวดหมู่ค่าใช้จ่าย (ภาษาอังกฤษ) <br> <ex>Example: Marketing & Advertising</ex>'
          example: Marketing & Advertising
        creditId:
          type: integer
          description: 'เลข id หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิิต <br> <ex>Example: 1081994</ex>'
          example: '1081994'
        creditCategory:
          type: integer
          description: 'เลขหมวดหมู่ ฝั่งเครดิต ของ หมวดหมู่ค่าใช้จ่าย <br> <ex>Example: 2</ex>'
          example: '2'
        creditCode:
          type: string
          description: 'เลขที่หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิต <br> <ex>Example: 21399</ex>'
          example: '21399'
        creditNameLocal:
          type: string
          description: 'ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิต <br> <ex>Example: 21399 / เจ้าหนี้อื่นๆ</ex>'
          example: 21399 / เจ้าหนี้อื่นๆ
        creditNameForeign:
          type: string
          description: 'ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิต (ภาษาอังกฤษ) <br> <ex>Example: 21399 / Other Payables</ex>'
          example: 21399 / Other Payables
        debitId:
          type: integer
          description: 'เลข id หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต <br> <ex>Example: 1082099</ex>'
          example: '1082099'
        debitCategory:
          type: integer
          description: เลขหมวดหมู่ ฝั่งเดบิต ของ หมวดหมู่ค่าใช้จ่าย
          example: '5'
        debitCode:
          type: string
          description: 'เลขที่หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต <br> <ex>Example: 53029</ex>'
          example: '53029'
        debitNameLocal:
          type: string
          description: 'ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต <br> <ex>Example: 53029 / ค่าใช้จ่ายด้านโฆษณาและการตลาดอื่นๆ</ex>'
          example: 53029 / ค่าใช้จ่ายด้านโฆษณาและการตลาดอื่นๆ
        debitNameForeign:
          type: string
          description: 'ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต (ภาษาอังกฤษ) <br> <ex>Example: 53029 / Other advertising and marketing expenses</ex>'
          example: 53029 / Other advertising and marketing expenses
        quantity:
          type: string
          description: (to be changed to number <decimal>) <br> จำนวนรายการค่าใช้จ่าย
          example: '1'
        unitName:
          type: string
          maxLength: 7
          description: หน่วยรายการค่าใช้จ่าย
          example: 'บริการ'
        pricePerUnit:
          type: string
          description: (to be changed to number <decimal>) <br> ราคาต่อหน่วยค่าใช้จ่าย
          example: '100'
        total:
          type: string
          description: (to be changed to number <decimal>) <br> ราคารวมค่าใช้จ่าย
          example: '100'
        vatRate:
          type: string
          description: (to be changed to integer) <br> รูปแบบภาษี <br> 7 = ภาษี 7% <br> 0 = ภาษี 0% <br> -1 = ยกเว้นภาษี
            <br> (For ExpenseSimpleDocument, always 7)
          default: '0'
        discountAmount:
          type: string
          description: (to be changed to number <decimal>) <br> จำนวนส่วนลดรายการค่าใช้จ่าย <br> (For ExpenseSimpleDocument, always 0)
          default: '0'
    ExpenseDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/APIResponse'
        - type: object
          properties:
            data:
              allOf:
                - $ref: '#/components/schemas/ExpenseResponse'
                - type: object
                  properties:
                    discountType:
                      type: string
                      description: (to be changed to integer) <br> รูปแบบส่วนลดในเอกสาร กรณีใช้รูปแบบ Inline ส่วนลด หรือ ภาษี แยกตามรายการสินค้า
                        <br> สามารถเลือกรูปแบบส่วนลดได้ <br> 1 =  เปอร์เซ็นต์ <br> 3 = จำนวน (บาท)
                        <br> (For SimpleDocument, always 1)
                      example: '1'
                    useInlineDiscount:
                      type: string
                      description: '(to be changed to boolean) <br> inline discount ใช้งานส่วนลด แยกตามรายการสินค้า
                        <br> (SimpleDocument : always false <br> InlineDocument : always true)'
                      example: 'false'
                    useInlineVat:
                      type: string
                      description: '(to be changed to boolean) <br> inline vat ใช้งานส่วนลดและภาษี แยกตามรายการสินค้า
                        <br> (SimpleDocument : always false)'
                      example: 'false'
                    exemptAmount:
                      type: string
                      description: (to be changed to number <decimal>) <br> ยอดขายที่ยกเว้นภาษีมูลค่าเพิ่ม <br> (For SimpleDocument, always 0)
                      example: '0'
                    items:
                      type: array
                      description: รายการสินค้าสำหรับเอกสาร Expense
                      items:
                        $ref: '#/components/schemas/ExpenseProductItemResponse'
    ExpenseSimpleDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/APIResponse'
        - type: object
          properties:
            data:
              allOf:
                - $ref: '#/components/schemas/ExpenseResponse'
                - type: object
                  properties:
                    discountType:
                      type: string
                      description: (to be changed to integer) <br> รูปแบบส่วนลดในเอกสาร กรณีใช้รูปแบบ Inline ส่วนลด หรือ ภาษี แยกตามรายการสินค้า
                        <br> สามารถเลือกรูปแบบส่วนลดได้ <br> 1 =  เปอร์เซ็นต์ <br> 3 = จำนวน (บาท)
                        <br> (For SimpleDocument, always 1)
                      example: '1'
                    useInlineDiscount:
                      type: string
                      description: (to be changed to boolean) <br> inline discount ใช้งานส่วนลด แยกตามรายการสินค้า
                        <br> (For SimpleDocument, always false)
                      example: 'false'
                    useInlineVat:
                      type: string
                      description: (to be changed to boolean) <br> inline vat ใช้งานส่วนลดและภาษี แยกตามรายการสินค้า
                        <br> (For SimpleDocument, always false)
                      example: 'false'
                    exemptAmount:
                      type: string
                      description: (to be changed to number <decimal>) <br> ยอดขายที่ยกเว้นภาษีมูลค่าเพิ่ม <br> (For SimpleDocument, always 0)
                      example: '0'
                    items:
                      type: array
                      description: รายการสินค้าใช้งานสำหรับเอกสาร Simple Expense
                      items:
                        $ref: '#/components/schemas/ExpenseProductItemResponse'
    ExpenseInlineDocumentResponse:
      allOf:
        - $ref: '#/components/schemas/APIResponse'
        - type: object
          properties:
            data:
              allOf:
                - $ref: '#/components/schemas/ExpenseResponse'
                - type: object
                  properties:
                    discountType:
                      type: string
                      description: (to be changed to integer) <br> รูปแบบส่วนลดในเอกสาร กรณีใช้รูปแบบ Inline ส่วนลด หรือ ภาษี แยกตามรายการสินค้า
                        <br> สามารถเลือกรูปแบบส่วนลดได้ <br> 1 =  เปอร์เซ็นต์ <br> 3 = จำนวน (บาท)
                      example: '1'
                    useInlineDiscount:
                      type: string
                      description: (to be changed to boolean) <br> inline discount ใช้งานส่วนลด แยกตามรายการสินค้า
                      example: 'true'
                    useInlineVat:
                      type: string
                      description: (to be changed to boolean) <br> inline vat ใช้งานส่วนลดและภาษี แยกตามรายการสินค้า
                      example: 'false'
                    exemptAmount:
                      type: string
                      description: (to be changed to number <decimal>) <br> ยอดขายที่ยกเว้นภาษีมูลค่าเพิ่ม
                      example: '0'
                    items:
                      type: array
                      description: รายการสินค้าใช้งานสำหรับเอกสาร Inline Expense
                      items:
                        $ref: '#/components/schemas/ExpenseProductItemResponse'
    ExpenseSimpleDocumentWithPaymentResponse:
      allOf:
        - $ref: '#/components/schemas/ExpenseSimpleDocumentResponse'
        - type: object
          properties:
            data:
              properties:
                creditType:
                  example: '3'
                creditDays:
                  example: '0'
                dueDate:
                  example: '2021-01-01'
                payments:
                  properties:
                    paymentDate:
                      example: '2021-01-01'
                    collected:
                      example: '100.00'
                    paymentMethod:
                      example: '1'
                    paymentChannel:
                      example: 'เงินสด'
                    paymentRemarks:
                      example: DocumentWithPayment
    ExpenseInlineDocumentWithPaymentResponse:
      allOf:
        - $ref: '#/components/schemas/ExpenseInlineDocumentResponse'
        - type: object
          properties:
            data:
              properties:
                creditType:
                  example: '3'
                creditDays:
                  example: '0'
                dueDate:
                  example: '2021-01-01'
                payments:
                  properties:
                    paymentDate:
                      example: '2021-01-01'
                    collected:
                      example: '100.00'
                    paymentMethod:
                      example: '1'
                    paymentChannel:
                      example: 'เงินสด'
                    paymentRemarks:
                      example: DocumentWithPayment
    AllExpenseDocumentResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: object
          properties:
            list:
              type: array
              description: ข้อมูลรายการสินค้า
              items:
                type: object
                properties:
                  recordId:
                    type: integer
                    format: int64
                    description: id ของเอกสาร
                    default: 0
                  documentId:
                    type: integer
                    format: int64
                    description: id ของเอกสาร
                    default: 0
                  documentSerial:
                    type: string
                    description: เลขที่เอกสาร
                  contactCode:
                    type: string
                    description: รหัส ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
                  contactId:
                    type: integer
                    format: int64
                    description: เลขที่ผู้ติดต่อ Id ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
                  contactName:
                    type: string
                    description: ชื่อ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
                  contactAddress:
                    type: string
                    description: ที่อยู่ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
                  contactTaxId:
                    type: string
                    description: 'เลขประจำตัวผู้เสียภาษี ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า <br> (ถ้ามีจำเป็นต้องครบ 13 หลัก) <br> <ex>Example: 1234567890123 </ex>'
                    example: '1234567890123'
                  contactBranch:
                    type: string
                    description: สำนักงาน/สาขา
                  contactPerson:
                    type: string
                    description: ชื่อผู้ติดต่อ
                  contactEmail:
                    type: string
                    description: 'อีเมลผู้ติดต่อ <br> <ex>Example: supplier@email.com</ex>'
                    example: supplier@email.com
                  contactNumber:
                    type: string
                    description: 'เบอร์มือถือผู้ติดต่อ <br> <ex>Example: 099-999-9999</ex>'
                    example: 099-999-9999
                  contactZipCode:
                    type: string
                    description: รหัสไปรษณีย์ติดต่อ
                  contactGroup:
                    type: integer
                    default: 1
                    description: ประผู้ติดต่อ <br> 1 = บุคคลธรรมดา <br> 3 = นิติบุคคล
                  publishedOn:
                    type: string
                    format: date
                    description: 'วันที่เอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
                    example: '2021-01-01'
                  creditType:
                    type: integer
                    description: รูปแบบเครดิต <br> 1 = เครดิต (วัน) <br> 3 = เงินสด  <br> 5 = เครดิต (ไม่แสดงวันที่ครบกำหนด)
                    default: 1
                  creditDays:
                    type: integer
                    description: 'จำนวนวันที่ให้เครดิต <br> <ex>Example: 30</ex>'
                    default: 0
                    example: 30
                  dueDate:
                    type: string
                    format: date
                    description: 'วันครบกำหนดเอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
                    example: '2021-01-01'
                  salesName:
                    type: string
                    description: 'ชื่อผู้สร้างเอกสาร หรือ ชื่อพนักงานขาย <br> <ex>Example: sale@email.com or Mr.Sale Shop</ex>'
                    default: อีเมล หรือ ชื่อผู้สร้างเอกสาร
                    example: พนักงาน ขายหน้าร้าน
                  projectName:
                    type: string
                    description: ชื่อโปรเจค
                  reference:
                    type: string
                    description: 'เลขที่อ้างอิง หรือ เลขที่เอกสารที่เกี่ยวข้อง <br> <ex>Example: INV2020010001</ex>'
                    example: INV2020010001
                  isVatInclusive:
                    type: boolean
                    description: มูลค่าเอกสารรวมภาษีแล้วหรือไม่
                    default: false
                  expenseCategoryView:
                    type: integer
                    description: 'แสดงหมวดหมู่ค่าใช้จ่าย: <br> 1 = แสดงหมวดหมู่มุมมองนักบัญชี <br> 3 = แสดงหมวดหมู่มุมมองนักธุรกิจ'
                    default: 3
                  items:
                    type: array
                    description: รายการสินค้าใช้งานสำหรับเอกสาร Inline Expense
                    items:
                      $ref: '#/components/schemas/ExpenseInlineProductItem'
                  subTotal:
                    type: number
                    format: decimal
                    description: มูลค่ารวมเป็นเงิน
                    default: 0
                  discountPercentage:
                    type: integer
                    description: มูลค่าส่วนลดเป็นเปอร์เซ็นต์
                    default: 0
                  discountAmount:
                    type: number
                    format: decimal
                    description: มูลค่าส่วนลดเป็นจำนวน (บาท)
                    default: 0
                  totalAfterDiscount:
                    type: number
                    format: decimal
                    description: มูลค่าหลังหักส่วนลด
                  isVat:
                    type: boolean
                    description: มูลค่าหลังหักส่วนลด มีีภาษีมูลค่าเพิ่ม 7%
                    default: false
                  isManualVat:
                    type: boolean
                    description: (to be changed to boolean) <br> กำหนดค่าภาษีมูลค่าเพิ่มเอง
                    default: false
                  vatAmount:
                    type: number
                    format: decimal
                    description: ภาษีมูลค่าเพิ่ม
                  grandTotal:
                    type: number
                    format: decimal
                    description: จำนวนเงินรวมทั้งสิ้น (รวมภาษีมูลค่าเพิ่ม 7% แล้ว)
                  remarks:
                    type: string
                    description: หมายเหตุเอกสาร
                  internalNotes:
                    type: string
                    description: โน๊ตภายในบริษัท
                  showSignatureOrStamp:
                    type: boolean
                    description: ลายเซ็นอิเล็กทรอนิกส์และตรายาง
                    default: true
                  discountType:
                    type: integer
                    description: รูปแบบส่วนลดในเอกสาร กรณีใช้รูปแบบ Inline ส่วนลด หรือ ภาษี แยกตามรายการสินค้า <br> สามารถเลือกรูปแบบส่วนลดได้ <br> 1 =  เปอร์เซ็นต์ <br> 3 = จำนวน (บาท)
                    default: 1
                  useInlineDiscount:
                    type: boolean
                    description: inline discount ใช้งานส่วนลด แยกตามรายการสินค้า
                    default: true
                  useInlineVat:
                    type: boolean
                    description: inline vat ใช้งานส่วนลดและภาษี แยกตามรายการสินค้า
                  exemptAmount:
                    type: number
                    nullable: true
                    format: decimal
                    description: ยอดขายที่ยกเว้นภาษีมูลค่าเพิ่ม
                    default: 0
                  vatableAmount:
                    type: number
                    nullable: true
                    format: decimal
                    description: ยอดขายที่คิดภาษีมูลค่าเพิ่ม
                    default: 0
                  payments:
                    type: object
                    description: 'ข้อมูลการเก็บเงินและจ่ายเงินของเอกสาร <br> ข้อมูลการเก็บเงิน: <br>1. ใบกำกับภาษี/ใบเสร็จรับเงิน (Tax Invoice) <br> 2. ใบเสร็จรับเงิน (Receipt) <br> 3. ใบกำกับภาษี/ใบเสร็จรับเงิน (Cash Invoice) <br> ข้อมูลการจ่ายเงิน: <br>1. เอกสารใบรับสินค้า (Receiving Inventory)'
                    properties:
                      paymentDate:
                        type: string
                        format: date
                        description: 'วันที่รับชำระเงิน รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
                        example: '2021-01-01'
                      collected:
                        type: number
                        format: decimal
                        description: จำนวนเงินยอดรับสุทธิ
                        default: 0
                      paymentDeductionType:
                        type: integer
                        format: int64
                        description: 'ประเภทรายการปรับลด: <br> 1 = ส่วนลดพิเศษ <br> 3 = ค่านายหน้าและส่วนแบ่งการขาย <br> 5 = ค่าดำเนินการ <br> 7 = ปัดเศษ <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)'
                        default: 0
                      paymentDeductionAmount:
                        type: number
                        format: decimal
                        description: จำนวนเงินยอดรายการปรับลด <br> (เฉพาะเอกสารใบกำกับภาษี/ใบเสร็จรับเงิน)
                        default: 0
                      withheldPercentage:
                        type: number
                        format: decimal
                        description: เปอร์เซ็น หัก ณ ที่จ่าย
                        default: 0
                      withheldAmount:
                        type: number
                        format: decimal
                        description: จำนวน ยอดหัก ณ ที่จ่าย
                        default: 0
                      paymentCharge:
                        type: number
                        format: decimal
                        description: ค่าธรรมเนียม ที่ชำระโดยการโอนเงิน หรือ เช็ค <br> (เฉพาะเอกสารค่าใช้จ่าย)
                        default: 0
                      paymentMethod:
                        type: integer
                        description: 'วิธีการชำระ: <br> 1 = เงินสด <br> 3 = เช็ค <br> 5 = โอนเงิน <br> 7 = เครดิต'
                        default: 0
                      paymentChannel:
                        type: string
                        description: 'ช่องทางการชำระเงิน: <br> - เงินสด (Cash) <br> - โอนเงิน (Transfer) - ชื่อธนาคาร (Bank Name) <br> - เช็ค (Cheque) <br> - บัตรเครดิต (Credit card)'
                      bankAccountType:
                        type: integer
                        description: 'ประเภทบัญชีธนาคาร: <br> 1 = ออมทรัพย์ <br> 3 = กระแสรายวัน <br> 7 = ฝากประจำ'
                      bankAccountName:
                        type: string
                        description: ชื่อธนาคาร
                      bankAccountNumber:
                        type: string
                        description: เลขที่ธนาคาร / บัตรเคดิต
                      chequeDate:
                        type: string
                        format: date
                        description: 'วันที่หน้าเช็ค รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
                        example: '2021-01-01'
                      chequeNumber:
                        type: string
                        description: เลขที่เช็คธนาคาร
                      creditCardBankAccountId:
                        type: integer
                        format: int64
                        description: ธนาคารที่ชำระด้วยบัตรเครดิต <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)<br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)<br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank)<br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)<br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank)<br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)<br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya)<br> 10 = ธนาคารออมสิน - (Government Savings Bank)<br> 11 = ธนาคารธนชาต - (Thanachart Bank)<br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)<br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank)<br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)<br> 19 = ธนาคารทิสโก้ - (Tisco Bank)<br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives) <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand) <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank)<br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)<br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)<br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)<br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)<br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)<br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)<br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)<br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
                        default: 0
                      paymentRemarks:
                        type: string
                        description: หมายเหตุ การรับชำระเงิน หรือ ชำระเงิน
                      remainingCollectedType:
                        type: integer
                        format: int64
                        description: 'สาเหตุเงินขาดเงินเกิน: <br> 51 = เงินขาดหรือเงินกิน <br> 55 = ค่าธรรมเนียมธนาคาร '
                        default: 0
                      remainingCollected:
                        type: number
                        format: decimal
                        description: จำนวน ยอดเงินขาด หรือ เงินเกิน
                        default: 0
                      pettyCashId:
                        type: integer
                        format: int64
                        description: 'id บัญชีเงินสดย่อย <br> <ex> Example : 1234 </ex>'
                        default: 0
                      pettyCashName:
                        type: string
                        description: 'ชื่อบัญชีเงินสดย่อย <br> <ex> Example : บัญชีเงินสดย่อยสำหรับซื้ออุปกรณ์สำนักงาน </ex>'
                      bankChequeId:
                        type: integer
                        format: int64
                        description: 'id บัญชีเช็คจ่าย <br> <ex>Example: 1234</ex>'
                        default: 0
                      creditCardId:
                        type: integer
                        format: int64
                        description: เลข id บัตรเครดิตจ่าย
                      creditCardNumber:
                        type: string
                        description: 'เลขบัตรเครดิต 4 ตัวท้าย <br> <ex>Example: 1234</ex>'
                      otherChannelId:
                        type: integer
                        format: int64
                        description: 'id บัญชีช่องทางอื่น ๆ <ex> Example: 1234 </ex>'
                        default: 0
                      otherChannelPaymentChannel:
                        type: integer
                        format: int64
                        description: 'ประเภทช่องทางอื่น ๆ <br> 1 = เครื่องบันทึกเงินสด (POS) <br> 3 = ช่องทางรับชำระออนไลน์ (Payment Gateway) <br> 5 = เครื่องรูดบัตรเครดิต(EDC) <br> 7 = ร้านค้าออนไลน์ (Online shop/E-Commerce)<ex> Example: 1 </ex>'
                        default: 0
                      otherChannelName:
                        type: string
                        description: 'ชื่อเครื่อง/เลขซีเรียล/ชื่อผู้ให้บริการ/ชื่อ Market place <ex> Example: Wongnai POS </ex>'
                  company:
                    type: object
                    description: ข้อมูลบริษัทของคุณในเอกสาร
                    properties:
                      companyName:
                        type: string
                        description: ชื่อบริษัท
                      companyNameEn:
                        type: string
                        description: ชื่อบริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ)
                      companyAddress:
                        type: string
                        description: ที่อยู่บริษัท
                      companyAddressEn:
                        type: string
                        description: ที่อยู่บริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ)
                      companyTaxId:
                        type: string
                        description: 'เลขประจำตัวผู้เสียภาษี บริษัท <br><ex>Example: 0105558096348</ex>'
                      companyBranch:
                        type: string
                        description: 'ชื่อ และ รหัสสาขา <br><ex>Example: สำนักงานใหญ่ 00000</ex>'
                      companyBranchEn:
                        type: string
                        description: 'ชื่อ และ รหัสสาขา ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br><ex>Example: Head Office 00000</ex>'
                      companyPhone:
                        type: string
                        description: 'เบอร์โทรสำนักงาน <br><ex>Example: 02-999-9999</ex>'
                      companyMobile:
                        type: string
                        description: 'เบอร์โทรศัพท์มือถือ <br><ex>Example: 099-999-9999</ex>'
                      companyFax:
                        type: string
                        description: 'เบอร์โทรสาร <br><ex>Example: 02-999-9999 ต่อ 1</ex>'
                      companyWebsite:
                        type: string
                        description: 'เว็บไซต์ <br><ex>Example: www.flowaccount.com</ex>'
                  status:
                    type: integer
                    description: เลขสถานะเอกสารฉบับนี้
                  statusString:
                    type: integer
                    description: ชื่อสถานะเอกสารฉบับนี้
                  documentType:
                    type: integer
                    description: เลขประเภทเอกสารฉบับนี้
                  allowDelete:
                    type: boolean
                    description: สามารถลบเอกสาร :<br> true = ลบได้ <br> false = ลบไม่ได้
                  externalDocumentId:
                    type: string
                    description: รหัสเอกสารอ้างอิงจากระบบภายนอก
            totalDocument:
              type: string
              description: จำนวนเอกสาร
    ExpenseProductItem:
      type: object
      properties:
        systemCode:
          type: integer
          description: เลขที่ system code หมวดหมู่ค่าใช้จ่าย (เลือกใช้ หมวดหมู่ค่าใช้จ่ายสำหรับธุรกิจ)
          example: '1001'
        categoryId:
          type: integer
          description: 'เลขที่ id หมวดหมู่ค่าใช้จ่าย (เลือกใช้ หมวดหมู่ค่าใช้จ่ายสำหรับธุรกิจ) <br> <ex>Example: 40238</ex>'
          example: '40238'
        description:
          type: string
          description: รายละเอียดค่าใช้จ่าย
        nameLocal:
          type: string
          description: 'ชื่อหมวดหมู่ค่าใช้จ่าย <br> <ex>Example: การตลาดและโฆษณา</ex>'
          example: การตลาดและโฆษณา
        nameForeign:
          type: string
          description: 'ชื่อหมวดหมู่ค่าใช้จ่าย (ภาษาอังกฤษ) <br> <ex>Example: Marketing & Advertising</ex>'
          example: Marketing & Advertising
        creditId:
          type: integer
          description: 'เลข id หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิต <br> <ex>Example: 1081994</ex>'
          example: '1081994'
        creditCategory:
          type: integer
          description: 'เลขหมวดหมู่ ฝั่งเครดิต ของ หมวดหมู่ค่าใช้จ่าย <br> <ex>Example: 2</ex>'
          example: '2'
        creditCode:
          type: string
          description: 'เลขที่หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิต <br> <ex>Example: 21399</ex>'
          example: '21399'
        creditNameLocal:
          type: string
          description: 'ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิต <br> <ex>Example: 21399 / เจ้าหนี้อื่นๆ</ex>'
          example: 21399 / เจ้าหนี้อื่นๆ
        creditNameForeign:
          type: string
          description: 'ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิต (ภาษาอังกฤษ) <br> <ex>Example: 21399 / Other Payables</ex>'
          example: 21399 / Other Payables
        debitId:
          type: integer
          description: 'เลข id หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต <br> <ex>Example: 1082099</ex>'
          example: '1082099'
        debitCategory:
          type: integer
          description: เลขหมวดหมู่ ฝั่งเดบิต ของ หมวดหมู่ค่าใช้จ่าย
          example: '5'
        debitCode:
          type: string
          description: 'เลขที่หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต <br> <ex>Example: 53029</ex>'
          example: '53029'
        debitNameLocal:
          type: string
          description: 'ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต <br> <ex>Example: 53029 / ค่าใช้จ่ายด้านโฆษณาและการตลาดอื่นๆ</ex>'
          example: 53029 / ค่าใช้จ่ายด้านโฆษณาและการตลาดอื่นๆ
        debitNameForeign:
          type: string
          description: 'ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต (ภาษาอังกฤษ) <br> <ex>Example: 53029 / Other advertising and marketing expenses</ex>'
          example: 53029 / Other advertising and marketing expenses
        quantity:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 4 digits** <br> จำนวนรายการค่าใช้จ่าย'
          example: 100.0001
        unitName:
          type: string
          maxLength: 10
          description: หน่วยรายการค่าใช้จ่าย
        pricePerUnit:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 4 digits** <br>
            ราคาต่อหน่วยค่าใช้จ่าย'
          example: 100.0001
        total:
          type: number
          format: decimal
          description: '**Limit decimal places to no more than 2 digits** <br> ราคารวมค่าใช้จ่าย'
          example: 100.01
      required:
        - systemCode
        - description
        - categoryId
        - creditId
        - creditCategory
        - debitId
        - debitCategory
        - quantity
        - pricePerUnit
        - total
    ExpenseSimpleProductItem:
      allOf:
        - $ref: '#/components/schemas/ExpenseProductItem'
    ExpenseInlineProductItem:
      allOf:
        - $ref: '#/components/schemas/ExpenseProductItem'
        - type: object
          properties:
            discountAmount:
              type: integer
              format: decimal
              description: '**Limit decimal places to no more than 2 digits** <br>
                จำนวนส่วนลดรายการค่าใช้จ่าย'
              default: 0
              example: 100.01
            vatRate:
              type: integer
              description: รูปแบบภาษี <br> 7 = ภาษี 7% <br> 0 = ภาษี 0% <br> -1 = ยกเว้นภาษี
              default: 7
      required:
        - systemCode
        - description
        - namelocal
        - nameForeign
        - creditCode
        - creditNameLocal
        - creditNameForeign
        - debitCode
        - debitNameLocal
        - debitNameForeign
        - vatRate
        - discountAmount
    BusinessCategory:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: array
          description: ข้อมูลหมวดหมู่ค่าใช้จ่าย ในระบบ
          items:
            type: object
            properties:
              id:
                type: integer
                description: id ของหมวดหมู่ค่าใช้จ่าย
              systemCode:
                type: integer
                description: เลขที่ system code หมวดหมู่ค่าใช้จ่าย (เลือกใช้ หมวดหมู่ค่าใช้จ่ายสำหรับธุรกิจ)
              categoryId:
                type: integer
                description: เลขที่ id หมวดหมู่ค่าใช้จ่าย (เลือกใช้ หมวดหมู่ค่าใช้จ่ายสำหรับธุรกิจ)
              categoryNameLocal:
                type: string
                description: ชื่อหมวดหมู่ค่าใช้จ่าย
              categoryNameForeign:
                type: string
                description: ชื่อหมวดหมู่ค่าใช้จ่าย (ภาษาอังกฤษ)
              debitId:
                type: integer
                description: เลข id หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต
              debitCategory:
                type: integer
                description: เลขหมวดหมู่ ฝั่งเดบิต ของ หมวดหมู่ค่าใช้จ่าย
              debitCode:
                type: string
                description: เลขที่หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต
              debitNameLocal:
                type: string
                description: ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต
              debitNameForeign:
                type: string
                description: ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต (ภาษาอังกฤษ)
              creditId:
                type: integer
                description: เลข id หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิิต
              creditCategory:
                type: integer
                description: เลขหมวดหมู่ ฝั่งเครดิต ของ หมวดหมู่ค่าใช้จ่าย
              creditCode:
                type: string
                description: เลขที่หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิต
              creditNameLocal:
                type: string
                description: 'ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิต '
              creditNameForeign:
                type: string
                description: ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิต (ภาษาอังกฤษ)
              subCategories:
                type: array
                description: หมวดหมู่ค่าใช้จ่ายย่อย
                items:
                  $ref: '#/components/schemas/subCategories'
    subCategories:
      type: object
      properties:
        id:
          type: integer
          description: id ของหมวดหมู่ค่าใช้จ่าย
        systemCode:
          type: integer
          description: เลขที่ system code หมวดหมู่ค่าใช้จ่าย (เลือกใช้ หมวดหมู่ค่าใช้จ่ายสำหรับธุรกิจ)
        categoryId:
          type: integer
          description: เลขที่ id หมวดหมู่ค่าใช้จ่าย (เลือกใช้ หมวดหมู่ค่าใช้จ่ายสำหรับธุรกิจ)
        categoryNameLocal:
          type: string
          description: ชื่อหมวดหมู่ค่าใช้จ่าย
        categoryNameForeign:
          type: string
          description: ชื่อหมวดหมู่ค่าใช้จ่าย (ภาษาอังกฤษ)
        debitId:
          type: integer
          description: เลข id หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต
        debitCategory:
          type: integer
          description: เลขหมวดหมู่ ฝั่งเดบิต ของ หมวดหมู่ค่าใช้จ่าย
        debitCode:
          type: string
          description: เลขที่หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต
        debitNameLocal:
          type: string
          description: ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต
        debitNameForeign:
          type: string
          description: ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเดบิต (ภาษาอังกฤษ)
        creditId:
          type: integer
          description: เลข id หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิิต
        creditCategory:
          type: integer
          description: เลขหมวดหมู่ ฝั่งเครดิต ของ หมวดหมู่ค่าใช้จ่าย
        creditCode:
          type: string
          description: เลขที่หมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิต
        creditNameLocal:
          type: string
          description: 'ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิต '
        creditNameForeign:
          type: string
          description: ชื่อหมวดหมู่ค่าใช้จ่ายทางบัญชี ฝั่งเครดิต (ภาษาอังกฤษ)
    WithholidingTaxDocument:
      type: object
      properties:
        contactCode:
          type: string
          description: รหัส ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
        contactName:
          type: string
          description: ชื่อ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
        contactAddress:
          type: string
          description: ที่อยู่ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
        contactTaxId:
          type: string
          description: 'เลขประจำตัวผู้เสียภาษี ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า <br> (ถ้ามีจำเป็นต้องครบ 13 หลัก) <br> <ex>Example: 1234567890123 </ex>'
          example: '1234567890123'
        contactBranch:
          type: string
          description: สำนักงาน/สาขา
        contactPerson:
          type: string
          description: ชื่อผู้ติดต่อ
        contactEmail:
          type: string
          description: 'อีเมลผู้ติดต่อ <br> <ex>Example: contact@email.com</ex>'
          example: contact@email.com
        contactNumber:
          type: string
          description: 'เบอร์มือถือผู้ติดต่อ <br> <ex>Example: 099-999-9999</ex>'
          example: 099-999-9999
        contactZipCode:
          type: string
          description: รหัสไปรษณีย์ติดต่อ
        contactGroup:
          type: integer
          description: ประผู้ติดต่อ <br> 1 = บุคคลธรรมดา <br> 3 = นิติบุคคล
          default: 1
        publishedOn:
          type: string
          format: date
          description: 'วันที่เอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2026-05-25</ex>'
          example: '2026-05-25' 
          default: currentDate
        entity:
          type: integer
          description: แบบฟอร์มเอกสารหัก ณ ที่จ่าย <br> ภงด 3 = 1 <br> ภงด 53 = 3 <br> ภงด 1ก = 1 <br> ภงด 1ก (พิเศษ) = 7 <br> ภงด 2 = 9 <br> ภงด 2ก = 11 <br> ภงด 3ก = 13
          default: 1
        textOther:
          type: string
          description: 'ระบุปีของเอกสาร เช่น 2020 (สำหรับแบบฟอร์มเอกสาร ภงด 1ก หรือ ภงด 1ก (พิเศษ) <br>Example: 2020</ex>'
          example: '2020'
        withholdingTaxItems:
          type: array
          description: รายการหัก ของเอกสารหัก ณ ที่จ่าย
          items:
            $ref: '#/components/schemas/WithholidingTaxItem'
        total:
          type: number
          format: decimal
          description: จำนวนเงิน (ไม่รวมภาษี)
        totalTaxWithheld:
          type: number
          format: decimal
          description: ภาษีที่หัก
        taxPayment:
          type: integer
          description: ผู้จ่ายเงิน <br> 1 = ภาษีหัก ณ ที่จ่าย <br> 3 = ออกภาษีให้ตลอดไป <br> 5 = ออกภาษีให้ครั้งเดียว <br> 7 = อื่น ๆ
          default: 1
        taxPaymentOthers:
          type: string
          description: 'ข้อความ สำหรับผู้จ่ายเงิน อื่นๆ '
        providentFundNumber:
          type: string
          description: ใบอนุญาตเลขที่
        providentFundAmount:
          type: string
          description: จำนวนเงินที่ต้องจ่ายเข้า กองทุนสำรองเลี้ยงชีพ
        socialSecurityAmount:
          type: string
          description: จำนวนเงินที่ต้องจ่ายเข้า กองทุนประกันสังคม
        remarks:
          type: string
          description: หมายเหตุเอกสาร
        internalNotes:
          type: string
          description: โน๊ตภายในบริษัท
        showSignatureOrStamp:
          type: boolean
          default: true
          description: ลายเซ็นอิเล็กทรอนิกส์และตรายาง
        externalDocumentId:
          type: string
          description: 'รหัสเอกสารอ้างอิงจากระบบภายนอก
            <br> <ex>Example: platform-123456</ex>'
          example: 'platform-123456'
      required:
        - contactName
        - entity
        - withholdingTaxItems
        - total
        - totalTaxWithheld
    UpdateWithholidingTaxDocument:
      type: object
      properties:
        companyName:
          type: string
          description: ชื่อบริษัท <br>(to be deprecated)
        companyNameEn:
          type: string
          description: ชื่อบริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br>(to be deprecated)
        companyAddress:
          type: string
          description: ที่อยู่บริษัท <br>(to be deprecated)
        companyAddressEn:
          type: string
          description: ที่อยู่บริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br>(to be deprecated)
        companyTaxId:
          type: string
          description: 'เลขประจำตัวผู้เสียภาษี บริษัท <br><ex>Example: 0105558096348</ex> <br>(to be deprecated)<br>' 
        companyBranch:
          type: string
          description: 'ชื่อ และ รหัสสาขา <br><ex>Example: สำนักงานใหญ่ 00000</ex> <br>(to be deprecated)<br>'
        companyBranchEn:
          type: string
          description: 'ชื่อ และ รหัสสาขา ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br><ex>Example: Head Office 00000</ex> <br>(to be deprecated)<br>'
        companyPhone:
          type: string
          description: 'เบอร์โทรสำนักงาน <br><ex>Example: 02-999-9999</ex> <br>(to be deprecated)<br >'
        companyMobile:
          type: string
          description: 'เบอร์โทรศัพท์มือถือ <br><ex>Example: 099-999-9999</ex> <br>(to be deprecated)<br>'
        companyFax:
          type: string
          description: 'เบอร์โทรสาร <br><ex>Example: 02-999-9999 ต่อ 1</ex> <br>(to be deprecated)<br>'
        companyWebsite:
          type: string
          description: 'เว็บไซต์ <br><ex>Example: www.flowaccount.com</ex> <br>(to be deprecated)<br>'
        contactCode:
          type: string
          description: รหัส ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
        contactName:
          type: string
          description: ชื่อ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
        contactAddress:
          type: string
          description: ที่อยู่ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
        contactTaxId:
          type: string
          description: 'เลขประจำตัวผู้เสียภาษี ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า <br> (ถ้ามีจำเป็นต้องครบ 13 หลัก) <br> <ex>Example: 1234567890123 </ex>'
          example: '1234567890123'
        contactBranch:
          type: string
          description: สำนักงาน/สาขา
        contactPerson:
          type: string
          description: ชื่อผู้ติดต่อ
        contactEmail:
          type: string
          description: 'อีเมลผู้ติดต่อ <br> <ex>Example: contact@email.com</ex>'
          example: contact@email.com
        contactNumber:
          type: string
          description: 'เบอร์มือถือผู้ติดต่อ <br> <ex>Example: 099-999-9999</ex>'
          example: 099-999-9999
        contactZipCode:
          type: string
          description: รหัสไปรษณีย์ติดต่อ
        contactGroup:
          type: integer
          description: ประผู้ติดต่อ <br> 1 = บุคคลธรรมดา <br> 3 = นิติบุคคล
          default: 1
        publishedOn:
          type: string
          format: date
          description: 'วันที่เอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2026-05-25</ex>'
          example: '2026-05-25' 
          default: currentDate
        entity:
          type: integer
          description: แบบฟอร์มเอกสารหัก ณ ที่จ่าย <br> ภงด 3 = 1 <br> ภงด 53 = 3 <br> ภงด 1ก = 1 <br> ภงด 1ก (พิเศษ) = 7 <br> ภงด 2 = 9 <br> ภงด 2ก = 11 <br> ภงด 3ก = 13
          default: 1
        textOther:
          type: string
          description: 'ระบุปีของเอกสาร เช่น 2020 (สำหรับแบบฟอร์มเอกสาร ภงด 1ก หรือ ภงด 1ก (พิเศษ) <br>Example: 2020</ex>'
          example: '2020'
        withholdingTaxItems:
          type: array
          description: รายการหัก ของเอกสารหัก ณ ที่จ่าย
          items:
            $ref: '#/components/schemas/WithholidingTaxItem'
        total:
          type: number
          format: decimal
          description: จำนวนเงิน (ไม่รวมภาษี)
        totalTaxWithheld:
          type: number
          format: decimal
          description: ภาษีที่หัก
        taxPayment:
          type: integer
          description: ผู้จ่ายเงิน <br> 1 = ภาษีหัก ณ ที่จ่าย <br> 3 = ออกภาษีให้ตลอดไป <br> 5 = ออกภาษีให้ครั้งเดียว <br> 7 = อื่น ๆ
          default: 1
        taxPaymentOthers:
          type: string
          description: 'ข้อความ สำหรับผู้จ่ายเงิน อื่นๆ '
        providentFundNumber:
          type: string
          description: ใบอนุญาตเลขที่
        providentFundAmount:
          type: string
          description: จำนวนเงินที่ต้องจ่ายเข้า กองทุนสำรองเลี้ยงชีพ
        socialSecurityAmount:
          type: string
          description: จำนวนเงินที่ต้องจ่ายเข้า กองทุนประกันสังคม
        remarks:
          type: string
          description: หมายเหตุเอกสาร
        internalNotes:
          type: string
          description: โน๊ตภายในบริษัท
        showSignatureOrStamp:
          type: boolean
          default: true
          description: ลายเซ็นอิเล็กทรอนิกส์และตรายาง
        externalDocumentId:
          type: string
          description: 'รหัสเอกสารอ้างอิงจากระบบภายนอก
            <br> <ex>Example: platform-123456</ex>'
          example: 'platform-123456'
      required:
        - contactName
        - entity
        - withholdingTaxItems
        - total
        - totalTaxWithheld
    WithholidingTaxDocumentResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: object
          properties:
            recordId:
              type: string
              description: เลข Id เอกสารใบหัก ณ ที่จ่าย
            documentId:
              type: string
              description: เลข Id เอกสารใบหัก ณ ที่จ่าย
            documentSerial:
              type: string
              description: เลขที่เอกสารใบหัก ณ ที่จ่าย
            contactCode:
              type: string
              description: รหัส ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
            contactName:
              type: string
              description: ชื่อ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
            contactAddress:
              type: string
              description: ที่อยู่ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
            contactTaxId:
              type: string
              description: 'เลขประจำตัวผู้เสียภาษี ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า <br> (ถ้ามีจำเป็นต้องครบ 13 หลัก) <br> <ex>Example: 1234567890123 </ex>'
              example: '1234567890123'
            contactBranch:
              type: string
              description: สำนักงาน/สาขา
            contactPerson:
              type: string
              description: ชื่อผู้ติดต่อ
            contactEmail:
              type: string
              description: 'อีเมลผู้ติดต่อ <br> <ex>Example: contact@email.com</ex>'
              example: contact@email.com
            contactNumber:
              type: string
              description: 'เบอร์มือถือผู้ติดต่อ <br> <ex>Example: 099-999-9999</ex>'
              example: 099-999-9999
            contactZipCode:
              type: string
              description: รหัสไปรษณีย์ติดต่อ
            contactGroup:
              type: integer
              default: 1
              description: ประผู้ติดต่อ <br> 1 = บุคคลธรรมดา <br> 3 = นิติบุคคล
            publishedOn:
              type: string
              format: date
              description: 'วันที่เอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2026-05-25</ex>'
              example: '2026-05-25' 
              default: currentDate
            entity:
              type: integer
              description: แบบฟอร์มเอกสารหัก ณ ที่จ่าย <br> ภงด 3 = 1 <br> ภงด 53 = 3 <br> ภงด 1ก = 1 <br> ภงด 1ก (พิเศษ) = 7 <br> ภงด 2 = 9 <br> ภงด 2ก = 11 <br> ภงด 3ก = 13
              default: 1
            textOther:
              type: string
              description: 'ระบุปีของเอกสาร เช่น 2020 (สำหรับแบบฟอร์มเอกสาร ภงด 1ก หรือ ภงด 1ก (พิเศษ) Example: 2020'
              example: '2020'
            withholdingTaxItems:
              type: array
              description: รายการหัก ของเอกสารหัก ณ ที่จ่าย
              items:
                $ref: '#/components/schemas/WithholidingTaxItem'
            total:
              type: number
              format: decimal
              description: จำนวนเงิน (ไม่รวมภาษี)
            totalTaxWithheld:
              type: number
              format: decimal
              description: ภาษีที่หัก
            taxPayment:
              type: integer
              description: ผู้จ่ายเงิน <br> 1 = ภาษีหัก ณ ที่จ่าย <br> 3 = ออกภาษีให้ตลอดไป <br> 5 = ออกภาษีให้ครั้งเดียว <br> 7 = อื่น ๆ
              default: 1
            taxPaymentOthers:
              type: string
              description: 'ข้อความ สำหรับผู้จ่ายเงิน อื่นๆ '
            providentFundNumber:
              type: string
              description: ใบอนุญาตเลขที่
            providentFundAmount:
              type: string
              description: จำนวนเงินที่ต้องจ่ายเข้า กองทุนสำรองเลี้ยงชีพ
            socialSecurityAmount:
              type: string
              description: จำนวนเงินที่ต้องจ่ายเข้า กองทุนประกันสังคม
            remarks:
              type: string
              description: หมายเหตุเอกสาร
            internalNotes:
              type: string
              description: โน๊ตภายในบริษัท
            showSignatureOrStamp:
              type: boolean
              default: true
              description: ลายเซ็นอิเล็กทรอนิกส์และตรายาง
            company:
              type: object
              description: ข้อมูลบริษัทของคุณในเอกสาร
              properties:
                companyName:
                  type: string
                  description: ชื่อบริษัท
                companyNameEn:
                  type: string
                  description: ชื่อบริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ)
                companyAddress:
                  type: string
                  description: ที่อยู่บริษัท
                companyAddressEn:
                  type: string
                  description: ที่อยู่บริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ)
                companyTaxId:
                  type: string
                  description: 'เลขประจำตัวผู้เสียภาษี บริษัท <br><ex>Example: 0105558096348</ex>'
                companyBranch:
                  type: string
                  description: 'ชื่อ และ รหัสสาขา <br><ex>Example: สำนักงานใหญ่ 00000</ex>'
                companyBranchEn:
                  type: string
                  description: 'ชื่อ และ รหัสสาขา ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br><ex>Example: Head Office 00000</ex>'
                companyPhone:
                  type: string
                  description: 'เบอร์โทรสำนักงาน <br><ex>Example: 02-999-9999</ex>'
                companyMobile:
                  type: string
                  description: 'เบอร์โทรศัพท์มือถือ <br><ex>Example: 099-999-9999</ex>'
                companyFax:
                  type: string
                  description: 'เบอร์โทรสาร <br><ex>Example: 02-999-9999 ต่อ 1</ex>'
                companyWebsite:
                  type: string
                  description: 'เว็บไซต์ <br><ex>Example: www.flowaccount.com</ex>'
            status:
              type: integer
              description: เลขสถานะเอกสารฉบับนี้
            statusString:
              type: integer
              description: ชื่อสถานะเอกสารฉบับนี้
            documentType:
              type: integer
              description: เลขประเภทเอกสารฉบับนี้
            allowDelete:
              type: boolean
              description: สามารถลบเอกสาร :<br> true = ลบได้ <br> false = ลบไม่ได้
            isDelete:
              type: string
              description: '(to be changed to boolean) <br> เอกสารถูกลบแล้ว : <br> true : ถูกลบแล้ว <br> false : ยังไม่ถูกลบ'
              example: 'false'
    AllWithholidingTaxDocumentResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: object
          properties:
            list:
              type: array
              description: ข้อมูลรายการสินค้า
              items:
                type: object
                properties:
                  recordId:
                    type: string
                    description: เลข Id เอกสารใบหัก ณ ที่จ่าย
                  documentId:
                    type: string
                    description: เลข Id เอกสารใบหัก ณ ที่จ่าย
                  documentSerial:
                    type: string
                    description: เลขที่เอกสารใบหัก ณ ที่จ่าย
                  contactCode:
                    type: string
                    description: รหัส ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
                  contactName:
                    type: string
                    description: ชื่อ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
                  contactAddress:
                    type: string
                    description: ที่อยู่ ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า
                  contactTaxId:
                    type: string
                    description: 'เลขประจำตัวผู้เสียภาษี ผู้จำหน่าย หรือ ผู้จำหน่าย/ลูกค้า <br> (ถ้ามีจำเป็นต้องครบ 13 หลัก) <br> <ex>Example: 1234567890123 </ex>'
                    example: '1234567890123'
                  contactBranch:
                    type: string
                    description: สำนักงาน/สาขา
                  contactPerson:
                    type: string
                    description: ชื่อผู้ติดต่อ
                  contactEmail:
                    type: string
                    description: 'อีเมลผู้ติดต่อ <br> <ex>Example: contact@email.com</ex>'
                    example: contact@email.com
                  contactNumber:
                    type: string
                    description: 'เบอร์มือถือผู้ติดต่อ <br> <ex>Example: 099-999-9999</ex>'
                    example: 099-999-9999
                  contactZipCode:
                    type: string
                    description: รหัสไปรษณีย์ติดต่อ
                  contactGroup:
                    type: integer
                    default: 1
                    description: ประผู้ติดต่อ <br> 1 = บุคคลธรรมดา <br> 3 = นิติบุคคล
                  publishedOn:
                    type: string
                    format: date
                    description: 'วันที่เอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2026-05-25</ex>'
                    example: '2026-05-25' 
                    default: currentDate
                  entity:
                    type: integer
                    description: แบบฟอร์มเอกสารหัก ณ ที่จ่าย <br> ภงด 3 = 1 <br> ภงด 53 = 3 <br> ภงด 1ก = 1 <br> ภงด 1ก (พิเศษ) = 7 <br> ภงด 2 = 9 <br> ภงด 2ก = 11 <br> ภงด 3ก = 13
                    default: 1
                  textOther:
                    type: string
                    description: 'ระบุปีของเอกสาร เช่น 2020 (สำหรับแบบฟอร์มเอกสาร ภงด 1ก หรือ ภงด 1ก (พิเศษ) Example: 2020'
                    example: '2020'
                  withholdingTaxItems:
                    type: array
                    description: รายการหัก ของเอกสารหัก ณ ที่จ่าย
                    items:
                      $ref: '#/components/schemas/WithholidingTaxItem'
                  total:
                    type: number
                    format: decimal
                    description: จำนวนเงิน (ไม่รวมภาษี)
                  totalTaxWithheld:
                    type: number
                    format: decimal
                    description: ภาษีที่หัก
                  taxPayment:
                    type: integer
                    description: ผู้จ่ายเงิน <br> 1 = ภาษีหัก ณ ที่จ่าย <br> 3 = ออกภาษีให้ตลอดไป <br> 5 = ออกภาษีให้ครั้งเดียว <br> 7 = อื่น ๆ
                    default: 1
                  taxPaymentOthers:
                    type: string
                    description: 'ข้อความ สำหรับผู้จ่ายเงิน อื่นๆ '
                  providentFundNumber:
                    type: string
                    description: ใบอนุญาตเลขที่
                  providentFundAmount:
                    type: string
                    description: จำนวนเงินที่ต้องจ่ายเข้า กองทุนสำรองเลี้ยงชีพ
                  socialSecurityAmount:
                    type: string
                    description: จำนวนเงินที่ต้องจ่ายเข้า กองทุนประกันสังคม
                  remarks:
                    type: string
                    description: หมายเหตุเอกสาร
                  internalNotes:
                    type: string
                    description: โน๊ตภายในบริษัท
                  showSignatureOrStamp:
                    type: boolean
                    default: true
                    description: ลายเซ็นอิเล็กทรอนิกส์และตรายาง
                  company:
                    type: object
                    description: ข้อมูลบริษัทของคุณในเอกสาร
                    properties:
                      companyName:
                        type: string
                        description: ชื่อบริษัท
                      companyNameEn:
                        type: string
                        description: ชื่อบริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ)
                      companyAddress:
                        type: string
                        description: ที่อยู่บริษัท
                      companyAddressEn:
                        type: string
                        description: ที่อยู่บริษัท ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ)
                      companyTaxId:
                        type: string
                        description: 'เลขประจำตัวผู้เสียภาษี บริษัท <br><ex>Example: 0105558096348</ex>'
                      companyBranch:
                        type: string
                        description: 'ชื่อ และ รหัสสาขา <br><ex>Example: สำนักงานใหญ่ 00000</ex>'
                      companyBranchEn:
                        type: string
                        description: 'ชื่อ และ รหัสสาขา ภาษาอังกฤษ (แสดงเมื่อเลือกเอกสารเป็นภาษาอังกฤษ) <br><ex>Example: Head Office 00000</ex>'
                      companyPhone:
                        type: string
                        description: 'เบอร์โทรสำนักงาน <br><ex>Example: 02-999-9999</ex>'
                      companyMobile:
                        type: string
                        description: 'เบอร์โทรศัพท์มือถือ <br><ex>Example: 099-999-9999</ex>'
                      companyFax:
                        type: string
                        description: 'เบอร์โทรสาร <br><ex>Example: 02-999-9999 ต่อ 1</ex>'
                      companyWebsite:
                        type: string
                        description: 'เว็บไซต์ <br><ex>Example: www.flowaccount.com</ex>'
                  status:
                    type: integer
                    description: เลขสถานะเอกสารฉบับนี้
                  statusString:
                    type: integer
                    description: ชื่อสถานะเอกสารฉบับนี้
                  documentType:
                    type: integer
                    description: เลขประเภทเอกสารฉบับนี้
                  allowDelete:
                    type: boolean
                    description: สามารถลบเอกสาร :<br> true = ลบได้ <br> false = ลบไม่ได้
                  isDelete:
                    type: string
                    description: '(to be changed to boolean) <br> เอกสารถูกลบแล้ว : <br> true : ถูกลบแล้ว <br> false : ยังไม่ถูกลบ'
                    example: 'false'
            totalDocument:
              type: string
              description: จำนวนเอกสาร
    WithholidingTaxItem:
      type: object
      properties:
        incomeType:
          type: integer
          description: ประเภทเงินได้ที่จ่าย <br> 1 = 1. เงินเดือน ค่าจ้าง เบี้ยเลี้ยง โบนัส ฯลฯ ตามมาตรา 40 (1) <br> 3 = 2. ค่าธรรมเนียม ค่านายหน้า ฯลฯ ตามมาตรา 40 (2) <br> 5 = 3. ค่าแห่งลิขสิทธิ์ ฯลฯ ตามมาตรา 40(3) <br> 7 = 4. (ก) ค่าดอกเบี้ย ฯลฯ ตามมาตรา 40(4) (ก) <br> 11 = 4. (ข)(1.1) กิจการที่ต้องเสียภาษีเงินได้นิติบุคคลในอัตราร้อยละ 25 ของกำไรสุทธิ <br> 13 = 4. (ข)(1.2) กิจการที่ต้องเสียภาษีเงินได้นิติบุคคลในอัตราร้อยละ 20 ของกำไรสุทธิ <br> 15 = 4. (ข)(1.3) กิจการที่ต้องเสียภาษีเงินได้นิติบุคคลในอัตราอื่น ของกำไรสุทธิ (กรุณาระบุ) <br> 17 = 4. (ข)(2.1) กำไรสุทธิของกิจการที่ได้รับยกเว้นเงินได้นิติบุคคล <br> 19 = 4. (ข)(2.2) เงินปันผลหรือเงินส่วนแบ่งของกำไรที่ได้รับยกเว้น... <br> 21 = 4. (ข)(2.3) กำไรสุทธิส่วนที่ได้หักผลขาดทุนสิทธิยกมาไม่เกิน 5 ปี... <br> 23 = 4. (ข)(2.4) กำไรที่รับรู้ทางบัญชีโดยวิธีส่วนได้เสีย (equity method) <br> 25 = 4. (ข)(2.5) อื่นๆ (กรุณาระบุ) <br> 27 = 5. การจ่ายเงินได้ที่ต้องหักภาษี ณ ที่จ่ายตามคำสั่งกรมสรรพากร.... <br> 29 = 6. อื่นๆ (กรุณาระบุ)
          default: 1
        description:
          type: string
          description: รายละเอียดหัก ณ ที่จ่าย <br> สำหรับประเภทเงินได้ที่จ่าย ข้อ 4.(ข)(2.5) อื่นๆ และ ข้อ 6. อื่นๆ
        taxRate:
          type: number
          format: decimal
          description: อัตราภาษี หัก ณ ที่จ่าย <br> 3 = อัตราภาษี 3% <br> 5 = อัตราภาษี 5% <br> 0.5 = อัตราภาษี 0.5% <br> 0.75 = อัตราภาษี 0.75% <br> 1 = อัตราภาษี 1% <br> 2 = อัตราภาษี 2% <br> 10 = อัตราภาษี 10% <br> 15 = อัตราภาษี 15% <br> -1 = อัตราภาษีเป็นแบบจำนวนเงิน
        taxAmount:
          type: number
          format: decimal
          description: จำนวนเงินที่นำมาหักภาษี
        taxAmountNoVat:
          type: number
          format: decimal
          description: จำนวนเงินไม่รวมภาษีมูลค่าเพิ่ม
        withheld:
          type: number
          format: decimal
          description: จำนวนเงินภาษีหัก ณ ที่จ่าย
        total:
          type: number
          format: decimal
          description: จำนวนเงินหลังหักภาษี ณ ที่จ่าย (taxAmount - withheld = total)
        vatType:
          type: integer
          default: 1
          description: ภาษีมูลค่าเพิ่ม <br> 1 = รวมภาษีมูลค่าเพิ่ม <br> 3 = ไม่รวมภาษีมูลค่าเพิ่ม <br>7 = ไม่มี/ยกเว้นภาษีมูลค่าเพิ่ม
      required:
        - incomeType
        - taxRate
        - taxAmount
        - taxAmountNoVat
        - withheld
        - total
        - vatType
    SendEmail:
      type: object
      properties:
        documentId:
          type: integer
          format: int64
          description: documentId หรือ recordId ของเอกสารที่ต้องการส่งอีเมล
        fromemail:
          type: string
          description: 'ใส่อีเมลผู้ส่ง <br> <ex>Example: myemail@email.com</ex>'
          example: myemail@email.com
        toemail:
          type: string
          description: 'ใส่อีเมลผู้รับ <br> <ex>Example: contact@email.com</ex>'
          example: contact@email.com
        cCMyself:
          type: boolean
          description: ส่งสำเนาหาตนเอง
          default: true
        ccEmail:
          type: string
          description: 'สำเนา (CC) <br> <ex>Example: cc@email.com</ex>'
          example: cc@email.com
        bccEmail:
          type: string
          description: 'สำเนาลับ (BCC) <br> <ex>Example: bcc@email.com</ex>'
          example: bcc@email.com
        subject:
          type: string
          description: 'หัวข้อ / ชื่อเรื่อง '
        message:
          type: string
          description: ข้อความ เนื้อหาของ email
        IsPaymentDetail:
          type: boolean
          description: เปิดใช้งานแนบข้อมูลเอกสารการชำระเงิน (เฉพาะเอกสารขาย Quotations, Billing Notes, Tax Invoices, Receipt)
          default: false
      required:
        - documentId
        - fromemail
        - toemail
        - subject
    SendEmailSimple:
      $ref: '#/components/schemas/SendEmail'
    SendEmailCoppies:
      allOf:
        - $ref: '#/components/schemas/SendEmail'
        - type: object
          properties:
            doCopy:
              type: boolean
              description: ส่งต้นฉบับ พร้อม สำเนา
              default: true
    SendEmailResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: object
          description: data success
          properties:
            ok:
              type: boolean
              description: Status
            message:
              type: string
              description: Email sent successfully
            successMsg:
              type: string
              description: Change Status Complete
    ShareDocument:
      type: object
      properties:
        documentId:
          type: integer
          format: int64
          description: documentId หรือ recordId ของเอกสารที่ต้องการส่งอีเมล
        culture:
          type: string
          default: th
          description: เลือกภาษาของเอกสาร <br> th = ไทย <br> en = อังกฤษ
      required:
        - documentId
    ShareDocumentResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: object
          description: data success
          properties:
            link:
              type: string
              description: Link Document
    AttachmentResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: array
          description: ข้อมูลไฟล์แนบเอกสาร
          items:
            type: object
            properties:
              attachmentId:
                type: integer
                format: int64
                description: เลข Id ไฟล์แนบเอกสาร
              createdOn:
                type: string
                format: date
                description: 'วันที่แนบไฟล์เอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
                example: '2021-01-01'
              attachmentName:
                type: string
                description: ชื่อไฟล์แนบเอกสาร
              orderNumber:
                type: integer
                format: int64
                description: ลำดับไฟล์แนบเอกสาร
              isDisplay:
                type: boolean
                description: สถานะการแสดงไฟล์แนบเอกสาร
                default: true
              attachmentPath:
                type: string
                description: path ที่อยู่ไฟล์แนบเอกสาร
    ExportPdfRequest:
      type: object
      properties:
        culture:
          type: string
          description: "รูปแบบภาษาสำหรับการสร้าง PDF รองรับ 'th' (ภาษาไทย) หรือ 'en' (ภาษาอังกฤษ)"
          default: th
          example: th
        document:
          type: object
          description: กำหนดเอกสารที่ต้องการรวมในไฟล์ PDF ที่ส่งออก
          properties:
            original:
              type: boolean
              description: เอกสารต้นฉบับ
              default: true
              example: true
            copy:
              type: boolean
              description: เอกสารสำเนา
              default: false
              example: false
    ExportPdfTaxInvoiceRequest:
      type: object
      properties:
        culture:
          type: string
          description: "รูปแบบภาษาสำหรับการสร้าง PDF รองรับ 'th' (ภาษาไทย) หรือ 'en' (ภาษาอังกฤษ)"
          default: th
          example: th
        document:
          type: object
          description: กำหนดเอกสารที่ต้องการรวมในไฟล์ PDF ที่ส่งออก
          properties:
            original:
              type: boolean
              description: รวมต้นฉบับของเอกสาร
              default: true
              example: true
            copy:
              type: boolean
              description: รวมสำเนาของเอกสาร
              default: false
              example: false
        receipt:
          type: object
          description: กำหนดเอกสารใบเสร็จรับเงินที่ต้องการรวมในไฟล์ PDF เอกสารใบกำกับภาษีสามารถรวมทั้งส่วนใบกำกับภาษีและใบเสร็จรับเงินในไฟล์ PDF เดียวกัน
          properties:
            original:
              type: boolean
              description: ต้นฉบับของใบเสร็จรับเงิน
              default: false
              example: false
            copy:
              type: boolean
              description: สำเนาของใบเสร็จรับเงิน
              default: false
              example: false
    ExportPdfResponse:
      type: object
      properties:
        data:
          type: string
          format: byte
          description: เนื้อหาไฟล์ PDF ที่เข้ารหัสด้วย base64
          example: "U3dhZ2dlciByb2Nrcw=="
        status:
          type: boolean
          example: true
        message:
          type: string
          example: ""
        code:
          type: integer
          example: 0
      example:
        data: "JVBERi0xLjMKJf////8KOCAwIG9iago8PAovVHlwZSAvRXh0R1N0YXRlCi9DQSAxCj4+CmVuZG9iago5IDAgb2JqCjw8Ci9UeXBlIC9FeHRHU3RhdGUKL2NhIDEKL0NBIDEKPj4KZW5kb2JqCjExIDAgb2JqCjw8Ci9UeXBlIC9FeHRHU3RhdGUKL2NhIDEKPj4KZW5kb2JqCjcgMCBvYmoKPDwKL1R5cGUgL1BhZ2UKL1BhcmVudCAxIDAgUgovTWVkaWFCb3ggWzAgMCA1OTUuMjggODQxLjg5XQovQ29udGVudHMgNSAwIFIKL1Jlc291cmNlcyA2IDAgUgo+PgplbmRvYmoK"
        status: true
        message: ""
        code: 0
    ExportPdfErrorResponse:
      type: object
      properties:
        status:
          type: boolean
          example: false
        data:
          type: string
          description: ข้อความแสดงข้อผิดพลาดที่เกิดจากการตรวจสอบข้อมูล
          example: At least one of document.original or document.copy must be true.
    AttachmentBase64:
      type: object
      properties:
        files:
          type: array
          items:
            type: object
            properties:
              fileName:
                type: string
                description: ชื่อไฟล์แนบเอกสารและนามสกุลไฟล์
                example: document.pdf
              base64Data:
                type: string
                description: เนื้อหาไฟล์ในรูปแบบ base64
                example: /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAg...
    AttachmentBase64Response:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: array
          description: ข้อมูลไฟล์แนบเอกสาร
          items:
            type: object
            properties:
              attachmentId:
                type: integer
                format: int64
                description: เลข Id ไฟล์แนบเอกสาร
              attachmentName:
                type: string
                description: ชื่อไฟล์แนบเอกสาร
                example: document.pdf
              createdOn:
                type: string
                format: date
                description: 'วันที่แนบไฟล์เอกสาร รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
                example: '2021-01-01'
              orderNumber:
                type: integer
                format: int64
                description: ลำดับไฟล์แนบเอกสาร
              isDisplay:
                type: boolean
                description: สถานะการแสดงไฟล์แนบเอกสาร
                default: true
              attachmentPath:
                type: string
                description: path ที่อยู่ไฟล์แนบเอกสาร
    ProductMasterType:
      oneOf:
        - $ref: '#/components/schemas/ProductMasterRequestService'
        - $ref: '#/components/schemas/ProductMasterRequestNonStock'
        - $ref: '#/components/schemas/ProductMasterRequestStockSingleUnit'
        - $ref: '#/components/schemas/ProductMasterRequestStockMultipleUnit'
    ProductMasterRequestService:
      title: ProductMasterRequestService
      type: object
      properties:
        type:
          type: integer
          description: 'ประเภทสินค้า: 1 = บริการ'
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        code:
          type: string
          description: 'รหัสสินค้า <br> <ex>Example: P001</ex>'
          nullable: true
          example: 'P001'
        categoryName:
          type: string
          description: หมวดสินค้า
          nullable: true
        sellSettings:
          description: ข้อมูลการขาย
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        productLists:
          type: array
          description: รายการสินค้า
          items:
            $ref: '#/components/schemas/NonInventoryProductListRequest'
      required:
        - type
        - name
    ProductMasterRequestNonStock:
      title: ProductMasterRequestNonStock
      type: object
      properties:
        type:
          type: integer
          description: 'ประเภทสินค้า: 3 = ไม่นับสต๊อก'
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        code:
          type: string
          description: 'รหัสสินค้า <br> <ex>Example: P001</ex>'
          nullable: true
          example: 'P001'
        categoryName:
          type: string
          description: หมวดสินค้า
          nullable: true
        sellSettings:
          description: ข้อมูลการขาย
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        buySettings:
          description: ข้อมูลการซื้อ
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        nonInventorySettings:
          description: ข้อมูลเกี่ยวกับสินค้าไม่นับสต๊อก
          items:
            $ref: '#/components/schemas/NonInventorySettingsRequest'
        productLists:
          type: array
          description: รายการสินค้า
          items:
            $ref: '#/components/schemas/NonInventoryProductListRequest'
      required:
        - type
        - name
    ProductMasterRequestStockSingleUnit:
      title: ProductMasterRequestStockSingleUnit
      type: object
      properties:
        type:
          type: integer
          description: 'ประเภทสินค้า: 5 = นับสต๊อก'
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        code:
          type: string
          description: 'รหัสสินค้า <br> <ex>Example: P001</ex>'
          nullable: true
          example: 'P001'
        categoryName:
          type: string
          description: หมวดสินค้า
          nullable: true
        sellSettings:
          description: ข้อมูลการขาย
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        buySettings:
          description: ข้อมูลการซื้อ
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        inventorySettings:
          description: ข้อมูลเกี่ยวกับการตั้งต้นจำนวนสินค้า
          items:
            $ref: '#/components/schemas/InventorySettingsRequest'
        productLists:
          type: array
          description: รายการสินค้า 1 รายการ
          minItems: 1
          items:
            $ref: '#/components/schemas/InventoryProductListSingleUnitRequest'
      required:
        - type
        - name
        - productLists
    ProductMasterRequestStockMultipleUnit:
      title: ProductMasterRequestStockMultipleUnit
      type: object
      properties:
        type:
          type: integer
          description: 'ประเภทสินค้า: 5 = นับสต๊อก'
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        code:
          type: string
          description: 'รหัสสินค้า <br> <ex>Example: P001</ex>'
          nullable: true
          example: 'P001'
        categoryName:
          type: string
          description: หมวดสินค้า
          nullable: true
        sellSettings:
          description: ข้อมูลการขาย
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        buySettings:
          description: ข้อมูลการซื้อ
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        inventorySettings:
          description: ข้อมูลเกี่ยวกับการตั้งต้นจำนวนสินค้า
          items:
            $ref: '#/components/schemas/InventorySettingsRequest'
        productLists:
          type: array
          description: รายการสินค้ามากกว่า 2 รายการ
          items:
            $ref: '#/components/schemas/InventoryProductListMultipleUnitRequest'
      required:
        - type
        - name
        - productLists
    ProductMasterTypeUpdate:
      oneOf:
        - $ref: '#/components/schemas/ProductMasterRequestServiceUpdate'
        - $ref: '#/components/schemas/ProductMasterRequestNonStockUpdate'
        - $ref: '#/components/schemas/ProductMasterRequestStockSingleUnitUpdate'
        - $ref: '#/components/schemas/ProductMasterRequestStockMultipleUnitUpdate'
    ProductMasterRequestServiceUpdate:
      title: ProductMasterRequestServiceUpdate
      type: object
      properties:
        id:
          type: integer
          description: เลข id ของ product master
        type:
          type: integer
          description: 'ประเภทสินค้า: 1 = บริการ'
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        code:
          type: string
          description: 'รหัสสินค้า <br> <ex>Example: P001</ex>'
          nullable: true
          example: 'P001'
        categoryName:
          type: string
          description: หมวดสินค้า
          nullable: true
        sellSettings:
          description: ข้อมูลการขาย
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        productLists:
          type: array
          description: รายการสินค้า
          items:
            allOf:
              - type: object
                properties:
                  id:
                    type: integer
                    description: เลข id ของรายการสินค้า
                required:
                  - id
              - $ref: '#/components/schemas/NonInventoryProductListRequest'
      required:
        - type
        - name
        - productLists
    ProductMasterRequestNonStockUpdate:
      title: ProductMasterRequestNonStockUpdate
      type: object
      properties:
        id:
          type: integer
          description: เลข id ของ product master
        type:
          type: integer
          description: 'ประเภทสินค้า: 3 = ไม่นับสต๊อก'
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        code:
          type: string
          description: 'รหัสสินค้า <br> <ex>Example: P001</ex>'
          nullable: true
          example: 'P001'
        categoryName:
          type: string
          description: หมวดสินค้า
          nullable: true
        sellSettings:
          description: ข้อมูลการขาย
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        buySettings:
          description: ข้อมูลการซื้อ
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        nonInventorySettings:
          description: ข้อมูลเกี่ยวกับสินค้าไม่นับสต๊อก
          items:
            $ref: '#/components/schemas/NonInventorySettingsRequest'
        productLists:
          type: array
          description: รายการสินค้า
          items:
            allOf:
              - type: object
                properties:
                  id:
                    type: integer
                    description: เลข id ของรายการสินค้า
                required:
                  - id
              - $ref: '#/components/schemas/NonInventoryProductListRequest'
      required:
        - type
        - name
        - productLists
    ProductMasterRequestStockSingleUnitUpdate:
      title: ProductMasterRequestStockSingleUnitUpdate
      type: object
      properties:
        id:
          type: integer
          description: เลข id ของ product master
        type:
          type: integer
          description: 'ประเภทสินค้า: 5 = นับสต๊อก'
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        code:
          type: string
          description: 'รหัสสินค้า <br> <ex>Example: P001</ex>'
          nullable: true
          example: 'P001'
        categoryName:
          type: string
          description: หมวดสินค้า
          nullable: true
        sellSettings:
          description: ข้อมูลการขาย
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        buySettings:
          description: ข้อมูลการซื้อ
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        inventorySettings:
          description: ข้อมูลเกี่ยวกับการตั้งต้นจำนวนสินค้า
          items:
            $ref: '#/components/schemas/InventorySettingsRequest'
        productLists:
          type: array
          description: รายการสินค้า 1 รายการ
          items:
            allOf:
              - type: object
                properties:
                  id:
                    type: integer
                    description: เลข id ของรายการสินค้า
                required:
                  - id
              - $ref: '#/components/schemas/InventoryProductListSingleUnitRequest'
      required:
        - type
        - name
        - productLists
    ProductMasterRequestStockMultipleUnitUpdate:
      title: ProductMasterRequestStockMultipleUnitUpdate
      type: object
      properties:
        id:
          type: integer
          description: เลข id ของ product master
        type:
          type: integer
          description: 'ประเภทสินค้า: 5 = นับสต๊อก'
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        code:
          type: string
          description: 'รหัสสินค้า <br> <ex>Example: P001</ex>'
          nullable: true
          example: 'P001'
        categoryName:
          type: string
          description: หมวดสินค้า
          nullable: true
        sellSettings:
          description: ข้อมูลการขาย
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        buySettings:
          description: ข้อมูลการซื้อ
          items:
            $ref: '#/components/schemas/TradeSettingsRequest'
        inventorySettings:
          description: ข้อมูลเกี่ยวกับการตั้งต้นจำนวนสินค้า
          items:
            $ref: '#/components/schemas/InventorySettingsRequest'
        productLists:
          type: array
          description: รายการสินค้ามากกว่า 1 รายการ
          items:
            allOf:
              - type: object
                properties:
                  id:
                    type: integer
                    description: เลข id ของรายการสินค้า
                required:
                  - id
              - $ref: '#/components/schemas/InventoryProductListMultipleUnitRequest'
      required:
        - type
        - name
        - productLists
    TradeSettingsRequest:
      type: object
      properties:
        vatType:
          type: integer
          description: 'ภาษี: <br> 1 = ราคาขายรวมภาษี <br> 3 = ราคาขายไม่รวมภาษี
            <br> 5 = ราคาขายภาษี 0% <br> 7 = ราคาขายสินค้าได้รับการยกเว้นภาษี'
          default: 3
        description:
          type: string
          description: รายละเอียดสินค้า
        chartOfAccountId:
          type: integer
          description: เลข id ของผังบัญชี
    NonInventorySettingsRequest:
      type: object
      properties:
        productNonInventoryType:
          type: integer
          description: 'ประเภทของสินค้าไม่นับสต๊อก <br> 1 = สินค้าเพื่อขาย <br> 11 = อื่น ๆ'
    InventorySettingsRequest:
      type: object
      properties:
        inventoryPublishedOn:
          type: string
          format: date
          description: 'วันที่ตั้งต้นสินค้า รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
          nullable: true
          example: '2021-01-01'
        inventoryQuantity:
          type: number
          format: decimal
          description: จำนวนยอดตั้งต้นสินค้า
          default: 0
        inventoryPrice:
          type: number
          format: decimal
          description: ต้นทุนสินค้าต่อหน่วย
          default: 0
    NonInventoryProductListRequest:
      type: object
      properties:
        unitName:
          type: string
          description: ชื่อของหน่วยของรายการสินค้า
        sellPrice:
          type: number
          format: decimal
          description: ราคาขายรายการสินค้า
        buyPrice:
          type: number
          format: decimal
          description: ราคาซื้อรายการสินค้า
        barcode:
          type: string
          description: บาร์โค้ดรายการสินค้า ไม่เกิน 15 ตัวอักษร
          nullable: true
        isMainProduct:
          type: boolean
          description: เครื่องหมายเพื่อระบุการเป็นรายการสินค้าที่มีหน่วยหลัก
    InventoryProductListSingleUnitRequest:
      allOf:
        - $ref: '#/components/schemas/NonInventoryProductListRequest'
          required:
            - unitName
    InventoryProductListMultipleUnitRequest:
      allOf:
        - $ref: '#/components/schemas/NonInventoryProductListRequest'
          required:
            - unitName
            - isMainProduct
        - type: object
          properties:
            convertRatio:
              type: number
              format: decimal
              description: อัตราส่วนระหว่างรายการสินค้าและรายการสินค้าที่มีหน่วยหลัก
          required:
            - convertRatio
    DataProductMasterResponse:
      type: object
      properties:
        id:
          type: integer
          description: เลข id Product master
        type:
          type: integer
          description: 'ประเภทสินค้า: 1 = บริการ / 3 = ไม่นับสต๊อก / 5 = นับสต๊อก'
          example: 1
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        code:
          type: string
          description: 'รหัสสินค้า <br> <ex>Example: P001</ex>'
          nullable: true
          example: 'P001'
        categoryId:
          type: integer
          description: id หมวดสินค้า
          nullable: true
          example: 123
        categoryName:
          type: string
          description: หมวดสินค้า
          nullable: true
          example: Category A
        sellSettings:
          description: ข้อมูลการขาย
          items:
            $ref: '#/components/schemas/TradeSettingsResponse'
        buySettings:
          description: ข้อมูลการซื้อ
          items:
            $ref: '#/components/schemas/TradeSettingsResponse'
        nonInventorySettings:
          description: ข้อมูลเกี่ยวกับสินค้าไม่นับสต๊อก
          items:
            $ref: '#/components/schemas/NonInventorySettingsResponse'
        inventorySettings:
          description: ข้อมูลเกี่ยวกับการตั้งต้นจำนวนสินค้า
          items:
            $ref: '#/components/schemas/InventorySettingsResponse'
        mainProductId:
          type: integer
          description: เลข id ของสินค้าหน่วยหลัก
          example: 12345
        mainUnitId:
          type: integer
          description: เลข id ของหน่วยหลักของสินค้า
          nullable: true
          example: 56789
        mainUnitName:
          type: string
          description: ชื่อหน่วยของหน่วยหลักของสินค้า
          nullable: true
          example: หน่วย
        productLists:
          type: array
          description: รายการสินค้า
          items:
            $ref: '#/components/schemas/ProductListResponse'
    TradeSettingsResponse:
      type: object
      properties:
        vatType:
          type: integer
          description: 'ภาษี: <br> 1 = ราคาขายรวมภาษี <br> 3 = ราคาขายไม่รวมภาษี
            <br> 5 = ราคาขายภาษี 0% <br> 7 = ราคาขายสินค้าได้รับการยกเว้นภาษี'
          default: 3
        description:
          type: string
          description: รายละเอียดสินค้า
          nullable: true
        chartOfAccountId:
          type: integer
          description: เลข id ของผังบัญชี
          nullable: true
        chartOfAccountCode:
          type: string
          description: รหัสของผังบัญชี
          nullable: true
        chartOfAccountName:
          type: string
          description: ชื่อของผังบัญชี
          nullable: true
    NonInventorySettingsResponse:
      type: object
      properties:
        productNonInventoryType:
          type: integer
          description: 'ประเภทของสินค้าไม่นับสต๊อก <br> 1 = สินค้าเพื่อขาย <br> 11 = อื่น ๆ'
          nullable: true
    InventorySettingsResponse:
      type: object
      properties:
        inventoryPublishedOn:
          type: string
          format: date
          description: 'วันที่ตั้งต้นสินค้า รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
          nullable: true
          example: '2021-01-01'
        averageSellPrice:
          type: number
          format: decimal
          description: ราคาขายเฉลี่ย
          nullable: true
        averageBuyPrice:
          type: number
          format: decimal
          description: ราคาซื้อเฉลี่ย
          nullable: true
        remainingStock:
          type: number
          format: decimal
          description: จำนวนคงคลัง
          nullable: true
        totalValueInHand:
          type: number
          format: decimal
          description: มูลค่ารวม
          nullable: true
        warehouseId:
          type: integer
          description: เลข id คลังสินค้า
          nullable: true
    ProductListResponse:
      type: object
      properties:
        id:
          type: integer
          description: เลข id ของรายการสินค้า
          example: 456
        unitId:
          type: integer
          description: เลข id ของหน่วยของรายการสินค้า
          nullable: true
          example: 789
        unitName:
          type: string
          description: ชื่อของหน่วยของรายการสินค้า
          nullable: true
          example: "ครั้ง"
        isMainProduct:
          type: boolean
          description: เครื่องหมายเพื่อระบุการเป็นรายการสินค้าที่มีหน่วยหลัก
          example: true
        sellPrice:
          type: number
          format: decimal
          description: ราคาขายรายการสินค้า
          nullable: true
          example: 9345.794393
        sellPriceWithVat:
          type: number
          format: decimal
          description: ราคาขายรวมภาษีของรายการสินค้า
          nullable: true
          example: 10000
        buyPrice:
          type: number
          format: decimal
          description: ราคาซื้อรายการสินค้า
          nullable: true
          example: 0.00000000
        buyPriceWithVat:
          type: number
          format: decimal
          description: ราคาซื้อรวมภาษีของรายการสินค้า
          nullable: true
          example: 0.00000000
        barcode:
          type: string
          description: บาร์โค้ดรายการสินค้า ไม่เกิน 15 ตัวอักษร
          nullable: true
          example: "SERVICE"
        convertRatio:
          type: number
          format: decimal
          description: อัตราส่วนระหว่างรายการสินค้าและรายการสินค้าที่มีหน่วยหลัก
          example: 1
        hasMovement:
          type: boolean
          description: เครื่องหมายเพื่อระบุความเคลื่อนไหวของรายการสินค้า
          example: false
    ProductMasterResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          items:
            $ref: '#/components/schemas/DataProductMasterResponse'
    ListOfProductMasterResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
          example: true
        message:
          type: string
          description: error message
          example: ""
        code:
          type: integer
          description: error code
          example: 0
        data:
          type: object
          properties:
            total:
              type: integer
              description: จำนวนสินค้าทั้งหมด
              example: 10
            currentPage:
              type: integer
              description: หน้าที่แสดงสินค้า
              example: 1
            list:
              type: array
              description: ข้อมูลสินค้า
              items:
                type: object
                properties:
                  id:
                    type: integer
                    example: 12345
                  type:
                    type: integer
                    example: 1
                  name:
                    type: string
                    example: "Product Master Service"
                  code:
                    type: string
                    example: ""
                  categoryId:
                    type: integer
                    example: 10
                  categoryName:
                    type: string
                    example: "Description Product Master Service"
                  sellSettings:
                    type: object
                    properties:
                      vatType:
                        type: integer
                        example: 1
                      description:
                        type: string
                        nullable: true
                        example: "Sell vat type settings description"
                  buySettings:
                    type: object
                    properties:
                      vatType:
                        type: integer
                        example: 7
                      description:
                        type: string
                        nullable: true
                        example: null
                  mainProductId:
                    type: integer
                    example: 456
                  mainUnitId:
                    type: integer
                    example: 789
                  mainUnitName:
                    type: string
                    example: "ครั้ง"
                  productLists:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProductListResponse'
    ProductType:
      oneOf:
        - $ref: '#/components/schemas/ProductService'
        - $ref: '#/components/schemas/ProductNonInventory'
        - $ref: '#/components/schemas/ProductInventory'
        - $ref: '#/components/schemas/ProductInventoryBalance'
    ProductService:
      title: ProductService
      type: object
      properties:
        productStructureType:
          type: string
          nullable: true
          description: สร้างสินค้าประเภท บริการ
        type:
          type: integer
          format: int64
          description: 'ประเภทสินค้า: <br>1 = บริการ <br> 3 = ไม่นับสต๊อก <br> 5 = นับสต๊อก'
          default: 1
        code:
          type: string
          description: 'รหัสสินค้า / SKU <br> <ex>Example: P001</ex>'
          example: P001
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        sellDescription:
          type: string
          description: รายละเอียดสินค้า ฝั่งขาย
        sellPrice:
          type: number
          format: decimal
          description: ราคาขายสินค้า
        sellVatType:
          type: integer
          format: int64
          description: 'ภาษีขาย: <br> 1 = ราคาขายรวมภาษี <br> 3 = ราคาขายไม่รวมภาษี <br> 5 = ราคาขายภาษี 0% <br> 7 = ราคาขายสินค้าได้รับการยกเว้นภาษี'
          default: 3
        unitName:
          type: string
          description: หน่วยสินค้า
        categoryName:
          type: string
          description: หมวดสินค้า
        barcode:
          type: string
          description: บาร์โค้ดสินค้า ไม่เกิน 15 ตัวอักษร
      required:
        - type
        - name
    ProductNonInventory:
      title: ProductNonInventory
      type: object
      properties:
        productStructureType:
          type: string
          nullable: true
          description: สร้างสินค้าประเภท ไม่นับสต๊อก
        type:
          type: integer
          format: int64
          description: 'ระเภทสินค้า: <br>1 = บริการ <br> 3 = ไม่นับสต๊อก <br> 5 = นับสต๊อก'
          default: 1
        code:
          type: string
          description: 'รหัสสินค้า / SKU <br> <ex>Example: P001</ex>'
          example: P001
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        sellDescription:
          type: string
          description: รายละเอียดสินค้า ฝั่งขาย
        sellPrice:
          type: number
          format: decimal
          description: ราคาขายสินค้า
        sellVatType:
          type: integer
          format: int64
          description: 'ภาษีขาย: <br> 1 = ราคาขายรวมภาษี <br> 3 = ราคาขายไม่รวมภาษี <br> 5 = ราคาขายภาษี 0% <br> 7 = ราคาขายสินค้าได้รับการยกเว้นภาษี'
          default: 3
        unitName:
          type: string
          description: หน่วยสินค้า
        categoryName:
          type: string
          description: หมวดสินค้า
        barcode:
          type: string
          description: บาร์โค้ดสินค้า ไม่เกิน 15 ตัวอักษร
        buyDescription:
          type: string
          description: รายละเอียดสินค้า ฝั่งซื้อ
        buyPrice:
          type: number
          format: decimal
          description: ราคาซื้อสินค้า
        buyVatType:
          type: integer
          format: int64
          description: 'ภาษีซื้อ: <br> 1 = ราคาซื้อรวมภาษี <br> 3 = ราคาซื้อไม่รวมภาษี <br> 5 = ราคาซื้อภาษี 0% <br> 7 = ราคาซื้อสินค้าได้รับการยกเว้นภาษี'
          default: 3
      required:
        - type
        - name
    ProductInventory:
      title: ProductInventory
      type: object
      properties:
        productStructureType:
          type: string
          nullable: true
          description: สร้างสินค้าประเภท นับสต๊อก
        type:
          type: integer
          format: int64
          description: 'ระเภทสินค้า: <br>1 = บริการ <br> 3 = ไม่นับสต๊อก <br> 5 = นับสต๊อก'
          default: 1
        code:
          type: string
          description: 'รหัสสินค้า / SKU <br> <ex>Example: P001</ex>'
          example: P001
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        sellDescription:
          type: string
          description: รายละเอียดสินค้า ฝั่งขาย
        sellPrice:
          type: number
          format: decimal
          description: ราคาขายสินค้า
        sellVatType:
          type: integer
          format: int64
          description: 'ภาษีขาย: <br> 1 = ราคาขายรวมภาษี <br> 3 = ราคาขายไม่รวมภาษี <br> 5 = ราคาขายภาษี 0% <br> 7 = ราคาขายสินค้าได้รับการยกเว้นภาษี'
          default: 3
        unitName:
          type: string
          description: หน่วยสินค้า
        categoryName:
          type: string
          description: หมวดสินค้า
        barcode:
          type: string
          description: บาร์โค้ดสินค้า ไม่เกิน 15 ตัวอักษร
        buyDescription:
          type: string
          description: รายละเอียดสินค้า ฝั่งซื้อ
        buyPrice:
          type: number
          format: decimal
          description: ราคาซื้อสินค้า
        buyVatType:
          type: integer
          format: int64
          description: 'ภาษีซื้อ: <br> 1 = ราคาซื้อรวมภาษี <br> 3 = ราคาซื้อไม่รวมภาษี <br> 5 = ราคาซื้อภาษี 0% <br> 7 = ราคาซื้อสินค้าได้รับการยกเว้นภาษี'
          default: 3
      required:
        - type
        - name
        - unitName
    ProductInventoryBalance:
      title: ProductInventoryBalance
      type: object
      properties:
        productStructureType:
          type: string
          nullable: true
          description: สร้างสินค้าประเภท นับสต๊อก พร้อมตั้งค่ายอดเริ่มต้น
        type:
          type: integer
          format: int64
          description: 'ประเภทสินค้า: <br>1 = บริการ <br> 3 = ไม่นับสต๊อก <br> 5 = นับสต๊อก'
          default: 1
        code:
          type: string
          description: 'รหัสสินค้า / SKU <br> <ex>Example: P001</ex>'
          example: P001
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        sellDescription:
          type: string
          description: รายละเอียดสินค้า ฝั่งขาย
        sellPrice:
          type: number
          format: decimal
          description: ราคาขายสินค้า
        sellVatType:
          type: integer
          format: int64
          description: 'ภาษีขาย: <br> 1 = ราคาขายรวมภาษี <br> 3 = ราคาขายไม่รวมภาษี <br> 5 = ราคาขายภาษี 0% <br> 7 = ราคาขายสินค้าได้รับการยกเว้นภาษี'
          default: 3
        unitName:
          type: string
          description: หน่วยสินค้า
        categoryName:
          type: string
          description: หมวดสินค้า
        barcode:
          type: string
          description: บาร์โค้ดสินค้า ไม่เกิน 15 ตัวอักษร
        buyDescription:
          type: string
          description: รายละเอียดสินค้า ฝั่งซื้อ
        buyPrice:
          type: number
          format: decimal
          description: ราคาซื้อสินค้า
        buyVatType:
          type: integer
          format: int64
          description: 'ภาษีซื้อ: <br> 1 = ราคาซื้อรวมภาษี <br> 3 = ราคาซื้อไม่รวมภาษี <br> 5 = ราคาซื้อภาษี 0% <br> 7 = ราคาซื้อสินค้าได้รับการยกเว้นภาษี'
          default: 3
        inventoryPublishedOn:
          type: string
          description: 'วันที่ตั้งต้นสินค้า รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
          default: '2021-01-01'
          example: '2021-01-01'
        inventoryQuantity:
          type: number
          format: decimal
          description: จำนวนยอดตั้งต้นสินค้า
          default: 0
        inventoryPrice:
          type: number
          format: decimal
          description: ต้นทุนสินค้าต่อหน่วย
          default: 0
      required:
        - type
        - name
        - unitName
        - inventoryPublishedOn
        - inventoryQuantity
        - inventoryPrice
    Product:
      type: object
      properties:
        id:
          type: string
          description: เลข id Product
        type:
          type: integer
          format: int64
          description: 'ประเภทสินค้า: 1 = บริการ / 3 = ไม่นับสต๊อก / 5 = นับสต๊อก'
          default: 1
        code:
          type: string
          description: 'รหัสสินค้า <br> <ex>Example: P001</ex>'
          example: P001
        name:
          type: string
          description: 'ชื่อสินค้า <br> <ex>Example: Product</ex>'
          example: Product
        sellDescription:
          type: string
          description: รายละเอียดสินค้า ฝั่งขาย
        sellPrice:
          type: number
          format: decimal
          description: ราคาขายสินค้า
        sellPriceWithVat:
          type: number
          format: decimal
          description: ราคาขายสินค้า รวมภาษี
        sellVatType:
          type: integer
          format: int64
          description: 'ภาษีขาย: <br> 1 = ราคาขายรวมภาษี <br> 3 = ราคาขายไม่รวมภาษี <br> 5 = ราคาขายภาษี 0% <br> 7 = ราคาขายสินค้าได้รับการยกเว้นภาษี'
          default: 3
        unitName:
          type: string
          description: หน่วยสินค้า
        categoryId:
          type: integer
          format: int64
          description: id หมวดสินค้า
        categoryName:
          type: string
          description: หมวดสินค้า
        barcode:
          type: string
          description: บาร์โค้ดสินค้า ไม่เกิน 15 ตัวอักษร
        buyDescription:
          type: string
          description: รายละเอียดสินค้า ฝั่งซื้อ
        buyPrice:
          type: number
          format: decimal
          description: ราคาซื้อสินค้า
        buyPriceWithVat:
          type: number
          format: decimal
          description: ราคาซื้อสินค้า รวมภาษี
        buyVatType:
          type: integer
          format: int64
          description: 'ภาษีซื้อ: <br> 1 = ราคาซื้อรวมภาษี <br> 3 = ราคาซื้อไม่รวมภาษี <br> 5 = ราคาซื้อภาษี 0% <br> 7 = ราคาซื้อสินค้าได้รับการยกเว้นภาษี'
          default: 3
        inventoryPublishedOn:
          type: string
          format: date
          description: 'วันที่ตั้งต้นสินค้า รูปแบบ yyyy-MM-dd <br> <ex>Example: 2021-01-01</ex>'
          example: '2021-01-01'
        inventoryQuantity:
          type: number
          format: decimal
          description: จำนวนยอดตั้งต้นสินค้า
        inventoryPrice:
          type: number
          format: decimal
          description: ต้นทุนสินค้าต่อหน่วย
          default: 0
        inventoryTotal:
          type: number
          format: decimal
          description: มูลค่ารวมยอดตั้งต้นสินค้า
          default: 0
        averageBuyPrice:
          type: number
          format: decimal
          description: ราคาสินค้าซื้อเฉลี่ย
        averageSellPrice:
          type: number
          format: decimal
          description: ราคาขายสินค้าเฉลี่ย
        remainingStock:
          type: number
          format: decimal
          description: จำนวนสินค้าคงเหลือในสต๊อก
        totalValueInHand:
          type: number
          format: decimal
          description: มูลค่าสินค้าคงเหลือในสต๊อก
        isMainProduct:
          type: boolean
          description: >
            ค่าแสดงว่า product list ดังกล่าวเป็นสินค้าหลักของสินค้านับสต็อกแบบแยกหน่วยหรือไม่ `true` สำหรับสินค้าหลัก `false` สำหรับหน่วยย่อย
            
            
            สำหรับสินค้าประเภทบริการ, ไม่นับสต็อกหรือนับสต็อกแบบหน่วยเดียว จะมีค่าเป็น `true` เสมอ

    ProductResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: object
          properties:
            total:
              type: integer
              description: จำนวนสินค้าทั้งหมด
            currentPage:
              type: integer
              description: หน้าที่แสดงรายการสินค้า
            list:
              type: array
              description: ข้อมูลรายการสินค้า
              items:
                $ref: '#/components/schemas/Product'
            isDB:
              type: boolean
              description: database
    Contact:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: เลข id Contact
        contactGroup:
          type: integer
          format: int64
          description: 'ประเภทผู้ติดต่อ: 1 = บุคคลธรรมดา / 3 = นิติบุคคล'
          default: 3
        contactType:
          type: integer
          format: int64
          description: 'ประเภท: 3 = ลูกค้า / 5 = ผู้จำหน่าย / 7 = ผู้จำหน่ายและลูกค้า'
          default: 3
        contactCode:
          type: integer
          format: int64
          description: 'รหัสผู้ติดต่อ ​<br><ex>Example: C0001</ex>'
          example: C0001
        contactName:
          type: string
          description: ชื่อผู้ธุรกิจ หรือ ชื่อลูกค้า หรือ ชื่อผู้จำหน่าย
        contactAddress:
          type: string
          description: ที่อยู่ผู้ติดต่อ
        contactZipCode:
          type: string
          description: 'รหัสไปรษณีย์ติดต่อ <ex>Example: 10140 </ex>'
        contactTaxId:
          type: string
          format: int64
          description: 'เลขประจำตัวผู้เสียภาษี 13 หลัก ​<br><ex>Example: 1234567890123</ex>'
          example: '1234567890123'
        contactBranchCode:
          type: string
          description: รหัสสาขา
        contactBranch:
          type: string
          default: สำนักงานใหญ่
          description: ชื่อสาขา
        contactPerson:
          type: string
          description: ชื่อผู้ติดต่อ
        contactEmail:
          type: string
          description: 'อีเมลผู้ติดต่อ <br> <ex>Example: contact@email.com</ex>'
          example: contact@email.com
        contactMobile:
          type: string
          description: 'เบอร์มือถือผู้ติดต่อ <br> <ex>Example: 099-999-9999</ex>'
          example: 099-999-9999
        contactBankId:
          type: integer
          format: int64
          description: รหัสธนาคาร <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)<br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)<br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank)<br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)<br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank)<br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)<br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya)<br> 10 = ธนาคารออมสิน - (Government Savings Bank)<br> 11 = ธนาคารธนชาต - (Thanachart Bank)<br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)<br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank)<br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)<br> 19 = ธนาคารทิสโก้ - (Tisco Bank)<br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives) <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand) <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank)<br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)<br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)<br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)<br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)<br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)<br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)<br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)<br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
          default: 0
        contactBankAccountNumber:
          type: integer
          format: int64
          description: 'เลขที่บัญชีธนาคาร <br> <ex>Example: 1111111111</ex>'
          example: '1111111111'
        contactBankAccountName:
          type: string
          description: 'ชื่อบัญชีธนาคาร <br> <ex>Example: บริษัท โฟลว์แอคเคาท์ จำกัด</ex>'
          example: บริษัท โฟลว์แอคเคาท์ จำกัด
        contactBankBranch:
          type: string
          description: 'สาขาธนาคาร <br> <ex>Example: บางรัก</ex>'
          example: บางรัก
        contactBankBranchCode:
          type: string
          description: 'รหัสสาขาธนาคาร <br> <ex>Example: 0001</ex>'
          example: '0001'
        contactBankAccountType:
          type: integer
          format: int64
          description: 'ประเภทบัญชีธนาคาร: <br> 1 = บัญชีออมทรัพย์ <br> 3 = บัญชีกระแสรายวัน'
          default: 1
          example: '1'
        contactCreditDays:
          type: integer
          format: int64
          description: 'เครดิต (วัน) <br> <ex>Example: 30</ex>'
          default: 0
        contactOffice:
          type: string
          description: 'เบอร์โทรศัพท์สำนักงาน <br> <ex>Example: 02-999-9999</ex>'
          example: 02-999-9999
        contactFax:
          type: string
          description: 'เบอร์โทรสาร <br> <ex>Example: 02-888-8888</ex>'
          example: 02-888-8888
        contactWebsite:
          type: string
          description: 'เว็บไซต์ ผู้ติดต่อ <br> <ex>Eample: www.flowaccount.com</ex>'
          example: www.flowaccount.com
        contactShippingAddress:
          type: string
          description: ที่อยู่สำหรับจัดส่ง
        contactNote:
          type: string
          description: โน๊ต
      required:
        - contactGroup
        - contactType
        - contactName
    ContactResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: object
          properties:
            total:
              type: integer
              description: จำนวนรายชื่อติดต่อทั้งหมด
            currentPage:
              type: integer
              description: หน้าที่แสดงรายชื่อผู้ติดต่อ
            list:
              type: array
              description: ข้อมูลรายชื่อผู้ติดต่อ
              items:
                $ref: '#/components/schemas/Contact'
            isDB:
              type: boolean
              description: database
    BankAccount:
      type: object
      properties:
        bankAccountNumber:
          type: integer
          format: int64
          description: 'เลขบัญชีธนาคาร ไม่น้อยกว่า 10 หลัก <ex>Example: 0048620000</ex>'
        bankAccountName:
          type: string
          description: ชื่อบัญชีธนาคาร
        bankAccountType:
          type: integer
          format: int64
          description: ประเภทบัญชีธนาคาร <br> 1 = บัญชีออมทรัพย์  <br> 3 = บัญชีกระรายวัน <br> 7  = บัญชีฝากประจำ
        bankBranch:
          type: string
          description: ชื่อสาขา
        bankId:
          type: integer
          format: int64
          description: เลข id ธนาคาร <br> 1 = ธนาคารกรุงเทพ - (Bangkok Bank)<br> 2 = ธนาคารกสิกรไทย - (Kasikorn Bank)<br> 3 = ธนาคารกรุงไทย - (Krungthai Bank)<br> 4 = ธนาคารทหารไทย - (TMB Bank)<br> 5 = ธนาคารไทยพาณิชย์ - (Siam Commercial Bank)<br> 6 = ธนาคารสแตนดาร์ดชาร์เตอร์ด - (StandardChartered Bank Thai)<br> 7 = ธนาคารซีไอเอ็มบี ไทย - (CIMB Thai Bank)<br> 8 = ธนาคารยูโอบี - (United Overseas Bank Thai)<br> 9 = ธนาคารกรุงศรีอยุธยา - (Bank of Ayudhya)<br> 10 = ธนาคารออมสิน - (Government Savings Bank)<br> 11 = ธนาคารธนชาต - (Thanachart Bank)<br> 12 = ธนาคารแลนด์ แอนด์ เฮ้าส์ - (Landand Houses Bank)<br> 16 = ธนาคารเกียรตินาคิน - (Kiatnakin Bank)<br> 18 = ธนาคารซิตี้แบงก์ - (Citi bank)<br> 19 = ธนาคารทิสโก้ - (Tisco Bank)<br> 20 = ธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร - (Bank For Agriculture And Agricultural Cooperatives) <br> 21 = ธนาคารเพื่อการส่งออกและนำเข้าแห่งประเทศไทย - (Export Import Bank Of Thailand) <br> 22 = ธนาคารอาคารสงเคราะห์ - (Government Housing Bank)<br> 23 = ธนาคารพัฒนาวิสาหกิจขนาดกลางและขนาดย่อมแห่งประเทศไทย - (SmallAnd Medium Enterprise Development Bank)<br> 24 = ธนาคารอิสลามแห่งประเทศไทย (Islamic Bank Of Thailand)<br> 25 = ธนาคารแห่งประเทศจีน (ไทย) - (Bank Of China)<br> 26 = ธนาคารไอซีบีซี (ไทย) - (Industrial And Commercial Bank Of China)<br> 27 = ธนาคารเมกะ สากลพาณิชย์ - (Mega International Commercial Bank)<br> 28 = ธนาคารซูมิโตโม มิตซุย แบงกิ้ง คอร์ปอเรชั่น - (Sumitomo Mitsui Banking Corporation)<br> 29 = ธนาคารมิซูโฮ จำกัด (กรุงเทพฯ) - (Mizuho Bank)<br> 30 = ธนาคารฮ่องกงและเซี่ยงไฮ้แบงกิ้งคอร์ปอเรชั่น - (The Hongkong and Shanghai Banking Corporation)<br> 31 = ธนาคารไทยเครดิต เพื่อรายย่อย - (ThaiCreditRetailBank) <br> 32 = ธนาคารดอยซ์แบงก์ - (Deutsche Bank) <br> 33 = ธนาคารอินเดียนโอเวอร์ซีส์ - (Indian Overseas Bank) <br> 34 = ธนาคารแห่งอเมริกา - (Bank of America)
      required:
        - bankId
        - bankAccountNumber
        - bankBranch
        - bankAccountName
        - bankAccountType
    BankAccountResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: object
          properties:
            bankAccountId:
              type: integer
              format: int64
              description: เลข id บัญชีธนาคาร
            bankAccountNumber:
              type: string
              description: 'เลขบัญชี <br> <ex>Example: 0048620000 </ex>'
            bankAccountName:
              type: string
              description: 'ชื่อบัญชี <br> <ex>Example: บัญชีใช้รับเงิน</ex>'
            bankAccountType:
              type: integer
              format: int64
              description: ประเภทบัญชีธนาคาร <br> 1 = บัญชีออมทรัพย์  <br> 3 = บัญชีกระรายวัน <br> 7  = บัญชีฝากประจำ
            bankBranch:
              type: string
              description: ชื่อสาขาธนาคาร
            bankId:
              type: integer
              format: int64
              description: เลข id ธนาคาร
            bankName:
              type: string
              description: ชื่อธนาคาร
    AllBankAccountResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: array
          description: บัญชีธนาคารบริษัทเราทั้งหมด
          items:
            type: object
            properties:
              bankAccountId:
                type: integer
                format: int64
                description: เลข id บัญชีธนาคาร
              bankAccountNumber:
                type: string
                description: 'เลขบัญชี <br> <ex>Example: 0048620000 </ex>'
              bankAccountName:
                type: string
                description: 'ชื่อบัญชี <br> <ex>Example: บัญชีใช้รับเงิน</ex>'
              bankAccountType:
                type: integer
                format: int64
                description: ประเภทบัญชีธนาคาร <br> 1 = บัญชีออมทรัพย์  <br> 3 = บัญชีกระรายวัน <br> 7  = บัญชีฝากประจำ
              bankBranch:
                type: string
                description: ชื่อสาขาธนาคาร
              bankId:
                type: integer
                format: int64
                description: เลข id ธนาคาร
              bankName:
                type: string
                description: ชื่อธนาคาร
    AllBankChequeResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: array
          description: บัญชีเช็คจ่ายของบริษัทเราทั้งหมด
          items:
            type: object
            properties:
              bankChequeId:
                type: integer
                format: int64
                description: เลข id บัญชีเช็คจ่าย
              bankAccountId:
                type: integer
                format: int64
                description: เลข id บัญชีธนาคาร
              bankAccountNumber:
                type: string
                description: 'เลขบัญชี <br> <ex>Example: 0048620000 </ex>'
              bankAccountName:
                type: string
                description: 'ชื่อบัญชี <br> <ex>Example: บัญชีใช้รับเงิน</ex>'
              bankAccountType:
                type: integer
                format: int64
                description: ประเภทบัญชีธนาคาร <br> 1 = บัญชีออมทรัพย์  <br> 3 = บัญชีกระรายวัน <br> 7  = บัญชีฝากประจำ
              bankId:
                type: integer
                format: int64
                description: เลข id ธนาคาร
              bankName:
                type: string
                description: ชื่อธนาคาร
    AllCreditCardResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: array
          description: บัตรเครดิตจ่ายของบริษัทเราทั้งหมด
          items:
            type: object
            properties:
              creditCardId:
                type: integer
                format: int64
                description: เลข id บัตรเครดิตจ่าย
              creditCardHolderName:
                type: string
                description: 'ชื่อผู้ถือบัตร <br> <ex>Example: Mr. Card </ex>'
              creditCardNumber:
                type: string
                description: 'เลขบัตรเครดิต 4 ตัวท้าย <br> <ex>Example: 1234</ex>'
              creditCardName:
                type: string
                description: 'ชื่อบัตรเครดิต <br> <ex>Example: บัญชีใช้รับเงิน</ex>'
              creditCardLimit:
                type: number
                format: decimal
                description: 'วงเงินบัตรเครดิต <br> <ex>Example: 100,000.00</ex>'
              bankId:
                type: integer
                format: int64
                description: เลข id ธนาคาร
              bankName:
                type: string
                description: ชื่อธนาคาร
    AllPettyCashResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: array
          description: บัญชีเงินสดย่อยของบริษัทเราทั้งหมด
          items:
            type: object
            properties:
              pettyCashId:
                type: integer
                format: int64
                description: เลข id บัญชีเงินสดย่อย
              pettyCashName:
                type: string
                description: ชื่อบัญชีเงินสดย่อย
              pettyCashFund:
                type: number
                format: decimal
                description: 'วงเงินสดย่อย <br> <ex>Example: 100,000.00</ex>'
              pettyCashHolder:
                type: string
                description: 'ชื่อผู้ถือบัญชีเงินสดย่อย <br> <ex>Example: นางสาวนักบัญชี </ex>'
              description:
                type: string
                description: 'รายละเอียดวงเงินสดย่อย <br> <ex>Example: ใช้สำหรับซื้ออุปกรณ์สำนักงาน</ex>'
    AllOtherChannelsResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
          example: ""
        code:
          type: integer
          description: error code
        data:
          type: array
          description: ช่องทางชำระอื่น ๆ ของบริษัทเราทั้งหมด
          items:
            type: object
            properties:
              otherChannelsId:
                type: string
                description: (to be changed to integer) <br> เลข id ช่องทางชำระอื่น ๆ
                example: "1234"
              otherChannelsName:
                type: string
                description: (EDC) ชื่อเครื่อง/เลขซีเรียล, <br>(POS) ผู้ให้บริการ/ชื่อเครื่อง, <br>(Payment Gateway) ชื่อผู้ให้บริการ,
                  <br>(Marketplace) ชื่อ Marketplace เช่น Lazada, Shopee
                example: "Name"
              otherChannelsType:
                type: string
                description: (to be changed to integer) <br> ประเภทช่องทางชำระอื่น ๆ <br> 1 = เครื่องบันทึกเงินสด (EDC)
                  <br> 3 = เครื่องรูดบัตรเครดิต (POS) <br> 5 = ช่องทางรับชำระออนไลน์ (Online Payment Gateway)
                  <br> 7 = ร้านค้าออนไลน์ (Online shop/E-commerce)
                example: "1"
    JournalEntryRequest:
      type: object
      properties:
        description:
          type: string
          description: Description of Journals
        documentDate:
          type: string
          description: Posted Date YYYY-MM-DD
          example: 2024-01-31
        documentType:
          type: number
          description: 51 = Journal Voucher
            <br> 53 = Purchase Voucher
            <br> 55 = Sales Voucher
            <br> 57 = Payment Voucher
            <br> 59 = Received Voucher
        remarks:
          type: string
          description: Remarks of Journals
        note:
          type: string
          description: Internal notes
        reference:
          type: string
          description: References of Journals
        contactId:
          type: number
          description: Customer Id
        contactName:
          type: string
          description: Customer name is required in all journals except Joutnal Voucher (JV)
        bookOfAccounts:
          type: array
          minItems: 2
          items:
            $ref: '#/components/schemas/BookOfAccountsRequest'
      required:
        - description
        - documentDate
        - documentType
        - contactName
        - bookOfAccounts
    BookOfAccountsRequest:
      type: object
      properties:
        debitCredit:
          type: number
          description: 1 = debit, 3 = credit
          enum:
            - 1
            - 3
        chartOfAccountId:
          type: number
          description: Id of account code
          example: 53139
        value:
          type: number
          format: decimal
          description: Amount of debit/credit
        description:
          type: string
          description: Description of debit/credit
      required:
        - debitCredit
        - chartOfAccountId
        - value
    DocumentList:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/JournalEntryResponse'
        status:
          type: boolean
        message:
          type: string
        code:
          type: number
    JournalEntryResponse:
      type: object
      properties:
        recordId:
          type: number
          description: Document Id
        companyId:
          type: number
          description: Id of company
        documentSerial:
          type: string
          description: Serial number of Document
        status:
          type: number
          description: 1 = draft, 5 = approve
        description:
          type: string
          description: Description of Journals
        documentDate:
          type: string
          description: Posted Date YYYY-MM-DD
          example: 2024-01-31
        createdOn:
          type: string
          description: Create Date YYYY-MM-DD
          example: 2023-11-08T10:49:00
        postedDate:
          type: string
          description: Posted Date YYYY-MM-DD
          example: 2024-01-31T00:00:00
        approvedOn:
          type: string
          description: Approved Date YYYY-MM-DD
          example: 2023-11-08T10:49:00
        documentType:
          type: number
          description: 51 = Journal Voucher, 53 = Purchase Voucher, 55 = Sales Voucher, 57 = Payment Voucher, 59 = Received Voucher
        debit:
          type: number
          format: decimal
          description: Total amount of debit
        credit:
          type: number
          format: decimal
          description: Total amount od credit
        remarks:
          type: string
          description: Remarks of Journals
        note:
          type: string
          description: Internal notes
        reference:
          type: string
          description: References of Journals
        contactId:
          type: number
          description: Customer Id
        contactName:
          type: string
          description: Customer name
        bookOfAccounts:
          type: array
          items:
            $ref: '#/components/schemas/BookOfAccountsResponse'
        isSystemDocument:
          type: boolean
          description: false for Manual JournalEntry
        isLockingPeriod:
          type: boolean
          description: false if not in or set Locking Period
        referenceDocuments:
          type: array
          items:
            $ref: '#/components/schemas/ReferenceDocumentForJournals'
    BookOfAccountsResponse:
      type: object
      properties:
        debitCredit:
          type: number
          description: 1 = debit, 3 = credit
          enum:
            - 1
            - 3
        chartOfAccountId:
          type: number
          description: Id of account code
          example: 2707445
        value:
          type: number
          format: decimal
          description: Amount of debit/credit
        rowNumber:
          type: number
          format: integer
          description: order of row
        description:
          type: string
          description: Description of debit/credit
        displayName:
          type: string
          description: Account code/Account name on list
          example: 11111 / เงินสดในมือ
    ReferenceDocumentForJournals:
      type: object
      properties:
        DocumentId:
          type: number
          description: Id of referenceDocument
        DocumentType:
          type: number
        DocumentSerial:
          type: number
          description: Serial number of referenceDocument
    CompanyInfo:
      type: object
      properties:
        companyType:
          type: string
          description: ประเภทธุรกิจ <br> 10 = บริษัท - จดภาษีมูลค่าเพิ่มแล้ว <br> 20 = บริษัท - ยังไม่เข้าระบบภาษีมูลค่าเพิ่ม <br> 30 = บุคคลธรรมดา/ฟรีแลนซ์ - ยังไม่เข้าระบบภาษีมูลค่าเพิ่ม <br> 40 = บุคคลธรรมดา/ฟรีแลนซ์ - จดภาษีมูลค่าเพิ่มแล้ว <br> 50 = ห้างหุ้นส่วนจำกัด - จดภาษีมูลค่าเพิ่มแล้ว <br> 60 = ห้างหุ้นส่วนจำกัด - ยังไม่เข้าระบบภาษีมูลค่าเพิ่ม
          default: 10
        compnayName:
          type: string
          description: ชื่อบริษัท
        companyNameEn:
          type: string
          description: ชื่อบริษัท ภาษาอังกฤษ
        companyAddress:
          type: string
          description: ที่อยู่บริษัท
        companyAddressEn:
          type: string
          description: ที่อยู่บริษัท ภาษาอังกฤษ
        companyZipCode:
          type: string
          description: 'รหัสไปรษณีย์ บริษัท <br><ex>Example: 10150</ex>'
        companyTaxId:
          type: string
          description: 'เลขประจำตัวผู้เสียภาษี บริษัท <br><ex>Example: 0105558096348</ex>'
        companyBranch:
          type: string
          description: 'ชื่อ และ รหัสสาขา <br><ex>Example: สำนักงานใหญ่</ex>'
          default: สำนักงานใหญ่
        companyBranchEn:
          type: string
          description: 'ชื่อ และ รหัสสาขา ภาษาอังกฤษ <br><ex>Example: Head Office</ex>'
        companyBranchCode:
          type: string
          description: 'รหัสสาขา <br><ex>Example: 00000</ex>'
        companyPhone:
          type: string
          description: 'เบอร์โทรสำนักงาน <br><ex>Example: 02-999-9999</ex>'
        companyMobile:
          type: string
          description: 'เบอร์โทรศัพท์มือถือ <br><ex>Example: 099-999-9999</ex>'
        companyFax:
          type: string
          description: 'เบอร์โทรสาร <br><ex>Example: 02-999-9999 ต่อ 1</ex>'
        companyWebsite:
          type: string
          description: 'เว็บไซต์ <br><ex>Example: www.flowaccount.com</ex>'
      required:
        - compnayName
    CompanyInfoResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: object
          description: ข้อมูลบริษัทเรา
          properties:
            companyId:
              type: integer
              format: int64
              description: รหัสบริษัท
              default: 0
            companyType:
              type: string
              description: ประเภทธุรกิจ <br> 10 = บริษัท - จดภาษีมูลค่าเพิ่มแล้ว <br> 20 = บริษัท - ยังไม่เข้าระบบภาษีมูลค่าเพิ่ม <br> 30 = บุคคลธรรมดา/ฟรีแลนซ์ - ยังไม่เข้าระบบภาษีมูลค่าเพิ่ม <br> 40 = บุคคลธรรมดา/ฟรีแลนซ์ - จดภาษีมูลค่าเพิ่มแล้ว <br> 50 = ห้างหุ้นส่วนจำกัด - จดภาษีมูลค่าเพิ่มแล้ว <br> 60 = ห้างหุ้นส่วนจำกัด - ยังไม่เข้าระบบภาษีมูลค่าเพิ่ม
              default: 10
            compnayName:
              type: string
              description: ชื่อบริษัท
            companyNameEn:
              type: string
              description: ชื่อบริษัท ภาษาอังกฤษ
            companyAddress:
              type: string
              description: ที่อยู่บริษัท
            companyAddressEn:
              type: string
              description: ที่อยู่บริษัท ภาษาอังกฤษ
            companyZipCode:
              type: string
              description: 'รหัสไปรษณีย์ บริษัท <br><ex>Example: 10150</ex>'
            companyTaxId:
              type: string
              description: 'เลขประจำตัวผู้เสียภาษี บริษัท <br><ex>Example: 0105558096348</ex>'
            companyBranch:
              type: string
              description: 'ชื่อ และ รหัสสาขา <br><ex>Example: สำนักงานใหญ่</ex>'
              default: สำนักงานใหญ่
            companyBranchEn:
              type: string
              description: 'ชื่อ และ รหัสสาขา ภาษาอังกฤษ <br><ex>Example: Head Office</ex>'
            companyBranchCode:
              type: string
              description: 'รหัสสาขา <br><ex>Example: 00000</ex>'
            companyPhone:
              type: string
              description: 'เบอร์โทรสำนักงาน <br><ex>Example: 02-999-9999</ex>'
            companyMobile:
              type: string
              description: 'เบอร์โทรศัพท์มือถือ <br><ex>Example: 099-999-9999</ex>'
            companyFax:
              type: string
              description: 'เบอร์โทรสาร <br><ex>Example: 02-999-9999 ต่อ 1</ex>'
            companyWebsite:
              type: string
              description: 'เว็บไซต์ <br><ex>Example: www.flowaccount.com</ex>'
    DocumentsRemarkResponse:
      type: object
      properties:
        status:
          type: boolean
          description: action success
        message:
          type: string
          description: error message
        code:
          type: integer
          description: error code
        data:
          type: object
          description: ข้อมูลตั้งค่าหมายเหตุเอกสารทั้งหมด
          properties:
            quotation:
              type: string
              description: หมายเหตุเอกสารใบเสนอราคา
            billingNote:
              type: string
              description: หมายเหตุเอกสารใบวางบิล
            invoice:
              type: string
              description: หมายเหตุเอกสารใบกำกับภาษี, ใบกำกับภาษี/ใบเสร็จรับเงิน
            receipt:
              type: string
              description: หมายเหตุเอกสารใบเสร็จรับเงิน
            creditNote:
              type: string
              description: หมายเหตุเอกสารใบลดหนี้
            debitNote:
              type: string
              description: หมายเหตุเอกสารใบเพิ่มหนี้
            cashInvoice:
              type: string
              description: หมายเหตุเอกสารใบกับภาษี / ใบเสร็จรับเงิน (ขายสด)
            purchaseOrder:
              type: string
              description: หมายเหตุเอกสารใบสั่งซื้อ
            purchase:
              type: string
              description: หมายเหตุเอกสารใบรับสินค้า
    Empty:
      type: object
      title: Empty Schema
