OnPrintShop icon

OnPrintShop

Interact with OnPrintShop API

Actions218

Complete API → Modify Order Product

AI-generated

Summary

Modify the products of an existing order in OnPrintShop by specifying the order ID and an input object detailing one or more order products with optional fields to update their attributes.

Inputs

  • Order ID (required) — The ID of the order containing the products to modify.
  • Input (required) — An object containing a 'product_arr' array with one or more items specifying order product details to modify. Each item can include fields such as 'order_product_id', 'product_id', 'product_name', 'products_quantity', 'cost', 'customer_price', 'comment', 'delete', 'height', 'width', and others as optional parameters to update respective product attributes.
  • Safe Mode — Whether to block mutations in Complete API (default false).
  • Partial Response — Configures if operation should fail on errors or return partial data (default 'fail').
  • Return Fields Mode — Choose to return all fields or customize which fields to return (default 'all').
  • Return Fields — Specific fields to include in the response when using custom selection mode.

Output shape

a list of result objects indicating the outcome of modifying each order product

The operation accepts batched input for multiple products. The response includes objects with keys like 'index', 'result', 'message', and 'id' corresponding to each modified product. Errors during modification result in exceptions unless 'Partial Response' is set to return partial data.

Examples

Example 1: Modify multiple products in a single order

Specify 'Order ID' as the target order and provide 'Input' with 'product_arr' containing multiple items each including the 'order_product_id' and fields to update such as 'products_quantity' and 'comment'.

Links

Discussion