Skip to main content

Get All Suppliers

Retrieve a list of all suppliers with optional filtering and pagination.
curl -X GET "https://cemac-api.vercel.app/suppliers?search=&isActive=true&page=1&limit=50" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"
Authentication: Required (Bearer Token) Method: GET Endpoint: /suppliers

Query Parameters

Search term to filter suppliers by name or contact
isActive
boolean
Filter by active status (true/false)
page
number
Page number for pagination
limit
number
Number of suppliers per page

Response

success
boolean
Indicates if the request was successful
suppliers
array
Array of supplier objects
total
number
Total number of suppliers
message
string
Response message

Create Supplier

Create a new supplier.
curl -X POST https://cemac-api.vercel.app/suppliers \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Tech Distributors Inc.",
    "description": "Leading technology product distributor",
    "contactName": "Jane Smith",
    "email": "[email protected]",
    "phone": "+1-555-0123",
    "address": "789 Business Blvd, Tech City, TC 54321"
  }'
Authentication: Required (Bearer Token) Method: POST Endpoint: /suppliers

Request Body

name
string
required
Supplier’s business name (max 100 characters)
description
string
Description of the supplier (max 500 characters)
contactName
string
Primary contact person name (max 100 characters)
email
string
Supplier’s email address (valid email format)
phone
string
Supplier’s phone number (max 20 characters)
address
string
Supplier’s physical address (max 500 characters)

Response

success
boolean
Indicates if the supplier was created successfully
supplier
object
Created supplier object
message
string
Success message

Update Supplier

Update an existing supplier’s information.
curl -X PUT https://cemac-api.vercel.app/suppliers/SUPPLIER_ID \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Tech Distributors Global",
    "description": "Global technology product distributor",
    "contactName": "Jane Doe",
    "email": "[email protected]",
    "phone": "+1-555-9999",
    "address": "999 Global Plaza, Tech City, TC 54321",
    "isActive": true
  }'
Authentication: Required (Bearer Token) Method: PUT Endpoint: /suppliers/{supplierId}

Path Parameters

supplierId
string
required
Unique identifier of the supplier

Request Body

name
string
Updated supplier name (max 100 characters)
description
string
Updated description (max 500 characters)
contactName
string
Updated contact name (max 100 characters)
email
string
Updated email address
phone
string
Updated phone number (max 20 characters)
address
string
Updated address (max 500 characters)
isActive
boolean
Updated active status

Response

success
boolean
Indicates if the supplier was updated successfully
supplier
object
Updated supplier object
message
string
Success message

Delete Supplier

Delete a supplier from the system.
curl -X DELETE https://cemac-api.vercel.app/suppliers/SUPPLIER_ID \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"
Authentication: Required (Bearer Token) Method: DELETE Endpoint: /suppliers/{supplierId}

Path Parameters

supplierId
string
required
Unique identifier of the supplier to delete

Response

success
boolean
Indicates if the supplier was deleted successfully
supplierId
string
ID of the deleted supplier
message
string
Success message

Get Supplier Statistics

Retrieve detailed statistics for a specific supplier.
curl -X GET https://cemac-api.vercel.app/suppliers/SUPPLIER_ID/stats \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"
Authentication: Required (Bearer Token) Method: GET Endpoint: /suppliers/{supplierId}/stats

Path Parameters

supplierId
string
required
Unique identifier of the supplier

Response

success
boolean
Indicates if the request was successful
supplier
object
Supplier details
stats
object
Supplier statistics
message
string
Response message

Build docs developers (and LLMs) love