defaultWarehouse
Requires an authenticated session.
Returns the warehouse a new document should start with: the customer's own default if one is given and set, else the organization's default warehouse, else an active warehouse chosen the same way every time. Fails when the organization has no active warehouse.
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:
- GraphQL
- cURL
query DefaultWarehouse {
defaultWarehouse {
id
code
taxRegistrationNumber
name
status
type
address {
postalCode
city
country
latitude
longitude
state
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query DefaultWarehouse {\n defaultWarehouse {\n id\n code\n taxRegistrationNumber\n name\n status\n type\n address {\n postalCode\n city\n country\n latitude\n longitude\n state\n }\n }\n}"
}
EOF
Response:
{
"data": {
"defaultWarehouse": {
"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"
}
}
}
}
defaultWarehouse(
partnerId: ID
): Warehouse!
Arguments
defaultWarehouse.partnerId ● ID scalar
The ID of a customer whose own default warehouse should apply first. Omit it for the organization's default.
Type
Warehouse object
A location where stock is held.