> For the complete documentation index, see [llms.txt](https://vu-custom.gitbook.io/vu-custom/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vu-custom.gitbook.io/vu-custom/admin-api/products/create-a-product.md).

# Create a product

Method : <mark style="color:green;">**POST**</mark> &#x20;

{% code fullWidth="false" %}

```url
https://os.vucustom.com/api/v1/products
```

{% endcode %}

<details>

<summary>Example Request </summary>

{% code fullWidth="true" %}

```json
{
  "product": {
    "name": "2s3test",
    "product_category": "Outdoor Products",
		"product_variants_attributes": [{
		"price": 15,
        "sku": "SKU1131215",
        "upc": "UPC123",
		"name": "test"
		}],
		"b2b": true,
		"customize_only": true
  }
}
```

{% endcode %}

</details>

Request Body Schema (Product)

<table><thead><tr><th width="254">Field Name</th><th width="94">Type</th><th width="109">Required</th><th>Description</th></tr></thead><tbody><tr><td>name</td><td>string</td><td>Yes</td><td>Product display name</td></tr><tr><td>product_category</td><td>string</td><td>Yes</td><td>Category identifier</td></tr><tr><td>b2b</td><td>boolean</td><td>Yes</td><td>B2B availability flag</td></tr><tr><td>customize_only</td><td>boolean</td><td>Yes</td><td>Customization-only flag</td></tr><tr><td>product_variants_attributes</td><td>array</td><td>Yes</td><td>Array of product variant objects. refer below for schema</td></tr></tbody></table>

Product Variations Schema

<table><thead><tr><th width="188">Field Name</th><th width="113">Type</th><th width="104">Required</th><th>Description</th></tr></thead><tbody><tr><td>price</td><td>string</td><td>Yes</td><td>Variant price</td></tr><tr><td>sku</td><td>string</td><td>Yes</td><td>Stock keeping unit</td></tr><tr><td>name</td><td>string</td><td>Yes</td><td>Variant name</td></tr><tr><td>upc</td><td>string</td><td>No</td><td>Universal product code</td></tr></tbody></table>

{% tabs %}
{% tab title="200" %}
**`200 Successful response example`**

```json
{
	"product": {
		"id": 25,
		"product_categories": [
			"Outdoor Products1"
		],
		"name": "2s3test",
		"b2b": true,
		"active": true,
		"customize_only": true,
		"code": null,
		"product_variants": [
			{
				"id": 17,
				"sku": "SKU1131215",
				"name": "test",
				"upc": "UPC123",
				"code": null
			}
		]
	}
}
```

{% endtab %}

{% tab title="401 " %}
**`401 Unauthorized`**

`The client doesn’t have correct authentication credentials.`

```
{
"errors": "[API] Invalid API key or secret (unrecognized login or wrong password)"
}
```

{% endtab %}

{% tab title="403" %}
**`403 Forbidden`**

`The server is refusing to respond. This is typically caused by incorrect access.`
{% endtab %}

{% tab title="404" %}
**`404 Not Found`**

`The requested resource was not found but could be available again in the future.`
{% endtab %}

{% tab title="422" %}
**`422 Unprocessable Entity`**
{% endtab %}

{% tab title="5xx" %}
**`5xx Errors`**

`An internal error occurred in VU Admin.`
{% endtab %}
{% endtabs %}
