# Create or Update customer

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v3/customers:
    post:
      summary: Create or Update customer
      deprecated: false
      description: เพิ่ม/แก้ไขข้อมูล Customer
      tags:
        - Venio/Customer
        - VenioCRM/Customer
      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:
                customerCode:
                  type: string
                  description: |
                    #### รหัสลูกค้า
                    >
                    > - ถ้าไม่ใส่(null)จะเป็น การสร้างลูกค้าใหม่
                    > - กรณีที่ใส่มาจะเป็นการอัพเดตข้อมูลลูกค้า idเดิม
                  nullable: true
                customerName:
                  type: string
                  description: ชื่อลูกค้า Required [ชื่อลูกค้าห้ามซ้ำกัน]
                customerState:
                  type: integer
                  description: ' สถานะของลูกค้า Required : 1 = Lead , 2 = Prospect , 3 = Customer'
                customerStatus:
                  type: integer
                  description: >-
                    สถานะการใช้งาน 0 = active , 1 = ended (Required Note) , 2 =
                    closed (Required Note)
                  nullable: true
                customerType:
                  type: integer
                  description: ประเภท 1 = Business , 2 = individual
                  nullable: true
                customerPicture:
                  type: string
                  description: ' รูปของลูกค้า โดยรับเป็น URL'
                  nullable: true
                customer2ndName:
                  type: string
                  description: ชื่อรองลูกค้า เช่น ชื่อลูกค้าภาษาอื่นๆ
                  nullable: true
                customerAliases:
                  type: array
                  items:
                    type: string
                  description: รายการนามแฝง
                  nullable: true
                customerTaxNo:
                  type: string
                  description: เลขประจำตัวผู้เสียภาษี
                  nullable: true
                customerPhone:
                  type: string
                  description: เบอร์โทรศัพท์ลูกค้า
                  nullable: true
                customerMobile:
                  type: string
                  description: เบอร์มือถือลูกค้า
                  nullable: true
                customerEmail:
                  type: string
                  description: อีเมลลูกค้า
                customerPosition:
                  type: string
                  description: ตำแหน่งลูกค้า
                  nullable: true
                customerGender:
                  type: integer
                  description: เพศลูกค้า [1 = Male , 2 = Female]
                  nullable: true
                customerMaritalStatus:
                  type: integer
                  description: >-
                    สถานภาพสมรส [1 = Single , 2 = Engaged , 3 = Married , 4 =
                    Separated , 5 = Disvorced , 6 = Widowed]
                  nullable: true
                customerBirthdate:
                  type: string
                  description: ' วันเกิดลูกค้า โดยมี Format : YYYY-MM-DD'
                  nullable: true
                customerIncome:
                  type: string
                  description: "รายได้\_**\_ช่วงรายได้*ทำการสร้างให้ใหม่เมื่อข้อมูลไม่ตรงกัน"
                  nullable: true
                creditLimit:
                  type: string
                  description: |-
                    งบลูกค้า
                    *ไม่มีใช้ใน venio
                  nullable: true
                addresses:
                  type: array
                  items:
                    type: object
                    properties:
                      addressId:
                        type: integer
                        description: สำหรับใช้ในการ Update
                        nullable: true
                      branchCode:
                        type: string
                        description: รหัสสาขา
                        nullable: true
                      locationName:
                        type: string
                        description: ชื่อสถานที่
                      locationAddress:
                        type: string
                        description: ที่อยู่
                      secondaryAddress:
                        type: string
                        description: ที่อยู่ ภาษาอังกฤษ
                      locationType:
                        type: integer
                        description: >-
                          ประเภทสถานที่ [1 = billing address , 2 = shipping
                          address]
                      latitude:
                        type: number
                        description: ละติจูด
                        nullable: true
                      longitude:
                        type: number
                        description: ลองจิจูด
                        nullable: true
                      subdistrict:
                        type: string
                        description: แขวง/ตำบล
                        nullable: true
                      subdistrictEN:
                        type: string
                        description: แขวง/ตำบล ภาษาอังกฤษ
                        nullable: true
                      district:
                        type: string
                        description: เขต/อำเภอ
                        nullable: true
                      districtEN:
                        type: string
                        description: เขต/อำเภอ ภาษาอังกฤษ
                        nullable: true
                      province:
                        type: string
                        description: จังหวัด
                        nullable: true
                      provinceEN:
                        type: string
                        description: จังหวัด ภาษาอังกฤษ
                        nullable: true
                      zipCode:
                        type: string
                        description: รหัสไปรษณีย์
                        nullable: true
                    x-apidog-orders:
                      - addressId
                      - 01KE6NNW9K1ZK337P4J911TW2H
                    x-apidog-refs:
                      01KE6NNW9K1ZK337P4J911TW2H: &ref_0
                        $ref: '#/components/schemas/Customer.Address'
                    required:
                      - locationName
                      - locationAddress
                      - secondaryAddress
                      - locationType
                    x-apidog-ignore-properties:
                      - branchCode
                      - locationName
                      - locationAddress
                      - secondaryAddress
                      - locationType
                      - latitude
                      - longitude
                      - subdistrict
                      - subdistrictEN
                      - district
                      - districtEN
                      - province
                      - provinceEN
                      - zipCode
                  description: รายการที่อยู่
                  nullable: true
                sourceName:
                  type: string
                  description: ' แหล่งที่มาลูกค้า'
                  nullable: true
                customerGroupName:
                  type: string
                  description: กลุ่มลูกค้า [*ทำการสร้างให้ใหม่เมื่อข้อมูลไม่ตรงกัน]
                  nullable: true
                leadStatus:
                  type: integer
                  description: >-
                    สถานะผู้สนใจ 1 = New , 2 = Followup , 3 = Unqualified , 4 =
                    Interested [*ถ้าไม่มีการส่งข้อมูลมา Lead = 1 ,Prospect =  2,
                    Customer = 3]
                  nullable: true
                unqulifiedReasonName:
                  type: string
                  description: >-
                    หัวข้อเหตุผลที่พลาด [*ระบบจะ Required เมื่อ leadStatus = 3 &
                    customerState = 1 [Unqualified] เท่านั้น]
                  nullable: true
                unqulifiedReasonNote:
                  type: string
                  description: ' เหตุผล [*ระบบจะ Required เมื่อ leadStatus = 3 & customerState = 1 [Unqualified] เท่านั้น]'
                  nullable: true
                interestsName:
                  type: array
                  items:
                    type: string
                  description: ' ความสนใจ [*ทำการสร้างให้ใหม่เมื่อข้อมูลไม่ตรงกัน]'
                  nullable: true
                customerTags:
                  type: array
                  items:
                    type: string
                  description: แท็กลูกค้า
                  nullable: true
                classificationName:
                  type: string
                  description: คลาสลูกค้า โดยใส่ค่าได้ มากที่สุด 3 ตัวอักษร
                  nullable: true
                customFields:
                  type: array
                  items:
                    type: object
                    properties:
                      customFieldName:
                        type: string
                        description: 'ชื่อหัวข้อฟิลด์ '
                      customFieldValue:
                        type: array
                        items:
                          type: string
                        description: ' ข้อมูลของฟิลด์'
                    x-apidog-orders:
                      - customFieldName
                      - customFieldValue
                    required:
                      - customFieldName
                      - customFieldValue
                    x-apidog-ignore-properties: []
                  description: ฟิลด์ข้อมูลลูกค้าที่กำหนดเอง
                  nullable: true
                contacts:
                  type: array
                  items:
                    type: object
                    properties:
                      contactName:
                        type: string
                        description: ผู้ติดต่อ
                      contactStatus:
                        type: boolean
                        description: ' true = active , false = inactive'
                        nullable: true
                      contactPicture:
                        type: string
                        description: ' รูปของผู้ติดต่อ ใช้เป็น URL ของรูป'
                        nullable: true
                      contactPhone:
                        type: string
                        description: เบอร์โทรศัพ ของผู้ติดต่อ
                        nullable: true
                      contactMobile:
                        type: string
                        description: ' เบอร์โทรศัพมือถือ ของผู้ติดต่อ'
                        nullable: true
                      contactEmail:
                        type: string
                        description: Email ของผู้ติดต่อ
                        nullable: true
                      contactPosition:
                        type: string
                        description: ' ตำแหน่ง ของผู้ติดต่อ'
                        nullable: true
                      contactBirthdate:
                        type: string
                        description: 'วันเกิด ของผู้ติดต่อ โดยมี Format : "YYYY-MM-DD"'
                        nullable: true
                      contactNote:
                        type: string
                        description: รายละเอียดเพิ่มเติม
                        nullable: true
                      contactSocialAccount:
                        type: object
                        properties:
                          facebook:
                            type: string
                            description: facebook ผู้ติดต่อ
                          line:
                            type: string
                            description: line ผู้ติดต่อ
                          whatsapp:
                            type: string
                            description: whatsApp ผู้ติดต่อ
                          skype:
                            type: string
                            description: skype ผู้ติดต่อ
                          instagram:
                            type: string
                            description: instagram ผู้ติดต่อ
                          linkedin:
                            type: string
                            description: linked ผู้ติดต่อ
                          telegram:
                            type: string
                            description: telegram ผู้ติดต่อ
                          wechat:
                            type: string
                            description: wechat ผู้ติดต่อ
                        description: Social Account ของผู้ติดต่อ
                        x-apidog-orders:
                          - facebook
                          - line
                          - whatsapp
                          - skype
                          - instagram
                          - linkedin
                          - telegram
                          - wechat
                        x-apidog-ignore-properties: []
                        nullable: true
                      tags:
                        type: array
                        items:
                          type: string
                        description: Tags ผู้ติดต่อ
                    required:
                      - contactName
                    x-apidog-orders:
                      - contactName
                      - contactStatus
                      - contactPicture
                      - contactPhone
                      - contactMobile
                      - contactEmail
                      - contactPosition
                      - contactBirthdate
                      - contactNote
                      - contactSocialAccount
                      - tags
                    description: กรณีcustomer type=2 individual
                    x-apidog-ignore-properties: []
                  description: |-
                    รายการผู้ติดต่อ
                    *ถ้ามีข้อมูล
                    customerType = business
                customerSocialAccount:
                  type: object
                  properties:
                    facebook:
                      type: string
                      description: Facebook ลูกค้า
                    line:
                      type: string
                      description: Line ลูกค้า
                    whatsapp:
                      type: string
                      description: whatsApp ลูกค้า
                    skype:
                      type: string
                      description: skype ลูกค้า
                    instagram:
                      type: string
                      description: Instagram ลูกค้า
                    linkedin:
                      type: string
                      description: LinkedIn ลูกค้า
                    telegram:
                      type: string
                      description: Telegram
                    wechat:
                      type: string
                      description: wechat ลูกค้า
                  description: 'Social Account ของลูกค้า '
                  x-apidog-orders:
                    - facebook
                    - line
                    - whatsapp
                    - skype
                    - instagram
                    - linkedin
                    - telegram
                    - wechat
                  x-apidog-ignore-properties: []
                  nullable: true
                customerNote:
                  type: string
                  description: เมื่อ CustomerStatus เป็น Ended , Closed
                  nullable: true
                owners:
                  type: array
                  items:
                    type: string
                  description: รหัสพนักงาน
                primaryOwner:
                  type: string
                  description: รหัสพนักงานที่จะตั้งเป็นผู้รับผิดชอบหลัก
              required:
                - customerName
                - customerState
              x-apidog-orders:
                - customerCode
                - customerName
                - customerState
                - customerStatus
                - customerType
                - customerPicture
                - customer2ndName
                - customerAliases
                - customerTaxNo
                - customerPhone
                - customerMobile
                - customerEmail
                - customerPosition
                - customerGender
                - customerMaritalStatus
                - customerBirthdate
                - customerIncome
                - creditLimit
                - addresses
                - sourceName
                - customerGroupName
                - leadStatus
                - unqulifiedReasonName
                - unqulifiedReasonNote
                - interestsName
                - customerTags
                - classificationName
                - customFields
                - contacts
                - customerSocialAccount
                - customerNote
                - owners
                - primaryOwner
              x-apidog-ignore-properties: []
            example: |-
              {
                "customerCode": "string", // รหัสลูกค้า [ถ้าไม่ใส่จะเป็น การสร้างลูกค้าใหม่]
                "customerName": "string", // ชื่อลูกค้า Required [ชื่อลูกค้าห้ามซ้ำกัน]
                "customerState": 0, // <integer> สถานะของลูกค้า Required : 1 = Lead , 2 = Prospect , 3 = Customer 
                "customerStatus": 0, // <integer> สถานะการใช้งาน 0 = active , 1 = ended (Required Note) , 2 = closed (Required Note)
                "customerType": 0, //<integer> ประเภท 1 = Business , 2 = individual
                "customerPicture": "string", // รูปของลูกค้า โดยรับเป็น URL
                "customer2ndName": "string", // ชื่อรองลูกค้า เช่น ชื่อลูกค้าภาษาอื่นๆ
                "customerAliases": [
                  "string",
                  "string"
                ], // รายการนามแฝง
                "customerTaxNo": "string", // เลขประจำตัวผู้เสียภาษี
                "creditLimit": "string",
                "customerPhone": "string", // เบอร์โทรศัพท์ลูกค้า
                "customerMobile": "string", // เบอร์มือถือลูกค้า
                "customerEmail": "string", // อีเมลลูกค้า
                "customerPosition": "string", // ตำแหน่งลุกค้า
                "customerGender": 0, //<integer> เพศลูกค้า [1 = Male , 2 = Female]
                "customerMaritalStatus": 0, // <integer> สถานภาพสมรส [1 = Single , 2 = Engaged , 3 = Married , 4 = Separated , 5 = Disvorced , 6 = Widowed]
                "customerBirthdate": "2022-12-30", // วันเกิดลูกค้า โดยมี Format : YYYY-MM-DD
                "customerIncome": "string",
                "addresses": [
                  {
                    "addressId": 0,
                    "branchCode": "string", // รหัสสาขา,
                    "locationName": "string", // Required ชื่อสถานที่
                    "locationAddress": "string", // Required ที่อยู่
                    "secondaryLocation": "string", // ที่อยู EN
                    "locationType": 0, //<integer> Required ประเภทสถานที่ [1 = billing address , 2 = shipping address]
                    "latitude": 0.0, // ละติจูด
                    "longitude": 0.0, // ลองจิจูด
                    "subdistrict": "string", //แขวง/ตำบล
                    "subdistrictEN": "string", // แขวง/ตำบล ภาษาอังกฤษ
                    "district": "string", //เขต/อำเภอ
                    "districtEN": "string", //เขต/อำเภอ ภาษาอังกฤษ
                    "province": "string", // จังหวัด
                    "provinceEN": "string", //จังหวัด ภาษาอังกฤษ
                    "zipCode": "string" // รหัสไปรษณีย์
                  }
                ],
                "sourceName": "string", // แหล่งที่มาลูกค้า
                "customerGroupName": "string", // กลุ่มลูกค้า [*ทำการสร้างให้ใหม่เมื่อข้อมูลไม่ตรงกัน]
                "leadStatus": 0, // สถานะลูกค้า 1 = New , 2 = Followup , 3 = Unqualified , 4 = Interested [*ถ้าไม่มีการส่งข้อมูลมา Lead = 1 ,Prospect =  4 , Customer = 4]
                "unqulifiedReasonName": "string", // หัวข้อเหตุผลที่พลาด [*ระบบจะ Required เมื่อ leadStatus = 3 & customerState = 1 [Unqualified] เท่านั้น]
                "unqulifiedReasonNote": "string", // เหตุผล [*ระบบจะ Required เมื่อ leadStatus = 3 & customerState = 1 [Unqualified] เท่านั้น]
                "interestsName": [
                  "string",
                  "string"
                ], // ความสนใจ [*ทำการสร้างให้ใหม่เมื่อข้อมูลไม่ตรงกัน]
                "customerTags": [
                  "string"
                ],
                "classificationName": "string", // คราสลูกค้า โดยใส่ค่าได้ มากที่สุด 3 ตัวอักษร
                "customFields": [
                  {
                    "customFieldName": "string", // ชื่อหัวข้อฟิลด์ Required 
                    "customFieldValue": [
                      "string"
                    ] // ข้อมูลของฟิลด์ Required
                  }
                ],
                "contacts": [
                  {
                    "contactName": "string", // ผู้ติดต่อ Required
                    "contactStatus": true, // true = active , false = inactive
                    "contactPicture": "string", // รูปของผู้ติดต่อ ใช้เป็น URL ของรูป
                    "contactPhone": "string", // เบอร์โทรศัพ ของผู้ติดต่อ
                    "contactMobile": "string", // เบอร์โทรศัพมือถือ ของผู้ติดต่อ
                    "contactEmail": "string", // Email ของผู้ติดต่อ
                    "contactPosition": "string", // ตำแหน่ง ของผู้ติดต่อ
                    "contactBirthdate": "2000-00-04", // วันเกิด ของผู้ติดต่อ โดยมี Format : "YYYY-MM-DD"
                    "contactNote": "string",
                    "tags": [ // Tags ผู้ติดต่อ
                      "string"
                    ]
                  }
                ],
                "customerSocialAccount": {
                  "facebook": "string",
                  "line": "string",
                  "whatsapp": "string",
                  "skype": "string",
                  "instagram": "string",
                  "linkedin": "string",
                  "telegram": "string",
                  "wechat": "string"
                }, // Social Account ของลูกค้า 
                "customerNote": "string", // Required เมื่อ CustomerStatus เป็น Ended , Closed
                "owners": [
                  "string"
                ], // รหัสพนังงาน
                "primaryOwner": "string" //รหัสพนักงานที่จะตั้งเป็นผู้รับผิดชอบหลัก
              }
      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: คำอธิบายข้อความที่จะแสดง
                    required:
                      - code
                      - description
                    x-apidog-orders:
                      - code
                      - description
                    x-apidog-ignore-properties: []
                  data:
                    type: object
                    properties:
                      customerId:
                        type: string
                        description: รหัส id ลูกค้า
                      customerName:
                        type: string
                        description: ชื่อลูกค้า Required [ชื่อลูกค้าห้ามซ้ำกัน]
                      customerCode:
                        type: string
                        description: รหัสลูกค้า [ถ้าไม่ใส่จะเป็น การสร้างลูกค้าใหม่]
                      customerState:
                        type: integer
                        description: >-
                          สถานะของลูกค้า Required : 1 = Lead , 2 = Prospect , 3
                          = Customer
                      customerType:
                        type: integer
                        description: ประเภท 1 = Business , 2 = individual
                      customerStatus:
                        type: integer
                        description: >-
                          สถานะการใช้งาน 0 = active , 1 = ended (Required Note)
                          , 2 = closed (Required Note)
                      customerPicture:
                        type: string
                        description: รูปของลูกค้า โดยรับเป็น URL
                      customer2ndName:
                        type: string
                        description: ชื่อรองลูกค้า เช่น ชื่อลูกค้าภาษาอื่นๆ
                        nullable: true
                      customerAliases:
                        type: array
                        items:
                          type: string
                        description: รายการนามแฝง
                      customerTaxNo:
                        type: string
                        description: เลขประจำตัวผู้เสียภาษี
                        nullable: true
                      branchCode:
                        type: string
                        description: รหัสสาขา
                        nullable: true
                      customerPhone:
                        type: string
                        description: เบอร์โทรศัพท์ลูกค้า
                        nullable: true
                      customerMobile:
                        type: string
                        description: เบอร์มือถือลูกค้า
                        nullable: true
                      customerEmail:
                        type: string
                        description: อีเมลลูกค้า
                        nullable: true
                      customerSocialAccount:
                        type: object
                        properties:
                          facebook:
                            type: string
                            description: Facebook ลูกค้า
                          line:
                            type: string
                            description: Line ลูกค้า
                          whatsapp:
                            type: string
                            description: whatsApp ลูกค้า
                          skype:
                            type: string
                            description: skype ลูกค้า
                          instagram:
                            type: string
                            description: Instagram ลูกค้า
                          linkedin:
                            type: string
                            description: LinkedIn ลูกค้า
                          telegram:
                            type: string
                            description: Telegram
                          wechat:
                            type: string
                            description: wechat ลูกค้า
                        description: 'Social Account ของลูกค้า '
                        x-apidog-orders:
                          - facebook
                          - line
                          - whatsapp
                          - skype
                          - instagram
                          - linkedin
                          - telegram
                          - wechat
                        x-apidog-ignore-properties: []
                      customerTags:
                        type: array
                        items:
                          type: string
                        description: แท็กลูกค้า
                        nullable: true
                      addresses:
                        type: array
                        items:
                          type: object
                          properties:
                            addressId:
                              type: integer
                            branchCode:
                              type: string
                              description: รหัสสาขา
                              nullable: true
                            locationName:
                              type: string
                              description: ชื่อสถานที่
                            locationAddress:
                              type: string
                              description: ที่อยู่
                            secondaryAddress:
                              type: string
                              description: ที่อยู่ ภาษาอังกฤษ
                            locationType:
                              type: integer
                              description: >-
                                ประเภทสถานที่ [1 = billing address , 2 =
                                shipping address]
                            latitude:
                              type: number
                              description: ละติจูด
                              nullable: true
                            longitude:
                              type: number
                              description: ลองจิจูด
                              nullable: true
                            subdistrict:
                              type: string
                              description: แขวง/ตำบล
                              nullable: true
                            subdistrictEN:
                              type: string
                              description: แขวง/ตำบล ภาษาอังกฤษ
                              nullable: true
                            district:
                              type: string
                              description: เขต/อำเภอ
                              nullable: true
                            districtEN:
                              type: string
                              description: เขต/อำเภอ ภาษาอังกฤษ
                              nullable: true
                            province:
                              type: string
                              description: จังหวัด
                              nullable: true
                            provinceEN:
                              type: string
                              description: จังหวัด ภาษาอังกฤษ
                              nullable: true
                            zipCode:
                              type: string
                              description: รหัสไปรษณีย์
                              nullable: true
                          x-apidog-orders:
                            - addressId
                            - 01KE6CJCHVN7B7D5767SXJBREM
                          x-apidog-refs:
                            01KE6CJCHVN7B7D5767SXJBREM: *ref_0
                          required:
                            - addressId
                            - locationName
                            - locationAddress
                            - secondaryAddress
                            - locationType
                          x-apidog-ignore-properties:
                            - branchCode
                            - locationName
                            - locationAddress
                            - secondaryAddress
                            - locationType
                            - latitude
                            - longitude
                            - subdistrict
                            - subdistrictEN
                            - district
                            - districtEN
                            - province
                            - provinceEN
                            - zipCode
                        description: ที่อยู่
                        nullable: true
                      sourceName:
                        type: string
                        description: แหล่งที่มาลูกค้า
                        nullable: true
                      customerGroupName:
                        type: string
                        description: กลุ่มลูกค้า [*ทำการสร้างให้ใหม่เมื่อข้อมูลไม่ตรงกัน]
                        nullable: true
                      interestsName:
                        type: array
                        items:
                          type: string
                        description: ความสนใจ [*ทำการสร้างให้ใหม่เมื่อข้อมูลไม่ตรงกัน]
                      classificationName:
                        type: string
                        description: คลาสลูกค้า โดยใส่ค่าได้ มากที่สุด 3 ตัวอักษร
                      contacts:
                        type: array
                        items:
                          type: object
                          properties:
                            contactName:
                              type: string
                              description: ผู้ติดต่อ
                            contactPicture:
                              type: string
                              description: รูปของผู้ติดต่อ ใช้เป็น URL ของรูป
                            contactPhone:
                              type: string
                              description: เบอร์โทรศัพ ของผู้ติดต่อ
                              nullable: true
                            contactMobile:
                              type: string
                              description: เบอร์โทรศัพมือถือ ของผู้ติดต่อ
                              nullable: true
                            contactEmail:
                              type: string
                              description: Email ของผู้ติดต่อ
                              nullable: true
                            contactSocialAccount:
                              type: object
                              properties:
                                facebook:
                                  type: string
                                  description: facebook ผู้ติดต่อ
                                line:
                                  type: string
                                  description: line ผู้ติดต่อ
                                whatsapp:
                                  type: string
                                  description: whatsApp ผู้ติดต่อ
                                skype:
                                  type: string
                                  description: skype ผู้ติดต่อ
                                instagram:
                                  type: string
                                  description: instagram ผู้ติดต่อ
                                linkedin:
                                  type: string
                                  description: linked ผู้ติดต่อ
                                telegram:
                                  type: string
                                  description: telegram ผู้ติดต่อ
                                wechat:
                                  type: string
                                  description: wechat ผู้ติดต่อ
                              description: Social Account ของผู้ติดต่อ
                              x-apidog-orders:
                                - facebook
                                - line
                                - whatsapp
                                - skype
                                - instagram
                                - linkedin
                                - telegram
                                - wechat
                              x-apidog-ignore-properties: []
                              nullable: true
                            contactPosition:
                              type: string
                              description: ตำแหน่ง ของผู้ติดต่อ
                              nullable: true
                            contactBirthdate:
                              type: string
                              description: 'วันเกิด ของผู้ติดต่อ โดยมี Format : "YYYY-MM-DD"'
                              nullable: true
                            contactNote:
                              type: string
                              description: รายละเอียดเพิ่มเติม
                              nullable: true
                            contactStatus:
                              type: boolean
                              description: true = active , false = inactive
                              nullable: true
                          x-apidog-orders:
                            - contactName
                            - contactPicture
                            - contactPhone
                            - contactMobile
                            - contactEmail
                            - contactSocialAccount
                            - contactPosition
                            - contactBirthdate
                            - contactNote
                            - contactStatus
                          required:
                            - contactName
                            - contactPicture
                          x-apidog-ignore-properties: []
                        description: รายการข้อมูลผู้ติดต่อ
                      customFields:
                        type: array
                        items:
                          type: object
                          properties:
                            customFieldName:
                              type: string
                              description: ชื่อหัวข้อฟิลด์
                            customFieldValue:
                              type: array
                              items:
                                type: string
                              description: ข้อมูลของฟิลด์
                          x-apidog-orders:
                            - customFieldName
                            - customFieldValue
                          x-apidog-ignore-properties: []
                        description: ฟิลด์ข้อมูลลูกค้าที่กำหนดเอง
                      customerNote:
                        type: string
                        description: เมื่อ CustomerStatus เป็น Ended , Closed
                      owners:
                        type: array
                        items:
                          type: string
                        description: รหัสพนังงาน
                      customerIncome:
                        type: string
                        description: "รายได้\_**\_ช่วงรายได้*ทำการสร้างให้ใหม่เมื่อข้อมูลไม่ตรงกัน"
                        nullable: true
                      creditLimit:
                        type: string
                        description: |-
                          งบลูกค้า
                          *ไม่มีใช้ใน venio
                        nullable: true
                      leadStatus:
                        type: integer
                        description: >-
                          สถานะผู้สนใจ 1 = New , 2 = Followup , 3 = Unqualified
                          , 4 = Interested [*ถ้าไม่มีการส่งข้อมูลมา Lead = 1
                          ,Prospect =  2, Customer = 3]
                    required:
                      - customerId
                      - customerName
                      - customerCode
                      - customerState
                      - customerType
                      - customerStatus
                      - customerPicture
                      - customerAliases
                      - customerSocialAccount
                      - interestsName
                      - contacts
                      - customFields
                      - owners
                      - leadStatus
                    x-apidog-orders:
                      - customerId
                      - customerName
                      - customerCode
                      - customerState
                      - customerType
                      - customerStatus
                      - customerPicture
                      - customer2ndName
                      - customerAliases
                      - customerTaxNo
                      - branchCode
                      - customerPhone
                      - customerMobile
                      - customerEmail
                      - customerSocialAccount
                      - customerTags
                      - addresses
                      - sourceName
                      - customerGroupName
                      - interestsName
                      - classificationName
                      - contacts
                      - customFields
                      - customerNote
                      - owners
                      - customerIncome
                      - creditLimit
                      - leadStatus
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - status
                  - data
                required:
                  - status
                  - data
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Update Success
        '201':
          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:
                      customerId:
                        type: string
                        description: รหัส id ลูกค้า
                      customerName:
                        type: string
                        description: ชื่อลูกค้า Required [ชื่อลูกค้าห้ามซ้ำกัน]
                      customerCode:
                        type: string
                        description: รหัสลูกค้า [ถ้าไม่ใส่จะเป็น การสร้างลูกค้าใหม่]
                        nullable: true
                      customerState:
                        type: integer
                        description: ' สถานะของลูกค้า Required : 1 = Lead , 2 = Prospect , 3 = Customer'
                      customerType:
                        type: integer
                        description: ประเภท 1 = Business , 2 = individual
                      customerStatus:
                        type: integer
                        description: >-
                          สถานะการใช้งาน 0 = active , 1 = ended (Required Note)
                          , 2 = closed (Required Note)
                      customer2ndName:
                        type: string
                        description: ชื่อรองลูกค้า เช่น ชื่อลูกค้าภาษาอื่นๆ
                        nullable: true
                      customerPicture:
                        type: string
                        description: ' รูปของลูกค้า โดยรับเป็น URL'
                        nullable: true
                      customerAliases:
                        type: array
                        items:
                          type: string
                        description: รายการนามแฝง
                      customerTaxNo:
                        type: string
                        description: เลขประจำตัวผู้เสียภาษี
                        nullable: true
                      customerPhone:
                        type: string
                        description: เบอร์โทรศัพท์ลูกค้า
                        nullable: true
                      customerMobile:
                        type: string
                        description: เบอร์มือถือลูกค้า
                        nullable: true
                      customerMaritalStatus:
                        type: integer
                        description: >-
                          สถานภาพสมรส [1 = Single , 2 = Engaged , 3 = Married ,
                          4 = Separated , 5 = Disvorced , 6 = Widowed]
                        nullable: true
                      customerGender:
                        type: integer
                        description: เพศลูกค้า [1 = Male , 2 = Female]
                        nullable: true
                      customerPosition:
                        type: string
                        description: ตำแหน่งลูกค้า
                        nullable: true
                      customerEmail:
                        type: string
                        description: อีเมลลูกค้า
                        nullable: true
                      customerTags:
                        type: array
                        items:
                          type: string
                        description: แท็กลูกค้า
                      customerGroupName:
                        type: string
                        description: กลุ่มลูกค้า [*ทำการสร้างให้ใหม่เมื่อข้อมูลไม่ตรงกัน]
                      customerSocialAccount:
                        type: object
                        properties:
                          facebook:
                            type: string
                            description: Facebook ลูกค้า
                          line:
                            type: string
                            description: Line ลูกค้า
                          whatsapp:
                            type: string
                            description: whatsApp ลูกค้า
                          skype:
                            type: string
                            description: skype ลูกค้า
                          instagram:
                            type: string
                            description: Instagram ลูกค้า
                          linkedin:
                            type: string
                            description: LinkedIn ลูกค้า
                          telegram:
                            type: string
                            description: Telegram
                          wechat:
                            type: string
                            description: wechat ลูกค้า
                        description: 'Social Account ของลูกค้า '
                        x-apidog-orders:
                          - facebook
                          - line
                          - whatsapp
                          - skype
                          - instagram
                          - linkedin
                          - telegram
                          - wechat
                        x-apidog-ignore-properties: []
                      addresses:
                        type: array
                        items:
                          type: object
                          properties:
                            addressId:
                              type: integer
                              nullable: true
                            branchCode:
                              type: string
                              description: รหัสสาขา
                              nullable: true
                            locationName:
                              type: string
                              description: ชื่อสถานที่
                            locationAddress:
                              type: string
                              description: ที่อยู่
                            secondaryAddress:
                              type: string
                              description: ที่อยู่ ภาษาอังกฤษ
                            locationType:
                              type: integer
                              description: >-
                                ประเภทสถานที่ [1 = billing address , 2 =
                                shipping address]
                            latitude:
                              type: number
                              description: ละติจูด
                              nullable: true
                            longitude:
                              type: number
                              description: ลองจิจูด
                              nullable: true
                            subdistrict:
                              type: string
                              description: แขวง/ตำบล
                              nullable: true
                            subdistrictEN:
                              type: string
                              description: แขวง/ตำบล ภาษาอังกฤษ
                              nullable: true
                            district:
                              type: string
                              description: เขต/อำเภอ
                              nullable: true
                            districtEN:
                              type: string
                              description: เขต/อำเภอ ภาษาอังกฤษ
                              nullable: true
                            province:
                              type: string
                              description: จังหวัด
                              nullable: true
                            provinceEN:
                              type: string
                              description: จังหวัด ภาษาอังกฤษ
                              nullable: true
                            zipCode:
                              type: string
                              description: รหัสไปรษณีย์
                              nullable: true
                          x-apidog-orders:
                            - addressId
                            - 01KE6NQD0XZGESSV5JGARE9HW3
                          required:
                            - locationName
                            - locationAddress
                            - secondaryAddress
                            - locationType
                          x-apidog-refs:
                            01KE6NQD0XZGESSV5JGARE9HW3: *ref_0
                          x-apidog-ignore-properties:
                            - branchCode
                            - locationName
                            - locationAddress
                            - secondaryAddress
                            - locationType
                            - latitude
                            - longitude
                            - subdistrict
                            - subdistrictEN
                            - district
                            - districtEN
                            - province
                            - provinceEN
                            - zipCode
                        description: ที่อยู่
                      sourceName:
                        type: string
                        description: ' แหล่งที่มาลูกค้า'
                        nullable: true
                      classificationName:
                        type: string
                        description: คลาสลูกค้า โดยใส่ค่าได้ มากที่สุด 3 ตัวอักษร
                      customFields:
                        type: array
                        items:
                          type: object
                          properties:
                            customFieldName:
                              type: string
                              description: 'ชื่อหัวข้อฟิลด์ '
                            customFieldValue:
                              type: array
                              items:
                                type: string
                              description: ' ข้อมูลของฟิลด์'
                          x-apidog-orders:
                            - customFieldName
                            - customFieldValue
                          x-apidog-ignore-properties: []
                        description: ฟิลด์ข้อมูลลูกค้าที่กำหนดเอง
                      owners:
                        type: array
                        items:
                          type: string
                        description: รหัสพนังงาน
                      customerBirthdate:
                        type: string
                        description: ' วันเกิดลูกค้า โดยมี Format : YYYY-MM-DD'
                        nullable: true
                      customerIncome:
                        type: string
                        description: "รายได้\_**\_ช่วงรายได้*ทำการสร้างให้ใหม่เมื่อข้อมูลไม่ตรงกัน"
                        nullable: true
                      creditLimit:
                        type: string
                        description: |-
                          งบลูกค้า
                          *ไม่มีใช้ใน venio
                        nullable: true
                      unqulifiedReasonName:
                        type: string
                        description: >-
                          หัวข้อเหตุผลที่พลาด [*ระบบจะ Required เมื่อ leadStatus
                          = 3 & customerState = 1 [Unqualified] เท่านั้น]
                        nullable: true
                      unqulifiedReasonNote:
                        type: string
                        description: ' เหตุผล [*ระบบจะ Required เมื่อ leadStatus = 3 & customerState = 1 [Unqualified] เท่านั้น]'
                        nullable: true
                      interestsName:
                        type: array
                        items:
                          type: string
                        description: ' ความสนใจ [*ทำการสร้างให้ใหม่เมื่อข้อมูลไม่ตรงกัน]'
                      customerNote:
                        type: string
                        description: เมื่อ CustomerStatus เป็น Ended , Closed
                      leadStatus:
                        type: integer
                        description: >-
                          สถานะผู้สนใจ 1 = New , 2 = Followup , 3 = Unqualified
                          , 4 = Interested [*ถ้าไม่มีการส่งข้อมูลมา Lead = 1
                          ,Prospect =  2, Customer = 3]
                    x-apidog-orders:
                      - customerId
                      - customerName
                      - customerCode
                      - customerState
                      - customerType
                      - customerStatus
                      - customer2ndName
                      - customerPicture
                      - customerAliases
                      - customerTaxNo
                      - customerPhone
                      - customerMobile
                      - customerMaritalStatus
                      - customerGender
                      - customerPosition
                      - customerEmail
                      - customerTags
                      - customerGroupName
                      - customerSocialAccount
                      - addresses
                      - sourceName
                      - classificationName
                      - customFields
                      - owners
                      - customerBirthdate
                      - customerIncome
                      - creditLimit
                      - unqulifiedReasonName
                      - unqulifiedReasonNote
                      - interestsName
                      - customerNote
                      - leadStatus
                    required:
                      - customerId
                      - customerName
                      - customerState
                      - customerType
                      - customerStatus
                      - customerAliases
                      - customerTags
                      - customerGroupName
                      - customerSocialAccount
                      - addresses
                      - classificationName
                      - customFields
                      - owners
                      - interestsName
                      - leadStatus
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - status
                  - data
                title: ''
                required:
                  - status
                  - data
                x-apidog-ignore-properties: []
              examples:
                '1':
                  summary: Create Type individual Success (201)
                  value:
                    status:
                      code: '1000'
                      description: Success
                    data:
                      customerId: '1'
                      customerName: string
                      customerCode: string
                      customerState: 3
                      customerPicture: string
                      customer2ndName: string
                      customerAliases:
                        - string
                        - string
                      customerPhone: string
                      customerMobile: string
                      customerEmail: string
                      customerSocialAccount:
                        facebook: string
                      customerPosition: sales
                      customerGender: 1
                      customerMaritalStatus: 2
                      customerBirthdate: 2000-12-30T00:00:00+0700
                      addresses:
                        - addressId: 0
                          branchCode: string
                          locationName: string
                          locationAddress: string
                          secondaryAddress: string
                          locationType: 2
                          latitude: 0
                          longitude: 0
                          subdistrict: string
                          subdistrictEN: string
                          district: string
                          districtEN: string
                          province: string
                          provinceEN: string
                          zipCode: string
                      interestsName:
                        - string
                      classificationName: string
                      customFields:
                        - customFieldName: string
                          customFieldValue:
                            - string
                      customerType: 2
                      customerNote: string
                      owners:
                        - string
                      customerStatus: 0
                      leadStatus: 1
                      customerIncome: string
                '2':
                  summary: Create Type Business Success (201)
                  value:
                    status:
                      code: '1000'
                      description: Success
                    data:
                      customerId: string
                      customerName: string
                      customerCode: string
                      customerState: 3
                      customerType: 1
                      customerStatus: 0
                      customerPicture: string
                      customer2ndName: string
                      customerAliases:
                        - string
                      customerTaxNo: string
                      branchCode: string
                      customerPhone: string
                      customerMobile: string
                      customerEmail: string
                      customerSocialAccount:
                        facebook: string
                      customerTags:
                        - string
                      addresses:
                        - addressId: 0
                          branchCode: string
                          locationName: string
                          locationAddress: string
                          secondaryAddress: string
                          locationType: 2
                          latitude: 0
                          longitude: 0
                          subdistrict: string
                          subdistrictEN: string
                          district: string
                          districtEN: string
                          province: string
                          provinceEN: string
                          zipCode: string
                      sourceName: string
                      customerGroupName: string
                      interestsName:
                        - string
                      classificationName: string
                      customFields:
                        - customFieldName: string
                          customFieldValue:
                            - string
                      contacts:
                        - contactName: string
                          contactPicture: string
                          contactPhone: string
                          contactMobile: string
                          contactEmail: string
                          contactSocialAccount:
                            facebook: string
                          contactPosition: string
                          contactBirthdate: '1999-01-01'
                          contactNote: string
                          contactStatus: true
                          tags:
                            - string
                      customerNote: string
                      owners:
                        - string
                '3':
                  summary: Update Success (200)
                  value:
                    status:
                      code: '1000'
                      description: Success
                    data:
                      customerId: string
                      customerName: string
                      customerCode: string
                      customerState: 3
                      customerType: 1
                      customerPicture: string
                      customer2ndName: string
                      customerAliases:
                        - string
                      customerTaxNo: string
                      branchCode: string
                      customerPhone: string
                      customerMobile: string
                      customerEmail: string
                      customerSocialAccount:
                        facebook: string
                      customerTags:
                        - string
                      addresses:
                        - addressId: 0
                          branchCode: string
                          locationName: string
                          locationAddress: string
                          secondaryAddress: string
                          locationType: 2
                          latitude: 0
                          longitude: 0
                          subdistrict: string
                          subdistrictEN: string
                          district: string
                          districtEN: string
                          province: string
                          provinceEN: string
                          zipCode: string
                      sourceName: string
                      customerGroupName: string
                      interestsName:
                        - string
                      classificationName: string
                      customFields:
                        - customFieldName: string
                          customFieldValue:
                            - string
                      contact:
                        - contactName: string
                          contactPicture: string
                          contactPhone: string
                          contactMobile: string
                          contactEmail: string
                          contactSocialAccount:
                            facebook: string
                          contactPosition: string
                          contactBirthdate: '1999-01-01'
                          contactNote: string
                          contactStatus: true
                      customerNote: string
                      owners:
                        - string
                      customerStatus: 0
                      leadStatus: 1
                      customerIncome: string
                '4':
                  summary: Unauthorized (401)
                  value:
                    statusCode: 401
                    message: Access denied due to invalid subscription key. Mak ...
                '5':
                  summary: Forbidden (403)
                  value:
                    status:
                      code: E9503
                      description: Invalid access rights
                '6':
                  summary: Bad Request (400)
                  value:
                    status:
                      code: '4001'
                      description: Business error with 1 or more errors
                    data:
                      errors:
                        - subCode: E1102
                          description: 'The CustomerTaxNo field is invalid '
                '7':
                  summary: E9905 (500)
                  value:
                    status:
                      code: E9905
                      description: string
          headers: {}
          x-apidog-name: Create Type individual Success
        '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: "คำบรรยายsubcode/business\_code"
                    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: "<p>สถานะของ Business Code ถ้า<br>Success = 1000<br>Error 1 ตัว = 4001<br>Error มากกว่า 1 ตัว = 4002\_ \_ <br>หรือเป็น Subcode ที่ต้องการจะแสดงเพื่อมีความหมายสำหรับ Module ของเจ้าของในการดู Error โดย subcode จะเป็นตัวเดียวกับ business error code หรือไม่ก็ได้ เพื่อความสะดวกในการแสดงผล<p>"
                            description:
                              type: string
                              description: "คำบรรยาย\_business\_code/subcode"
                          x-apidog-orders:
                            - subCode
                            - description
                          required:
                            - subCode
                            - description
                          x-apidog-ignore-properties: []
                        description: >-
                          เป็นส่วนแสดงผล Error
                          ที่พบว่ามีจำนวนกี่ชุดก็ได้ไม่จำกัดเพื่อความสะดวกในการจัดการกับ
                          Error
                    x-apidog-orders:
                      - errors
                    required:
                      - errors
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - status
                  - data
                required:
                  - status
                  - data
                x-apidog-ignore-properties: []
          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
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Unauthorized
        '403':
          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: []
                x-apidog-orders:
                  - status
                required:
                  - status
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Forbidden
        '500':
          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: "คำบรรยาย\_subcode/business\_code"
                    x-apidog-orders:
                      - code
                      - description
                    required:
                      - code
                      - description
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - status
                required:
                  - status
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: (E9905)
        x-201:Create Type Business Success:
          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: คำอธิบายข้อความที่จะแสดง
                    required:
                      - code
                      - description
                    x-apidog-orders:
                      - code
                      - description
                    x-apidog-ignore-properties: []
                  data:
                    type: object
                    properties:
                      customerId:
                        type: string
                        description: รหัส id ของลูกค้า
                      customerName:
                        type: string
                        description: ชื่อลูกค้า Required [ชื่อลูกค้าห้ามซ้ำกัน]
                      customerCode:
                        type: string
                        description: รหัสลูกค้า [ถ้าไม่ใส่จะเป็น การสร้างลูกค้าใหม่]
                        nullable: true
                      customerState:
                        type: integer
                        description: >-
                          สถานะของลูกค้า Required : 1 = Lead , 2 = Prospect , 3
                          = Customer
                      customerType:
                        type: integer
                        description: ประเภท 1 = Business , 2 = individual
                      customerStatus:
                        type: integer
                        description: >-
                          สถานะการใช้งาน 0 = active , 1 = ended (Required Note)
                          , 2 = closed (Required Note)
                      customerPicture:
                        type: string
                        description: รูปของลูกค้า โดยรับเป็น URL
                      customer2ndName:
                        type: string
                        description: ชื่อรองลูกค้า เช่น ชื่อลูกค้าภาษาอื่นๆ
                        nullable: true
                      customerAliases:
                        type: array
                        items:
                          type: string
                        description: รายการนามแฝง
                        nullable: true
                      customerTaxNo:
                        type: string
                        description: เลขประจำตัวผู้เสียภาษี
                        nullable: true
                      branchCode:
                        type: string
                        description: รหัสสาขา
                        nullable: true
                      customerPhone:
                        type: string
                        description: เบอร์โทรศัพท์ลูกค้า
                        nullable: true
                      customerMobile:
                        type: string
                        description: เบอร์มือถือลูกค้า
                        nullable: true
                      customerEmail:
                        type: string
                        description: อีเมลลูกค้า
                        nullable: true
                      customerSocialAccount:
                        type: object
                        properties:
                          facebook:
                            type: string
                            description: Facebook ลูกค้า
                          line:
                            type: string
                            description: Line ลูกค้า
                          whatsapp:
                            type: string
                            description: whatsApp ลูกค้า
                          skype:
                            type: string
                            description: skype ลูกค้า
                          instagram:
                            type: string
                            description: Instagram ลูกค้า
                          linkedin:
                            type: string
                            description: LinkedIn ลูกค้า
                          telegram:
                            type: string
                            description: Telegram
                          wechat:
                            type: string
                            description: wechat ลูกค้า
                        description: 'Social Account ของลูกค้า '
                        x-apidog-orders:
                          - facebook
                          - line
                          - whatsapp
                          - skype
                          - instagram
                          - linkedin
                          - telegram
                          - wechat
                        x-apidog-ignore-properties: []
                        nullable: true
                      customerTags:
                        type: array
                        items:
                          type: string
                        description: แท็กลูกค้า
                        nullable: true
                      addresses:
                        type: array
                        items:
                          type: object
                          properties:
                            addressId:
                              type: integer
                            branchCode:
                              type: string
                              description: รหัสสาขา
                              nullable: true
                            locationName:
                              type: string
                              description: ชื่อสถานที่
                            locationAddress:
                              type: string
                              description: ที่อยู่
                            secondaryAddress:
                              type: string
                              description: ที่อยู่ ภาษาอังกฤษ
                            locationType:
                              type: integer
                              description: >-
                                ประเภทสถานที่ [1 = billing address , 2 =
                                shipping address]
                            latitude:
                              type: number
                              description: ละติจูด
                              nullable: true
                            longitude:
                              type: number
                              description: ลองจิจูด
                              nullable: true
                            subdistrict:
                              type: string
                              description: แขวง/ตำบล
                              nullable: true
                            subdistrictEN:
                              type: string
                              description: แขวง/ตำบล ภาษาอังกฤษ
                              nullable: true
                            district:
                              type: string
                              description: เขต/อำเภอ
                              nullable: true
                            districtEN:
                              type: string
                              description: เขต/อำเภอ ภาษาอังกฤษ
                              nullable: true
                            province:
                              type: string
                              description: จังหวัด
                              nullable: true
                            provinceEN:
                              type: string
                              description: จังหวัด ภาษาอังกฤษ
                              nullable: true
                            zipCode:
                              type: string
                              description: รหัสไปรษณีย์
                              nullable: true
                          x-apidog-orders:
                            - addressId
                            - 01KE67MG5QEBV75NM9A8ZX08NK
                          x-apidog-refs:
                            01KE67MG5QEBV75NM9A8ZX08NK: *ref_0
                          required:
                            - addressId
                            - locationName
                            - locationAddress
                            - secondaryAddress
                            - locationType
                          x-apidog-ignore-properties:
                            - branchCode
                            - locationName
                            - locationAddress
                            - secondaryAddress
                            - locationType
                            - latitude
                            - longitude
                            - subdistrict
                            - subdistrictEN
                            - district
                            - districtEN
                            - province
                            - provinceEN
                            - zipCode
                        description: ที่อยู่
                      sourceName:
                        type: string
                        description: แหล่งที่มาลูกค้า
                        nullable: true
                      customerGroupName:
                        type: string
                        description: กลุ่มลูกค้า [*ทำการสร้างให้ใหม่เมื่อข้อมูลไม่ตรงกัน]
                        nullable: true
                      interestsName:
                        type: array
                        items:
                          type: string
                        description: ความสนใจ [*ทำการสร้างให้ใหม่เมื่อข้อมูลไม่ตรงกัน]
                      classificationName:
                        type: string
                        description: คลาสลูกค้า โดยใส่ค่าได้ มากที่สุด 3 ตัวอักษร
                        nullable: true
                      customFields:
                        type: array
                        items:
                          type: object
                          properties:
                            customFieldName:
                              type: string
                              description: ชื่อหัวข้อฟิลด์
                            customFieldValue:
                              type: array
                              items:
                                type: string
                              description: ข้อมูลของฟิลด์
                          x-apidog-orders:
                            - customFieldName
                            - customFieldValue
                          required:
                            - customFieldName
                            - customFieldValue
                          x-apidog-ignore-properties: []
                        description: ฟิลด์ข้อมูลลูกค้าที่กำหนดเอง
                      contacts:
                        type: array
                        items:
                          type: object
                          properties:
                            contactName:
                              type: string
                              description: ผู้ติดต่อ
                            contactPicture:
                              type: string
                              description: รูปของผู้ติดต่อ ใช้เป็น URL ของรูป
                            contactPhone:
                              type: string
                              description: เบอร์โทรศัพ ของผู้ติดต่อ
                            contactMobile:
                              type: string
                              description: เบอร์โทรศัพมือถือ ของผู้ติดต่อ
                            contactEmail:
                              type: string
                              description: Email ของผู้ติดต่อ
                            contactSocialAccount:
                              type: object
                              properties:
                                facebook:
                                  type: string
                                  description: facebook ผู้ติดต่อ
                                line:
                                  type: string
                                  description: line ผู้ติดต่อ
                                whatsapp:
                                  type: string
                                  description: whatsApp ผู้ติดต่อ
                                skype:
                                  type: string
                                  description: skype ผู้ติดต่อ
                                instagram:
                                  type: string
                                  description: instagram ผู้ติดต่อ
                                linkedin:
                                  type: string
                                  description: linked ผู้ติดต่อ
                                telegram:
                                  type: string
                                  description: telegram ผู้ติดต่อ
                                wechat:
                                  type: string
                                  description: wechat ผู้ติดต่อ
                              description: Social Account ของผู้ติดต่อ
                              x-apidog-orders:
                                - facebook
                                - line
                                - whatsapp
                                - skype
                                - instagram
                                - linkedin
                                - telegram
                                - wechat
                              x-apidog-ignore-properties: []
                              nullable: true
                            contactPosition:
                              type: string
                              description: ตำแหน่ง ของผู้ติดต่อ
                            contactBirthdate:
                              type: string
                              description: 'วันเกิด ของผู้ติดต่อ โดยมี Format : "YYYY-MM-DD"'
                            contactNote:
                              type: string
                              description: รายละเอียดเพิ่มเติม
                            contactStatus:
                              type: boolean
                              description: true = active , false = inactive
                            tags:
                              type: array
                              items:
                                type: string
                              description: Tags ผู้ติดต่อ
                          x-apidog-orders:
                            - contactName
                            - contactPicture
                            - contactPhone
                            - contactMobile
                            - contactEmail
                            - contactSocialAccount
                            - contactPosition
                            - contactBirthdate
                            - contactNote
                            - contactStatus
                            - tags
                          x-apidog-ignore-properties: []
                        description: รายการข้อมูลผู้ติดต่อ
                      customerNote:
                        type: string
                        description: เมื่อ CustomerStatus เป็น Ended , Closed
                        nullable: true
                      owners:
                        type: array
                        items:
                          type: string
                          description: รายการผู้ติดต่อ
                        description: รหัสพนังงาน
                      creditLimit:
                        type: string
                        description: |-
                          งบลูกค้า
                          *ไม่มีใช้ใน venio
                        nullable: true
                      leadStatus:
                        type: integer
                        description: >-
                          สถานะผู้สนใจ 1 = New , 2 = Followup , 3 = Unqualified
                          , 4 = Interested [*ถ้าไม่มีการส่งข้อมูลมา Lead = 1
                          ,Prospect =  2, Customer = 3]
                    required:
                      - customerId
                      - customerName
                      - customerState
                      - customerType
                      - customerStatus
                      - customerPicture
                      - customerAliases
                      - customerSocialAccount
                      - addresses
                      - interestsName
                      - customFields
                      - contacts
                      - owners
                      - leadStatus
                    x-apidog-orders:
                      - customerId
                      - customerName
                      - customerCode
                      - customerState
                      - customerType
                      - customerStatus
                      - customerPicture
                      - customer2ndName
                      - customerAliases
                      - customerTaxNo
                      - branchCode
                      - customerPhone
                      - customerMobile
                      - customerEmail
                      - customerSocialAccount
                      - customerTags
                      - addresses
                      - sourceName
                      - customerGroupName
                      - interestsName
                      - classificationName
                      - customFields
                      - contacts
                      - customerNote
                      - owners
                      - creditLimit
                      - leadStatus
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - status
                  - data
                required:
                  - status
                  - data
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Create Type Business Success
        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/Customer
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-3590385-run
components:
  schemas:
    Customer.Address:
      type: object
      properties:
        branchCode:
          type: string
          description: รหัสสาขา
          nullable: true
        locationName:
          type: string
          description: ชื่อสถานที่
        locationAddress:
          type: string
          description: ที่อยู่
        secondaryAddress:
          type: string
          description: ที่อยู่ ภาษาอังกฤษ
        locationType:
          type: integer
          description: ประเภทสถานที่ [1 = billing address , 2 = shipping address]
        latitude:
          type: number
          description: ละติจูด
          nullable: true
        longitude:
          type: number
          description: ลองจิจูด
          nullable: true
        subdistrict:
          type: string
          description: แขวง/ตำบล
          nullable: true
        subdistrictEN:
          type: string
          description: แขวง/ตำบล ภาษาอังกฤษ
          nullable: true
        district:
          type: string
          description: เขต/อำเภอ
          nullable: true
        districtEN:
          type: string
          description: เขต/อำเภอ ภาษาอังกฤษ
          nullable: true
        province:
          type: string
          description: จังหวัด
          nullable: true
        provinceEN:
          type: string
          description: จังหวัด ภาษาอังกฤษ
          nullable: true
        zipCode:
          type: string
          description: รหัสไปรษณีย์
          nullable: true
      required:
        - locationName
        - locationAddress
        - secondaryAddress
        - locationType
      x-apidog-orders:
        - branchCode
        - locationName
        - locationAddress
        - secondaryAddress
        - locationType
        - latitude
        - longitude
        - subdistrict
        - subdistrictEN
        - district
        - districtEN
        - province
        - provinceEN
        - zipCode
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    '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: []

```
