Skip to main content
POST
/
v2
/
vendor
/
users
Create User
curl --request POST \
  --url https://api.puppetvendors.com/v2/vendor/users \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "email": "<string>",
  "password": "<string>",
  "vendor": "<string>",
  "approved": true,
  "notifications": true,
  "sendInvite": true,
  "profile": {
    "profile.firstName": "<string>",
    "profile.lastName": "<string>",
    "profile.phone": "<string>"
  },
  "permission": {}
}
'
V2 Alpha — This endpoint is part of the V2 API preview. Breaking changes may occur.

Overview

Create a new user account for the authenticated vendor. The vendorId is automatically derived from the vendor token, and the user type is always set to vendor. Optionally send an invitation email to the new user.
Vendor Token Required — This endpoint requires a vendor-scoped JWT token. Merchant tokens will receive a 403 error.

Use Cases

  • Invite team members to the vendor portal
  • Automate account provisioning for new vendor staff

Request Body

email
string
required
Email address for the new user. Must be a valid email format.
password
string
required
Password for the new user (minimum 6 characters).
vendor
string
Vendor name label for the user.
approved
boolean
default:"false"
Whether the account is immediately active.
notifications
boolean
Enable email notifications for the user.
sendInvite
boolean
default:"false"
Send an invitation email to the new user.
profile
object
User profile information.
permission
object
Permission configuration object for granular access control.

Response

201
{
  "success": true,
  "data": {
    "_id": "507f1f77bcf86cd799439022",
    "email": "newuser@vendor.com",
    "type": "vendor",
    "approved": false,
    "profile": {
      "firstName": "New",
      "lastName": "User"
    },
    "notifications": true,
    "permission": {},
    "createdAt": "2024-06-15T12:00:00.000Z",
    "updatedAt": "2024-06-15T12:00:00.000Z"
  }
}

Error Responses

409
{
  "success": false,
  "error": "A user with this email already exists"
}

Example

curl -X POST "https://api.puppetvendors.com/v2/vendor/users" \
  -H "Content-Type: application/json" \
  -H "x-access-token: YOUR_VENDOR_JWT_TOKEN" \
  -d '{
    "email": "newuser@vendor.com",
    "password": "securePass123",
    "approved": true,
    "sendInvite": true,
    "profile": {
      "firstName": "New",
      "lastName": "User"
    }
  }'