OnPrintShop icon

OnPrintShop

Interact with OnPrintShop API

Actions218

Complete API → Update Product Stock

AI-generated

Summary

Update product stock in OnPrintShop by adding, removing, or resetting quantities for one or more stock records. Supply stock details as repeatable fields or a JSON array; each detail identifies a stock ID or uses the Product SKU parameter and includes a numeric change and action.

Inputs

  • Safe Mode — Blocks mutations when enabled. Defaults to false.
  • Input Mode — Choose Fields or JSON Object. Fields mode supplies stock_details through the Stock Details JSON scalar; JSON Object mode supplies the full API arguments as JSON.
  • Input (required) — In Fields mode, provide stock_details as a JSON object or array. Each stock detail needs a numeric stock_change and action (add, remove, or reset), plus either stock_id or Product SKU. Optional comment and location are also accepted.
  • Parameters — Optional Product SKU and Type (product or product_option). The SKU can identify stock details that omit stock_id.
  • Arguments JSON — In JSON Object mode, provide the mutation arguments as a JSON object, including the required input.stock_details array.
  • Partial Response — Choose whether errors fail the operation or partial data is returned. Partial results may contain failures; reconcile each row before further writes.
  • Return Fields Mode — Return all available fields or select a custom subset.
  • Return Fields — When Custom Selection is chosen, select from id, message, result, stock_details, and stock_quantity.

Output shape

A list of items, each containing the stock update result.

Each result includes the selected response fields (all by default, or the custom selection), plus _operation and _stockDetailCount. GraphQL errors fail the item unless continue-on-fail is enabled. Safe Mode blocks the mutation when enabled.

Links

Discussion