> ## Documentation Index
> Fetch the complete documentation index at: https://doc-neteven.mylectra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Warehouse management

## Definition

A `warehouse` is an additional container for stock information per SKU. There are two types of warehouse:

* **Marketplace fulfillment warehouses** : they represent an actual warehouse of a given Marketplace. They are used for offers fulfilled by that Marketplace, to provide read-only information about stock.\
  Notable examples are FBA (Fulfilled by Amazon) or ZFS (Zalando fulfillment solution) warehouses.
* **Merchant warehouses:** they provide an additional storage for an alternative `item quantity`, which can in turn be associated to a Marketplace publication rule via the Neteven interface. Unlike Marketplace fulfillment warehouses, these are generally only abstract containers that the target Marketplace will never know of, and exist purely to split stock allocation per channel / geographic zone, etc.

> [!NOTE]
>
> Not every SKU have to be associated to a warehouse. You should only create warehouses and send stock on relevant products.

![](https://mintcdn.com/lectra/JkjXeVVMFu4Rgypa/images/-yiSJqT1XgkorK6PhtTTU_image.png?fit=max\&auto=format\&n=JkjXeVVMFu4Rgypa\&q=85\&s=a0104eefa74fb91b94f3a079f1347461)

> [!TIP]
>
> The standard `item quantity` exists outside of warehouses and has no direct relationship to them. Therefore, there is no need to create warehouses to send quantity updates on any SKU.

## Endpoints

#### Create a new warehouse

| `POST` | `/merchant/warehouses` |
| - | - |
| **Description** | create a single merchant warehouse, to be used in `PATCH /merchant/items/stocks` and configured as a stock location point for any Marketplace within the Neteven user interface. |
| **Required scope** | `warehouse_manager` |
| **Returns** | the `warehouse_id` of the warehouse created, to be stored and used in subsequent stock updates. |

**example:**

```bash Create a new warehouse theme={null}
curl --request POST \
  --url https://api-neteven.mylectra.com/v1/merchant/warehouses \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer $MYTOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"name": "MyNewWarehouse"}'
```

```javascript 201 Created response theme={null}
{
  "data": {
    "warehouse": {
      "status": {
        "message": "Created",
        "code": 201,
        "title": "OK"
      },
      "warehouse_id": 589
    }
  },
  "metadata": {
    "api_version": 1,
    "api_version_expiration_date": "2022-12-31",
    "number_of_results": 1
  }
}
```

***

#### Get existing warehouses

| `GET` | `/merchant/warehouses` |
| - | - |
| **Description** | Displays both Marketplace and Merchant warehouses, depending on what exists on your account and if you are connected to a Marketplace fulfillment solution. |
| **Required scope** | `warehouse_reader` |
| **Returns** | array of `warehouse` objects. |

**example:**

```bash Get warehouses theme={null}
curl --request GET \
  --url https://api-neteven.mylectra.com/v1/merchant/warehouses \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer $MYTOKEN' \
  --header 'Content-Type: application/json' \
```

```json 200 Response theme={null}
{
  "data": {
    "warehouses": [
      {
        "name": "FBA",
        "marketplaces": [7, 20, 22],
        "id": "513"
      },
      {
        "name": "MyNewWarehouse",
        "id": "589"
      }
    ]
  },
  "metadata": {
    "number_of_results": 2,
    "api_version": 1,
    "api_version_expiration_date": "2022-12-31"
  }
}
```

***

## API reference

*more information on parameters, responses and content in the* [API Reference](https://doc-neteven.mylectra.com/merchant-api/api-reference.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.