Skip to main content

Create a Location

POST 

https://euwest.api.elasticpath.com/v2/inventories/locations

Creates an Inventory Location

Request

Body

    data objectrequired
    typeInventoryLocationType (string)

    Possible values: [inventory_location]

    Example: inventory_location
    attributes LocationAttributesrequired
    namestringrequired

    Possible values: >= 3 characters and <= 1024 characters

    Example: Milton Keynes Warehouse
    external_refstring

    Possible values: >= 3 characters and <= 1024 characters

    Example: mk-stock-warehouse-walnut-tree
    slugstringrequired

    Possible values: non-empty and <= 128 characters

    Example: milton-keynes-warehouse
    descriptionstring

    Possible values: >= 3 characters and <= 1024 characters

    Example: Southern dispatch location for all inventory
    addressstring[]

    Possible values: >= 1, <= 8

    geolocation objectnullable

    The longitude and latitude of a location.

    latdoublerequired
    Example: 51.477928
    londoublerequired
    Example: -0.001545

Responses

Success. The location was created successfully

Schema
    data object
    idUUID (string)required

    The unique identifier.

    Example: 00000000-0000-0000-0000-000000000000
    typeInventoryLocationType (string)required

    Possible values: [inventory_location]

    Example: inventory_location
    attributes LocationAttributesrequired
    namestringrequired

    Possible values: >= 3 characters and <= 1024 characters

    Example: Milton Keynes Warehouse
    external_refstring

    Possible values: >= 3 characters and <= 1024 characters

    Example: mk-stock-warehouse-walnut-tree
    slugstringrequired

    Possible values: non-empty and <= 128 characters

    Example: milton-keynes-warehouse
    descriptionstring

    Possible values: >= 3 characters and <= 1024 characters

    Example: Southern dispatch location for all inventory
    addressstring[]

    Possible values: >= 1, <= 8

    geolocation objectnullable

    The longitude and latitude of a location.

    latdoublerequired
    Example: 51.477928
    londoublerequired
    Example: -0.001545
    meta object
    timestamps Timestampsrequired
    updated_atstring

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstringrequired

    The date and time a resource was created.

    Example: 2017-01-10T11:41:19.244842Z

Authorization: http

name: bearerAuthtype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://euwest.api.elasticpath.com/v2/inventories/locations");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"inventory_location\",\n \"attributes\": {\n \"name\": \"Milton Keynes Warehouse\",\n \"external_ref\": \"mk-stock-warehouse-walnut-tree\",\n \"slug\": \"milton-keynes-warehouse\",\n \"description\": \"Southern dispatch location for all inventory\",\n \"address\": [\n \"string\"\n ],\n \"geolocation\": {\n \"lat\": 51.477928,\n \"lon\": -0.001545\n }\n }\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Request Collapse all
Base URL
https://euwest.api.elasticpath.com/v2
Auth
Body
{
  "data": {
    "type": "inventory_location",
    "attributes": {
      "name": "Milton Keynes Warehouse",
      "external_ref": "mk-stock-warehouse-walnut-tree",
      "slug": "milton-keynes-warehouse",
      "description": "Southern dispatch location for all inventory",
      "address": [
        "string"
      ],
      "geolocation": {
        "lat": 51.477928,
        "lon": -0.001545
      }
    }
  }
}
ResponseClear

Click the Send API Request button above and see the response here!

We use cookies to enhance your experience. By continuing to visit this site you agree to our use of cookies.