---
title: Inventory endpoints
slug: inventory-endpoints
description: This document serves as a comprehensive guide to efficiently utilize the API for creating or updating entries in the inventory table. Learn how to define the inventory schema, effortlessly import inventory data into Pricemoov, and attain maximum success w
icon: 🧱
createdAt: 2023-03-13T15:11:20.000Z
---

# Quick reference

| Verb | Path                                       | Method                        |
| ---- | ------------------------------------------ | ----------------------------- |
| POST | /api/v1/inventory/schema/create\_schema    | Create inventory schema       |
| POST | /api/v1/inventory/bulk\_create\_or\_update | Bulk update inventory entries |

# Define Inventory Schema

## Description

With our API, you can easily create or update entries in your stock table. This table keeps track of all your inventory. Before that you need to define inventory schema.

```shell
curl --location --request POST 'https://api.pricemoov.com/api/v1/inventory/schema/create_schema/' \
--header 'Authorization: jwt <your_token>' \
--raw-data '{
    "attributes_config":[
	    "code",
	    "product_attribute_1",
		"product_attribute_2",
	    "product_attribute_X",
		"extension_name_1",
		"extension_name_2",
	    "extension_name_Y"
	],
	"is_dated": false
}'
```

## Parameters

::::VerticalSplit{layout="left"}
:::VerticalSplitItem
attributes\_config                   `type: list[string]`, `Required`




&#x20;

&#x20;is\_dated
`type: boolean`, `default: false`,`Optional`
:::

:::VerticalSplitItem
Allow to defined the granularity of inventory data. It corresponds to a subset of the product catalog fields (`code`,  `product_attribute_1`, `product_attribute_X`, `extension_name_1`, `extension_name_Y`.....). ⚠️ Note that if the product `code` is specified, then it is not necessary to add any product attributes (`product_attribute_1`, `product_attribute_X`, …).

Allow to specify if inventory data is defined at the date granularity (for Price List display)


:::
::::

## Example

Upon success, the response is 201 and returns

```json
{
    "input": {
        "dimensions": [
            "code",
            "product_attribute_1"
            "product_attribute_2",
            "product_attribute_X",
            "extension_name_1", 
            "extension_name_2", 
            "extension_name_Y"
        ]
    },
    "output": {"total": "Decimal", "booked": "Decimal"},
}
```

##

# Loading Inventory into Pricemoov

## Description

With our API, you can easily create or update entries in your stock table. This table keeps track of all your inventory.

```shell
curl --location --request POST 'https://api.pricemoov.com/api/v1/inventory/bulk_create_or_update/' \
--header 'Authorization: jwt <your_token>' \
--raw-data '[
    {
          "code": "pc_value",
          "product_attribute_1": "pa_value_1",
          "product_attribute_2": "pa_value_2",
          "product_attribute_X": "pa_value_X",
          "extension_name_1": "en_value_1",
          "extension_name_2": "en_value_2",
          "extension_name_X": "en_value_X",
          "total":100, // available
          "booked":78 // Note: this field is optional
     }, ...
]'
```

## Parameters

::::VerticalSplit{layout="left"}
:::VerticalSplitItem
code, product\_attribute\_1, product\_attribute\_2, product\_attribute\_X, extension\_name\_1,extension\_name\_2, extension\_name\_Y.      `type: string`, `Optional|Required`


total
`type: float`, `Required`

booked                                  `type: float`, `default: 0`, `Optional`

:::

:::VerticalSplitItem
Field from Product Catalog defined by inventory schema.









Corresponds to the total number of inventory (available + booked)


Corresponds to the number of booked units.
:::
::::

## Example

Upon success, the response is 201 and returns

```json
{
    "created": [created_hash],
    "updated": [updated_hash],
}
```

##









