Skip to main content
GET
/
v2
/
vendor
/
discounts
List Discounts
curl --request GET \
  --url https://api.puppetvendors.com/v2/vendor/discounts \
  --header 'x-access-token: <api-key>'
V2 Alpha — This endpoint is part of the V2 API preview. Breaking changes may occur.

Overview

Retrieve discount codes created by or assigned to the authenticated vendor.

Use Cases

  • Manage promotions in a vendor self-service portal
  • Monitor discount usage and effectiveness

Query Parameters

status
string
Filter by status. One of: active, expired, disabled.
Search in discount title and code.
first
integer
Forward pagination count (1–100).
after
string
Forward pagination cursor.
last
integer
Backward pagination count (1–100).
before
string
Backward pagination cursor.

Response

200
{
  "success": true,
  "data": {
    "edges": [
      {
        "node": {
          "_id": "507f1f77bcf86cd799439011",
          "code": "VENDOR20",
          "title": "Vendor Special 20% Off",
          "status": "active",
          "startsAt": "2024-06-01T00:00:00.000Z",
          "endsAt": "2024-08-31T23:59:59.000Z",
          "usageCount": 12,
          "usageLimit": 50
        },
        "cursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMSJ9"
      }
    ],
    "pageInfo": {
      "hasNextPage": false,
      "hasPreviousPage": false,
      "startCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMSJ9",
      "endCursor": "eyJpZCI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMSJ9"
    }
  }
}

Example

curl -X GET "https://api.puppetvendors.com/v2/vendor/discounts?status=active&first=20" \
  -H "x-access-token: YOUR_VENDOR_JWT_TOKEN"