Skip to main content

Update Stock for Product

PUT 

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

Updates the inventory for the specified product.

Request

Path Parameters

    product_uuid UUIDrequired

    The unique identifier of the product.

Body

    data objectrequired
    idUUID (string)required

    The unique identifier.

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

    Possible values: [stock]

    Default value: stock
    Example: stock
    attributes StockUpdateAttributesrequired
    locations object
    property name* NullableLocationnullable
    availableint64required
    Example: 20

Responses

Success. The stock item was updated successfully.

Schema
    data objectrequired
    idUUID (string)required

    The unique identifier.

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

    Possible values: [stock]

    Default value: stock
    Example: stock
    attributes objectrequired
    availableint64required
    Example: 20
    allocatedint64required
    Example: 10
    totalint64required
    Example: 30
    locations object
    property name* object
    availableint64required
    Example: 20
    allocatedint64required
    Example: 10
    totalint64required
    Example: 30
    meta objectrequired
    stock_idUUID (string)required

    The unique identifier.

    Example: 00000000-0000-0000-0000-000000000000
    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.Put, "https://euwest.api.elasticpath.com/v2/inventories/:product_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\": \"stock\",\n \"attributes\": {\n \"locations\": {}\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
Parameters
— pathrequired
Body
{
  "data": {
    "id": "00000000-0000-0000-0000-000000000000",
    "type": "stock",
    "attributes": {
      "locations": {}
    }
  }
}
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.