Warehouses
Physical/logical stock locations. Managed under the settings.* permission scope.
GET
/api/v1/warehousesList warehouses
Scope:
settings.readParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | number | Optional | 1-based page number. |
limit | query | number | Optional | Page size, max 200. |
Example request
curl "https://invoice.avscorp.in/api/v1/warehouses" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
JSON
{
"id": "clx9wh0000000000000000001",
"organizationId": "clx0org000000000000000001",
"name": "Main Warehouse - Delhi",
"code": "DEL01",
"systemKind": "USER",
"addressLine1": "Plot 45, Okhla Industrial Area Phase II",
"addressLine2": null,
"city": "New Delhi",
"pincode": "110020",
"phone": "9988776655",
"isDefault": true,
"isActive": true,
"createdBy": "clxusr0000000000000000001",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-07-15T09:00:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden
POST
/api/v1/warehousesCreate a warehouse
Scope:
settings.updateRequest body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | Required | min length 1; max length 191 |
code | any | Optional | — |
addressLine1 | any | Optional | — |
addressLine2 | any | Optional | — |
city | any | Optional | — |
pincode | any | Optional | — |
phone | any | Optional | — |
isDefault | boolean | Optional | default false |
isActive | boolean | Optional | default true |
Example request
curl -X POST "https://invoice.avscorp.in/api/v1/warehouses" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Main Warehouse - Delhi",
"code": "DEL01"
}'Example response
JSON
{
"id": "clx9wh0000000000000000001",
"organizationId": "clx0org000000000000000001",
"name": "Main Warehouse - Delhi",
"code": "DEL01",
"systemKind": "USER",
"addressLine1": "Plot 45, Okhla Industrial Area Phase II",
"addressLine2": null,
"city": "New Delhi",
"pincode": "110020",
"phone": "9988776655",
"isDefault": true,
"isActive": true,
"createdBy": "clxusr0000000000000000001",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-07-15T09:00:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden, validation_error
GET
/api/v1/warehouses/{id}Get a warehouse
Scope:
settings.readParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Warehouse ID. |
Example request
curl "https://invoice.avscorp.in/api/v1/warehouses/clx9wh0000000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
JSON
{
"id": "clx9wh0000000000000000001",
"organizationId": "clx0org000000000000000001",
"name": "Main Warehouse - Delhi",
"code": "DEL01",
"systemKind": "USER",
"addressLine1": "Plot 45, Okhla Industrial Area Phase II",
"addressLine2": null,
"city": "New Delhi",
"pincode": "110020",
"phone": "9988776655",
"isDefault": true,
"isActive": true,
"createdBy": "clxusr0000000000000000001",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-07-15T09:00:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found
PATCH
/api/v1/warehouses/{id}Update a warehouse
Scope:
settings.updatePATCH validates against the full warehouse schema (same as create) — name is required in every update, not just changed fields.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Warehouse ID. |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | Required | min length 1; max length 191 |
code | any | Optional | — |
addressLine1 | any | Optional | — |
addressLine2 | any | Optional | — |
city | any | Optional | — |
pincode | any | Optional | — |
phone | any | Optional | — |
isDefault | boolean | Optional | default false |
isActive | boolean | Optional | default true |
Example request
curl -X PATCH "https://invoice.avscorp.in/api/v1/warehouses/clx9wh0000000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Main Warehouse - Delhi",
"code": "DEL01",
"isDefault": true
}'Example response
JSON
{
"id": "clx9wh0000000000000000001",
"organizationId": "clx0org000000000000000001",
"name": "Main Warehouse - Delhi",
"code": "DEL01",
"systemKind": "USER",
"addressLine1": "Plot 45, Okhla Industrial Area Phase II",
"addressLine2": null,
"city": "New Delhi",
"pincode": "110020",
"phone": "9988776655",
"isDefault": true,
"isActive": true,
"createdBy": "clxusr0000000000000000001",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-07-15T09:00:00.000Z"
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found, validation_error
DELETE
/api/v1/warehouses/{id}Delete a warehouse
Scope:
settings.updateUses the settings.update scope, not a distinct delete scope.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Warehouse ID. |
Example request
curl -X DELETE "https://invoice.avscorp.in/api/v1/warehouses/clx9wh0000000000000000001" \
-H "Authorization: Bearer YOUR_API_KEY"Example response
JSON
{
"deleted": true
}Possible errors: unauthorized, insufficient_scope, forbidden, not_found