# Create Update Quotation

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/quotation:
    post:
      summary: Create Update Quotation
      deprecated: false
      description: เพิ่ม แก้ไขข้อมูลใบเสนอราคา ที่อยู่ในสถานะ ร่าง รออนุมัติ และรอส่ง
      tags:
        - Venio/Quotation
      parameters:
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Ocp-Apim-Subscription-Key
          in: header
          description: รหัส subscription key ลูกค้า
          required: true
          example: <Your subscription-key>
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                quotationSubject:
                  type: string
                  description: ชื่อหัวข้อใบเสนอราคา
                quotationDate:
                  type: string
                  description: 'วันที่สร้างใบเสนอราคา โดยมี Format : YYYY-MM-DD'
                quotationValidUntil:
                  type: string
                  description: 'วันที่สิ้นสุด โดยมี Format : YYYY-MM-DD'
                quotationStatus:
                  type: integer
                  description: "<p>สถานะใบเสนอราคา<br> 1 = ร่าง<br> 2=\_ รออนุมัติ <br>3 = รอส่ง <br>4 = ส่งแล้ว <br> 5 = เสร็จสิ้น <br> 6 = ปฏิเสธ <br> 7 = ยกเลิก</p>"
                customerCode:
                  type: string
                  description: รหัสลูกค้า
                staffCode:
                  type: string
                  description: รหัสพนักงานขาย
                referenceNo:
                  type: string
                  description: เลขที่อ้างอิ้ง
                  nullable: true
                vatCalculation:
                  type: boolean
                  description: การคำนวณภาษีมูลลค่าเพิ่ม
                quotationDetails:
                  type: array
                  items:
                    type: object
                    properties:
                      productCode:
                        type: string
                        description: รหัสสินค้า
                      productName:
                        type: string
                        description: ชื่อสินค้า
                        nullable: true
                      price:
                        type: number
                        description: ราคากำหนดต่อหน่วย
                        nullable: true
                      qty:
                        type: number
                        description: จำนวน จำเป็นต้องใส่ ห้ามใส่เกินจำนวนที่มีในstock
                      productUnitName:
                        type: string
                        description: หน่วยสินค้า
                        nullable: true
                      discountType:
                        type: boolean
                        description: >-
                          <p>ประเภทส่วนลด <br>True คือคิดเป็น %, <br>False
                          คิดเป็นบาท</p>
                        nullable: true
                      discountValue:
                        type: number
                        description: >-
                          ส่วนลดสินค้า (*ตัว Discount ต้องมีค่าไม่เกิน
                          ราคาของสินค้านั้น)
                          ถ้าการตั้งค่าชนิดส่วนลดของบริษัทเป็นต่อรายการ
                          จะเป็นส่วนลดของทั้งสินค้าชินนี้
                          แต่หากการตั้งค่าชนิดส่วนลดของบริษัทเป็นต่อหน่วย
                          จะเป็นส่วนลดของสินค้าต่อหน่วย
                        nullable: true
                      vatTaxValue:
                        type: number
                        description: ภาษี มูลลค่าเพิ่ม
                        nullable: true
                      whTaxValue:
                        type: number
                        description: ภาษี ณ ที่จ่าย
                        nullable: true
                      productDescription:
                        type: string
                        description: รายละเอียดสินค้า
                        nullable: true
                    x-apidog-orders:
                      - productCode
                      - productName
                      - price
                      - qty
                      - productUnitName
                      - productDescription
                      - discountType
                      - discountValue
                      - vatTaxValue
                      - whTaxValue
                    required:
                      - productCode
                      - qty
                  description: รายการสินค้า
                discountType:
                  type: boolean
                  description: >-
                    <p>ประเภทส่วนลด <br>True คือคิดเป็น %, <br>False
                    คิดเป็นบาท</p>
                  nullable: true
                discountValue:
                  type: number
                  description: ส่วนลด
                  nullable: true
                currencyCode:
                  type: string
                  description: >-
                    สกุลเงิน เช่น "THB" , "USD" [ถ้าไม่ส่ง หรือ null ระบบจะหยิบ
                    System Currency ของ Company นั้นๆให้] optional
                  nullable: true
                remark:
                  type: string
                  description: หมายเหตุใบเสนอราคา
                  nullable: true
                discountName:
                  type: string
                  description: ชื่อส่วนลด
                  nullable: true
                paymentTerm:
                  type: string
                  description: เงื่อนไขการชำระเงิน
                  nullable: true
                contactName:
                  type: string
                  description: ชื่อผู้ติดต่อ
                  nullable: true
                recipientName:
                  type: string
                  description: ชื่อผู้รับ
                  nullable: true
                recipientAddress:
                  type: string
                  description: ที่อยู่ผู้รับ
                  nullable: true
                headerTemplateId:
                  type: integer
                  description: หัวเอกสารในpdf
                  nullable: true
                quotationNo:
                  type: string
                  description: รหัสใบเสนอราคา ต้องใส่กรณีทำการ แก้ไขupdate
                  nullable: true
                customerAddressId:
                  type: number
                  description: ที่อยู่ลูกค้า
                  nullable: true
                warehouseCode:
                  type: string
                  description: รหัสคลังสินค้า
                  nullable: true
                privateNote:
                  type: string
                  description: รายละเอียดเพิ่มเติม
                  nullable: true
                quotationNote:
                  type: string
                  description: รายละเอียดเพิ่มเติม (ไปใช้ field privateNote แทน)
                  deprecated: true
                  nullable: true
              x-apidog-orders:
                - quotationSubject
                - quotationDate
                - quotationValidUntil
                - quotationStatus
                - customerCode
                - staffCode
                - quotationNo
                - referenceNo
                - vatCalculation
                - quotationDetails
                - discountType
                - discountValue
                - headerTemplateId
                - currencyCode
                - remark
                - discountName
                - paymentTerm
                - privateNote
                - quotationNote
                - contactName
                - recipientName
                - recipientAddress
                - customerAddressId
                - warehouseCode
              required:
                - quotationSubject
                - quotationDate
                - quotationValidUntil
                - quotationStatus
                - customerCode
                - staffCode
                - vatCalculation
                - quotationDetails
            example: "{\r\n    \"quotationSubject\": \"<string> \", //ชื่อหัวข้อใบเสนอราคา required **จำเป็นต้องใส่มา \r\n    \"ReferenceNo\": \"<string>\", //เลขอ้างอิง\r\n    \"quotationNo\": \"<string>\", //รหัสใบเสนอราคา  required กรณีแก้ไข ถ้าสร้างไม่ใส่ ต้องเป็นรหัสใบเสนอราคาที่อยู่ในบริษัท\r\n    \"quotationDate\": \"<datetime>\", //วันที่สร้างใบเสนอราคา  required **จำเป็นต้องใส่มา\r\n    \"quotationValidUntil\": \"<datetime>\", //วันที่สิ้นสุดใบเสนอราคา  required **จำเป็นต้องใส่มา\r\n    \"customerCode\": \"<string>\", //รหัสลูกค้า  required **จำเป็นต้องใส่มา\r\n    \"contactName\": \"<string>\", //ชื่อผู้ติดต่อ  optional\r\n    \"recipientName\": \"<string>\", //ชื่อผู้รับ  optional\r\n    \"recipientAddress\": \"<string>\", //ที่อยู่ผู้รับ  optional\r\n    \"quotationDetails\": [\r\n        //รายการสินค้า\r\n        {\r\n            \"productCode\": \"<string>\", //รหัสสินค้า  required **จำเป็นต้องใส่มา ต้องเป็นรหัสที่มีอยู่ในบริษัทและactive\r\n            \"productName\": \"<string>\", //ชื่อสินค้า  optional\r\n            \"price\": 0.0, //ราคาาำหนดต่อหน่วย  optional <decimal>\r\n            \"qty\": 0.0, //จำนวนสินค้า required **จำเป็นต้องใส่มา <decimal>\r\n            \"productUnitName\": \"<string>\", //หน่วยสินค้า  optional\r\n            \"productDescription\": \"<string>\", //รายละเอียดสินค้า  optional\r\n            \"discountValue\": 0.0, //ส่วนลดสินค้าถ้าหากประเภทสินค้าเป็น%คิดเป็น%  ถ้าไม่ใช่คิดเป็นบาท  optional ห้ามใส่เกิน100%หรือมากกว่ายอดรวมสินค้า <decimal>\r\n            \"vatTaxValue\": 0.0, //ภาษีมูลค่าเพิ่ม  required ห้ามใส่เกิน1000 <decimal>\r\n            \"discountType\": false, //ประเภทส่วนลด ถ้าtrueเป็น% ไม่ใช่เป็นบาท  optional <bool>\r\n            \"whtTaxValue\": 0.0 //ภาษี ณ ที่จ่าย ต้องเป็นภาษี ณ ที่จ่ายที่มีอยู่ในบริษัทและactiveอยู่ <decimal>\r\n        }\r\n    ],\r\n    \"currencyCode\": \"<string>\", // สกุลเงิน เช่น \"THB\" , \"USD\" [ถ้าไม่ส่ง หรือ null ระบบจะหยิบ System Currency ของ Company นั้นๆให้] optional\r\n    \"vatCalculation\": true, //การคำนวณภาษีมูลค่าเพิ่ม  required **จำเป็นต้องใส่มา <bool>\r\n    \"discountName\": \"<string>\", //ชื่อส่วนลด  optional\r\n    \"discountType\": false, //ประเภทส่วนลด ถ้าtrueเป็น% ไม่ใช่เป็นบาท  optional <bool>\r\n    \"discountValue\": 0.0, //ส่วนลดสินค้าถ้าหากประเภทสินค้าเป็น%คิดเป็น% ถ้าไม่ใช่คิดเป็นบาท  optional ห้ามใส่เกิน100%หรือมากกว่ายอดรวมสินค้า <decimal>\r\n    \"paymentTerm\": \"<string>\", //เงื่อนไขการชำระเงิน  optional\r\n    \"remark\": \"<string>\", //หมายเหตุใบเสนอราคา  optional\r\n    \"privateNote\": \"<string>\", //รายละเอียดเพิ่มเติม  optional\r\n    \"staffCode\": \"<string>\", //รหัสพนักงาน  required **จำเป็นต้องใส่มา ต้องเป็นรหัสที่มีอยู่ในบริษัทและactive\r\n    \"quotationStatus\": 1, //สถานะใบเสนอราคา required **จำเป็นต้องใส่มา สามารถสร้างสถานะเป็น 1 darf ใบร่าง, 2 waiting approve รอให้อนุมัติ, 3 pending sent รอส่ง\r\n    \"headerTemplate\": 1,\r\n    //หัวกระดาษในpdf <integer>\r\n    \"warehouseCode\": \"WH001\"\r\n}"
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                      description:
                        type: string
                        description: คำอธิบายข้อความที่จะแสดง
                    x-apidog-orders:
                      - code
                      - description
                    required:
                      - code
                      - description
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        quotationSubject:
                          type: string
                          description: |
                            ชื่อหัวข้อใบเสนอราคา
                        quotationDate:
                          type: string
                          description: 'วันที่สร้างใบเสนอราคา '
                        quotationValidUntil:
                          type: string
                          description: วันที่สิ้นสุด
                        quotationStatus:
                          type: integer
                          description: "<p>สถานะใบเสนอราคา<br> 1 = ร่าง<br> 2=\_ รออนุมัติ <br>3 = รอส่ง <br>4 = ส่งแล้ว <br> 5 = เสร็จสิ้น <br> 6 = ปฏิเสธ <br> 7 = ยกเลิก</p>"
                        staffCode:
                          type: string
                          description: รหัสพนักงาน
                        customerCode:
                          type: string
                          description: รหัสลูกค้า
                        vatCalculation:
                          type: boolean
                          description: การคำนวณภาษีมูลลค่าเพิ่ม
                        quotationDetails:
                          type: array
                          items:
                            type: object
                            properties:
                              productCode:
                                type: string
                                description: |
                                  รหัสสินค้า
                              productName:
                                type: string
                                description: ชื่อสินค้า
                              price:
                                type: number
                                description: ราคากำหนดต่อหน่วย
                              qty:
                                type: number
                                description: |
                                  จำนวน
                              productUnitName:
                                type: string
                                description: หน่วยสินค้า
                              productDescription:
                                type: string
                                description: รายละเอียดสินค้า
                              vatTaxValue:
                                type: number
                                description: ภาษี มูลลค่าเพิ่ม
                                nullable: true
                              whTaxValue:
                                type: number
                                description: ภาษี ณ ที่จ่าย
                                nullable: true
                              discountType:
                                type: boolean
                                description: >-
                                  <p>ประเภทส่วนลด <br>True คือคิดเป็น %,
                                  <br>False คิดเป็นบาท</p>
                                nullable: true
                              discountValue:
                                type: number
                                description: >
                                  ส่วนลด เมื่อ DiscountBasisType = 360002
                                  (ต่อหน่วย) จะเป็นส่วนลดต่อหน่วย, เมื่อ =
                                  360001 (ต่อรายการ) จะเป็นส่วนลดของทั้งบรรทัด
                                nullable: true
                              totalPrice:
                                type: number
                                description: ยอดรวมสินค้า
                              warehouseCode:
                                type: string
                                description: รหัสคลังสินค้า
                                nullable: true
                              discountBasisType:
                                type: number
                                enum:
                                  - 360001
                                  - 360002
                                x-apidog-enum:
                                  - value: 360001
                                    name: PerItem
                                    description: คิดส่วนลดแบบต่อรายการ/ทั้งบรรทัด
                                  - value: 360002
                                    name: PerUnit
                                    description: คิดส่วนลดแบบต่อหน่วย
                            x-apidog-orders:
                              - productCode
                              - productName
                              - price
                              - qty
                              - productUnitName
                              - productDescription
                              - vatTaxValue
                              - whTaxValue
                              - discountType
                              - discountValue
                              - totalPrice
                              - warehouseCode
                              - discountBasisType
                            required:
                              - productCode
                              - productName
                              - price
                              - qty
                              - productUnitName
                              - productDescription
                              - totalPrice
                              - discountBasisType
                          description: |
                            รายการสินค้า
                        discountName:
                          type: string
                          description: ชื่อส่วนลด
                          nullable: true
                        discountType:
                          type: boolean
                          description: >-
                            <p>ประเภทส่วนลด <br>True คือคิดเป็น %, <br>False
                            คิดเป็นบาท</p>
                          nullable: true
                        discountValue:
                          type: number
                          description: |
                            ส่วนลด
                          nullable: true
                        paymentTerm:
                          type: string
                          description: เงื่อนไขการชำระเงิน
                          nullable: true
                        contactName:
                          type: string
                          description: ชื่อผู้ติดต่อ
                          nullable: true
                        recipientName:
                          type: string
                          description: ชื่อผู้รับ
                          nullable: true
                        recipientAddress:
                          type: string
                          description: ที่อยู่
                          nullable: true
                        subTotal:
                          type: number
                          description: ยอดรวมสินค้า
                        subTotalWithDiscount:
                          type: number
                          description: ยอดรวมสินค้าหลังหักส่วนลด
                        totalVat:
                          type: number
                          description: ยอดรวมภาษี
                        grandTotal:
                          type: number
                          description: ยอดรวมที่ต้องจ่าย
                        remark:
                          type: string
                          description: หมายเหตุใบเสนอราคา
                          nullable: true
                        headerTemplateId:
                          type: integer
                          description: หัวเอกสารในpdf
                          nullable: true
                        currencyCode:
                          type: string
                          description: >-
                            สกุลเงิน เช่น "THB" , "USD" [ถ้าไม่ส่ง หรือ null
                            ระบบจะหยิบ System Currency ของ Company นั้นๆให้]
                            optional
                        warehouseCode:
                          type: string
                          description: รหัสคลังสินค้า
                          nullable: true
                        privateNote:
                          type: string
                          description: รายละเอียดเพิ่มเติม
                          nullable: true
                      x-apidog-orders:
                        - quotationSubject
                        - quotationDate
                        - quotationValidUntil
                        - quotationStatus
                        - staffCode
                        - customerCode
                        - vatCalculation
                        - quotationDetails
                        - currencyCode
                        - discountName
                        - discountType
                        - discountValue
                        - privateNote
                        - paymentTerm
                        - contactName
                        - recipientName
                        - recipientAddress
                        - subTotal
                        - subTotalWithDiscount
                        - totalVat
                        - grandTotal
                        - remark
                        - headerTemplateId
                        - warehouseCode
                      required:
                        - quotationSubject
                        - quotationDate
                        - quotationValidUntil
                        - quotationStatus
                        - staffCode
                        - customerCode
                        - vatCalculation
                        - quotationDetails
                        - subTotal
                        - subTotalWithDiscount
                        - totalVat
                        - grandTotal
                        - currencyCode
                x-apidog-orders:
                  - status
                  - data
                required:
                  - status
                  - data
              examples:
                '1':
                  summary: Created (200)
                  value:
                    status:
                      code: '1000'
                      description: Success
                    data:
                      - quotationSubject: string
                        quotationNo: string
                        quotationDate: 2022-12-16T00:00:00+0700
                        quotationValidUntil: 2023-12-16T00:00:00+0700
                        customerCode: string
                        contactName: string
                        recipientName: string
                        recipientAddress: string
                        quotationDetails:
                          - productCode: string
                            productName: string
                            price: 10
                            qty: 6
                            productUnitName: string
                            productDescription: string
                            discountValue: 1
                            vatTaxValue: 3
                            totalPrice: 5
                            warehouseCode: WH001
                        currencyCode: THB
                        vatCalculation: true
                        discountName: string
                        discountType: false
                        discountValue: 7
                        paymentTerm: string
                        remark: string
                        privateNote: string
                        staffCode: string
                        quotationStatus: 3
                        subTotal: 59
                        subTotalWithDiscount: 52
                        totalVat: 1.56
                        grandTotal: 53.56
                        warehouseCode: WH001
                '2':
                  summary: Updated (200)
                  value:
                    status:
                      code: '1000'
                      description: Success
                    data:
                      - quotationSubject: string
                        quotationNo: string
                        quotationDate: 2022-12-16T00:00:00+0700
                        quotationValidUntil: 2023-12-16T00:00:00+0700
                        customerCode: string
                        contactName: string
                        recipientName: string
                        recipientAddress: string
                        quotationDetails:
                          - productCode: string
                            productName: string
                            price: 10
                            qty: 6
                            productUnitName: string
                            productDescription: string
                            discountValue: 1
                            vatTaxValue: 3
                            totalPrice: 59
                        currencyCode: THB
                        vatCalculation: true
                        discountName: string
                        discountType: false
                        discountValue: 7
                        paymentTerm: string
                        remark: string
                        privateNote: string
                        staffCode: string
                        quotationStatus: 3
                        subTotal: 59
                        subTotalWithDiscount: 52
                        totalVat: 1.56
                        grandTotal: 53.56
                '3':
                  summary: Bad Request (400)
                  value:
                    status:
                      code: '4001'
                      description: Business error with 1 or more errors
                    data:
                      errors:
                        - subCode: E1101
                          description: The QuotationSubject field is required.
                        - subCode: E1102
                          description: Quotation RefereceNo is invalid
                        - subCode: E1101
                          description: The QuotationDate field is required.
                        - subCode: E1101
                          description: The QuotationStatus field is required.
                        - subCode: E1101
                          description: The StaffCode field is required
                        - subCode: E1101
                          description: The QuotationValidUntil field is required.
                        - subCode: E1101
                          description: The CustomerCode field is required.
                        - subCode: E1101
                          description: The VatCalculation field is required
                        - subCode: E1102
                          description: Can't set discount value more than totalprice
                        - subCode: E1102
                          description: Can't set discount value more than 100 percents
                        - description: Product Quantity must be set value
                        - subCode: E1102
                          description: Product is not valid
                        - description: Product is out of stock
                        - subCode: E1102
                          description: The QuotationStatus value is invalid.
                        - description: 3000.0000  Tax Value is invalid
                        - subCode: E1102
                          description: WhtTax doesn't exists.
                '4':
                  summary: Unauthorized (401)
                  value:
                    statusCode: 401
                    message: >-
                      Access denied due to invalid subscription key. Make sure
                      to provide a valid key for an active subscription.
          headers: {}
          x-apidog-name: Created
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                      description:
                        type: string
                        description: คำอธิบายข้อความที่จะแสดง
                    x-apidog-orders:
                      - code
                      - description
                    required:
                      - code
                      - description
                  data:
                    type: object
                    properties:
                      errors:
                        type: array
                        items:
                          type: object
                          properties:
                            subCode:
                              type: string
                              description: >-
                                เป็น Subcode
                                ที่ต้องการจะแสดงเพื่อมีความหมายสำหรับ Module
                                ของเจ้าของในการดู Error โดย subcode
                                จะเป็นตัวเดียวกับ business erroe code
                                หรือไม่ก็ได้ เพื่อความสะดวกในการแสดงผล
                            description:
                              type: string
                              description: คำอธิบายข้อความที่จะแสดง
                          x-apidog-orders:
                            - subCode
                            - description
                          required:
                            - description
                        description: >-
                          เป็นส่วนแสดงผล Error
                          ที่พบว่ามีจำนวนกี่ชุดก็ได้ไม่จำกัดเพื่อความสะดวกในการจัดการกับ
                          Error
                    x-apidog-orders:
                      - errors
                    required:
                      - errors
                    description: >-
                      ข้อมูลที่จะแสดง ไม่จำกัดรูปแบบว่าจะเป็นเช่นไร
                      ตอนเรียกออกมาสามารเป็น Array และ Object ได้
                x-apidog-orders:
                  - status
                  - data
                required:
                  - status
                  - data
          headers: {}
          x-apidog-name: Bad Request
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: |-
                      สถานะ code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  message:
                    type: string
                    description: คำบรรยาย error
                x-apidog-orders:
                  - statusCode
                  - message
                required:
                  - statusCode
                  - message
          headers: {}
          x-apidog-name: Unauthorized
        x-200:Updated:
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                      description:
                        type: string
                        description: คำอธิบายข้อความที่จะแสดง
                    x-apidog-orders:
                      - code
                      - description
                    required:
                      - code
                      - description
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        quotationSubject:
                          type: string
                          description: |
                            ชื่อหัวข้อใบเสนอราคา
                        quotationDate:
                          type: string
                          description: 'วันที่สร้างใบเสนอราคา '
                        quotationValidUntil:
                          type: string
                          description: วันที่สิ้นสุด
                        quotationStatus:
                          type: integer
                          description: "<p>สถานะใบเสนอราคา<br> 1 = ร่าง<br> 2=\_ รออนุมัติ <br>3 = รอส่ง <br>4 = ส่งแล้ว <br> 5 = เสร็จสิ้น <br> 6 = ปฏิเสธ <br> 7 = ยกเลิก</p>"
                        staffCode:
                          type: string
                          description: รหัสพนักงาน
                        customerCode:
                          type: string
                          description: รหัสลูกค้า
                        vatCalculation:
                          type: boolean
                          description: การคำนวณภาษีมูลลค่าเพิ่ม
                        quotationDetails:
                          type: array
                          items:
                            type: object
                            properties:
                              productCode:
                                type: string
                                description: |
                                  รหัสสินค้า
                              productName:
                                type: string
                                description: ชื่อสินค้า
                              price:
                                type: number
                                description: ราคากำหนดต่อหน่วย
                              qty:
                                type: number
                                description: |
                                  จำนวน
                              productUnitName:
                                type: string
                                description: หน่วยสินค้า
                              productDescription:
                                type: string
                                description: รายละเอียดสินค้า
                              vatTaxValue:
                                type: number
                                description: ภาษี มูลลค่าเพิ่ม
                                nullable: true
                              whTaxValue:
                                type: number
                                description: ภาษี ณ ที่จ่าย
                                nullable: true
                              discountType:
                                type: boolean
                                description: >-
                                  <p>ประเภทส่วนลด <br>True คือคิดเป็น %,
                                  <br>False คิดเป็นบาท</p>
                                nullable: true
                              discountValue:
                                type: number
                                description: |
                                  ส่วนลด
                                nullable: true
                              totalPrice:
                                type: number
                                description: ยอดรวมสินค้า
                            x-apidog-orders:
                              - productCode
                              - productName
                              - price
                              - qty
                              - productUnitName
                              - productDescription
                              - vatTaxValue
                              - whTaxValue
                              - discountType
                              - discountValue
                              - totalPrice
                            required:
                              - productCode
                              - productName
                              - price
                              - qty
                              - productUnitName
                              - productDescription
                              - totalPrice
                          description: |
                            รายการสินค้า
                        discountName:
                          type: string
                          description: ชื่อส่วนลด
                          nullable: true
                        discountType:
                          type: boolean
                          description: >-
                            <p>ประเภทส่วนลด <br>True คือคิดเป็น %, <br>False
                            คิดเป็นบาท</p>
                          nullable: true
                        discountValue:
                          type: number
                          description: |
                            ส่วนลด
                          nullable: true
                        quotationNote:
                          type: string
                          description: รายละเอียดเพิ่มเติม
                          nullable: true
                        paymentTerm:
                          type: string
                          description: เงื่อนไขการชำระเงิน
                          nullable: true
                        contactName:
                          type: string
                          description: ชื่อผู้ติดต่อ
                          nullable: true
                        recipientName:
                          type: string
                          description: ชื่อผู้รับ
                          nullable: true
                        recipientAddress:
                          type: string
                          description: ที่อยู่
                          nullable: true
                        subTotal:
                          type: number
                          description: ยอดรวมสินค้า
                        subTotalWithDiscount:
                          type: number
                          description: ยอดรวมสินค้าหลังหักส่วนลด
                        totalVat:
                          type: number
                          description: ยอดรวมภาษี
                        grandTotal:
                          type: number
                          description: ยอดรวมที่ต้องจ่าย
                        remark:
                          type: string
                          description: หมายเหตุใบเสนอราคา
                          nullable: true
                        headerTemplateId:
                          type: integer
                          description: หัวเอกสารในpdf
                          nullable: true
                        currencyCode:
                          type: string
                          description: >-
                            สกุลเงิน เช่น "THB" , "USD" [ถ้าไม่ส่ง หรือ null
                            ระบบจะหยิบ System Currency ของ Company นั้นๆให้]
                            optional
                      x-apidog-orders:
                        - quotationSubject
                        - quotationDate
                        - quotationValidUntil
                        - quotationStatus
                        - staffCode
                        - customerCode
                        - vatCalculation
                        - quotationDetails
                        - currencyCode
                        - discountName
                        - discountType
                        - discountValue
                        - quotationNote
                        - paymentTerm
                        - contactName
                        - recipientName
                        - recipientAddress
                        - subTotal
                        - subTotalWithDiscount
                        - totalVat
                        - grandTotal
                        - remark
                        - headerTemplateId
                      required:
                        - quotationSubject
                        - quotationDate
                        - quotationValidUntil
                        - quotationStatus
                        - staffCode
                        - customerCode
                        - vatCalculation
                        - quotationDetails
                        - subTotal
                        - subTotalWithDiscount
                        - totalVat
                        - grandTotal
                        - currencyCode
                x-apidog-orders:
                  - status
                  - data
                required:
                  - data
                  - status
          headers: {}
          x-apidog-name: Updated
      security:
        - bearer: []
      x-apidog-folder: Venio/Quotation
      x-apidog-status: developing
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-3590355-run
components:
  schemas: {}
  securitySchemes:
    bearerAuth:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: ใส่ JWT Token ในรูปแบบ Bearer {token}
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.gofive.co.th
    description: Production
security:
  - bearerAuth: []
    x-apidog:
      schemeGroups:
        - id: uyL_cJmK7q60QJZRTi5ot
          schemeIds:
            - bearerAuth
      required: true
      use:
        id: uyL_cJmK7q60QJZRTi5ot
      scopes:
        uyL_cJmK7q60QJZRTi5ot:
          bearerAuth: []

```
