# Update Order Draft Line Items Update line items in an order draft PATCH /api/v3/orders/draft/line-items Content-Type: application/json Use cases: - Update quantities before checkout - Change designs on line items - Fix errors in draft orders Endpoint: PATCH /api/v3/orders/draft/line-items Version: v3.0.0 ## Request fields (application/json): - `order_id` (string) Order draft ID to update (format: draft_xxxxx or UUID) - `line_items` (array) Updated line items (can update: quantity, designs, printing options; max 1000 line items per request) - `line_items.line_item_id` (string) Line item ID to update (required) - `line_items.variant_id` (string) Product variant ID (use variant_id OR legacy_id, not both) - `line_items.legacy_id` (integer,string) Legacy variant ID (for backward compatibility, use variant_id OR legacy_id, not both) - `line_items.quantity` (integer) Quantity to order (1-1000) - `line_items.printing_options` (array) Printing options (at least 1 required, must include front or back) - `line_items.printing_options.location_code` (string,number) Print location on product Enum: "PRINT_LOCATION_CODE_WHOLE", 1, "PRINT_LOCATION_CODE_FRONT", 2, "PRINT_LOCATION_CODE_BACK", 3, "PRINT_LOCATION_CODE_LEFT_SLEEVE", 4, "PRINT_LOCATION_CODE_RIGHT_SLEEVE", 5, "PRINT_LOCATION_CODE_POCKET", 6 - `line_items.printing_options.url` (string) Design file URL (PNG, JPEG, or PDF) - `line_items.barcode_url` (string) Barcode URL for inventory tracking (optional) ## Response 200 fields (application/json): - `status` (string) Response status: "success" or "error" - `message` (string) Human-readable message - `data` (object) Updated order draft information - `data.order_id` (string) Order draft ID that was updated ## Response 400 fields (application/json): - `code` (string, required) Machine-readable error code Example: "INVALID_ARGUMENT" - `message` (string, required) Human-readable error message Example: "The request parameters are invalid" - `details` (array) Additional error details - `details.field` (string) Field that caused the error - `details.issue` (string) Description of the issue ## Response 401 fields (application/json): - `code` (string, required) Machine-readable error code Example: "INVALID_ARGUMENT" - `message` (string, required) Human-readable error message Example: "The request parameters are invalid" - `details` (array) Additional error details - `details.field` (string) Field that caused the error - `details.issue` (string) Description of the issue ## Response 403 fields (application/json): - `code` (string, required) Machine-readable error code Example: "INVALID_ARGUMENT" - `message` (string, required) Human-readable error message Example: "The request parameters are invalid" - `details` (array) Additional error details - `details.field` (string) Field that caused the error - `details.issue` (string) Description of the issue ## Response 404 fields (application/json): - `code` (string, required) Machine-readable error code Example: "INVALID_ARGUMENT" - `message` (string, required) Human-readable error message Example: "The request parameters are invalid" - `details` (array) Additional error details - `details.field` (string) Field that caused the error - `details.issue` (string) Description of the issue ## Response 500 fields (application/json): - `code` (string, required) Machine-readable error code Example: "INVALID_ARGUMENT" - `message` (string, required) Human-readable error message Example: "The request parameters are invalid" - `details` (array) Additional error details - `details.field` (string) Field that caused the error - `details.issue` (string) Description of the issue