# Check Customer Existence

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/customers/exist:
    post:
      summary: Check Customer Existence
      deprecated: false
      description: |-
        ใช้สำหรับตรวจสอบว่า “มีลูกค้านี้อยู่ในระบบแล้วหรือไม่”
        ไม่ใช่เส้นสำหรับดึงรายละเอียด
        ไม่ใช่เส้นสำหรับ search แบบ list ยาว
      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:
                customerCode:
                  type: string
                  description: ตรวจสอบจากรหัสลูกค้า
                customerName:
                  type: string
                  description: ตรวจสอบจากชื่อลูกค้า
                customerTaxNo:
                  type: string
                  description: ตรวจสอบจากเลขผู้เสียภาษี
                customerPhone:
                  type: string
                  description: ตรวจสอบจากเบอร์โทรลูกค้า
                customerMobile:
                  type: string
                  description: ตรวจสอบจากเบอร์โทรลูกค้า
                customerEmail:
                  type: string
                  description: ตรวจสอบจากอีเมลลูกค้า
                contactName:
                  type: string
                  description: ตรวจสอบจากชื่อผู้ติดต่อ
                contactPhone:
                  type: string
                  description: ตรวจสอบจากเบอร์โทรผู้ติดต่อ
                contactMobile:
                  type: string
                  description: ตรวจสอบจากเบอร์โทรผู้ติดต่อ
                contactEmail:
                  type: string
                  description: ตรวจสอบจากอีเมลผู้ติดต่อ
                isExactMatch:
                  type: boolean
                  description: >-
                    true = ค้นหาแบบตรงเป๊ะ (Exact Match), false =
                    ค้นหาแบบบางส่วน (Partial Match/LIKE)

                    default เป็น false
                take:
                  type: integer
                  description: จำนวน record ที่ต้องการ (แทน pageLength)
                skip:
                  type: integer
                  description: จำนวน record ที่ข้าม (Pagination)
              x-apidog-orders:
                - customerCode
                - customerName
                - customerTaxNo
                - customerPhone
                - customerMobile
                - customerEmail
                - contactName
                - contactPhone
                - contactMobile
                - contactEmail
                - isExactMatch
                - take
                - skip
              required:
                - take
              description: >-
                ต้องมีอย่างน้อย 1 identifier ถ้าไม่ส่ง identifier ใดเลย
                ให้ถือว่า invalid request

                Identifiers
              x-apidog-ignore-properties: []
            example:
              customerCode: L000030
              customerName: บริษัท เทคโนโลยี จำกัด (มหาชน)
              customerTaxNo: '0107550000203'
              customerPhone: '021234567'
              customerMobile: '0801234567'
              customerEmail: tech@mail.com
              contactName: Somjai
              contactPhone: '021345567'
              contactMobile: '0811123455'
              contactEmail: somjai@mail.com
              isExactMatch: true
              take: 20
              skip: 0
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                      description:
                        type: string
                    required:
                      - code
                      - description
                    x-apidog-orders:
                      - code
                      - description
                    x-apidog-ignore-properties: []
                  data:
                    type: object
                    properties:
                      exists:
                        type: boolean
                      matches:
                        type: array
                        items:
                          type: object
                          properties:
                            customerId:
                              type: integer
                            customerCode:
                              type: string
                            customerName:
                              type: string
                            customerState:
                              type: integer
                            customerPhone:
                              type: string
                            customerEmail:
                              type: string
                            customerTaxNo:
                              type: string
                          x-apidog-orders:
                            - customerId
                            - customerCode
                            - customerName
                            - customerState
                            - customerPhone
                            - customerEmail
                            - customerTaxNo
                          required:
                            - customerId
                            - customerCode
                            - customerName
                            - customerState
                            - customerPhone
                            - customerEmail
                            - customerTaxNo
                          x-apidog-ignore-properties: []
                    x-apidog-orders:
                      - exists
                      - matches
                    required:
                      - exists
                      - matches
                    x-apidog-ignore-properties: []
                required:
                  - status
                  - data
                x-apidog-orders:
                  - status
                  - data
                x-apidog-ignore-properties: []
              example:
                status:
                  code: '200'
                  description: success
                data:
                  exists: true
                  matches:
                    - customerId: 58
                      customerCode: C-2024-0003
                      customerName: คุณเอลวิรา เฟฮีย์ (Elvira Fahey)
                      customerState: 1
                      customerPhone: 096-769-0708
                      customerEmail: elvira.fahey@premium-logistics.com
                      customerTaxNo: '0105564000123'
                    - customerId: 5
                      customerCode: C-2024-0004
                      customerName: คุณบอยด์ เวอัม (Boyd Veum)
                      customerState: 1
                      customerPhone: 096-769-0707
                      customerEmail: boyd.veum@tech-solutions.co.th
                      customerTaxNo: '9083716047588'
          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:
            required: true
            schemeGroups:
              - id: zrrM0S3yVuBDPVkRluN58
                schemeIds:
                  - bearerAuth
            use:
              id: zrrM0S3yVuBDPVkRluN58
      x-apidog-folder: Venio/Customer
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-28108417-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: []

```
