Skip to content

Vendor API

Manage vendor records for an organization — create, list, look up by code, and update.

Endpoints

MethodPathDescription
POST/api/vendor/:orgId/createCreate a new vendor
GET/api/vendor/:orgId/listList all vendors
GET/api/vendor/:orgId/by-code/:codeLook up vendor by code
GET/api/vendor/:orgId/:vendorIdGet vendor by ID
PUT/api/vendor/:orgId/:vendorId/updateUpdate a vendor

Path Parameters

ParameterTypeDescription
orgIdstringOrganization ID
vendorIdstringVendor ID
codestringUnique vendor code

Create Vendor

POST /api/vendor/:orgId/create

Request Body

json
{
  "name": "Hotel Linen Supplies Ltd.",
  "code": "VND-001",
  "email": "contact@linensupplies.com",
  "phone": "+91-9876543210",
  "gstin": "27AABCU9603R1ZM",
  "pan": "AABCU9603R",
  "address": {
    "line1": "42 Industrial Area",
    "line2": "Phase II",
    "city": "Pune",
    "state": "Maharashtra",
    "pincode": "411057",
    "country": "India"
  },
  "bankDetails": {
    "accountName": "Hotel Linen Supplies Ltd.",
    "accountNumber": "123456789012",
    "bankName": "State Bank of India",
    "ifsc": "SBIN0001234",
    "branch": "Pune Main Branch"
  },
  "notes": "Primary linen supplier"
}

Response — 201 Created

json
{
  "success": true,
  "message": "Vendor created successfully",
  "data": {
    "_id": "665a1b2c3d4e5f6a7b8c9d0e",
    "name": "Hotel Linen Supplies Ltd.",
    "code": "VND-001",
    "email": "contact@linensupplies.com",
    "phone": "+91-9876543210",
    "gstin": "27AABCU9603R1ZM",
    "pan": "AABCU9603R",
    "address": {
      "line1": "42 Industrial Area",
      "line2": "Phase II",
      "city": "Pune",
      "state": "Maharashtra",
      "pincode": "411057",
      "country": "India"
    },
    "bankDetails": {
      "accountName": "Hotel Linen Supplies Ltd.",
      "accountNumber": "123456789012",
      "bankName": "State Bank of India",
      "ifsc": "SBIN0001234",
      "branch": "Pune Main Branch"
    },
    "notes": "Primary linen supplier",
    "orgId": "663f1a2b3c4d5e6f7a8b9c0d",
    "createdAt": "2026-02-23T10:30:00.000Z",
    "updatedAt": "2026-02-23T10:30:00.000Z"
  }
}

List Vendors

GET /api/vendor/:orgId/list

Response — 200 OK

json
{
  "success": true,
  "data": [
    {
      "_id": "665a1b2c3d4e5f6a7b8c9d0e",
      "name": "Hotel Linen Supplies Ltd.",
      "code": "VND-001",
      "email": "contact@linensupplies.com",
      "phone": "+91-9876543210",
      "gstin": "27AABCU9603R1ZM",
      "createdAt": "2026-02-23T10:30:00.000Z"
    },
    {
      "_id": "665a1b2c3d4e5f6a7b8c9d0f",
      "name": "Fresh Foods Pvt. Ltd.",
      "code": "VND-002",
      "email": "orders@freshfoods.in",
      "phone": "+91-9123456780",
      "gstin": "29AADCF1234H1Z5",
      "createdAt": "2026-02-22T08:15:00.000Z"
    }
  ]
}

Get Vendor by Code

GET /api/vendor/:orgId/by-code/:code

Response — 200 OK

json
{
  "success": true,
  "data": {
    "_id": "665a1b2c3d4e5f6a7b8c9d0e",
    "name": "Hotel Linen Supplies Ltd.",
    "code": "VND-001",
    "email": "contact@linensupplies.com",
    "phone": "+91-9876543210",
    "gstin": "27AABCU9603R1ZM",
    "pan": "AABCU9603R",
    "address": {
      "line1": "42 Industrial Area",
      "line2": "Phase II",
      "city": "Pune",
      "state": "Maharashtra",
      "pincode": "411057",
      "country": "India"
    },
    "bankDetails": {
      "accountName": "Hotel Linen Supplies Ltd.",
      "accountNumber": "123456789012",
      "bankName": "State Bank of India",
      "ifsc": "SBIN0001234",
      "branch": "Pune Main Branch"
    },
    "notes": "Primary linen supplier",
    "orgId": "663f1a2b3c4d5e6f7a8b9c0d",
    "createdAt": "2026-02-23T10:30:00.000Z",
    "updatedAt": "2026-02-23T10:30:00.000Z"
  }
}

Get Vendor by ID

GET /api/vendor/:orgId/:vendorId

Response — 200 OK

json
{
  "success": true,
  "data": {
    "_id": "665a1b2c3d4e5f6a7b8c9d0e",
    "name": "Hotel Linen Supplies Ltd.",
    "code": "VND-001",
    "email": "contact@linensupplies.com",
    "phone": "+91-9876543210",
    "gstin": "27AABCU9603R1ZM",
    "pan": "AABCU9603R",
    "address": {
      "line1": "42 Industrial Area",
      "line2": "Phase II",
      "city": "Pune",
      "state": "Maharashtra",
      "pincode": "411057",
      "country": "India"
    },
    "bankDetails": {
      "accountName": "Hotel Linen Supplies Ltd.",
      "accountNumber": "123456789012",
      "bankName": "State Bank of India",
      "ifsc": "SBIN0001234",
      "branch": "Pune Main Branch"
    },
    "notes": "Primary linen supplier",
    "orgId": "663f1a2b3c4d5e6f7a8b9c0d",
    "createdAt": "2026-02-23T10:30:00.000Z",
    "updatedAt": "2026-02-23T10:30:00.000Z"
  }
}

Update Vendor

PUT /api/vendor/:orgId/:vendorId/update

Request Body

json
{
  "name": "Hotel Linen Supplies Ltd.",
  "email": "new-contact@linensupplies.com",
  "phone": "+91-9876543299",
  "notes": "Primary linen supplier — updated contact"
}

Response — 200 OK

json
{
  "success": true,
  "message": "Vendor updated successfully",
  "data": {
    "_id": "665a1b2c3d4e5f6a7b8c9d0e",
    "name": "Hotel Linen Supplies Ltd.",
    "code": "VND-001",
    "email": "new-contact@linensupplies.com",
    "phone": "+91-9876543299",
    "gstin": "27AABCU9603R1ZM",
    "pan": "AABCU9603R",
    "address": {
      "line1": "42 Industrial Area",
      "line2": "Phase II",
      "city": "Pune",
      "state": "Maharashtra",
      "pincode": "411057",
      "country": "India"
    },
    "bankDetails": {
      "accountName": "Hotel Linen Supplies Ltd.",
      "accountNumber": "123456789012",
      "bankName": "State Bank of India",
      "ifsc": "SBIN0001234",
      "branch": "Pune Main Branch"
    },
    "notes": "Primary linen supplier — updated contact",
    "orgId": "663f1a2b3c4d5e6f7a8b9c0d",
    "createdAt": "2026-02-23T10:30:00.000Z",
    "updatedAt": "2026-02-23T11:00:00.000Z"
  }
}

Released under the MIT License.