Create or update a customer lead
curl --request POST \
--url https://ecom-service.vercel.app/api/public/customer-leads \
--header 'Content-Type: application/json' \
--header 'X-Paysight-Lead-Key: <api-key>' \
--data '
{
"email": "buyer@example.com",
"first_name": "Jane",
"last_name": "Customer",
"phone": "+15551234567",
"session_id": "visit-123",
"scans": [
{
"page": "/pricing"
}
],
"cfa_device": "mobile"
}
'import requests
url = "https://ecom-service.vercel.app/api/public/customer-leads"
payload = {
"email": "buyer@example.com",
"first_name": "Jane",
"last_name": "Customer",
"phone": "+15551234567",
"session_id": "visit-123",
"scans": [{ "page": "/pricing" }],
"cfa_device": "mobile"
}
headers = {
"X-Paysight-Lead-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Paysight-Lead-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'buyer@example.com',
first_name: 'Jane',
last_name: 'Customer',
phone: '+15551234567',
session_id: 'visit-123',
scans: [{page: '/pricing'}],
cfa_device: 'mobile'
})
};
fetch('https://ecom-service.vercel.app/api/public/customer-leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ecom-service.vercel.app/api/public/customer-leads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'buyer@example.com',
'first_name' => 'Jane',
'last_name' => 'Customer',
'phone' => '+15551234567',
'session_id' => 'visit-123',
'scans' => [
[
'page' => '/pricing'
]
],
'cfa_device' => 'mobile'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Paysight-Lead-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ecom-service.vercel.app/api/public/customer-leads"
payload := strings.NewReader("{\n \"email\": \"buyer@example.com\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Customer\",\n \"phone\": \"+15551234567\",\n \"session_id\": \"visit-123\",\n \"scans\": [\n {\n \"page\": \"/pricing\"\n }\n ],\n \"cfa_device\": \"mobile\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Paysight-Lead-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ecom-service.vercel.app/api/public/customer-leads")
.header("X-Paysight-Lead-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"buyer@example.com\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Customer\",\n \"phone\": \"+15551234567\",\n \"session_id\": \"visit-123\",\n \"scans\": [\n {\n \"page\": \"/pricing\"\n }\n ],\n \"cfa_device\": \"mobile\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ecom-service.vercel.app/api/public/customer-leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Paysight-Lead-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"buyer@example.com\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Customer\",\n \"phone\": \"+15551234567\",\n \"session_id\": \"visit-123\",\n \"scans\": [\n {\n \"page\": \"/pricing\"\n }\n ],\n \"cfa_device\": \"mobile\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"session_id": "<string>",
"status": "lead",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"ok": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"session_id": "<string>",
"status": "lead",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}Customer Leads
Create or update a customer lead
Creates a lead or updates the existing row with the same tenant and session_id.
Use the same session_id as the current checkout’s partnerSession so a successful
configured transaction can mark the lead paid.
POST
/
api
/
public
/
customer-leads
Create or update a customer lead
curl --request POST \
--url https://ecom-service.vercel.app/api/public/customer-leads \
--header 'Content-Type: application/json' \
--header 'X-Paysight-Lead-Key: <api-key>' \
--data '
{
"email": "buyer@example.com",
"first_name": "Jane",
"last_name": "Customer",
"phone": "+15551234567",
"session_id": "visit-123",
"scans": [
{
"page": "/pricing"
}
],
"cfa_device": "mobile"
}
'import requests
url = "https://ecom-service.vercel.app/api/public/customer-leads"
payload = {
"email": "buyer@example.com",
"first_name": "Jane",
"last_name": "Customer",
"phone": "+15551234567",
"session_id": "visit-123",
"scans": [{ "page": "/pricing" }],
"cfa_device": "mobile"
}
headers = {
"X-Paysight-Lead-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Paysight-Lead-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email: 'buyer@example.com',
first_name: 'Jane',
last_name: 'Customer',
phone: '+15551234567',
session_id: 'visit-123',
scans: [{page: '/pricing'}],
cfa_device: 'mobile'
})
};
fetch('https://ecom-service.vercel.app/api/public/customer-leads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ecom-service.vercel.app/api/public/customer-leads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'email' => 'buyer@example.com',
'first_name' => 'Jane',
'last_name' => 'Customer',
'phone' => '+15551234567',
'session_id' => 'visit-123',
'scans' => [
[
'page' => '/pricing'
]
],
'cfa_device' => 'mobile'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Paysight-Lead-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://ecom-service.vercel.app/api/public/customer-leads"
payload := strings.NewReader("{\n \"email\": \"buyer@example.com\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Customer\",\n \"phone\": \"+15551234567\",\n \"session_id\": \"visit-123\",\n \"scans\": [\n {\n \"page\": \"/pricing\"\n }\n ],\n \"cfa_device\": \"mobile\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Paysight-Lead-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://ecom-service.vercel.app/api/public/customer-leads")
.header("X-Paysight-Lead-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"buyer@example.com\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Customer\",\n \"phone\": \"+15551234567\",\n \"session_id\": \"visit-123\",\n \"scans\": [\n {\n \"page\": \"/pricing\"\n }\n ],\n \"cfa_device\": \"mobile\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://ecom-service.vercel.app/api/public/customer-leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Paysight-Lead-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"buyer@example.com\",\n \"first_name\": \"Jane\",\n \"last_name\": \"Customer\",\n \"phone\": \"+15551234567\",\n \"session_id\": \"visit-123\",\n \"scans\": [\n {\n \"page\": \"/pricing\"\n }\n ],\n \"cfa_device\": \"mobile\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"session_id": "<string>",
"status": "lead",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"ok": true,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"session_id": "<string>",
"status": "lead",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": [
"<string>"
]
}
}Authorizations
PublishableKeySecretKey
Browser publishable key. The request Origin must exactly match the tenant allowlist.
Body
application/json
Maximum string length:
320Stable client session value also sent to current checkout as partnerSession. Use 50 characters or fewer for Card Submit compatibility.
Required string length:
1 - 255Standard base64 containing valid JSON.