Skip to main content
PUT
/
v2
/
vendors
/
{vendorId}
Update Vendor
curl --request PUT \
  --url https://api.puppetvendors.com/v2/vendors/{vendorId} \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "vendorName": "<string>",
  "vendorNameAlias": "<string>",
  "commissionType": "<string>",
  "commissionAmount": 123,
  "reportingEmail": "<string>",
  "isHidden": true
}
'
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

vendorId
string
required
The vendor’s MongoDB ObjectId.

Request Body

vendorName
string
Vendor display name (1-200 characters). Must be unique within the shop.
vendorNameAlias
string
URL-friendly alias (max 200 characters). Must be unique within the shop.
commissionType
string
Commission type. One of: percentage, flat.
commissionAmount
number
Commission amount (minimum 0). Interpreted as a percentage or flat amount depending on commissionType.
reportingEmail
string
Email address for vendor reports and notifications. Must be a valid email format.
isHidden
boolean
Set to true to hide the vendor, false to make them visible.

Response

200
{
  "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

404
{
  "success": false,
  "error": {
    "message": "Vendor not found",
    "code": "NOT_FOUND"
  }
}
409
{
  "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"
  }'