# Quotation Enquiry

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/quotation/enquiry:
    post:
      summary: Quotation Enquiry
      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: ''
          required: true
          example: <Your Subscription-key>
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                take:
                  type: integer
                  description: |
                    จำนวนรายการที่ต้องการแสดง
                skip:
                  type: integer
                  description: |
                    จำนวนรายการที่ต้องการข้าม
                  nullable: true
                quotationNo:
                  type: string
                  description: รหัสใบเสนอราคา
                  nullable: true
                quotationStatus:
                  type: integer
                  description: "<p>สถานะใบเสนอราคา<br> 1 = ร่าง<br> 2=\_ รออนุมัติ <br>3 = รอส่ง <br>4 = ส่งแล้ว <br> 5 = เสร็จสิ้น <br> 6 = ปฏิเสธ <br> 7 = ยกเลิก</p>"
                  nullable: true
                staffCode:
                  type: string
                  description: รหัสพนักงานขาย
                  nullable: true
                customerCode:
                  type: string
                  description: รหัสลูกค้า
                  nullable: true
                quotationDate:
                  type: string
                  description: 'วันที่สร้างใบเสนอราคา โดยมี Format : YYYY-MM-DD'
                  nullable: true
                createdByStaffCode:
                  type: string
                  description: รหัสพนักงานที่สร้างใบเสนอราคา
                  nullable: true
              x-apidog-orders:
                - take
                - skip
                - quotationNo
                - quotationStatus
                - staffCode
                - customerCode
                - quotationDate
                - createdByStaffCode
              required:
                - take
              x-apidog-ignore-properties: []
            example: "{\r\n    \"quotationDate\" : \"<datetime>\",//วันที่สร้างใบเสนอราคา  \r\n    \"staffCode\" : \"<string>\",//รหัสพนักงานขาย \r\n    \"quotationNo\" : \"<string>\",//รหัสใบเสนอราคา \r\n    \"customerCode\" : \"<string>\", ///รหัสลูกค้า \r\n    \"quotationStatus\" :2,//สถานะใบเสนอราคา <integer>\r\n    \"take\" : 5,//จำนวนรายการที่อยากแสดง  required **จำเป็นต้องใส่<decimal>\r\n    \"skip\" : 0, //จำนวนรายการที่อยากข้าม  <decimal>\r\n    \"createdByStaffCode\": \"<string>\" //รหัสพนักงานที่สร้างใบ\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
                    x-apidog-ignore-properties: []
                  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: หน่วยสินค้า
                                nullable: true
                              productDescription:
                                type: string
                                description: รายละเอียดสินค้า
                                nullable: true
                              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: integer
                                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
                              - totalPrice
                              - discountBasisType
                            x-apidog-ignore-properties: []
                          description: |
                            รายการสินค้า
                        currencyCode:
                          type: string
                          description: >-
                            สกุลเงิน เช่น "THB" , "USD" [ถ้าไม่ส่ง หรือ null
                            ระบบจะหยิบ System Currency ของ Company นั้นๆให้]
                            optional
                        discountName:
                          type: string
                          description: ชื่อส่วนลด
                          nullable: true
                        discountType:
                          type: boolean
                          description: >-
                            <p>ประเภทส่วนลด <br>True คือคิดเป็น %, <br>False
                            คิดเป็นบาท</p>
                          nullable: true
                        discountValue:
                          type: number
                          description: |
                            ส่วนลด
                          nullable: true
                        privateNote:
                          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: ยอดรวมสินค้าหลังหักส่วนลด
                          nullable: true
                        totalVat:
                          type: number
                          description: ยอดรวมภาษี
                        grandTotal:
                          type: number
                          description: ยอดรวมที่ต้องจ่าย
                        remark:
                          type: string
                          description: หมายเหตุใบเสนอราคา
                          nullable: true
                        headerTemplateId:
                          type: integer
                          description: หัวเอกสารในpdf
                          nullable: true
                        warehouseCode:
                          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
                        - currencyCode
                        - subTotal
                        - totalVat
                        - grandTotal
                      x-apidog-ignore-properties: []
                x-apidog-orders:
                  - status
                  - data
                required:
                  - status
                  - data
                x-apidog-ignore-properties: []
              examples:
                '1':
                  summary: OK (200)
                  value:
                    status:
                      code: '1000'
                      description: Success
                    data:
                      - quotationSubject: Bff test create quotation
                        quotationNo: DRAFT2212000100
                        quotationDate: 2022-12-16T00:00:00+0700
                        quotationValidUntil: 2023-12-16T00:00:00+0700
                        customerCode: daisy
                        recipientName: Mook
                        recipientAddress: Chanthaburi
                        quotationDetails:
                          - productCode: ROG001
                            productName: ROG Phone 6 Pro [Default]
                            price: 5000
                            qty: 6
                            productDescription: Good product
                            discountValue: 1
                            discountType: true
                            vatTaxValue: 3
                            whtTaxValue: 1
                            totalPrice: 29700
                            warehouseCode: WH001
                        currencyCode: THB
                        vatCalculation: true
                        discountName: just discount test
                        discountType: true
                        discountValue: 7
                        paymentTerm: 1 month test
                        remark: Remember this for test
                        privateNote: test 13dec2022
                        staffCode: Admin01
                        quotationStatus: 1
                        subTotal: 29700
                        subTotalWithDiscount: 27621
                        totalVat: 828.63
                        grandTotal: 28449.63
                        warehouseCode: WH001
                '2':
                  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.
                '3':
                  summary: Bad Request (400)
                  value:
                    status:
                      code: '4001'
                      description: Business error with 1 or more errors
                    data:
                      errors:
                        - subCode: E1101
                          description: Take is required
          headers: {}
          x-apidog-name: OK
        '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
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Unauthorized
        x-200:Bad Request:
          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
                    x-apidog-ignore-properties: []
                  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: คำอธิบายข้อความที่จะแสดง
                            metadata:
                              type: string
                              description: >-
                                เป็น metadata สำหรับแสดงผลของ Business นั้นๆ ไม่
                                Fix
                          x-apidog-orders:
                            - subCode
                            - description
                            - metadata
                          required:
                            - description
                          x-apidog-ignore-properties: []
                        description: >-
                          เป็นส่วนแสดงผล Error
                          ที่พบว่ามีจำนวนกี่ชุดก็ได้ไม่จำกัดเพื่อความสะดวกในการจัดการกับ
                          Error
                    x-apidog-orders:
                      - errors
                    required:
                      - errors
                    description: >-
                      ข้อมูลที่จะแสดง ไม่จำกัดรูปแบบว่าจะเป็นเช่นไร
                      ตอนเรียกออกมาสามารเป็น Array และ Object ได้
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - status
                  - data
                required:
                  - status
                  - data
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Bad Request
        x-200:User authentication required V2.:
          description: ''
          content:
            application/json:
              schema:
                title: ''
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Required%20authorization'
                  status:
                    $ref: '#/components/schemas/Response%20Error%20Msg%20'
                required:
                  - data
                  - status
                x-apidog-orders:
                  - data
                  - status
                x-apidog-ignore-properties: []
              example:
                data:
                  subCode: E9103
                  description: Authorization credentials required
                  metadata: {}
                status:
                  code: '4001'
                  description: Business error with 1 errors
          headers: {}
          x-apidog-name: User authentication required V2.
      security:
        - bearer: []
      x-apidog-folder: Venio/Quotation
      x-apidog-status: developing
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-3590357-run
components:
  schemas:
    'Response Error Msg ':
      type: object
      properties:
        code:
          type: string
          x-apidog-mock: '4001'
        description:
          type: string
          x-apidog-mock: Business error with 1 errors
      required:
        - code
        - description
      x-apidog-orders:
        - code
        - description
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    Required authorization:
      type: object
      properties:
        subCode:
          type: string
          x-apidog-mock: E9103
        description:
          type: string
          x-apidog-mock: Authorization credentials required
        metadata:
          type: object
          properties: {}
          x-apidog-orders: []
          x-apidog-ignore-properties: []
      required:
        - subCode
        - description
        - metadata
      x-apidog-orders:
        - subCode
        - description
        - metadata
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  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: []

```
