# Get Customer By TaxID

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v3/customers/by-tax/{customerTaxNo}:
    get:
      summary: Get Customer By TaxID
      deprecated: false
      description: |-
        ใช้สำหรับกรณีผู้ใช้รู้ Tax ID แน่ชัด และต้องการดึงข้อมูลเต็ม
        ต้องเป็น exact match (ไม่ fuzzy)
      tags:
        - Venio/Customer
      parameters:
        - name: customerTaxNo
          in: path
          description: Tax No. ของลูกค้าที่ต้องการค้นหา (ต้องพิมพ์ครบทุกตัวอักษร)
          required: true
          schema:
            type: string
        - 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
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: |-
                          สถานะ code ของ http เช่น
                          200 Ok
                          201 Created
                          400 BadRequest
                          401 Unauthorized
                          404 Record not found
                          500 Internal Server Error
                      description:
                        type: string
                    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: ชื่อลูกค้า
                      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)
                      leadStatus:
                        type: integer
                        description: สถานะของ Lead
                      customerPicture:
                        type: string
                        description: |+
                          รูปของลูกค้า โดยรับเป็น URL

                      customer2ndName:
                        type: string
                        description: ชื่อรองลูกค้า เช่น ชื่อลูกค้าภาษาอื่นๆ
                      customerAliases:
                        type: array
                        items:
                          type: string
                        description: รายการนามแฝง
                      customerTaxNo:
                        type: string
                        description: เลขประจำตัวผู้เสียภาษี
                      customerPhone:
                        type: string
                        description: เบอร์โทรศัพท์ลูกค้า
                      customerMobile:
                        type: string
                        description: เบอร์มือถือลูกค้า
                      customerEmail:
                        type: string
                        description: อีเมลลูกค้า
                      customerSocialAccount:
                        type: object
                        properties:
                          facebook:
                            type: string
                        required:
                          - facebook
                        x-apidog-orders:
                          - facebook
                        description: Social Account ของลูกค้า
                        x-apidog-ignore-properties: []
                      customerTags:
                        type: array
                        items:
                          type: string
                        description: แท็กของลูกค้า
                      addresses:
                        type: array
                        items:
                          type: object
                          properties:
                            addressId:
                              type: integer
                            branchCode:
                              type: string
                            locationName:
                              type: string
                            locationAddress:
                              type: string
                            secondaryAddress:
                              type: string
                            locationType:
                              type: integer
                            latitude:
                              type: string
                            longitude:
                              type: string
                            subdistrict:
                              type: string
                            subdistrictEN:
                              type: string
                            district:
                              type: string
                            districtEN:
                              type: string
                            province:
                              type: string
                            provinceEN:
                              type: string
                            zipCode:
                              type: string
                          x-apidog-orders:
                            - addressId
                            - branchCode
                            - locationName
                            - locationAddress
                            - secondaryAddress
                            - locationType
                            - latitude
                            - longitude
                            - subdistrict
                            - subdistrictEN
                            - district
                            - districtEN
                            - province
                            - provinceEN
                            - zipCode
                          x-apidog-ignore-properties: []
                        description: ที่อยู่
                      sourceName:
                        type: string
                        description: แหล่งที่มาลูกค้า
                      customerGroupName:
                        type: string
                        description: กลุ่มลูกค้า
                      interestsName:
                        type: array
                        items:
                          type: string
                        description: ความสนใจ
                      classificationName:
                        type: string
                        description: คลาสลูกค้า
                      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: ฟิลด์ข้อมูลลูกค้าที่กำหนดเอง
                      contact:
                        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: whatsApp ผู้ติดต่อ
                                instagram:
                                  type: string
                                  description: instagram ผู้ติดต่อ
                                linkedin:
                                  type: string
                                  description: linkedin ผู้ติดต่อ
                                telegram:
                                  type: string
                                  description: telegram ผู้ติดต่อ
                                wechat:
                                  type: string
                                  description: wechat ผู้ติดต่อ
                              required:
                                - facebook
                                - line
                                - whatsapp
                                - skype
                                - instagram
                                - linkedin
                                - telegram
                                - wechat
                              x-apidog-orders:
                                - facebook
                                - line
                                - whatsapp
                                - skype
                                - instagram
                                - linkedin
                                - telegram
                                - wechat
                              description: Social Account ของผู้ติดต่อ
                              x-apidog-ignore-properties: []
                            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: รายละเอียดเพิ่มเติม
                      owners:
                        type: array
                        items:
                          type: string
                        description: |+
                          รหัสพนักงานผู้รับผิดชอบ

                      primaryOwner:
                        type: string
                        description: รหัสพนักงานผู้รับผิดชอบหลัก
                    required:
                      - customerId
                      - customerName
                      - customerCode
                      - customerState
                      - customerType
                      - customerStatus
                      - leadStatus
                      - customerPicture
                      - customer2ndName
                      - customerAliases
                      - customerTaxNo
                      - customerPhone
                      - customerMobile
                      - customerEmail
                      - customerSocialAccount
                      - customerTags
                      - addresses
                      - sourceName
                      - customerGroupName
                      - interestsName
                      - classificationName
                      - customFields
                      - contact
                      - customerNote
                      - owners
                      - primaryOwner
                    x-apidog-orders:
                      - customerId
                      - customerName
                      - customerCode
                      - customerState
                      - customerType
                      - customerStatus
                      - leadStatus
                      - customerPicture
                      - customer2ndName
                      - customerAliases
                      - customerTaxNo
                      - customerPhone
                      - customerMobile
                      - customerEmail
                      - customerSocialAccount
                      - customerTags
                      - addresses
                      - sourceName
                      - customerGroupName
                      - interestsName
                      - classificationName
                      - customFields
                      - contact
                      - customerNote
                      - owners
                      - primaryOwner
                    x-apidog-ignore-properties: []
                required:
                  - status
                  - data
                x-apidog-orders:
                  - status
                  - data
                x-apidog-ignore-properties: []
              example:
                status:
                  code: '1000'
                  description: Success
                data:
                  customerId: string
                  customerName: string
                  customerCode: string
                  customerState: 3
                  customerType: 1
                  customerStatus: 0
                  leadStatus: 4
                  customerPicture: string
                  customer2ndName: string
                  customerAliases:
                    - string
                  customerTaxNo: string
                  customerPhone: string
                  customerMobile: string
                  customerEmail: string
                  customerSocialAccount:
                    facebook: string
                  customerTags:
                    - string
                  addresses:
                    - addressId: 0
                      branchCode: string
                      locationName: string
                      locationAddress: string
                      secondaryAddress: string
                      locationType: 1
                      latitude: string
                      longitude: string
                      subdistrict: string
                      subdistrictEN: string
                      district: string
                      districtEN: string
                      province: string
                      provinceEN: string
                      zipCode: string
                  sourceName: string
                  customerGroupName: string
                  interestsName:
                    - string
                  classificationName: string
                  customFields:
                    - null
                  contact:
                    - contactName: string
                      contactPicture: string
                      contactPhone: string
                      contactMobile: string
                      contactEmail: string
                      contactSocialAccount:
                        facebook: string
                      contactPosition: string
                      contactBirthdate: YYYY-MM-DD
                      contactNote: string
                      contactStatus: true
                      tags:
                        - string
                  customerNote: string
                  owners:
                    - string
                  primaryOwner: string
          headers: {}
          x-apidog-name: 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:
        - bearerAuth: []
          x-apidog:
            schemeGroups:
              - id: uyL_cJmK7q60QJZRTi5ot
                schemeIds:
                  - bearerAuth
            required: true
            use:
              id: uyL_cJmK7q60QJZRTi5ot
            scopes:
              uyL_cJmK7q60QJZRTi5ot:
                bearerAuth: []
      x-apidog-folder: Venio/Customer
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-28109932-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: bearer
      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: []

```
