POST
/
v1
/
locations
curl --location --request POST 'https://api.stateset.com/v1/locations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
    "name": "West Coast Distribution Center",
    "code": "WH-WEST-01",
    "type": "warehouse",
    "address": {
        "line1": "1000 Distribution Way",
        "city": "Los Angeles",
        "state": "CA",
        "postal_code": "90001",
        "country": "US"
    },
    "contact": {
        "name": "John Smith",
        "email": "john.smith@warehouse.com",
        "phone": "+1-555-123-4567"
    },
    "capabilities": ["storage", "fulfillment", "returns"],
    "capacity": {
        "total_sqft": 50000,
        "storage_units": 5000,
        "pallet_positions": 2000
    },
    "timezone": "America/Los_Angeles"
}'
{
  "id": "loc_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
  "object": "location",
  "name": "West Coast Distribution Center",
  "code": "WH-WEST-01",
  "type": "warehouse",
  "status": "active",
  "created_at": "2024-01-19T16:00:00Z",
  "address": {
    "line1": "1000 Distribution Way",
    "city": "Los Angeles",
    "state": "CA",
    "postal_code": "90001",
    "country": "US",
    "formatted": "1000 Distribution Way, Los Angeles, CA 90001, US"
  },
  "contact": {
    "name": "John Smith",
    "email": "john.smith@warehouse.com",
    "phone": "+1-555-123-4567"
  },
  "capabilities": ["storage", "fulfillment", "returns"],
  "capacity": {
    "total_sqft": 50000,
    "storage_units": 5000,
    "pallet_positions": 2000,
    "available_units": 4850,
    "available_pallets": 1920
  },
  "operating_hours": {
    "monday": { "open": "06:00", "close": "22:00" },
    "tuesday": { "open": "06:00", "close": "22:00" },
    "wednesday": { "open": "06:00", "close": "22:00" },
    "thursday": { "open": "06:00", "close": "22:00" },
    "friday": { "open": "06:00", "close": "22:00" },
    "saturday": { "open": "08:00", "close": "18:00" },
    "sunday": { "closed": true }
  },
  "timezone": "America/Los_Angeles",
  "coordinates": {
    "latitude": 34.0522,
    "longitude": -118.2437
  }
}
This endpoint creates a new location for inventory management. Locations can be warehouses, stores, or distribution centers.

Authentication

This endpoint requires a valid API key with locations:write permissions.
Authorization: Bearer YOUR_API_KEY

Request Body

name
string
required
Location name
code
string
required
Unique location code (e.g., “WH-001”, “STORE-NYC-01”)
type
string
required
Location type: “warehouse”, “store”, “distribution_center”, “dropship”
address
object
required
Location address
contact
object
Contact information
operating_hours
object
Operating hours
capabilities
array
Location capabilities: “storage”, “fulfillment”, “returns”, “cross_dock”, “pickup”
capacity
object
Storage capacity information
timezone
string
Location timezone (e.g., “America/Los_Angeles”)
is_active
boolean
Whether location is active (default: true)
metadata
object
Additional custom fields

Response

Returns the created location.
curl --location --request POST 'https://api.stateset.com/v1/locations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
    "name": "West Coast Distribution Center",
    "code": "WH-WEST-01",
    "type": "warehouse",
    "address": {
        "line1": "1000 Distribution Way",
        "city": "Los Angeles",
        "state": "CA",
        "postal_code": "90001",
        "country": "US"
    },
    "contact": {
        "name": "John Smith",
        "email": "john.smith@warehouse.com",
        "phone": "+1-555-123-4567"
    },
    "capabilities": ["storage", "fulfillment", "returns"],
    "capacity": {
        "total_sqft": 50000,
        "storage_units": 5000,
        "pallet_positions": 2000
    },
    "timezone": "America/Los_Angeles"
}'
{
  "id": "loc_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
  "object": "location",
  "name": "West Coast Distribution Center",
  "code": "WH-WEST-01",
  "type": "warehouse",
  "status": "active",
  "created_at": "2024-01-19T16:00:00Z",
  "address": {
    "line1": "1000 Distribution Way",
    "city": "Los Angeles",
    "state": "CA",
    "postal_code": "90001",
    "country": "US",
    "formatted": "1000 Distribution Way, Los Angeles, CA 90001, US"
  },
  "contact": {
    "name": "John Smith",
    "email": "john.smith@warehouse.com",
    "phone": "+1-555-123-4567"
  },
  "capabilities": ["storage", "fulfillment", "returns"],
  "capacity": {
    "total_sqft": 50000,
    "storage_units": 5000,
    "pallet_positions": 2000,
    "available_units": 4850,
    "available_pallets": 1920
  },
  "operating_hours": {
    "monday": { "open": "06:00", "close": "22:00" },
    "tuesday": { "open": "06:00", "close": "22:00" },
    "wednesday": { "open": "06:00", "close": "22:00" },
    "thursday": { "open": "06:00", "close": "22:00" },
    "friday": { "open": "06:00", "close": "22:00" },
    "saturday": { "open": "08:00", "close": "18:00" },
    "sunday": { "closed": true }
  },
  "timezone": "America/Los_Angeles",
  "coordinates": {
    "latitude": 34.0522,
    "longitude": -118.2437
  }
}