Create Stock Transaction on Product
POSThttps://euwest.api.elasticpath.com/v2/inventories/:product_uuid/transactions
Create Stock Transaction on Product
Request
Responses
- 200
- 404
- 422
- 500
Success. Stock was successfully modified for product
Not found. The requested entity does not exist.
The request was understood, but could not be processed by the server
Internal server error. There was a system failure in the platform.
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.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 \"product_id\": \"b9ad64bd-fc21-4918-b6ec-768809f4a1e9\",\n \"type\": \"stock-transaction\",\n \"action\": \"allocate\",\n \"quantity\": 5\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear