# Customers Enquiry

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/customers/enquiry:
    post:
      summary: Customers Enquiry
      deprecated: true
      description: 'ดึงข้อมูล customer '
      tags:
        - Venio/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:
                customerType:
                  type: integer
                  description: ประเภทลูกค้า Lead=11100, Prospect=11200, Customer=11300
                customerTaxNo:
                  type: string
                  description: เลขประจำตัวผู้เสียภาษี
                branchCode:
                  type: string
                  description: รหัสสาขา
                latitude:
                  type: number
                  description: ละติจูด
                longitude:
                  type: number
                  description: ลองจิจูด
                distanceLimit:
                  type: number
                  description: ระยะทาง ***ใส่ได้กรณีที่มีระบุค่า ละติจูด และลองจิจูด
                states:
                  type: integer
                  description: สถานะลูกค้า
                actionStates:
                  type: integer
                  description: สถานะการกระทำของลูกค้า
                ownerTeams:
                  type: integer
                  description: 1 = All, 2 = Assigned, Else = Team Id
                displayColumns:
                  type: array
                  items:
                    type: string
                  description: |-

                    See available columns
                topicInterests:
                  type: array
                  items:
                    type: integer
                  description: รายการหัวข้อที่สนใจ
                owners:
                  type: array
                  items:
                    type: string
                  description: รหัสพนักงานผู้รับผิดชอบ
                primaryOwner:
                  type: string
                  description: รหัสพนักงานผู้รับผิดชอบหลัก
                classifications:
                  type: array
                  items:
                    type: integer
                  description: รายการหมวดหมู่
                groups:
                  type: array
                  items:
                    type: integer
                  description: |-

                    Lead/Prospect/Customer group ids
                statuses:
                  type: array
                  items:
                    type: boolean
                  description: รายการสถานะ
                probabilities:
                  type: array
                  items:
                    type: integer
                  description: รายการความน่าจะเป็น
                pageLength:
                  type: integer
                  description: ความยาวของหน้า
                skip:
                  type: integer
                  description: จำนวนที่ข้าม
                orderBy:
                  type: string
                  description: จัดเรียงโดย
                keyword:
                  type: string
                  description: คำค้นหา
              x-apidog-orders:
                - customerType
                - customerTaxNo
                - branchCode
                - latitude
                - longitude
                - distanceLimit
                - states
                - actionStates
                - ownerTeams
                - displayColumns
                - topicInterests
                - owners
                - primaryOwner
                - classifications
                - groups
                - statuses
                - probabilities
                - pageLength
                - skip
                - orderBy
                - keyword
              required:
                - customerType
                - pageLength
              x-apidog-ignore-properties: []
            example:
              customerType: 11100
              latitude: 0
              longitude: 0
              distanceLimit: 0
              states: 0
              actionStates: 0
              ownerTeams: 0
              displayColumns:
                - string
              topicInterests:
                - 0
              owners:
                - string
              primaryOwner: string
              classifications:
                - 0
              groups:
                - 0
              statuses:
                - true
              probabilities:
                - 0
              pageLength: 0
              skip: 0
              orderBy: string
              keyword: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                  httpStatusCode:
                    type: integer
                    description: |-
                      สถานะ code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  data:
                    type: object
                    properties:
                      value:
                        type: array
                        items:
                          type: object
                          properties:
                            customerId:
                              type: integer
                              description: รหัส Id ลูกค้า
                            customerCode:
                              type: string
                              description: รหัสลูกค้า
                            customerName:
                              type: string
                              description: ชื่อลูกค้า
                            groupName:
                              type: string
                              description: ชื่อกลุ่ม
                              nullable: true
                            classificationName:
                              type: string
                              description: ชื่อหมวดหมู่
                              nullable: true
                            owners:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                    description: รหัส owner
                                  title:
                                    type: string
                                    description: หัวข้อ
                                  group:
                                    type: string
                                    description: กลุ่ม
                                    nullable: true
                                  teamId:
                                    type: integer
                                    description: รหัสทีม
                                  pictureUrl:
                                    type: string
                                    description: url รูป
                                  seq:
                                    type: integer
                                  isPrimaryOwner:
                                    type: boolean
                                    description: Flag สำหรับบ่งบอกว่าเป็นผู้รับผิดชอบหลัก
                                x-apidog-orders:
                                  - id
                                  - title
                                  - group
                                  - teamId
                                  - pictureUrl
                                  - seq
                                  - isPrimaryOwner
                                required:
                                  - id
                                  - title
                                  - teamId
                                  - pictureUrl
                                x-apidog-ignore-properties: []
                              description: |-

                                รายการ Owner
                            topicInterests:
                              type: array
                              items:
                                type: object
                                properties:
                                  topicId:
                                    type: integer
                                    description: ' รหัสหัวข้อ'
                                  topicName:
                                    type: string
                                    description: ชื่อหัวข้อ
                                x-apidog-orders:
                                  - topicId
                                  - topicName
                                required:
                                  - topicId
                                  - topicName
                                x-apidog-ignore-properties: []
                              description: |-

                                รายการหัวข้อที่สนใจ
                            latestUpdateByUser:
                              type: string
                              description: |-

                                Update ล่าสุดโดยใคร
                              nullable: true
                            latestUpdateType:
                              type: string
                              description: |-

                                ประเภท Update ล่าสุด
                              nullable: true
                            dateLatestUpdated:
                              type: string
                              description: |-

                                เวลา Update ล่าสุด
                              nullable: true
                            onGoingStats:
                              type: array
                              items:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    description: ประเภท
                                  count:
                                    type: integer
                                    description: จำนวน
                                    nullable: true
                                x-apidog-orders:
                                  - type
                                  - count
                                required:
                                  - type
                                x-apidog-ignore-properties: []
                              description: ' รายการสถานะของ OnGoing'
                              nullable: true
                            activityStats:
                              type: array
                              items:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    description: ประเภท
                                  count:
                                    type: integer
                                    description: จำนวน
                                    nullable: true
                                x-apidog-orders:
                                  - type
                                  - count
                                required:
                                  - type
                                x-apidog-ignore-properties: []
                              description: รายการสถานะกิจกรรม
                            thisYearStats:
                              type: array
                              items:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    description: ประเภท
                                  count:
                                    type: integer
                                    description: จำนวน
                                    nullable: true
                                x-apidog-orders:
                                  - type
                                  - count
                                required:
                                  - type
                                x-apidog-ignore-properties: []
                              description: ' รายการสถานะของปีปัจจุบัน'
                              nullable: true
                            pictureUrl:
                              type: string
                              description: |-

                                Url รูปภาพ
                            uniqueName:
                              type: string
                              description: |-

                                ชื่อเฉพาะ
                            dateAcquired:
                              type: integer
                              description: |-

                                เวลาทีได้รับ ปี
                            leadStatus:
                              type: integer
                              description: |-

                                สถานะของ Lead
                              nullable: true
                            currentStateId:
                              type: integer
                              description: รหัสสถานะปัจจุบัน
                              nullable: true
                            currentStateName:
                              type: string
                              description: |-

                                ชื่อสถานะปัจจุบัน
                              nullable: true
                            sourceOfLead:
                              type: string
                              description: ข้อมูลแหล่งที่มา
                              nullable: true
                            dateFollowUp:
                              type: string
                              description: เวลาติดตาม
                              nullable: true
                            markDealStage:
                              type: object
                              properties:
                                current:
                                  type: integer
                                  description: deal stage ปัจจุบัน
                                  nullable: true
                                max:
                                  type: integer
                                  description: เยอะที่สุด
                              description: รายละเอียดเกณฑ dealstage
                              x-apidog-orders:
                                - current
                                - max
                              required:
                                - max
                              x-apidog-ignore-properties: []
                              nullable: true
                            dealStage:
                              type: integer
                              description: รหัสสถานะของ deal
                            dealName:
                              type: string
                              description: ชื่อสถานะของ deal
                              nullable: true
                            dealPotential:
                              type: number
                              description: ผลรวมค่าdeal
                              nullable: true
                          x-apidog-orders:
                            - customerId
                            - customerCode
                            - customerName
                            - groupName
                            - classificationName
                            - owners
                            - topicInterests
                            - latestUpdateByUser
                            - latestUpdateType
                            - dateLatestUpdated
                            - onGoingStats
                            - activityStats
                            - thisYearStats
                            - pictureUrl
                            - uniqueName
                            - dateAcquired
                            - leadStatus
                            - currentStateId
                            - currentStateName
                            - sourceOfLead
                            - dateFollowUp
                            - markDealStage
                            - dealStage
                            - dealName
                            - dealPotential
                          required:
                            - customerId
                            - customerName
                            - owners
                            - topicInterests
                            - pictureUrl
                            - uniqueName
                            - dateAcquired
                          x-apidog-ignore-properties: []
                      statusCode:
                        type: integer
                        description: |-
                          สถานะ code ของ httpเช่น
                          200 Ok
                          201 Created
                          400 BadRequest
                          401 Unauthorized
                          404 Record not found
                          500 Internal Server Error
                    x-apidog-orders:
                      - value
                      - statusCode
                    required:
                      - value
                      - statusCode
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - statusCode
                  - httpStatusCode
                  - data
                required:
                  - statusCode
                  - httpStatusCode
                  - data
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: OK
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: |-
                      สถานะ code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  message:
                    type: string
                    description: คำบรรยาย error
                x-apidog-orders:
                  - statusCode
                  - message
                required:
                  - statusCode
                  - message
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Unauthorized
        x-200:Bad Request:
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                  httpStatusCode:
                    type: integer
                    description: |-
                      สถานะ  code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  errorMessage:
                    type: string
                    description: คำอธิบายเกี่ยวกับ error
                  hasError:
                    type: boolean
                    description: |-
                      มี error ไหม
                      true = มี
                      false = ไม่มี
                  validationErrors:
                    type: object
                    properties:
                      pageLength:
                        type: string
                        description: >-
                          คำบรรยายเกี่ยวกับ errorที่เกิดขึ้นกับการป้อน
                          pageLength
                        nullable: true
                      customerType:
                        type: string
                        description: >-
                          คำบรรยายเกี่ยวกับ errorที่เกิดขึ้นกับการป้อน
                          customerType
                        nullable: true
                    x-apidog-orders:
                      - pageLength
                      - customerType
                    description: รายการ errror ที่เกี่ยวกับการ validation
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - statusCode
                  - httpStatusCode
                  - errorMessage
                  - hasError
                  - validationErrors
                description: ' กรณีที่การป้อน request body มีการผิดพลาด'
                required:
                  - statusCode
                  - httpStatusCode
                  - errorMessage
                  - hasError
                  - validationErrors
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Bad Request
        x-200:User authentication required V2.:
          description: ''
          content:
            application/json:
              schema:
                title: ''
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Required%20authorization'
                  status:
                    $ref: '#/components/schemas/Response%20Error%20Msg%20'
                required:
                  - data
                  - status
                x-apidog-orders:
                  - data
                  - status
                x-apidog-ignore-properties: []
              example:
                data:
                  subCode: E9103
                  description: Authorization credentials required
                  metadata: {}
                status:
                  code: '4001'
                  description: Business error with 1 errors
          headers: {}
          x-apidog-name: User authentication required V2.
      security:
        - bearer: []
      x-apidog-folder: Venio/Customer
      x-apidog-status: deprecated
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-3601324-run
components:
  schemas:
    'Response Error Msg ':
      type: object
      properties:
        code:
          type: string
          x-apidog-mock: '4001'
        description:
          type: string
          x-apidog-mock: Business error with 1 errors
      required:
        - code
        - description
      x-apidog-orders:
        - code
        - description
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    Required authorization:
      type: object
      properties:
        subCode:
          type: string
          x-apidog-mock: E9103
        description:
          type: string
          x-apidog-mock: Authorization credentials required
        metadata:
          type: object
          properties: {}
          x-apidog-orders: []
          x-apidog-ignore-properties: []
      required:
        - subCode
        - description
        - metadata
      x-apidog-orders:
        - subCode
        - description
        - metadata
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    bearerAuth:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: ใส่ JWT Token ในรูปแบบ Bearer {token}
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.gofive.co.th
    description: Production
security:
  - bearerAuth: []
    x-apidog:
      schemeGroups:
        - id: uyL_cJmK7q60QJZRTi5ot
          schemeIds:
            - bearerAuth
      required: true
      use:
        id: uyL_cJmK7q60QJZRTi5ot
      scopes:
        uyL_cJmK7q60QJZRTi5ot:
          bearerAuth: []

```
