CAP Gateway - API Documentation (Simplfied)

CAP Gateway - API Documentation (Simplfied)

Lead submission

To submit a lead make a post request to one of the following URLs

Environment

URL

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

Key

Value

Content-Type

application/json

X-API-Key

<YOUR_API_KEY>

Payload description

Property

Type

Required

Supplied by CAP

Description

Property

Type

Required

Supplied by CAP

Description

metadata

object

 

Information about the campaign and enquiry details.

metadata.campaignId

guid

Unique ID of the marketing campaign.

metadata.enquiryDateTime

DateTime

 

Date and time the lead was made. ISO 8601 format, Coordinated Universal Time (UTC), to the second. "T" is a delimiter between the date and time.

metadata.externalReferenceId

string

 

 

External system reference ID for tracking. Client’s reference ID.

metadata.enquiryType

string

Type of enquiry.

Accepted Values: “Test Drive”, “Quotation”, “Retailer Contact”, “KMI”, “Interest Only”, “Register Of Interest”

metadata.ipAddress

string

 

 

The IP address of the user.

metadata.enquirySource.acquisitionChannel

string

The acquisition channel for the enquiry.

contactDetail

object

 

Contains the contact information of the person submitting the enquiry.

contactDetail.firstName

string

 

First name of the individual.

contactDetail.lastName

string

 

Last name of the individual.

contactDetail.emailAddress

string

 

Email address of the individual.

contactDetail.phoneNumber

string

 

Phone number of the individual. +44 or 0 prefix accepted.

Required for certain campaigns

contactDetail.address.postcode

string

 

Postcode of the individual's address.

Required for cetain campaigns

optInConsents

object

 

Contains consent data for different communication channels.

optInConsents.phoneCall

boolean

 

 

Opt-in status for the communication channel

Accepted values: true, false, null

optInConsents.post

boolean

 

 

Opt-in status for the communication channel

Accepted values: true, false, null

optInConsents.email

boolean

 

 

Opt-in status for the communication channel

Accepted values: true, false, null

optInConsents.sms

boolean

 

 

Opt-in status for the communication channel

Accepted values: true, false, null

vehicle.name

string

Name of the vehicle the user is interested in.

Example payload

{ "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": { "acquisitionChannel": "Google" } }, "contactDetail": { "firstName": "test", "lastName": "test", "emailAddress": "test@cap.co", "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:

{ "success": true, "messages": [], "result": { "requestReferenceId": "e05072f9-ae85-42e2-ba42-c13449e5abaf", "enquiryReferenceCode": "ENQ-240912-AZGCM0F8" } }

 

Failed response example:

{ "success": false, "messages": [ "ERROR_SPECIFIC_MESSAGE_HERE" ], "result": { "requestReferenceId": "08585f67-6d4d-4272-ac0a-342ac0edcb8c", "enquiryReferenceCode": null } }

 

Error codes:

Code

Meaning

Code

Meaning

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.