Dealers API
Connect and manage dealer accounts on the CHeKT platform
Overview
The Dealers API enables you to connect dealer accounts from your system to the CHeKT platform, retrieve dealer information, update dealer details, and disconnect dealers when needed.
Authentication
All dealer API requests require a valid OAuth 2.0 access token. The /dealers/connect endpoint requires an Authorization access token, while other endpoints use Client Credentials Grant (M2M).
Endpoints
Connect a Dealer
Links a CHeKT dealer account with your system's dealer ID.
Endpoint: PUT /partner/v1/dealers/connect
Authentication: Authorization access token (OAuth 2.0 Authorization Code)
Description: The authorization access token includes the user_id, and the dealer_id is retrieved based on the user_id. The dealer_id is then connected to external_dealer_id in the database.
Request
{
"external_dealer_id": "adc-67890",
"company_name": "CHeKT Security Solutions"
}
Parameters:
external_dealer_id(string, required): Unique identifier assigned by your systemcompany_name(string, required): Registered name of the dealer company
Response (200 OK)
{
"dealer_id": 12345,
"external_dealer_id": "adc-67890",
"company_name": "CHeKT Security Solutions Inc.",
"company_address1": "456 Market Street",
"company_address2": "Suite 801, 8th Floor",
"company_email": "support@chektdealer.com",
"company_phone_number": "+1-555-123-4567",
"created_at": "2024-03-27T12:34:56.000Z"
}
Response Fields:
dealer_id(number): Unique identifier assigned by the CHeKT systemexternal_dealer_id(string): Unique identifier assigned by your systemcompany_name(string): Legal or registered name of the dealer companycompany_address1(string): Primary street addresscompany_address2(string): Additional address details (optional)company_email(string): Email address for dealer communicationcompany_phone_number(string): Primary phone numbercreated_at(string): Date and time when dealer was registered (ISO format)
Get Dealer Information
Retrieve detailed information about a specific dealer.
Endpoint: GET /partner/v1/dealers/{dealerId}
Authentication: OAuth 2.0 Client Credentials Grant
Request
Path Parameters:
dealerId(string, required): The dealer ID returned from CHeKT
Headers:
Authorization: Bearer {access_token}x-partner-trace-id(optional): UUID for request tracking
Response (200 OK)
{
"dealer_id": 12345,
"external_dealer_id": "adc-67890",
"company_name": "CHeKT Security Solutions Inc.",
"company_address1": "456 Market Street",
"company_address2": "Suite 801, 8th Floor",
"company_email": "support@chektdealer.com",
"company_phone_number": "+1-555-123-4567",
"created_at": "2024-03-27T12:34:56.000Z"
}
Update Dealer Information
Update dealer details such as company name, address, or contact information.
Endpoint: PUT /partner/v1/dealers/{dealerId}
Authentication: OAuth 2.0 Client Credentials Grant
Request
Path Parameters:
dealerId(string, required): The dealer ID from CHeKT
Headers:
Authorization: Bearer {access_token}x-partner-trace-id(optional): UUID for request tracking
Body:
{
"company_name": "CHeKT Security Solutions Updated",
"company_address1": "789 New Street",
"company_address2": "Floor 10",
"company_email": "newsupport@chektdealer.com",
"company_phone_number": "+1-555-999-8888"
}
Parameters:
company_name(string, optional): Registered name of the dealer companycompany_address1(string, optional): Primary street addresscompany_address2(string, optional): Additional address detailscompany_email(string, optional): Email address for communicationcompany_phone_number(string, optional): Primary phone number
Response (200 OK)
{
"dealer_id": 12345,
"external_dealer_id": "adc-67890",
"company_name": "CHeKT Security Solutions Updated",
"company_address1": "789 New Street",
"company_address2": "Floor 10",
"company_email": "newsupport@chektdealer.com",
"company_phone_number": "+1-555-999-8888",
"created_at": "2024-03-27T12:34:56.000Z"
}
Disconnect a Dealer
Remove the connection between your system and the CHeKT dealer account.
Endpoint: PUT /partner/v1/dealers/{dealerId}/disconnect
Authentication: Authorization access token
Description: The authorization access token includes the user_id, and the dealer_id is retrieved based on the user_id. The dealer_id is then disconnected from external_dealer_id in the database.
Disconnecting a dealer will not delete their data, but will remove the link between your system and CHeKT. You can reconnect the dealer later.
Request
Path Parameters:
dealerId(string, required): The dealer ID from CHeKT
Headers:
Authorization: Bearer {access_token}x-partner-trace-id(optional): UUID for request tracking
Response (200 OK)
{
"dealer_id": 12345,
"external_dealer_id": null,
"company_name": "CHeKT Security Solutions Inc.",
"company_address1": "456 Market Street",
"company_address2": "Suite 801, 8th Floor",
"company_email": "support@chektdealer.com",
"company_phone_number": "+1-555-123-4567",
"created_at": "2024-03-27T12:34:56.000Z"
}
Error Responses
| Status Code | Description | Solution |
|---|---|---|
400 | Bad Request - Invalid input or parameters | Check your request payload format |
401 | Unauthorized - Invalid or expired token | Refresh your access token |
403 | Forbidden - Access denied | Verify your permissions |
404 | Not Found - Dealer does not exist | Check the dealer ID |
Code Examples
cURL
# Connect a dealer
curl -X PUT https://api.chekt.com/partner/v1/dealers/connect \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-partner-trace-id: 550e8400-e29b-41d4-a716-123456789000" \
-d '{
"external_dealer_id": "adc-67890",
"company_name": "CHeKT Security Solutions"
}'
# Get dealer information
curl -X GET https://api.chekt.com/partner/v1/dealers/12345 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-partner-trace-id: 550e8400-e29b-41d4-a716-123456789000"
# Update dealer
curl -X PUT https://api.chekt.com/partner/v1/dealers/12345 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "x-partner-trace-id: 550e8400-e29b-41d4-a716-123456789000" \
-d '{
"company_name": "Updated Company Name"
}'
JavaScript
// Connect a dealer
const response = await fetch("https://api.chekt.com/partner/v1/dealers/connect", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${accessToken}`,
"x-partner-trace-id": "550e8400-e29b-41d4-a716-123456789000"
},
body: JSON.stringify({
external_dealer_id: "adc-67890",
company_name: "CHeKT Security Solutions"
})
});
const dealer = await response.json();
console.log("Connected dealer:", dealer);
Python
import requests
# Connect a dealer
response = requests.put(
"https://api.chekt.com/partner/v1/dealers/connect",
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {access_token}",
"x-partner-trace-id": "550e8400-e29b-41d4-a716-123456789000"
},
json={
"external_dealer_id": "adc-67890",
"company_name": "CHeKT Security Solutions"
}
)
dealer = response.json()
print("Connected dealer:", dealer)
Best Practices
- Store dealer_id securely for future API calls
- Use x-partner-trace-id for request tracking and debugging
- Handle connection errors gracefully with retry logic
- Keep external_dealer_id synchronized with your system
- Validate dealer data before making API calls