# Create Deal

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/deals:
    post:
      summary: Create Deal
      deprecated: false
      description: เพิ่ม แก้ไขอัพเดท deal
      tags:
        - Venio/Deal
      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:
                customerCodes:
                  type: array
                  items:
                    type: string
                  description: รายการรหัสลูกค้า
                boardId:
                  type: integer
                  description: รหัสบอร์ด
                dealName:
                  type: string
                  description: ชื่อดีล
                dealValue:
                  type: integer
                  description: ค่า ดีล
                dealQuantity:
                  type: integer
                  description: ปริมาณดีล
                dealQuantityUnit:
                  type: string
                  description: หน่วยของปริมาณดีล
                dealInterests:
                  type: array
                  items:
                    type: integer
                  description: ชื่อหัวข้อความสนใจ
                dealLabels:
                  type: array
                  items:
                    type: integer
                  description: ชื่อป้ายกำกับ
                dealDate:
                  type: string
                  title: DateTimeString
                  description: เวลาขอเสนอ
                expectedCloseDate:
                  type: string
                  description: วันที่คาดว่าจะปิด
                note:
                  type: string
                  description: รายละเอียดเพิ่มเติม
                assignTo:
                  type: string
                  description: มอบหมายให้
                participantCodes:
                  type: array
                  items:
                    type: string
                  description: รายการรหัสผู้เขาร่วม
                dateFollowUp:
                  type: string
                  description: เวลาติดตาม
                  format: yyyy-MM-ddTHH:mm:ss
                followUpNotes:
                  type: string
                  description: บันทึกสำหรับการติดตาม
                remark:
                  type: string
                  description: บันทึกสำหรับการยกเลิกดีล Won / Missed ดีล
                dealStageId:
                  type: integer
                  description: รหัสสถานะของดีล
                  x-apidog-mock: '704'
                reasonCategoryId:
                  type: integer
                  description: ประเภทเหตุผลดีลที่ Missed
                markAllTaskAsDone:
                  type: boolean
                  description: ปรับให้ task ทั้งหมด Done
                cancleAllOrder:
                  type: boolean
                  description: ยกเลิก Saleorder , Quotation ทั้งหมด (กรณี Missed Deal)
              required:
                - customerCodes
                - boardId
                - dealName
                - dealValue
                - dealDate
                - expectedCloseDate
                - assignTo
              x-apidog-orders:
                - customerCodes
                - boardId
                - dealName
                - dealValue
                - dealQuantity
                - dealQuantityUnit
                - dealInterests
                - dealLabels
                - dealDate
                - expectedCloseDate
                - note
                - assignTo
                - participantCodes
                - dateFollowUp
                - followUpNotes
                - remark
                - dealStageId
                - reasonCategoryId
                - markAllTaskAsDone
                - cancleAllOrder
              x-apidog-ignore-properties: []
            example:
              customerCodes:
                - string
              boardId: 34628319
              dealName: dealName
              dealQuantity: 91493369
              dealQuantityUnit: unit
              dealValue: 10
              dealInterests:
                - 1001
              dealLabels:
                - 1002
              dealDate: 2023-02-07T16:51:40+0700
              expectedCloseDate: 2023-02-08T16:51:40+0700
              note: string
              assignTo: staff01
              participantCodes:
                - staff02
              dateFollowUp: 2023-02-08T16:51:40+0700
              followUpNotes: followUp
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                  httpStatusCode:
                    type: integer
                    description: |-
                      สถานะ code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  data:
                    type: object
                    properties:
                      value:
                        type: array
                        items:
                          type: object
                          properties:
                            dealsId:
                              type: integer
                              description: รหัสดีล
                            customerId:
                              type: integer
                              description: รหัสลูกค้า
                            dealNo:
                              type: string
                              description: หมายเลขดีล
                            dealsName:
                              type: string
                              description: ชื่อดีล
                            dealsValue:
                              type: number
                              description: ค่าดีล
                            statusId:
                              type: integer
                              description: รหัสสถานะ
                            dealStageId:
                              type: integer
                              description: รหัสขั้นตอน
                            dealsIndex:
                              type: integer
                              description: ลำดับดีล
                              nullable: true
                            dealsDate:
                              type: string
                              description: วันที่ดีล
                            expectedCloseDate:
                              type: string
                              description: วันที่คาดว่าจะปิด
                            probability:
                              type: integer
                              description: ความน่าจะเป็น
                            notes:
                              type: string
                              description: รายละเอียดเพิ่มเติม
                            isActive:
                              type: boolean
                              description: |-
                                ใช้งานอยู่หรือไหม
                                true = ใช้งาน
                                false = ไม่ได้ใช้งาน
                            boardId:
                              type: integer
                              description: รหัส board
                            dateCreated:
                              type: string
                              description: เวลาสร้าง
                            createByUserId:
                              type: string
                              description: รหัส userid ของผู้สร้าง
                            dateModified:
                              type: string
                              description: เวลาแก้ไข
                              nullable: true
                            modifiedByUserId:
                              type: string
                              description: รหัส userid ของผู้แก้ไข
                              nullable: true
                            measure:
                              type: integer
                              description: ค่าประมาณ
                              nullable: true
                            customer:
                              type: object
                              properties:
                                customerId:
                                  type: integer
                                  description: รหัส idลูกค้า
                                companyId:
                                  type: integer
                                  description: รหัสบริษัท
                                customerCode:
                                  type: string
                                  description: รหัสลูกค้า
                                customerName:
                                  type: string
                                  description: ชื่อลูกค้า
                                customerNameEN:
                                  type: string
                                  description: ชื่อลูกค้าภาษาอังกฤษ
                                type:
                                  type: integer
                                  description: |-
                                    ประเภทลูกค้า
                                    13001 = individual
                                    13002 = Business
                                customerType:
                                  type: integer
                                  description: |-
                                    ประเภท customerstage:
                                    Prospect=11200,
                                     Customer=11300,
                                     Lead=11100
                                branch:
                                  type: string
                                  description: สาขา
                                phone:
                                  type: string
                                  description: เบอร์โทรศัพท์
                                mobile:
                                  type: string
                                  description: เบอร์มือถือ
                                notes:
                                  type: string
                                  description: รายละเอียดเพิ่มเติม
                                isActive:
                                  type: boolean
                                  description: |-
                                    ใช้งานอยู่หรือไหม
                                    true= ใช้งาน
                                    false = ไม่ได้ใช้งาน
                                dateChangeToCustomer:
                                  type: string
                                  description: วันที่เปลี่ยนจาก Prospect เป็น Customer
                                createdByUserId:
                                  type: string
                                  description: รหัส  userid ของผู้ใส่
                                modifiedByUserId:
                                  type: string
                                  description: รหัส userid ผู้แก้ไข
                                dateModified:
                                  type: string
                                  description: เวลาแก้ไข
                                customerGroupId:
                                  type: integer
                                  description: รหัสกลุ่มลูกค้า
                                leadStatus:
                                  type: integer
                                  description: รหัสสถานะลูกค้า
                                hasPicture:
                                  type: boolean
                                  description: มีรูปหรือไหม
                                companyName:
                                  type: string
                                  description: ชื่อบริษัท
                                sourceOfLead:
                                  type: integer
                                  description: แหล่งที่มา
                                classificationId:
                                  type: integer
                                  description: ชื่อหมวดหมู่
                                customerStateId:
                                  type: integer
                                  description: รหัสสถานะของลูกค้า
                                hasOwner:
                                  type: boolean
                                  description: |-
                                    มีหัวหน้าหรือไม่
                                    true= มี owner
                                    false = ไม่มี
                                pictureUrl:
                                  type: string
                                  description: url รูปภาพ
                                addresses:
                                  type: array
                                  items:
                                    type: string
                                  description: ที่อยู่
                                customerInterests:
                                  type: array
                                  items:
                                    type: string
                                  description: สิ่งที่สนใจของลูกค้า
                              description: ลูกค้า
                              x-apidog-orders:
                                - customerId
                                - companyId
                                - customerCode
                                - customerName
                                - customerNameEN
                                - type
                                - customerType
                                - branch
                                - phone
                                - mobile
                                - notes
                                - isActive
                                - dateChangeToCustomer
                                - createdByUserId
                                - modifiedByUserId
                                - dateModified
                                - customerGroupId
                                - leadStatus
                                - hasPicture
                                - companyName
                                - sourceOfLead
                                - classificationId
                                - customerStateId
                                - hasOwner
                                - pictureUrl
                                - addresses
                                - customerInterests
                              required:
                                - customerId
                                - companyId
                                - customerCode
                                - customerName
                                - customerNameEN
                                - type
                                - customerType
                                - branch
                                - phone
                                - mobile
                                - notes
                                - isActive
                                - dateChangeToCustomer
                                - createdByUserId
                                - modifiedByUserId
                                - dateModified
                                - customerGroupId
                                - leadStatus
                                - hasPicture
                                - companyName
                                - sourceOfLead
                                - classificationId
                                - customerStateId
                                - hasOwner
                                - pictureUrl
                                - addresses
                                - customerInterests
                              x-apidog-ignore-properties: []
                              nullable: true
                            dealStage:
                              type: object
                              properties:
                                dealStageId:
                                  type: integer
                                  description: รหัสขั้นตอน
                                stageName:
                                  type: string
                                  description: ชื่อขั้นตอน
                                dateCreated:
                                  type: string
                                  description: เวลาสร้าง
                                createByUserId:
                                  type: string
                                  description: รหัส userid ของผู้สร้าง
                                dateModified:
                                  type: string
                                  description: เวลาแก้ไข
                                modifiedByUserId:
                                  type: string
                                  description: รหัสของผู้ที่แก้ไข
                                isActive:
                                  type: boolean
                                  description: ใช้งานอยู่หรือไหม
                                companyId:
                                  type: integer
                                  description: รหัสบริษัท
                                seq:
                                  type: integer
                                  description: ลำดับ
                                boardId:
                                  type: string
                                  description: รหัส board
                              description: รายละเอียดขั้นตอน
                              x-apidog-orders:
                                - dealStageId
                                - stageName
                                - dateCreated
                                - createByUserId
                                - dateModified
                                - modifiedByUserId
                                - isActive
                                - companyId
                                - seq
                                - boardId
                              required:
                                - dealStageId
                                - stageName
                                - dateCreated
                                - createByUserId
                                - dateModified
                                - modifiedByUserId
                                - isActive
                                - companyId
                                - seq
                                - boardId
                              x-apidog-ignore-properties: []
                              nullable: true
                            dealsInterests:
                              type: array
                              items:
                                type: object
                                properties:
                                  dealsId:
                                    type: integer
                                    description: รหัสข้อเสนอ
                                  topicId:
                                    type: integer
                                    description: รหัสหัวข้อ
                                  isActive:
                                    type: boolean
                                    description: ใช้งานอยู่หรือไม่
                                x-apidog-orders:
                                  - dealsId
                                  - topicId
                                  - isActive
                                required:
                                  - dealsId
                                  - topicId
                                  - isActive
                                x-apidog-ignore-properties: []
                              description: รายการ deal ที่สนใจ
                              nullable: true
                            dealsLabels:
                              type: array
                              items:
                                type: object
                                properties:
                                  dealsId:
                                    type: integer
                                    description: รหัส deal
                                  dealLabelId:
                                    type: integer
                                    description: รหัสปายดีล
                                  isActive:
                                    type: boolean
                                    description: |-
                                      ใช้งานอยู่หรือป่าว
                                      true = ใช้งาน
                                      false = ไม่ได้ใช้งาน
                                    nullable: true
                                x-apidog-orders:
                                  - dealsId
                                  - dealLabelId
                                  - isActive
                                required:
                                  - dealsId
                                  - dealLabelId
                                x-apidog-ignore-properties: []
                              description: รายการป้ายของ deal
                              nullable: true
                            isAction:
                              type: boolean
                              description: |-
                                มี action หรือไม่
                                true = มี action
                                false = ไม่มี action
                              nullable: true
                            isEdit:
                              type: boolean
                              description: |-
                                สามารถแก้ไขได้ไหม
                                true = แก้ได้
                                false = ไม่สามารถแก้ได้
                              nullable: true
                            isDelete:
                              type: boolean
                              description: สามารถลบได้ไหม
                              nullable: true
                            statusName:
                              type: string
                              description: ชื่อสถานะ
                              nullable: true
                            user:
                              type: object
                              properties:
                                userId:
                                  type: string
                                  description: รหัสผู้ใช้งาน
                                username:
                                  type: string
                                  description: ชื่อผู้ใช้งาน
                                companyId:
                                  type: integer
                                  description: รหัสบริษัท
                                companyName:
                                  type: string
                                  description: ชื่อบริษัท
                                teamId:
                                  type: integer
                                  description: รหัสทีม
                                teamName:
                                  type: string
                                  description: ชื่อทีม
                                staffCode:
                                  type: string
                                  description: รหัสพนักงาน
                                title:
                                  type: string
                                  description: หัวข้อ
                                firstname:
                                  type: string
                                  description: ชื่อต้น
                                lastname:
                                  type: string
                                  description: นามสกุล
                                fullname:
                                  type: string
                                  description: ชื่อเต็ม
                                nickname:
                                  type: string
                                  description: ชื่อเล่น
                                position:
                                  type: string
                                  description: ตำแหน่ง
                                email:
                                  type: string
                                  description: email
                                phoneNumber:
                                  type: string
                                  description: หมายเลขโทรศัพท์
                                orgString:
                                  type: string
                                  description: โครงสร้างตามสายงาน
                                orgLevel:
                                  type: integer
                                  description: ระดับองค์กร
                                latitude:
                                  type: number
                                  description: ละติจูด
                                longitude:
                                  type: number
                                  description: ลองจิจูด
                                location:
                                  type: string
                                  description: ที่ตั้ง
                                locationName:
                                  type: string
                                  description: ชื่อที่ตั้ง
                                isActive:
                                  type: boolean
                                  description: ใช้งานอยู่หรือไม่
                                createdByUserId:
                                  type: string
                                  description: รหัสผู้สร้าง
                                hasPicture:
                                  type: boolean
                                  description: มีรูปหรือไม่
                                dateCreated:
                                  type: string
                                  description: เวลาสร้าง
                                dateModified:
                                  type: string
                                  description: เวลาแก้ไข
                                role:
                                  type: string
                                  description: หน้าที
                                roleId:
                                  type: string
                                  description: รหัสหน้าที
                                level:
                                  type: integer
                                  description: ระดับ
                                  nullable: true
                                siteId:
                                  type: integer
                                  description: รหัสงาน
                                  nullable: true
                                isAgreementPDPA:
                                  type: integer
                                  description: เป็นข้อตกลง PDPA
                                dateAgreementPDPA:
                                  type: string
                                  description: เวลาตกลง PDPA
                                  nullable: true
                                emailSubscription:
                                  type: integer
                                  description: email สมัครสมาชิก
                                identityUserId:
                                  type: string
                                  description: รหัสยืนยันตัวตน
                                uniqueName:
                                  type: string
                                  description: ชื่อเฉพาะ
                                inAppSubscription:
                                  type: integer
                                  description: สมัครสมาชิกในแอพ
                                userType:
                                  type: integer
                                  description: ประเภทผู้ใช้
                              description: รายละเอียดผู้ใช้
                              x-apidog-orders:
                                - userId
                                - username
                                - companyId
                                - companyName
                                - teamId
                                - teamName
                                - staffCode
                                - title
                                - firstname
                                - lastname
                                - fullname
                                - nickname
                                - position
                                - email
                                - phoneNumber
                                - orgString
                                - orgLevel
                                - latitude
                                - longitude
                                - location
                                - locationName
                                - isActive
                                - createdByUserId
                                - hasPicture
                                - dateCreated
                                - dateModified
                                - role
                                - roleId
                                - level
                                - siteId
                                - isAgreementPDPA
                                - dateAgreementPDPA
                                - emailSubscription
                                - identityUserId
                                - uniqueName
                                - inAppSubscription
                                - userType
                              required:
                                - userId
                                - username
                                - companyId
                                - companyName
                                - teamId
                                - teamName
                                - staffCode
                                - title
                                - firstname
                                - lastname
                                - fullname
                                - nickname
                                - position
                                - email
                                - phoneNumber
                                - orgString
                                - orgLevel
                                - latitude
                                - longitude
                                - location
                                - locationName
                                - isActive
                                - createdByUserId
                                - hasPicture
                                - dateCreated
                                - dateModified
                                - role
                                - roleId
                                - isAgreementPDPA
                                - emailSubscription
                                - identityUserId
                                - uniqueName
                                - inAppSubscription
                                - userType
                              x-apidog-ignore-properties: []
                              nullable: true
                            dealSummary:
                              type: object
                              properties:
                                probability:
                                  type: string
                                  description: ความน่าจะเป็น
                                dealValue:
                                  type: string
                                  description: ค่าของดีล
                                expectedCloteDate:
                                  type: string
                                  description: วันที่คาดว่าจะปิด
                              description: ข้อมูลดีลโดยสรุป
                              x-apidog-orders:
                                - probability
                                - dealValue
                                - expectedCloteDate
                              required:
                                - probability
                                - dealValue
                                - expectedCloteDate
                              x-apidog-ignore-properties: []
                              nullable: true
                            measureUnit:
                              type: object
                              properties:
                                unitId:
                                  type: integer
                                  description: รหัสของหน่วย
                                name:
                                  type: string
                                  description: ชื่อของหน่วย
                                companyId:
                                  type: integer
                                  description: รหัสบริษัท
                                isActive:
                                  type: boolean
                                  description: |-
                                    ใช้งานอยู่หรือไม่
                                    true = ใช้งานอยู่
                                    false = ไม่ได้ใช้งานอยู่
                                createdByUserId:
                                  type: string
                                  description: รหัสของผู้สร้าง
                                dateCreated:
                                  type: string
                                  description: เวลาที่สร้าง
                                modifiedByUserId:
                                  type: string
                                  description: รหัสผู้ที่แก้ไข
                                dateModified:
                                  type: string
                                  description: เวลาที่แก้ไข
                              description: หน่วยการประมาณ
                              x-apidog-orders:
                                - unitId
                                - name
                                - companyId
                                - isActive
                                - createdByUserId
                                - dateCreated
                                - modifiedByUserId
                                - dateModified
                              required:
                                - unitId
                                - name
                                - companyId
                                - isActive
                                - createdByUserId
                                - dateCreated
                                - modifiedByUserId
                                - dateModified
                              x-apidog-ignore-properties: []
                              nullable: true
                            currentStage:
                              type: object
                              properties:
                                dealStageId:
                                  type: integer
                                  description: 'รหัสขั้นตอน '
                                stageName:
                                  type: string
                                  description: ชื่อขั้นตอน
                                dateChangeStage:
                                  type: string
                                  description: เวลาเปลี่ยนขั้นตอน
                              description: รายการ stage ปัจจุบัน
                              x-apidog-orders:
                                - dealStageId
                                - stageName
                                - dateChangeStage
                              required:
                                - dealStageId
                                - stageName
                                - dateChangeStage
                              x-apidog-ignore-properties: []
                              nullable: true
                            userId:
                              type: array
                              items:
                                type: string
                              description: รายการรหัสผู้ใช้
                              nullable: true
                            dateFollowUp:
                              type: string
                              description: เวลาติดตาม
                              nullable: true
                            customerIds:
                              type: array
                              items:
                                type: integer
                              description: รายการรหัสลูกค้า
                              nullable: true
                            participantUserIds:
                              type: array
                              items:
                                type: string
                              description: รายการรหัสผู้เข้าใช้งาน
                          x-apidog-orders:
                            - dealsId
                            - customerId
                            - dealNo
                            - dealsName
                            - dealsValue
                            - statusId
                            - dealStageId
                            - dealsIndex
                            - dealsDate
                            - expectedCloseDate
                            - probability
                            - notes
                            - isActive
                            - boardId
                            - dateCreated
                            - createByUserId
                            - dateModified
                            - modifiedByUserId
                            - measure
                            - customer
                            - dealStage
                            - dealsInterests
                            - dealsLabels
                            - isAction
                            - isEdit
                            - isDelete
                            - statusName
                            - user
                            - dealSummary
                            - measureUnit
                            - currentStage
                            - userId
                            - dateFollowUp
                            - customerIds
                            - participantUserIds
                          required:
                            - dealsId
                            - customerId
                            - dealNo
                            - dealsName
                            - dealsValue
                            - statusId
                            - dealStageId
                            - dealsDate
                            - expectedCloseDate
                            - probability
                            - notes
                            - isActive
                            - boardId
                            - dateCreated
                            - createByUserId
                            - participantUserIds
                          x-apidog-ignore-properties: []
                      statusCode:
                        type: integer
                        description: |-
                          สถานะ code ของ httpเช่น
                          200 Ok
                          201 Created
                          400 BadRequest
                          401 Unauthorized
                          404 Record not found
                          500 Internal Server Error
                    x-apidog-orders:
                      - value
                      - statusCode
                    required:
                      - value
                      - statusCode
                    x-apidog-ignore-properties: []
                  attachments:
                    type: 'null'
                  customerCodes:
                    type: array
                    items:
                      type: string
                  dealName:
                    type: string
                  assignTo:
                    type: string
                  dealValue:
                    type: integer
                  dealQuantity:
                    type: integer
                  dealQuantityUnit:
                    type: string
                  dealDate:
                    type: string
                  expectedCloseDate:
                    type: string
                  probability:
                    type: integer
                  notes:
                    type: 'null'
                  dealStageId:
                    type: integer
                    x-apidog-mock: '704'
                  followUpNotes:
                    type: string
                required:
                  - statusCode
                  - httpStatusCode
                  - data
                  - attachments
                  - customerCodes
                  - dealName
                  - assignTo
                  - dealValue
                  - dealDate
                  - expectedCloseDate
                  - probability
                x-apidog-orders:
                  - statusCode
                  - httpStatusCode
                  - data
                  - attachments
                  - customerCodes
                  - dealName
                  - assignTo
                  - dealValue
                  - dealQuantity
                  - dealQuantityUnit
                  - dealDate
                  - expectedCloseDate
                  - probability
                  - notes
                  - dealStageId
                  - followUpNotes
                x-apidog-ignore-properties: []
              example:
                data:
                  value:
                    - dealsId: 1
                      customerId: 1
                      dealNo: string
                      dealsName: string
                      dealsValue: 0
                      statusId: 702
                      dealStageId: 0
                      dealsDate: string
                      expectedCloseDate: 2023-02-24T00:00:00+0700
                      probability: 0
                      notes: string
                      isActive: true
                      boardId: 1
                      dateCreated: 2023-01-26T10:06:27+0700
                      createByUserId: string
                      dealsInterests:
                        - dealsId: 1
                          topicId: 1
                          isActive: true
                      dealsLabels:
                        - dealsId: 1
                          dealLabelId: 1
                      dateFollowUp: 2023-02-12T00:00:00+0700
                      userId:
                        - string
                      participantUserIds: []
                  statusCode: 200
                statusCode: 1000
                httpStatusCode: 200
          headers: {}
          x-apidog-name: OK
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    properties:
                      item:
                        type: string
                        description: ชื่อfieldเปลี่ยนตามerrorที่พบเจอและคำบรรยาย
                        nullable: true
                    description: รายการ error ที่เกิดขึ้น
                    x-apidog-orders:
                      - item
                    x-apidog-ignore-properties: []
                  type:
                    type: string
                    description: รายละเอียดประเภท ของ httpstatuscodeที่เจอ error
                  title:
                    type: string
                    description: คำบรรย้าย error
                  status:
                    type: integer
                    description: |-
                      สถานะ code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  extensions:
                    type: object
                    properties:
                      traceId:
                        type: string
                        description: รหัส traceId
                        nullable: true
                    x-apidog-orders:
                      - traceId
                    description: รายละเอียด extensions
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - errors
                  - type
                  - title
                  - status
                  - extensions
                required:
                  - errors
                  - type
                  - title
                  - status
                  - extensions
                x-apidog-ignore-properties: []
              example:
                errors:
                  assignTo:
                    - The AssignTo field is required.
                type: https://tools.ietf.org/html/rfc7231#section-6.5.1
                title: One or more validation errors occurred.
                status: 400
                extensions:
                  traceId: 00-c13cd358b0045716bb1322e1626ec8b8-d253b69dba823451-00
          headers: {}
          x-apidog-name: Field Required
        '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: []
              example:
                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: Unauthorized
        '403':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                  httpStatusCode:
                    type: integer
                    description: |-
                      สถานะ  code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  errorMessage:
                    type: string
                    description: คำอธิบายเกี่ยวกับ error
                  hasError:
                    type: boolean
                    description: |-
                      มี error ไหม
                      true = มี
                      false = ไม่มี
                  data:
                    type: object
                    properties:
                      authenticationSchemes:
                        type: array
                        items:
                          type: string
                        description: ค่า Enum ของ authenticationSchemes
                    x-apidog-orders:
                      - authenticationSchemes
                    required:
                      - authenticationSchemes
                    description: |-
                      ข้อมูลที่จะแสดง ไม่จำกัดรูปแบบว่าจะเป็นเช่นไร 
                      ตอนเรียกออกมาสามารเป็น Array และ Object ได้
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - statusCode
                  - httpStatusCode
                  - errorMessage
                  - hasError
                  - data
                description: ' กรณีที่คนที่ดูไม่มี permission view data '
                required:
                  - statusCode
                  - httpStatusCode
                  - errorMessage
                  - hasError
                  - data
                x-apidog-ignore-properties: []
              example:
                data:
                  authenticationSchemes: []
                hasError: true
                errorMessage: Invalid access rights
                statusCode: 9503
                httpStatusCode: 403
          headers: {}
          x-apidog-name: Forbidden
        '500':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  hasError:
                    type: boolean
                    description: |-
                      มี error ไม่
                      true = มี
                      false = ไม่มี
                  errorMessage:
                    type: string
                    description: คำบรรยายerror
                  statusCode:
                    type: integer
                    description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                  httpStatusCode:
                    type: integer
                    description: |-
                      สถานะ code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  data:
                    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
                    x-apidog-orders:
                      - statusCode
                    required:
                      - statusCode
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - hasError
                  - errorMessage
                  - statusCode
                  - httpStatusCode
                  - data
                required:
                  - hasError
                  - errorMessage
                  - statusCode
                  - httpStatusCode
                  - data
                x-apidog-ignore-properties: []
              example:
                data:
                  statusCode: 400
                hasError: true
                errorMessage: Internal Server Error
                statusCode: 9999
                httpStatusCode: 500
          headers: {}
          x-apidog-name: Server Error
        x-200:Bad Request:
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                  httpStatusCode:
                    type: integer
                    description: |-
                      สถานะ  code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  errorMessage:
                    type: string
                    description: คำอธิบายเกี่ยวกับ error
                  hasError:
                    type: boolean
                    description: |-
                      มี error ไหม
                      true = มี
                      false = ไม่มี
                  data:
                    type: object
                    properties:
                      value:
                        type: string
                        description: valueที่พบerror
                      statusCode:
                        type: integer
                        description: |-
                          สถานะ  code ของ httpเช่น
                          200 Ok
                          201 Created
                          400 BadRequest
                          401 Unauthorized
                          404 Record not found
                          500 Internal Server Error
                    x-apidog-orders:
                      - value
                      - statusCode
                    description: 'รายละเอียดรายการที่เกิดerror '
                    required:
                      - value
                      - statusCode
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - statusCode
                  - httpStatusCode
                  - errorMessage
                  - hasError
                  - data
                description: ' กรณีที่คนที่request bodyมีข้อผิดพลาด'
                required:
                  - statusCode
                  - httpStatusCode
                  - errorMessage
                  - hasError
                  - data
                x-apidog-ignore-properties: []
              example:
                data:
                  value: Customer Code "" doesn't exist.
                  statusCode: 400
                hasError: true
                errorMessage: Invalid parameters entered
                statusCode: 1102
                httpStatusCode: 400
          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/Deal
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-3608469-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: []

```
