Skip to main content

createWarehouse

Requires permission inventory:warehouse:create.

Creates a warehouse. The code must not already be used by another warehouse of the organization. A new warehouse is active. Needs the warehouse create permission.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation CreateWarehouse($input: CreateWarehouseInput!) {
createWarehouse(input: $input) {
id
code
taxRegistrationNumber
name
status
type
address {
postalCode
city
country
latitude
longitude
state
}
}
}

Variables:

{
"input": {
"code": "string",
"name": "string",
"type": "string"
}
}

Response:

{
"data": {
"createWarehouse": {
"id": "id",
"code": "string",
"taxRegistrationNumber": "string",
"name": "string",
"status": "ACTIVE",
"type": "string",
"address": {
"postalCode": "string",
"city": "string",
"country": "string",
"latitude": 0,
"longitude": 0,
"state": "string"
}
}
}
}
createWarehouse(
input: CreateWarehouseInput!
): Warehouse!

Arguments​

createWarehouse.input ● CreateWarehouseInput! non-null input​

The warehouse's name, code and details.

Type​

Warehouse object​

A location where stock is held.