after that I just call openboxes API with inventory item IDs to decrease their quantity
Ok thanks, that should be easy to implement.
Now I think that just updating the inventory items quantity is not a really good idea.
There’s no way to do this in OB without a transaction. But from your perspective, there shouldn’t be much of a difference. You can just pass us a list of sold items (i.e. inventory item, quantity, unit of measure) and we should be able to create a transaction for you.
For example, we could send us the following request
request
POST /api/transactions
payload
{
transactionType: "SALES",
transactionDate: "2022-03-10 21:49:00",
items: [
{ inventoryItemId: "09f5e116819082200181979bdcf92b8c", quantity: 1, unitOfMeasure: "EA" },
{ inventoryItemId: "8a8a9e9666194c8901661d2e06340167", quantity: 10, unitOfMeasure: "EA" }]
}
NOTE: The transaction type (SALES) tell us whether we should add or subtract the quantities from the quantity on hand.
From what you said earlier, we can do this as a straight-up transaction (i.e. Debit 1 EA of Inventory Item 001 of Product ABC from Location A). We can always build in the additional layers later.
For example, we can get more complicated if you eventually want to track other data elements like customer info, sales reference number, sales interaction type (POS vs e-commerce), or if you need to track the fulfillment process (allocation, picking, packing, shipping) as disparate events within a workflow.