# Get product by item code

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://apidocs.cata.sg/pos-integration-service-api/api/v-1/products/item-code/llms.txt.
> For full documentation content, see https://apidocs.cata.sg/pos-integration-service-api/api/v-1/products/item-code/llms-full.txt.

GET http://localhost:8080/api/v1/products/{itemCode}

Returns the full flat product record (base fields, modifiers,
per-store prices, bundle sections if applicable).
Accepts either a partner API key or a user JWT.


Reference: https://apidocs.cata.sg/pos-integration-service-api/api/v-1/products/item-code/get-product-by-item-code

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/products/{itemCode}:
    get:
      operationId: get-product-by-item-code
      summary: Get product by item code
      description: |
        Returns the full flat product record (base fields, modifiers,
        per-store prices, bundle sections if applicable).
        Accepts either a partner API key or a user JWT.
      tags:
        - >-
          subpackage_api.subpackage_api/v1.subpackage_api/v1/products.subpackage_api/v1/products/itemCode
      parameters:
        - name: itemCode
          in: path
          description: Unique product item code
          required: true
          schema:
            type: string
        - name: X-Api-Key
          in: header
          required: true
          schema:
            type: string
        - name: X-Tenant-ID
          in: header
          description: Tenant identifier
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/api_v1_products_{itemCode}_Get product by
                  item code_Response_200
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetApiV1ProductsItemcodeRequestUnauthorizedError
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetApiV1ProductsItemcodeRequestNotFoundError
servers:
  - url: http://localhost:8080
components:
  schemas:
    ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaModifierGroupsItemsOptionsItems:
      type: object
      properties:
        id:
          type: string
        itemCode:
          type: string
        name:
          type: string
        additionalPrice:
          type: number
          format: double
        sortNum:
          type: integer
        asDefault:
          type: boolean
        visible:
          type: boolean
        taxOverride:
          type: number
          format: double
      required:
        - id
        - itemCode
        - name
        - additionalPrice
        - sortNum
        - asDefault
        - visible
        - taxOverride
      title: >-
        ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaModifierGroupsItemsOptionsItems
    ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaModifierGroupsItems:
      type: object
      properties:
        id:
          type: string
        itemCode:
          type: string
        name:
          type: string
        inputType:
          type: string
        sortNum:
          type: integer
        minSelect:
          type: integer
        maxSelect:
          type: integer
        allowMultipleQty:
          type: boolean
        options:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaModifierGroupsItemsOptionsItems
      required:
        - id
        - itemCode
        - name
        - inputType
        - sortNum
        - minSelect
        - maxSelect
        - allowMultipleQty
        - options
      title: >-
        ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaModifierGroupsItems
    ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaBundleSectionsItemsItemsItems:
      type: object
      properties:
        itemCode:
          type: string
        price:
          type: number
          format: double
        sortNum:
          type: integer
      required:
        - itemCode
        - price
        - sortNum
      title: >-
        ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaBundleSectionsItemsItemsItems
    ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaBundleSectionsItems:
      type: object
      properties:
        id:
          type: string
        itemCode:
          type: string
        name:
          type: string
        sortNum:
          type: integer
        minSelection:
          type: integer
        maxSelection:
          type: integer
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaBundleSectionsItemsItemsItems
      required:
        - id
        - itemCode
        - name
        - sortNum
        - minSelection
        - maxSelection
        - items
      title: >-
        ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaBundleSectionsItems
    api_v1_products_{itemCode}_Get product by item code_Response_200:
      type: object
      properties:
        id:
          type: string
        itemCode:
          type: string
        name:
          type: string
        originalName:
          type: string
        internalName:
          type: string
        shortDescription:
          type: string
        originalShortDescription:
          type: string
        description:
          type: string
        originalDescription:
          type: string
        slug:
          type: string
        mainImageUrl:
          type: string
        externalImageUrl:
          type: string
        basePrice:
          type: number
          format: double
        specialPrice:
          type: number
          format: double
        visible:
          type: boolean
        pickupAvailable:
          type: boolean
        deliveryAvailable:
          type: boolean
        eatInAvailable:
          type: boolean
        sortNum:
          type: integer
        publishStatus:
          type: string
        productType:
          type: integer
        isBundle:
          type: boolean
        isVariant:
          type: boolean
        taxOverride:
          type: number
          format: double
        taxOverrideDelivery:
          type: number
          format: double
        taxOverrideEatIn:
          type: number
          format: double
        provider:
          type: string
        posCategory:
          type: string
        modifierGroups:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaModifierGroupsItems
        bundleSections:
          type: array
          items:
            $ref: >-
              #/components/schemas/ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaBundleSectionsItems
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - itemCode
        - name
        - originalName
        - internalName
        - shortDescription
        - originalShortDescription
        - description
        - originalDescription
        - slug
        - mainImageUrl
        - externalImageUrl
        - basePrice
        - specialPrice
        - visible
        - pickupAvailable
        - deliveryAvailable
        - eatInAvailable
        - sortNum
        - publishStatus
        - productType
        - isBundle
        - isVariant
        - taxOverride
        - taxOverrideDelivery
        - taxOverrideEatIn
        - provider
        - posCategory
        - modifierGroups
        - bundleSections
        - createdAt
        - updatedAt
      title: api_v1_products_{itemCode}_Get product by item code_Response_200
    ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaError:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        details:
          type: string
        field:
          type: string
      required:
        - code
        - message
        - details
        - field
      title: ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaError
    GetApiV1ProductsItemcodeRequestUnauthorizedError:
      type: object
      properties:
        error:
          $ref: >-
            #/components/schemas/ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaError
      required:
        - error
      title: GetApiV1ProductsItemcodeRequestUnauthorizedError
    GetApiV1ProductsItemcodeRequestNotFoundError:
      type: object
      properties:
        error:
          $ref: >-
            #/components/schemas/ApiV1ProductsItemCodeGetResponsesContentApplicationJsonSchemaError
      required:
        - error
      title: GetApiV1ProductsItemcodeRequestNotFoundError
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

