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

Path Parameters

    product_uuid UUIDrequired

    The unique identifier of the product.

Body

    data TransactionCreaterequired
    product_iduuid

    The ID of the product to perform the transaction against

    Example: b9ad64bd-fc21-4918-b6ec-768809f4a1e9
    typestringrequired

    The type of object being returned. Always stock-transaction.

    Possible values: [stock-transaction]

    Default value: stock-transaction
    Example: stock-transaction
    actionstringrequired

    The type of action being performed by this transaction.

    • increment - use this when you want to make products available for purchase, for example, when you have received stock from a supplier.

    • decrement - Use this when you want to remove stock from product inventory.

    • allocate - Use this when you want to allocate stock, normally to a reseller who sells on the stock.

    • deallocate - Use this when you want to deallocate any previously allocated stock.

    Possible values: [increment, decrement, allocate, deallocate]

    Example: allocate
    quantityint64

    The amount of stock affected by the stock transaction.

    Possible values: >= 1

    Example: 5

Responses

Success. Stock was successfully modified for product

Schema
    data Transaction
    idstring

    The unique identifier for the stock transaction.

    Example: f976dace-450f-4a5d-8877-d119c5a550a1
    typestringrequired

    The type represents the object being returned. Always stock-transaction.

    Possible values: [stock-transaction]

    Default value: stock-transaction
    Example: stock-transaction
    actionstring

    The type of action performed by this transaction.

    • increment - use this when you want to make products available for purchase, for example, when you have received stock from a supplier.

    • decrement - Use this when you want to remove stock from product inventory.

    • allocate - Use this when you want to allocate stock, normally to a reseller who sells on the stock.

    • deallocate - Use this when you want to deallocate any previously allocated stock.

    Possible values: [increment, decrement, allocate, deallocate]

    Example: allocate
    product_idstring

    The product identifier that this stock transaction is for.

    Example: 86b84d3e-0a86-43d6-a347-78ba4adacca2
    quantityint64

    The amount of stock affected by the stock transaction.

    Example: 5
    timestamps Timestamps
    updated_atstring

    The date and time a resource was updated.

    Example: 2017-01-10T11:41:19.244842Z
    created_atstring

    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.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());
Request Collapse all
Base URL
https://euwest.api.elasticpath.com/v2
Auth
Parameters
— pathrequired
Body
{
  "data": {
    "product_id": "b9ad64bd-fc21-4918-b6ec-768809f4a1e9",
    "type": "stock-transaction",
    "action": "allocate",
    "quantity": 5
  }
}
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.