Lead submission


To submit a lead, make a POST request to one of the following URLs:

EnvironmentURL
QAhttps://qa-api.cap-gateway.com/lead-submission/v1/external
Productionhttps://api.cap-gateway.com/lead-submission/v1/external

The following headers are required to submit a lead:

KeyValue
Content-Typeapplication/json
X-API-KeyYOUR_API_KEY

Payload description


PropertyTypeRequiredSupplied by CAPDescription
metadataobjectYesNoInformation about the campaign and enquiry details.
metadata.campaignIdguidYesYesUnique ID of the marketing campaign.
metadata.enquiryDateTimedatetimeYesNoDate 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.externalReferenceIdstringNoNoExternal system reference ID for tracking. Client's reference ID.
metadata.enquiryTypestringYesYesType of enquiry. Accepted Values: “Test Drive”, “Quotation”, “Retailer Contact”, “KMI”, “Interest Only”, “Register Of Interest”.
metadata.ipAddressstringNoNoThe IP address of the user.
metadata.enquirySource.sourcestringYesYesThe source for the enquiry.
contactDetailobjectYesNoContains the contact details of the person submitting the enquiry.
contactDetail.firstNamestringYesNoFirst name of the individual.
contactDetail.lastNamestringYesNoLast name of the individual.
contactDetail.emailAddressstringYesNoEmail address of the individual.
contactDetail.phoneNumberstringConditionalNoPhone number of the individual. +44 or 0 prefix accepted.Required for certain campaigns.
contactDetail.address.postcodestringConditionalNoPostcode of the individual's address. Required for certain campaigns.
optInConsentsobjectYesNoContains consent data for different communication channels.
optInConsents.phoneCallbooleanNoNoOpt-in status for the communication channel. Accepted values: true, false, null.
optInConsents.postbooleanNoNoOpt-in status for the communication channel. Accepted values: true, false, null.
optInConsents.emailbooleanNoNoOpt-in status for the communication channel. Accepted values: true, false, null.
optInConsents.smsbooleanNoNoOpt-in status for the communication channel. Accepted values: true, false, null.
vehicle.namestringYesYesName 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

CodeDescription
202Lead submission accepted
400Bad request, validation error
401Unauthorized, invalid token
500Internal server error