Actions42
- Attribute Actions
- Attribute Price Actions
- Formula Actions
- Master Option Actions
- Option Group Actions
- Range Actions
- Rule Actions
- Stock Actions
- Tag Actions
- Complete API Actions
- Get Custom Formula
- Get Master Option Combination Matrix
- Get Master Option Range
- Get Master Option Stock Configs
- Get Master Option Stock History
- Get Master Option Tag
- Get Option Group
- Product Master Options
- Add Master Option Stock Config
- Delete Master Option Stock Config
- Set Assign Options
- Set Custom Formula
- Set Master Option
- Set Master Option Attribute Price
- Set Master Option Attributes
- Set Master Option Range
- Set Master Option Stock Settings
- Set Master Option Tag
- Set Option Group
- Update Master Option Stock
Complete API → Add Master Option Stock Config
AI-generatedSummary
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.