Jump to content

API Question: Unable to set initial stock when creating an item


Recommended Posts

Posted

Hello!!,

I am writing to ask a technical question regarding your v1.0 API.

I am trying to create a new item and set its initial stock level to "1" in a single call, using the POST /items endpoint.

I have confirmed that the account is on the Free Plan and that importing items via a CSV file does allow setting the stock. However, I am unable to achieve this through the API.

This is an example of the JSON payload I am sending:
 

json** { "item_name": "Test Product", "track_stock": true, "variants": [{ "stores": [{ "store_id": "ID_DE_TIENDA_VERIFICADO", "pricing_type": "FIXED", "price": 48, "in_stock": 1 }] }] } **

The result is that the item is created correctly with the specified price (48.00), but the in_stock field is ignored, and the item's inventory remains at 0.

My question is the following: Is it possible to set an item's initial stock (in_stock) at the time of its creation via the POST /items endpoint for an account on the Free Plan?

If so, what is the exact payload structure required? If it is not possible, is there another endpoint (like /stock_adjustments) that allows for programmatically adjusting inventory on the Free Plan?

I have confirmed that the store_id is correct and the track_stock parameter is set to true.

Thank you in advance for your help and clarification.

Sincerely,

Loyverse Point of Sale

 

 

 

 

×
×
  • Create New...