OnPrintShop Master Options icon

OnPrintShop Master Options

Manage OnPrintShop master options, attributes, formulas, rules, ranges, prices, tags, groups, and stock

Complete API → Add Master Option Stock Config

AI-generated

Summary

Add a new master option stock configuration in OnPrintShop by specifying details such as stock type, option ID, default stock, custom multiplier usage, and optional multipliers, attribute stock, and combination stock data.

Inputs

  • Stock Type (required) — An integer specifying the stock type, indicating if stock is managed option-wise, attribute-wise, or combination-wise.
  • Option ID — The master option ID to which the stock configuration applies.
  • Default Stock — The default stock quantity for the specified configuration.
  • Custom Multiplier — An integer indicating whether custom multipliers should be used (typically 1 for true, 0 for false).
  • Apply To All — An integer flag to apply the configuration to all relevant items.
  • Multipliers — A list of multipliers, each including an attribute ID and multiplier value to scale stock accordingly.
  • Attributes — A list defining stock quantities per attribute, each entry requiring an attribute ID and optional stock.
  • Combinations — A list defining stock quantities per combination, each entry requires attribute IDs, option IDs, and optional stock quantity.
  • Input Mode (required) — Specifies whether the input for the stock configuration is provided as structured fields or a raw JSON object.
  • Partial Response — Determines whether to fail entirely on errors or return partial data when errors occur in batch operations.
  • Return Fields Mode — Defines whether to return all fields in the response or a custom selection of fields.

Output shape

a list of result items, each containing the index, operation result status, message, and configuration ID of the added stock configuration

Output includes fields such as 'index', 'result', 'message', and 'id'. The operation may produce partial results if 'Partial Response' is set to return partial data.

Examples

Example 1: Create a new attribute-wise stock configuration with default stock and custom multipliers

Set Stock Type to 2 (Attribute Wise), specify Option ID, set Default Stock to desired quantity, enable Custom Multiplier, and provide multipliers and attribute stock details.

Links

Discussion