Skip to main content

Update Product

Update an existing product. All fields are optional — only provided fields will be updated.

PUThttps://api.zenpayz.com/merchant/api/v1/products/:productId
Bearer · API key

Request

Headers

HeaderDescription
Authorization
REQUIRED
Bearer {api_key}
X-Signature
REQUIRED
HMAC-SHA256 signature
X-Timestamp
REQUIRED
ISO 8601 timestamp
X-Secret-Salt
REQUIRED
Secret salt for HMAC validation
Content-Type
REQUIRED
application/json

Path Parameters

ParameterTypeDescription
productId
REQUIRED
stringThe product ID (e.g. prod_a1b2c3d4e5f6g7h8)

Body Parameters

ParameterTypeDescription
name
OPTIONAL
stringProduct name (1-255 characters)
description
OPTIONAL
stringProduct description
price
OPTIONAL
numberProduct price (minimum 0)
currency
OPTIONAL
stringCurrency code. One of USD, INR, EUR, GBP
sku
OPTIONAL
stringStock keeping unit (1-100 characters)
status
OPTIONAL
stringProduct status. One of ACTIVE, INACTIVE, ARCHIVED
categoryId
OPTIONAL
numberCategory ID to assign the product to
images
OPTIONAL
arrayArray of product images
pricingTiers
OPTIONAL
arrayArray of pricing tiers
metadata
OPTIONAL
objectCustom key-value pairs

Response

Success (200 OK)

{
"success": true,
"data": {
"productId": "prod_a1b2c3d4e5f6g7h8",
"name": "Pro Plan Plus",
"description": "Enhanced professional subscription plan",
"price": 5999,
"currency": "INR",
"sku": "PRO-PLAN-001",
"status": "ACTIVE",
"categoryId": 1,
"images": [
{
"url": "https://example.com/images/pro-plan-plus.png",
"alt": "Pro Plan Plus",
"isPrimary": true
}
],
"pricingTiers": [
{
"name": "Monthly",
"price": 5999,
"description": "Billed monthly",
"features": ["Unlimited access", "Priority support", "API access"]
}
],
"metadata": {},
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-16T14:20:00.000Z"
},
"message": "Product updated successfully",
"error": null,
"meta": {
"request_id": "req_xxxxx",
"timestamp": "2024-01-16T14:20:00.000Z",
"processing_time_ms": 40,
"api_version": "v1",
"endpoint": "PUT /products/:productId",
"user_type": "merchant"
}
}

Error Responses

CodeHTTPMessage
VALIDATION_ERROR400Invalid request parameters
UNAUTHORIZED401Invalid API key
PRODUCT_NOT_FOUND404Product does not exist
DUPLICATE_SKU409Product with this SKU already exists

Examples

curl -X PUT https://api.zenpayz.com/merchant/api/v1/products/prod_a1b2c3d4e5f6g7h8 \
-H "Authorization: Bearer zp_test_xxxxx" \
-H "X-Timestamp: 2024-01-16T14:20:00.000Z" \
-H "X-Signature: a1b2c3d4e5f6..." \
-H "X-Secret-Salt: your_secret_salt" \
-H "Content-Type: application/json" \
-d '{
"name": "Pro Plan Plus",
"price": 5999,
"description": "Enhanced professional subscription plan"
}'