Commerce
Set or adjust stock
set makes quantity the new available count; adjust adds quantity (negative to subtract). The variant must be stocked at the location. Answers the product's stock after the change.
PlatformsShopify
Authorization
bearerAuth AuthorizationBearer <token>
API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.
In: header
Path Parameters
productId*string
Platform-native id.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.commerce.changeCommerceInventory({ path: { productId: 'product_abc123', }, body: { accountId: 'account_abc123', changes: [ { variantId: 'variant_abc123', locationId: 'location_abc123', quantity: 0, }, ], },});console.log(data);{ "inventory": [ { "productId": "string", "variantId": "string", "sku": "string", "tracked": true, "levels": [ { "locationId": "string", "available": 0, "onHand": 0, "committed": 0, "incoming": 0 } ] } ]}Was this page helpful?