```

## SDK Code Examples

```python api_v1_products_{itemCode}_Get product by item code_example
import requests

url = "http://localhost:8080/api/v1/products/string"

headers = {
    "X-Tenant-ID": "string",
    "X-Api-Key": "<apiKey>"
}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript api_v1_products_{itemCode}_Get product by item code_example
const url = 'http://localhost:8080/api/v1/products/string';
const options = {method: 'GET', headers: {'X-Tenant-ID': 'string', 'X-Api-Key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go api_v1_products_{itemCode}_Get product by item code_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8080/api/v1/products/string"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Tenant-ID", "string")
	req.Header.Add("X-Api-Key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby api_v1_products_{itemCode}_Get product by item code_example
require 'uri'
require 'net/http'

url = URI("http://localhost:8080/api/v1/products/string")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)
request["X-Tenant-ID"] = 'string'
request["X-Api-Key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java api_v1_products_{itemCode}_Get product by item code_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("http://localhost:8080/api/v1/products/string")
  .header("X-Tenant-ID", "string")
  .header("X-Api-Key", "<apiKey>")
  .asString();
```

```php api_v1_products_{itemCode}_Get product by item code_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://localhost:8080/api/v1/products/string', [
  'headers' => [
    'X-Api-Key' => '<apiKey>',
    'X-Tenant-ID' => 'string',
  ],
]);

echo $response->getBody();
```

```csharp api_v1_products_{itemCode}_Get product by item code_example
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v1/products/string");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Tenant-ID", "string");
request.AddHeader("X-Api-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift api_v1_products_{itemCode}_Get product by item code_example
import Foundation

let headers = [
  "X-Tenant-ID": "string",
  "X-Api-Key": "<apiKey>"
]

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v1/products/string")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```