Assign product to commission
POST /commission/assign
Assign the given VI to commission partner. It is required that the product has a pre-defined commission partner before it can be assigned.
When sendEmailNotification
is set to true
a notification e-mail will be sent to the assigned commission partner, letting them know the product is now available.
Default is true
.
You may use fields.assignedToCommissionPartnerDate
to set the date a product was assigned to commission partner, defaults to current date if not set.
<?php
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://YOUR-ENVIRONMENT.autoproff.com/api/product/create',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"vehicleIdentificationNumber": "2135678987654",
"fields": {
"commissionPrice": "23000",
"commissionFee": "3000",
"salesPriceDealer": "26000",
"assignedToCommissionPartnerDate": "2024-05-21"
},
"sendEmailNotification": true
}',
CURLOPT_HTTPHEADER => [
'X-Api-Key: YOUR-API-KEY'
],
]);
$response = curl_exec($ch);
curl_close($ch);
Parameters
Parameter | Required | Description |
---|---|---|
vehicleIdentificationNumber |
This is your 17 character VIN | |
fields |
An object of key-value pairs, where key is the field key used by Fleet. | |
fields.* |
Optional values for commission to change before assigning. | |
sendEmailNotification |
Enable/Disable e-mail notification |
Errors codes
Status Code | Error Message | Description |
---|---|---|
404 Not Found | Product not found with VIN %s |
The vehicleIdentificationNumber is not provided in the request body body. |
409 Conflict | Product cannot be assigned as no commission partner has been set. |
The product cannot be assigned because there is no commission partner set for the product, one must be assigned manually. |
422 Unprocessable Entity | Field '%s' has no predefined value, and none was provided. |
One of the optional fields (commissionPrice , commissionFee , salesPriceDealer , assignedToCommissionPartnerDate ) has no predefined value and none was provided in the request body. |
422 Unprocessable Entity | '%s' must be a numeric value |
One of the fields (commissionPrice , commissionFee , salesPriceDealer , commissionPartnerID ) contains a non-numeric value. |
422 Unprocessable Entity | Commission partner has no e-mail set for notifications |
The predefined commissions partner does not have a valid e-mail adress, this must be corrected by your support rep |