Update a Location
PUThttps://euwest.api.elasticpath.com/v2/inventories/locations/:location_uuid
Updates an Inventory Location
Request
Path Parameters
location_uuid UUIDrequired
The unique identifier of the location.
- application/json
Body
data objectrequired
Responses
- 200
- 400
- 404
Success. The location was updated successfully
- application/json
- Schema
- Example (auto)
- Example
Schema
data object
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"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
}
},
"meta": {
"timestamps": {
"updated_at": "2017-01-10T11:41:19.244842Z",
"created_at": "2017-01-10T11:41:19.244842Z"
}
}
}
}
{
"data": {
"id": "ebc7652d-bb7d-4359-9a83-78f2998208d9",
"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": [
"Troughton Supplies",
"38 Pipernel Grove",
"Walnut Tree",
"MK7 4UL"
],
"geolocation": {
"lat": -90,
"lon": 180
}
}
}
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (auto)
- missing-name
Schema
errors object[]required
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Validation Error",
"status": "400",
"detail": "Your request was invalid"
}
]
}
Not found. The requested entity does not exist.
- application/json
- Schema
- Example (auto)
- not-found
Schema
errors object[]required
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred.",
"meta": {
"missing_ids": [
"e7d50bd5-1833-43c0-9848-f9d325b08be8"
]
}
}
]
}
{
"errors": [
{
"title": "Not Found",
"status": "404",
"detail": "No location found"
}
]
}
Authorization: http
name: bearerAuthtype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://euwest.api.elasticpath.com/v2/inventories/locations/:location_uuid");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"id\": \"00000000-0000-0000-0000-000000000000\",\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());
ResponseClear