OnPrintShop icon

OnPrintShop

Interact with OnPrintShop API

Actions218

Complete API → Product Stocks

AI-generated

Summary

Reads OnPrintShop product stock records through the Complete API productStocks query.

Inputs

  • safeMode — In Complete API, enabling Safe Mode blocks mutations. This operation is read-only, so Safe Mode is not needed for normal use.
  • apiInputMode (required) — Select Fields to build the request from individual form fields, or JSON Object to supply the query arguments as a JSON object.
  • api_type (required) — Required stock scope when Input Mode is Fields. Select Product Option (product_option) or Product (product).
  • apiOptional — Optional query parameters in Fields mode: Limit, Offset, and Product ID. Product ID filters stock records for a specific product; Limit and Offset control pagination.
  • apiArgumentsJson — Used when Input Mode is JSON Object. Provide the API arguments for the productStocks query as a JSON object instead of using the Type and Parameters form.
  • apiReturnMode (required) — Choose All Fields to return the full productStocks response, or Custom Selection to return only the fields you select.
  • apiReturnFields — When Return Fields Mode is Custom Selection, choose from currentCount, totalProductStocks, and per-stock fields: stock_id, product_id, product_name, size_id, size_title, credited_stock, current_stock, debited_stock, option_details, and location.

Output shape

Returns the productStocks query response data: matching product stock records with the requested fields, plus totalProductStocks and currentCount counts when those fields are selected.

In All Fields mode, the full available stock field set is returned. In Custom Selection mode, only the selected fields are requested.

Examples

Example 1: Check current stock for a product

Set Resource to Complete API, Operation to Product Stocks, Input Mode to Fields, Type to Product, add Product ID in Parameters, and use Return Fields Mode All Fields.

Example 2: Check product option stock with custom fields

Set Input Mode to Fields, Type to Product Option, optionally add Limit/Offset, set Return Fields Mode to Custom Selection, and select fields such as productStocks.stock_id, productStocks.product_name, and productStocks.current_stock.

Links

Discussion