Create Stock Transaction on Product
POST/inventories/:product_uuid/transactions
Create Stock Transaction on Product
Request
Path Parameters
The unique identifier of the product.
- application/json
Body
-
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.
data TransactionCreaterequired
Possible values: [stock-transaction
]
Default value: stock-transaction
The type of object being returned. Always stock-transaction
.
Possible values: [increment
, decrement
, allocate
, deallocate
]
The type of action being performed by this transaction.
The amount of stock affected by the stock transaction.
Responses
- 200
- 422
- 500
Success. Stock was successfully modified for product
- application/json
- Schema
- Example (from schema)
Schema
-
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.
data Transaction
The unique identifier for the stock transaction.
Possible values: [stock-transaction
]
Default value: stock-transaction
The type represents the object being returned. Always stock-transaction
.
Possible values: [increment
, decrement
, allocate
, deallocate
]
The type of action performed by this transaction.
The product identifier that this stock transaction is for.
The amount of stock affected by the stock transaction.
timestamps Timestamps
The date and time a transaction is created.
The date and time a transaction is created.
{
"data": {
"id": "f976dace-450f-4a5d-8877-d119c5a550a1",
"type": "stock-transaction",
"action": "allocate",
"product_id": "86b84d3e-0a86-43d6-a347-78ba4adacca2",
"quantity": 5,
"timestamps": {
"created_at": "2017-07-21T17:32:28Z"
}
}
}
The request was understood, but could not be processed by the server
- application/json
- Schema
- Example (from schema)
- missing-name
Schema
- Array [
- ]
errors ErrorBody[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred."
}
]
}
{
"errors": [
{
"title": "Cannot complete request",
"status": 422,
"detail": "Your request could not be completed due to insufficient stock levels"
}
]
}
Internal server error. There was a system failure in the platform.
- application/json
- Schema
- Example (from schema)
- internal-server-error
Schema
- Array [
- ]
errors ErrorBody[]required
The HTTP response code of the error.
A brief summary of the error.
Optional additional detail about the error.
{
"errors": [
{
"status": 500,
"title": "Internal server error",
"detail": "An internal error has occurred."
}
]
}
{
"errors": [
{
"title": "Internal Server Error",
"status": 500
}
]
}