Skip to main content
PUT
/
v2
/
vendor
/
discounts
/
{discountId}
Update Discount
curl --request PUT \
  --url https://api.puppetvendors.com/v2/vendor/discounts/{discountId} \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "title": "<string>",
  "endsAt": "<string>",
  "status": "<string>"
}
'
V2 Alpha — This endpoint is part of the V2 API preview. Breaking changes may occur.

Overview

Update an existing discount code owned by the authenticated vendor.

Path Parameters

discountId
string
required
Discount ObjectId.

Request Body

title
string
Updated title.
endsAt
string
Updated end date (ISO 8601).
status
string
Updated status. One of: active, expired, disabled.

Response

200
{
  "success": true,
  "data": {
    "discount": {
      "_id": "507f1f77bcf86cd799439011",
      "code": "VENDOR20",
      "title": "Extended Vendor Sale",
      "status": "active",
      "updatedAt": "2024-08-01T09:00:00.000Z"
    }
  }
}

Example

curl -X PUT https://api.puppetvendors.com/v2/vendor/discounts/507f1f77bcf86cd799439011 \
  -H "Content-Type: application/json" \
  -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \
  -d '{
    "title": "Extended Vendor Sale",
    "endsAt": "2024-09-30T23:59:59.000Z"
  }'