Skip to main content
POST
/
v1
/
vendors
Create Vendor
curl --request POST \
  --url https://api.puppetvendors.com/v1/vendors \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "vendorName": "<string>",
  "commissionType": "<string>",
  "commissionAmount": 123
}
'

Overview

Creates a new vendor with the specified commission configuration. The vendor name is stored in lowercase and must be unique within your shop.

Use Cases

  • Automate vendor onboarding from a registration form or CRM
  • Bulk-create vendors by scripting multiple API calls
  • Sync vendors from an external marketplace or ERP system

Request Body

vendorName
string
required
Name of the vendor. Will be converted to lowercase. Must be unique per shop.
commissionType
string
required
Commission model: "percentage" or "flat".
commissionAmount
number
required
Commission value. For percentage type, this is the percentage (e.g. 10 for 10%). For flat type, this is the fixed amount per item.

Response

200
{
  "message": "Vendor created successfully.",
  "vendor": {
    "_id": "6157faecbebcf01bf49097d9",
    "vendorName": "acme supplies",
    "commissionType": "percentage",
    "commissionAmount": 10,
    "shopId": "...",
    "createdAt": "2024-01-15T08:00:00.000Z"
  }
}

Error: Duplicate Vendor

409
{
  "error": "A vendor with this name already exists.",
  "vendorName": "acme supplies"
}

Example

curl -X POST https://api.puppetvendors.com/v1/vendors \
  -H "Content-Type: application/json" \
  -H "x-access-token: YOUR_JWT_TOKEN" \
  -d '{
    "vendorName": "Acme Supplies",
    "commissionType": "percentage",
    "commissionAmount": 10
  }'