# Fetch Product

### Endpoint

<mark style="color:green;">**`GET`**</mark> `https://api.keepup.store/v2.0/products/{product_id}`

### Headers

`Authorization: Bearer API_KEY`

### Path Parameters

|                                                                                                |          |                                                   |
| ---------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------- |
| <p><strong>product\_id</strong>                                     </p><p><em>number</em></p> | required | Unique identifier for the product. Example: 12345 |

## Sample Requests

{% tabs %}
{% tab title="Node.js" %}
{% code overflow="wrap" fullWidth="true" %}

```javascript
const axios = require('axios');

const product_id = 'YOUR_PRODUCT_ID'; // Replace 'YOUR_PRODUCT_ID' with your actual product ID
const config = {
    method: 'get',
    url: `https://api.keepup.store/v2.0/products/{product_id}`,
    headers: {
        'Authorization': 'Bearer API_KEY' // Replace 'API_KEY' with your actual API key
    }
};

axios(config).then(function(response) {
    console.log(JSON.stringify(response.data));
}).catch(function(error) {
    console.error(error);
});
```

{% endcode %}
{% endtab %}

{% tab title="PHP" %}

```php
<?php
$product_id = 'YOUR_PRODUCT_ID'; // Replace 'YOUR_PRODUCT_ID' with your actual product ID
$url = 'https://api.keepup.store/v2.0/products/' . $product_id;

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer API_KEY' // Replace 'API_KEY' with your actual API key
  ],
]);

$response = curl_exec($curl);

if (curl_errno($curl)) {
    echo 'Error:' . curl_error($curl);
} else {
    echo $response;
}

curl_close($curl);
?>

```

{% endtab %}

{% tab title="Python" %}

```python
import requests

product_id = 'YOUR_PRODUCT_ID'  # Replace 'YOUR_PRODUCT_ID' with your actual product ID
url = f'https://api.keepup.store/v2.0/inventory/{product_id}'
headers = {
    'Authorization': 'Bearer API_KEY'  # Replace 'API_KEY' with your actual API key
}

try:
    response = requests.get(url, headers=headers)
    print(response.json())
except requests.exceptions.RequestException as e:
    print(e)
```

{% endtab %}
{% endtabs %}

## Sample Response

{% tabs %}
{% tab title="Success" %}

```json
{
    "status": 200,
    "message": "product ready",
    "data": {
        "product_info": {
            "product_id": 19842,
            "product_name": "6:16",
            "description": "<p>6:16 description</p>",
            "cost_price": "0.00",
            "selling_price": "37.00",
            "previous_price": "0.00",
            "stock_limit": "unlimited",
            "stock_status": "out_of_stock",
            "quantity": 0,
            "images": [],
            "restock_level": 1,
            "barcode": null,
            "SKU": null,
            "product_location": null,
            "category": null,
            "tags": [],
            "variants": [],
            "show_on_storefront": "yes",
            "featured_product": "no",
            "expirations": [],
            "created_at": "2024-05-11 16:18",
            "updated_at": "2024-05-11 17:00"
        }
    }
}
```

{% endtab %}

{% tab title="Error" %}

```json
{
    "status": 401,
    "error": "Authentication invalid"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keepup.store/docs/api/products/fetch-product.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
