Vendors
Endpoints for managing vendors.
List Vendors
GET /api/vendors
Description: Retrieves a list of vendors for your company. Supports searching by vendor name.
Authorization: API Key (Bearer Token) required.
Query Parameters:
- Name
search
- Type
- string
- Description
Search term to filter vendors by name.
Request
curl -X GET "https://your-summit-instance.com/api/vendors?search=SupplyCo" \
-H "Authorization: Bearer <YOUR_API_TOKEN>"
Response (Success: 200 OK)
{
"data": [
{
"id": 1,
"companyId": 1,
"name": "SupplyCo Inc.",
"contactName": "John Supplier",
"email": "[email protected]",
"phone": "555-0201",
"address": "789 Supplier Ave, Supplytown",
"website": "https://supplyco.com",
"notes": "Preferred supplier for office materials.",
"createdAt": "2023-08-01T00:00:00.000Z",
"updatedAt": "2023-08-01T00:00:00.000Z",
"softDelete": false
}
],
"count": 1
}
Create Vendor
POST /api/vendors
Description: Creates a new vendor.
Authorization: API Key (Bearer Token) required.
Request Body: application/json
- Name
name
- Type
- string
- Description
Name of the vendor.
- Name
contactName
- Type
- string
- Description
Name of the contact person.
- Name
email
- Type
- string
- Description
Email address of the vendor.
- Name
phone
- Type
- string
- Description
Phone number of the vendor.
- Name
address
- Type
- string
- Description
Address of the vendor.
- Name
website
- Type
- string
- Description
Website URL of the vendor.
- Name
notes
- Type
- string
- Description
Additional notes.
Request
curl -X POST "https://your-summit-instance.com/api/vendors" \
-H "Authorization: Bearer <YOUR_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Tech Solutions Ltd.",
"contactName": "Jane Techie",
"email": "[email protected]",
"phone": "555-0202"
}'
Response (Success: 201 Created)
{
"message": "Vendor created successfully",
"data": {
"id": 2,
"companyId": 1,
"name": "Tech Solutions Ltd.",
"contactName": "Jane Techie",
"email": "[email protected]",
"phone": "555-0202",
"address": null,
"website": null,
"notes": null,
"createdAt": "2023-10-27T17:00:00.000Z",
"updatedAt": "2023-10-27T17:00:00.000Z",
"softDelete": false
}
}
Get Vendor Details
GET /api/vendors/{vendorId}
Description: Retrieves details for a specific vendor.
Authorization: API Key (Bearer Token) required.
Path Parameters:
- Name
vendorId
- Type
- integer
- Description
ID of the vendor to retrieve.
Request
curl -X GET "https://your-summit-instance.com/api/vendors/2" \
-H "Authorization: Bearer <YOUR_API_TOKEN>"
Response (Success: 200 OK)
{
"data": {
"id": 2,
"companyId": 1,
"name": "Tech Solutions Ltd.",
"contactName": "Jane Techie",
"email": "[email protected]",
"phone": "555-0202",
"address": null,
"website": null,
"notes": null,
"createdAt": "2023-10-27T17:00:00.000Z",
"updatedAt": "2023-10-27T17:00:00.000Z",
"softDelete": false
}
}
Update Vendor
PUT /api/vendors/{vendorId}
Description: Updates an existing vendor.
Authorization: API Key (Bearer Token) required.
Path Parameters:
- Name
vendorId
- Type
- integer
- Description
ID of the vendor to update.
Request Body: application/json
(Same as Create Vendor, all fields optional for update)
Request
curl -X PUT "https://your-summit-instance.com/api/vendors/2" \
-H "Authorization: Bearer <YOUR_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "Tech Solutions International",
"website": "https://techsolutions.com"
}'
Response (Success: 200 OK)
{
"message": "Vendor updated successfully",
"data": {
"id": 2,
"companyId": 1,
"name": "Tech Solutions International",
"contactName": "Jane Techie",
"email": "[email protected]",
"phone": "555-0202",
"address": null,
"website": "https://techsolutions.com",
"notes": null,
"createdAt": "2023-10-27T17:00:00.000Z",
"updatedAt": "2023-10-27T18:00:00.000Z",
"softDelete": false
}
}
Delete Vendor
DELETE /api/vendors/{vendorId}
Description: Soft deletes a vendor.
Authorization: API Key (Bearer Token) required.
Path Parameters:
- Name
vendorId
- Type
- integer
- Description
ID of the vendor to delete.
Request
curl -X DELETE "https://your-summit-instance.com/api/vendors/2" \
-H "Authorization: Bearer <YOUR_API_TOKEN>"
Response (Success: 200 OK)
{
"message": "Vendor deleted successfully"
}