# Get a Product by ProductCode

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v2/products/{productCode}:
    get:
      summary: Get a Product by ProductCode
      deprecated: false
      description: การแสดงสินค้าโดยใช้ productCode
      tags:
        - Venio/Product
      parameters:
        - name: productCode
          in: path
          description: รหัสสินค้า
          required: true
          schema:
            type: string
        - name: Ocp-Apim-Subscription-Key
          in: header
          description: รหัส subscription key ลูกค้า
          required: true
          example: <Your-Subscription-Key>
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: 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: คำอธิบายข้อความที่จะแสดง
                    x-apidog-orders:
                      - code
                      - description
                    required:
                      - code
                      - description
                  data:
                    type: object
                    properties:
                      productCode:
                        type: string
                        description: รหัสสินค้า [ไม่ต้องกรอก ถ้าเป็น multi-SKU]
                      productBarcode:
                        type: string
                        description: รหัสบาร์โค้ด
                      productName:
                        type: string
                        description: ชื่อสินค้า
                      productDescription:
                        type: string
                        description: รายละเอียดสินค้า
                      category:
                        type: string
                        description: >-
                          หมวดหมู่หลัก [ถ้ามีการส่งข้อมูลมาไม่ตรงกับระบบ
                          ทางระบบจะทำการสร้าง Category ให้]
                      subCategory:
                        type: string
                        description: >-
                          หมวดหมู่รอง [ถ้ามีการส่งข้อมูลมาไม่ตรงกับระบบ
                          ทางระบบจะทำการสร้าง Category ให้]
                      sub_SubCategory:
                        type: string
                        description: >-
                          หมวดหมู่ย่อย [ถ้ามีการส่งข้อมูลมาไม่ตรงกับระบบ
                          ทางระบบจะทำการสร้าง Category ให้]
                      cost:
                        type: number
                        description: >-
                          ต้นทุนสินค้า [ระบบจะไม่ Required และไม่สนใจ ถ้าเป็น
                          Multi SKU]
                      prices:
                        type: array
                        items:
                          type: object
                          properties:
                            priceTierName:
                              type: string
                              description: ชื่อระดับราคา
                            regularPrice:
                              type: number
                              description: ราคาปกติ
                            salePrice:
                              type: number
                              description: ราคาลด
                            vatValue:
                              type: number
                              description: >-
                                ภาษีมูลค่าเพิ่ม [ถ้าไม่มีอยู๋ในระบบ
                                จะทำการสร้างให้]
                              nullable: true
                            useDefaultVat:
                              type: boolean
                              description: >-
                                <p>ใช้ภาษีมูลค่าเพิ่ม ที่เป็นค่าเริ่มต้น
                                [<br>False = ไม่ใช้ Vat default , <br>True = ใช้
                                Vat default] <br>ค่า Vat จะเป็นตาม Set Defult
                                Vat</p>
                          x-apidog-orders:
                            - priceTierName
                            - regularPrice
                            - salePrice
                            - vatValue
                            - useDefaultVat
                          required:
                            - priceTierName
                            - regularPrice
                            - useDefaultVat
                        description: รายการราคาสินค้า
                      productUnitName:
                        type: string
                        description: >-
                          หน่วยสินค้า [ถ้าใส่ค่า Unit ไม่ตรงกับระบบ จะแสดง
                          error]
                      productWeight:
                        type: number
                        description: ' น้ำหนักสินค้า'
                      productWeightUnit:
                        type: string
                        description: "หน่วยน้ำหนักสินค้า\_[ระบบ\_Default\_ให้\_มี\_\"gram\"\_,\_\"kilogram\"]"
                      productTag:
                        type: array
                        items:
                          type: string
                        description: >-
                          ป้ายกำกับสินค้า [ถ้าไม่ตรงกับในระบบ จะสร้าง productTag
                          ให้ใหม่]
                      productImage:
                        type: array
                        items:
                          type: string
                        description: ' รูปสินค้า ให้ส่งเป็น PublicUrl'
                      trackInventory:
                        type: boolean
                        description: >-
                          จัดการข้อมูลคลังสินค้า [true = อนุญาตให้จัดการ , false
                          = ไม่อนุญาตให้จัดการ]
                      useWarranty:
                        type: boolean
                        description: >-
                          การรับประกันสินค้า [true = รับประกัน , false =
                          ไม่รับประกัน]
                      timeWarrantyValue:
                        type: integer
                        description: ' ระยะเวลาการรับประกันสินค้า'
                      timeWarrantyUnit:
                        type: string
                        description: >-
                          หน่วยเวลาการรับประกันสินค้า [y = year ,m = month ,d =
                          day]
                      warrantyNote:
                        type: string
                        description: ' บันทึกการรับประกันสินค้า'
                      visibility:
                        type: boolean
                        description: true = ทำรายการขายได้ , false = ทำรายการขายไม่ได้]
                      active:
                        type: boolean
                        description: สถานะสินค้า [true = ใช้งาน , false = ไม่ใช้งาน]
                      warehouses:
                        type: object
                        properties:
                          warehouseCode:
                            type: string
                          qty:
                            type: number
                          availableQty:
                            type: number
                          allocatedQty:
                            type: number
                          lowStockAlert:
                            type: number
                        x-apidog-orders:
                          - warehouseCode
                          - qty
                          - availableQty
                          - allocatedQty
                          - lowStockAlert
                    x-apidog-orders:
                      - productCode
                      - productBarcode
                      - productName
                      - productDescription
                      - category
                      - subCategory
                      - sub_SubCategory
                      - cost
                      - prices
                      - productUnitName
                      - productWeight
                      - productWeightUnit
                      - productTag
                      - productImage
                      - trackInventory
                      - useWarranty
                      - timeWarrantyValue
                      - timeWarrantyUnit
                      - warrantyNote
                      - visibility
                      - active
                      - warehouses
                    required:
                      - productCode
                      - productName
                      - category
                      - prices
                      - productUnitName
                      - trackInventory
                      - useWarranty
                      - visibility
                      - active
                x-apidog-orders:
                  - status
                  - data
                required:
                  - status
                  - data
              examples:
                '1':
                  summary: OK (200)
                  value:
                    status:
                      code: '1000'
                      description: Success
                    data:
                      productCode: OSP100
                      productBarcode: ''
                      productName: Singel Open API-2
                      productDescription: Open API Test
                      category: Open API
                      cost: 10
                      prices:
                        - priceTierName: Normal Price
                          regularPrice: 5000
                          salePrice: 2500
                          vatValue: 7
                          useDefaultVat: false
                      productUnitName: API
                      productTag: []
                      productImage:
                        - https://i.postimg.cc/8zj5pZf8/Ea-Ix-XP-VAAY2-K8-X.jpg
                      trackInventory: true
                      qty: 90
                      lowStockAlert: 10
                      useWarranty: false
                      visibility: true
                      active: true
                      warehouses:
                        - warehouseCode: WH001
                          qty: 50
                          availableQty: 49
                          allocatedQty: 1
                          lowStockAlert: 5
                        - warehouseCode: WH002
                          qty: 30
                          availableQty: 49
                          allocatedQty: 1
                          lowStockAlert: 3
                '2':
                  summary: Bad Request (400)
                  value:
                    status:
                      code: E1102
                      description: Product "100022jujo" doesn't exist.
                '3':
                  summary: Unauthorized (401)
                  value:
                    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: OK
        '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/bussiness\_code"
                    required:
                      - code
                      - description
                    x-apidog-orders:
                      - code
                      - description
                x-apidog-orders:
                  - status
                required:
                  - status
          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
          headers: {}
          x-apidog-name: Unauthorized
      security:
        - bearer: []
      x-apidog-folder: Venio/Product
      x-apidog-status: developing
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-3597197-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: []

```
