Skip to main content

Create Stock Transaction on Product

POST 

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

Create Stock Transaction on Product

Request

Responses

Success. Stock was successfully created for product

Authorization: http

name: bearerAuthtype: httpscheme: bearer
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://euwest.api.elasticpath.com/v2/inventories/:product_uuid/transactions");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"type\": \"stock-transaction\",\n \"attributes\": {\n \"product_id\": \"00000000-0000-0000-0000-000000000000\",\n \"action\": \"allocate\",\n \"quantity\": 5,\n \"location\": \"milton-keynes-warehouse\"\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": {
    "type": "stock-transaction",
    "attributes": {
      "product_id": "00000000-0000-0000-0000-000000000000",
      "action": "allocate",
      "quantity": 5,
      "location": "milton-keynes-warehouse"
    }
  }
}
ResponseClear

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