# Get Products By Filter

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/products/getProduct:
    post:
      summary: Get Products By Filter
      deprecated: false
      description: ดึงข้อมูล product โดยการ filter
      tags:
        - Venio/Product
      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:
                productType:
                  type: integer
                  description: |-
                    ประเภทสินค้า
                    Product = 1301
                    Bundle = 1302
                productFor:
                  type: string
                  description: สินค้าสำหรับ
                  nullable: true
                typeFor:
                  type: integer
                  description: |-
                    null = all
                    1 = for sale
                    2 = for inventory 
                    none
                  nullable: true
                productGroupIds:
                  type: array
                  items:
                    type: integer
                  description: รายการรหัสกลุ่มสินค้า
                  nullable: true
                status:
                  type: array
                  items:
                    type: integer
                  description: สถานะ
                skip:
                  type: integer
                  description: จำนวนรายการที่ข้าม
                take:
                  type: integer
                  description: จำนวนรายการที่ต้องการแสดง
                smartSearch:
                  type: string
                  description: คำค้นหา
                  nullable: true
                orderBy:
                  type: string
                  description: จัดเรียงตาม
                  nullable: true
              x-apidog-orders:
                - productType
                - productFor
                - typeFor
                - productGroupIds
                - status
                - skip
                - take
                - smartSearch
                - orderBy
              required:
                - productType
                - status
                - take
            example:
              productFor: string
              typeFor: 0
              productType: 1031
              productGroupIds:
                - 0
              status:
                - true
              skip: 0
              take: 0
              smartSearch: string
              orderBy: 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:
                            productId:
                              type: integer
                              description: รหัสproductId
                            productType:
                              type: integer
                              description: ประเภทสินค้า
                            productCode:
                              type: string
                              description: รหัสสินค้า
                            groupId:
                              type: integer
                              description: รหัสกลุ่ม
                            groupName:
                              type: string
                              description: ชื่อกลุ่ม
                            productName:
                              type: string
                              description: ชื่อสินค้า
                            qty:
                              type: number
                              description: จำนวน
                            price:
                              type: number
                              description: ราคาสินค้า
                            companyId:
                              type: integer
                              description: |
                                รหัสบริษัท
                            unitName:
                              type: string
                              description: ชื่อหน่วย
                            unitId:
                              type: integer
                              description: รหัสหน่วย
                            notes:
                              type: string
                              description: รายละเอียดเพิ่มเติม
                              nullable: true
                            isForSale:
                              type: boolean
                              description: |
                                ขายแล้วหรือยัง
                                true= ขายแล้ว
                                false= ยัง
                              nullable: true
                            isForInventory:
                              type: boolean
                              description: |
                                มีสินค้าคงคลังหรือไม่
                                true = มี
                                false = ไม่มี
                            isForPurchase:
                              type: boolean
                              description: |-
                                สำหรับขอสั่งซื้อไม่
                                true=สำหรับขอสั่งซื้อ
                                false= ไม่
                            productValues:
                              type: array
                              items:
                                type: object
                                properties:
                                  itemId:
                                    type: integer
                                    description: รหัส item
                                  productPropertyId:
                                    type: integer
                                    description: รหัสคุณสมบัติสินค้า
                                    nullable: true
                                  productPeropertyValueId:
                                    type: integer
                                    description: รหัสค่าของคุณสมบัติ
                                    nullable: true
                                  proptertyValue:
                                    type: string
                                    description: ค่าของคุณสมบัติ
                                    nullable: true
                                x-apidog-orders:
                                  - itemId
                                  - productPropertyId
                                  - productPeropertyValueId
                                  - proptertyValue
                                required:
                                  - itemId
                              description: รายการคุณสมบัติสินค้า
                            isActive:
                              type: boolean
                              description: |-
                                ใช้งานอยู่หรือไหม
                                true=ใช้งานอยู่
                                false= ไม่ใช้งาน
                            attachments:
                              type: array
                              items:
                                type: object
                                properties:
                                  attachmentId:
                                    type: integer
                                    description: |
                                      รหัสfileแนบ
                                  refId:
                                    type: integer
                                    description: >-
                                      รหัสอ้างอิงจากตาราง activity, feedback,
                                      inventory,purchaseRequisition
                                  type:
                                    type: integer
                                    description: |-
                                      ประเภท file:
                                      1 = activity
                                      2 = expense
                                      3 = customer
                                  filename:
                                    type: string
                                    description: ไฟล์แนบ
                                  extension:
                                    type: string
                                    description: นามสกุลไฟล์
                                  fileSize:
                                    type: integer
                                    description: ขนาดไฟล์
                                  isActive:
                                    type: boolean
                                    description: |-
                                      ใช้งานอยู่หรือไม่
                                      true = ใช้งานอยู่
                                      false = ไม่ได้ใช้งานอยู่
                                    nullable: true
                                  createdByUserId:
                                    type: string
                                    description: รหัส userid ผู้สร้าง
                                  dateCreated:
                                    type: string
                                    description: เวลาสร้าง
                                  resourceUrl:
                                    type: string
                                    description: urlที่มา
                                  companyId:
                                    type: integer
                                    description: รหัสบริษัท
                                  isProcessed:
                                    type: boolean
                                    description: |-
                                      ดำเนินการแล้วหรือยัง
                                      true = ดำเนินการแล้ว
                                      false = ยังไม่ดำเนินการ
                                    nullable: true
                                  url:
                                    type: string
                                    description: url
                                  urlResponseUpload:
                                    type: string
                                    description: urlResponseUpload
                                  thumbnail:
                                    type: string
                                    description: thumbnail
                                x-apidog-orders:
                                  - attachmentId
                                  - refId
                                  - type
                                  - filename
                                  - extension
                                  - fileSize
                                  - isActive
                                  - createdByUserId
                                  - dateCreated
                                  - resourceUrl
                                  - companyId
                                  - isProcessed
                                  - url
                                  - urlResponseUpload
                                  - thumbnail
                                required:
                                  - attachmentId
                                  - refId
                                  - type
                                  - filename
                                  - extension
                                  - fileSize
                                  - createdByUserId
                                  - dateCreated
                                  - resourceUrl
                                  - companyId
                                  - url
                                  - urlResponseUpload
                                  - thumbnail
                              description: รายการไฟล์แนบ
                          x-apidog-orders:
                            - productId
                            - productType
                            - productCode
                            - groupId
                            - groupName
                            - productName
                            - qty
                            - price
                            - companyId
                            - unitId
                            - unitName
                            - notes
                            - isForSale
                            - isForInventory
                            - isForPurchase
                            - isActive
                            - productValues
                            - attachments
                          required:
                            - productId
                            - productType
                            - groupId
                            - groupName
                            - productName
                            - qty
                            - price
                            - companyId
                            - unitId
                            - unitName
                            - isForInventory
                            - isForPurchase
                            - productValues
                            - isActive
                            - attachments
                            - productCode
                      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-orders:
                  - statusCode
                  - httpStatusCode
                  - data
                required:
                  - statusCode
                  - httpStatusCode
                  - data
              example:
                data:
                  value:
                    - productId: 0
                      productType: 1031
                      productCode: string
                      groupId: 20
                      groupName: string
                      productName: string
                      qty: 1
                      price: 10
                      companyId: 0
                      unitId: 2
                      unitName: กล่อง
                      notes: string
                      isForInventory: true
                      isForPurchase: true
                      isActive: true
                      productValues: []
                      attachments:
                        - attachmentId: 1
                          refId: 1
                          type: 40007
                          filename: string
                          extension: image/jpeg
                          fileSize: 1
                          isActive: true
                          createdByUserId: string
                          dateCreated: 2021-09-15T10:04:42+0700
                          resourceUrl: string
                          companyId: 1015
                          url: string
                          urlResponseUpload: string
                          thumbnail: string
                  statusCode: 200
                statusCode: 1000
                httpStatusCode: 200
          headers: {}
          x-apidog-name: OK
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  hasError:
                    type: boolean
                    description: |-
                      มี error ไม่
                      true = มี
                      false = ไม่มี
                  errorMessage:
                    type: string
                    description: คำบรรยายerror
                  statusCode:
                    type: integer
                    description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                  httpStatusCode:
                    type: integer
                    description: |-
                      สถานะ code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  data:
                    type: object
                    properties:
                      statusCode:
                        type: integer
                        description: |-
                          สถานะ code ของ httpเช่น
                          200 Ok
                          201 Created
                          400 BadRequest
                          401 Unauthorized
                          404 Record not found
                          500 Internal Server Error
                    x-apidog-orders:
                      - statusCode
                    required:
                      - statusCode
                x-apidog-orders:
                  - hasError
                  - errorMessage
                  - statusCode
                  - httpStatusCode
                  - data
                required:
                  - hasError
                  - errorMessage
                  - statusCode
                  - httpStatusCode
                  - data
              example:
                data:
                  statusCode: 400
                hasError: true
                errorMessage: Internal Server Error
                statusCode: 9999
                httpStatusCode: 500
          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
              example:
                statusCode: 401
                message: >-
                  Access denied due to invalid subscription key. Make sure to
                  provide a valid key for an active subscription.
          headers: {}
          x-apidog-name: Unauthorized
        '403':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                  httpStatusCode:
                    type: integer
                    description: |-
                      สถานะ  code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  errorMessage:
                    type: string
                    description: คำอธิบายเกี่ยวกับ error
                  hasError:
                    type: boolean
                    description: |-
                      มี error ไหม
                      true = มี
                      false = ไม่มี
                  data:
                    type: object
                    properties:
                      authenticationSchemes:
                        type: array
                        items:
                          type: string
                        description: ค่า Enum ของ authenticationSchemes
                    x-apidog-orders:
                      - authenticationSchemes
                    required:
                      - authenticationSchemes
                    description: |-
                      ข้อมูลที่จะแสดง ไม่จำกัดรูปแบบว่าจะเป็นเช่นไร 
                      ตอนเรียกออกมาสามารเป็น Array และ Object ได้
                x-apidog-orders:
                  - statusCode
                  - httpStatusCode
                  - errorMessage
                  - hasError
                  - data
                description: ' กรณีที่คนที่ดูไม่มี permission view data '
                required:
                  - statusCode
                  - httpStatusCode
                  - errorMessage
                  - hasError
                  - data
              example:
                data:
                  authenticationSchemes: []
                hasError: true
                errorMessage: Invalid access rights
                statusCode: 9503
                httpStatusCode: 403
          headers: {}
          x-apidog-name: Forbidden
      security:
        - bearer: []
      x-apidog-folder: Venio/Product
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-3607153-run
components:
  schemas: {}
  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: []

```
