Vendor Config API
Configure distributor API integrations for real-time pricing and availability.
This API manages vendor API integration settings. For vendor entity CRUD (create, update, delete vendors), see Vendors API.
GET /api/v1/vendor-config/{vendorId}
Returns the API configuration status for a specific vendor.
Response (200 - Success)
{
"success": true,
"data": {
"vendorId": 1,
"vendorName": "TD SYNNEX",
"apiEnabled": true,
"apiEndpoint": "https://api.us.tdsynnex.com",
"hasCredentials": true,
"lastTestedAt": "2024-12-24T10:00:00Z",
"lastTestResult": "success"
},
"timestamp": "2024-12-25T12:00:00Z"
}
Error Responses
| Status | Code | Description |
|---|---|---|
| 404 | VENDOR_NOT_FOUND |
Vendor with specified ID does not exist |
PUT /api/v1/vendor-config/{vendorId}
Updates the API credentials and endpoint configuration for a vendor.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
apiEndpoint |
string | No | Vendor API endpoint URL |
apiKey |
string | No | API key or client ID |
apiSecret |
string | No | API secret or password (stored securely) |
Response (200 - Success)
{
"success": true,
"message": "Vendor configuration updated successfully",
"timestamp": "2024-12-25T12:00:00Z"
}
POST /api/v1/vendor-config/{vendorId}/test
Tests connectivity to the vendor's API using the stored credentials.
Response (200 - Success)
{
"success": true,
"data": {
"connectionSuccessful": true,
"responseTime": 245,
"message": "Connection successful"
},
"timestamp": "2024-12-25T12:00:00Z"
}
Response (200 - Connection Failed)
{
"success": true,
"data": {
"connectionSuccessful": false,
"responseTime": 5000,
"message": "Connection timed out",
"errorDetails": "Request timeout after 5000ms"
},
"timestamp": "2024-12-25T12:00:00Z"
}
PATCH /api/v1/vendor-config/{vendorId}/toggle
Enables or disables the API integration for a vendor without modifying credentials.
Request Body
{
"enabled": true
}
Response (200 - Success)
{
"success": true,
"message": "Vendor API integration enabled",
"timestamp": "2024-12-25T12:00:00Z"
}
DELETE /api/v1/vendor-config/{vendorId}
Removes all stored API credentials for a vendor, disabling the integration.
Response (200 - Success)
{
"success": true,
"message": "Vendor credentials removed",
"timestamp": "2024-12-25T12:00:00Z"
}
GET /api/v1/vendor-config/enabled
Returns a list of all vendors that currently have API integration enabled.
Response (200 - Success)
{
"success": true,
"data": {
"vendors": [
{
"vendorId": 1,
"vendorName": "TD SYNNEX",
"apiEnabled": true,
"hasCredentials": true
},
{
"vendorId": 2,
"vendorName": "Ingram Micro",
"apiEnabled": true,
"hasCredentials": true
}
]
},
"timestamp": "2024-12-25T12:00:00Z"
}
API credentials are stored encrypted and are never returned in API responses. Use the hasCredentials field to check if credentials are configured.
