Skip to content
View in the app

A better way to browse. Learn more.

Loyverse Town

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

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,

  • 1 month later...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.