Update Customer Product
Update an existing customer product's name and/or customer access list. This endpoint performs partial updates - only the fields provided in the request will be modified.
PATCH /product/v1/customer-products/{id}
Request Format
The request body contains only the fields you want to update. Fields not included in the request will remain unchanged.
{
"name": "Premium Framed Poster - Updated Edition",
"customerIds": ["customer-123", "customer-456", "customer-789"]
}
Example curl request
curl --location --request PATCH 'https://connect.gelatoapis.com/product/v1/customer-products/cp-550e8400-e29b-41d4-a716-446655440001' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: your-api-key' \
--data-raw '{
"name": "Premium Framed Poster - Updated Edition",
"customerIds": ["customer-123", "customer-456", "customer-789"]
}'
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Required | Unique identifier of the customer product to update (URL path parameter) |
| name | string | Optional | Updated name for the customer product (only updated if provided) |
| customerIds | array[string] | Optional | Updated array of customer IDs that can order this product. Use ["*"] to allow all customers (only updated if provided) |
Response Format
Returns the updated customer product with all current configuration:
{
"id": "cp-550e8400-e29b-41d4-a716-446655440001",
"name": "Premium Framed Poster - Updated Edition",
"customerIds": ["customer-123", "customer-456", "customer-789"],
"productModelId": "model-framed-poster-001",
"variantOptions": [
{
"id": "size",
"name": "Size",
"attributesMapping": [
{
"partModelId": "frame",
"attributeIds": ["attr-width", "attr-height"]
},
{
"partModelId": "poster-print-paper-premium",
"attributeIds": ["attr-width", "attr-height"]
}
]
},
{
"id": "frame-color",
"name": "Frame Color",
"attributesMapping": [
{
"partModelId": "frame",
"attributeIds": ["attr-color"]
}
]
}
],
"partQuantities": [
{
"partModelId": "frame",
"quantity": 1
},
{
"partModelId": "poster-print-paper-premium",
"quantity": 1
}
],
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-15T14:45:00Z"
}
Common Use Cases
Update Customer Access List Only:
curl --location --request PATCH 'https://connect.gelatoapis.com/product/v1/customer-products/cp-550e8400-e29b-41d4-a716-446655440001' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: your-api-key' \
--data-raw '{
"customerIds": ["customer-123", "customer-456", "customer-789", "customer-999"]
}'
Update Product Name Only:
curl --location --request PATCH 'https://connect.gelatoapis.com/product/v1/customer-products/cp-550e8400-e29b-41d4-a716-446655440001' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: your-api-key' \
--data-raw '{
"name": "Premium Framed Poster - Limited Edition"
}'
Make Product Available to All Customers:
curl --location --request PATCH 'https://connect.gelatoapis.com/product/v1/customer-products/cp-550e8400-e29b-41d4-a716-446655440001' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: your-api-key' \
--data-raw '{
"customerIds": ["*"]
}'