---
title: "Create a new inventory source"
method: POST
path: "/settings/inventory-sources"
tags: ["Admin Settings: Inventory Sources"]
---

# Create a new inventory source

`POST /settings/inventory-sources`

## Request

- Base URL: `http://localhost:8000/api/admin`
- URL: `http://localhost:8000/api/admin/settings/inventory-sources`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-admin-api/docs/settings/inventory-sources/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new inventory source

## Request body

- object
  - `code` string, required
  - `name` string, required
  - `description` string
  - `contact_name` string, required
  - `contact_email` string, required
  - `contact_number` string, required
  - `contact_fax` string
  - `country` string, required
  - `state` string, required
  - `city` string, required
  - `street` string, required
  - `postcode` string, required
  - `priority` integer
  - `latitude` number, float
  - `longitude` number, float
  - `status` 0 | 1

## Response `201`

Inventory source created.

- AdminSettingsInventorySource: Admin Settings → Inventory Sources endpoints (Block B Wave 1). REST: GET /api/admin/settings/inventory-sources GET /api/admin/settings/inventory-sources/{id} POST /api/admin/settings/inventory-sources PUT /api/admin/settings/inventory-sources/{id} DELETE /api/admin/settings/inventory-sources/{id} GraphQL: adminSettingsInventorySources, adminSettingsInventorySource, createAdminSettingsInventorySource, updateAdminSettingsInventorySource, deleteAdminSettingsInventorySource Mirrors Webkul\Admin\Http\Controllers\Settings\InventorySourceController. Delete guards (parity with monolith + API-specific FK guard): - 400 if this is the last remaining inventory source. - 400 if any product_inventories row references this source.
  - `id` integer, nullable
  - `code` string, nullable
  - `name` string, nullable
  - `description` string, nullable
  - `contactName` string, nullable
  - `contactEmail` string, nullable
  - `contactNumber` string, nullable
  - `contactFax` string, nullable
  - `country` string, nullable
  - `state` string, nullable
  - `city` string, nullable
  - `street` string, nullable
  - `postcode` string, nullable
  - `priority` integer, nullable
  - `latitude` number, nullable
  - `longitude` number, nullable
  - `status` integer, nullable
  - `createdAt` string, nullable
  - `updatedAt` string, nullable
  - `message` string, nullable

## Other responses

- `400`: Invalid input
- `422`: Validation failure.

---

[API](https://skmtc.dev/bagisto/apis/bagisto-admin-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-admin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-admin-api/revisions/3198f11be70f?raw)
