V2 Alpha — This endpoint is part of the V2 API preview. Breaking changes may occur.
Overview
Update one or more fields on an existing vendor. All body fields are optional; only provided fields will be updated. The vendor name and alias must remain unique within the shop.
Use Cases
- Commission adjustments — Update a vendor’s commission rate or type
- Vendor management — Change vendor names, aliases, or contact emails
- Visibility control — Hide or unhide vendors from the marketplace
Path Parameters
The vendor’s MongoDB ObjectId.
Request Body
Vendor display name (1-200 characters). Must be unique within the shop.
URL-friendly alias (max 200 characters). Must be unique within the shop.
Commission type. One of: percentage, flat.
Commission amount (minimum 0). Interpreted as a percentage or flat amount depending on commissionType.
Email address for vendor reports and notifications. Must be a valid email format.
Set to true to hide the vendor, false to make them visible.
Response
{
"success": true,
"data": {
"vendor": {
"_id": "507f1f77bcf86cd799439011",
"vendorName": "Acme Supplies Updated",
"vendorNameAlias": "acme-supplies",
"commissionType": "percentage",
"commissionAmount": 12,
"reportingEmail": "new-reports@acmesupplies.com",
"isHidden": false,
"createdAt": "2024-03-10T08:00:00.000Z",
"updatedAt": "2024-06-15T14:00:00.000Z"
}
}
}
Error Responses
{
"success": false,
"error": {
"message": "Vendor not found",
"code": "NOT_FOUND"
}
}
{
"success": false,
"error": {
"message": "A vendor with this name or alias already exists",
"code": "CONFLICT"
}
}
Example
curl -X PUT https://api.puppetvendors.com/v2/vendors/507f1f77bcf86cd799439011 \
-H "Content-Type: application/json" \
-H "x-access-token: YOUR_JWT_TOKEN" \
-d '{
"commissionAmount": 12,
"reportingEmail": "new-reports@acmesupplies.com"
}'