Prerequisites
- A Marqo Cloud account (sign up here)
- Your Marqo API key (find your API key guide)
- An existing ecommerce index with products (add products guide)
Partial Update Documents
Update existing product documents by making aPATCH /documents request. This endpoint allows you to modify specific fields without affecting other product data.
Endpoint: PATCH https://ecom.marqo-ep.ai/api/v1/indexes/{index_name}/documents
Request Body:
Key Differences from Add Products
- Method:
PATCHinstead ofPOST - Required Fields: Only
_idis required - all other fields are optional - Behavior: Updates only the fields you specify, leaving other fields unchanged
- Body Structure: Identical to Add Products but with optional fields
Update Examples
Price Update
Update just the price of a product:Description and Collections Update
Update product description and add it to new collections:Stock and Custom Fields Update
Update custom fields like stock quantity and availability:Variant Information Update
Update variant-specific information:Updating Products in Your Index
{index_name} with your actual index name and {api_key} with your API key.
Response
The response structure is identical to the Add Products endpoint. A status code of200 indicates successful processing.
| Field Name | Type | Description |
|---|---|---|
errors | Boolean | Indicates whether any errors occurred during the processing of the batch request. |
items | Array | An array of objects, each representing the processing status of an individual document update. |
processingTimeMs | Integer | The time taken to process the batch request, in milliseconds. |
index_name | String | The name of the index where documents were updated. |
Response Status Codes
| Status Code | Description |
|---|---|
200 | The document was successfully updated. |
400 | Bad request. Invalid input or document ID not found. |
404 | Document with the specified _id does not exist. |
429 | Too many requests. Please try again later. |
500 | Internal error. |
Best Practices
Efficient Updates
- Update only changed fields - Don’t include fields that haven’t changed
- Batch updates - Group multiple updates into single requests for better performance
- Use specific IDs - Ensure
_idvalues match existing documents exactly
Common Update Patterns
- Price updates - For sales, promotions, or inventory changes
- Stock management - Update availability and quantity fields
- Content improvements - Enhance descriptions and add new collections
- Seasonal changes - Update collections for holidays or seasons
Error Handling
Check the response status and handle errors appropriately:errors field and individual item statuses to identify any failed updates.
Performance Tips
- Batch size - Update 25-75 products per request for optimal performance
- Frequency - Avoid updating the same products too frequently
- Field types - Remember that only certain field types can be vectorized (see Add Products guide)