Comprehensive developer integration documentation is available here.
Lead submission
Before you can start your integration, you will require the following details from CAP:
- API key and campaign ID, per environment
- Source acquisition channel
- Enquiry type
- Vehicle names
- Additional required fields for campaign
To submit a lead, make a POST request to one of the following URLs:
| Environment | URL |
|---|---|
| QA | https://qa-api.cap-gateway.com/lead-submission/v1/external |
| Production | https://api.cap-gateway.com/lead-submission/v1/external |
The following headers are required to submit a lead:
| Key | Value |
|---|---|
| Content-Type | application/json |
| X-API-Key | YOUR_API_KEY |
Payload description
| Property | Type | Required | Supplied by CAP | Description |
|---|---|---|---|---|
metadata | object | Yes | No | Information about the campaign and enquiry details. |
metadata.campaignId | guid | Yes | Yes | Unique ID of the marketing campaign. |
metadata.enquiryDateTime | datetime | Yes | No | Date and time the enquiry was made. ISO 8601 format, Coordinated Universal Time (UTC), to the second. 'T' is a delimiter between the date and time. |
metadata.externalReferenceId | string | No | No | External system reference ID for tracking. Client's reference ID. |
metadata.enquiryType | string | Yes | Yes | Type of enquiry. Accepted Values: “Test Drive”, “Quotation”, “Retailer Contact”, “KMI”, “Interest Only”, “Register Of Interest”. |
metadata.ipAddress | string | No | No | The IP address of the user. |
metadata.enquirySource.source | string | Yes | Yes | The source for the enquiry. |
contactDetail | object | Yes | No | Contains the contact details of the person submitting the enquiry. |
contactDetail.firstName | string | Yes | No | First name of the individual. |
contactDetail.lastName | string | Yes | No | Last name of the individual. |
contactDetail.emailAddress | string | Yes | No | Email address of the individual. |
contactDetail.phoneNumber | string | Conditional | No | Phone number of the individual. +44 or 0 prefix accepted.Required for certain campaigns. |
contactDetail.address.postcode | string | Conditional | No | Postcode of the individual's address. Required for certain campaigns. |
optInConsents | object | Yes | No | Contains consent data for different communication channels. |
optInConsents.phoneCall | boolean | No | No | Opt-in status for the communication channel. Accepted values: true, false, null. |
optInConsents.post | boolean | No | No | Opt-in status for the communication channel. Accepted values: true, false, null. |
optInConsents.email | boolean | No | No | Opt-in status for the communication channel. Accepted values: true, false, null. |
optInConsents.sms | boolean | No | No | Opt-in status for the communication channel. Accepted values: true, false, null. |
vehicle.name | string | Yes | Yes | Name of the vehicle the user is interested in. |
Example payload
Example request [POST]
{
"metadata": {
"campaignId": "966c7488-bfa7-45b5-8510-d26ba3008879",
"enquiryDateTime": "2024-09-12T10:20:59.52",
"externalReferenceId": "9cf5ae87-aafb-43e5-b4d3-9d72367a2b86",
"enquiryType": "Test Drive",
"ipAddress": null,
"enquirySource": {
"source": "Google"
}
},
"contactDetail": {
"firstName": "test",
"lastName": "test",
"emailAddress": "[email protected]",
"phoneNumber": "+4420 8759 9036",
"address": {
"postcode": "L39AG"
}
},
"optInConsents": {
"phoneCall": true,
"post": false,
"email": false,
"sms": false
},
"vehicle": {
"name": "Audi Q6 e-tron"
}
}Responses
Successful response example
Successful response
{
"success": true,
"messages": [],
"result": {
"requestReferenceId": "e05072f9-ae85-42e2-ba42-c13449e5abaf",
"enquiryReferenceCode": "ENQ-240912-AZGCM0F8"
}
}Failed response example
Failed response
{
"success": false,
"messages": [
"ERROR_SPECIFIC_MESSAGE_HERE"
],
"result": {
"requestReferenceId": "08585f67-6d4d-4272-ac0a-342ac0edcb8c",
"enquiryReferenceCode": null
}
}HTTP response codes
| Code | Description |
|---|---|
| 202 | Lead submission accepted |
| 400 | Bad request, validation error |
| 401 | Unauthorized, invalid token |
| 500 | Internal server error |
For a full list of possible errors please refer to our detailed documentation here.