Skip to main content

Create a Location

POST 

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

Creates an Inventory Location

Request

Responses

Success. The location was created successfully

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!