Conversions & Sales
Sale confirm
Register checkout event.
POST
/
api
/
v2
/
stats
/
sales
Sale confirm
curl --request POST \
--url https://{search_zone}-api.doofinder.com/api/v2/stats/sales \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"hashid": "<string>",
"has_init": true,
"ip": "<string>",
"referer": "<string>",
"session_id": "<string>",
"user_agent": "<string>",
"user_id": "<string>"
}
'import requests
url = "https://{search_zone}-api.doofinder.com/api/v2/stats/sales"
payload = {
"hashid": "<string>",
"has_init": True,
"ip": "<string>",
"referer": "<string>",
"session_id": "<string>",
"user_agent": "<string>",
"user_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
hashid: '<string>',
has_init: true,
ip: '<string>',
referer: '<string>',
session_id: '<string>',
user_agent: '<string>',
user_id: '<string>'
})
};
fetch('https://{search_zone}-api.doofinder.com/api/v2/stats/sales', 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://{search_zone}-api.doofinder.com/api/v2/stats/sales",
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([
'hashid' => '<string>',
'has_init' => true,
'ip' => '<string>',
'referer' => '<string>',
'session_id' => '<string>',
'user_agent' => '<string>',
'user_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://{search_zone}-api.doofinder.com/api/v2/stats/sales"
payload := strings.NewReader("{\n \"hashid\": \"<string>\",\n \"has_init\": true,\n \"ip\": \"<string>\",\n \"referer\": \"<string>\",\n \"session_id\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"user_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://{search_zone}-api.doofinder.com/api/v2/stats/sales")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"hashid\": \"<string>\",\n \"has_init\": true,\n \"ip\": \"<string>\",\n \"referer\": \"<string>\",\n \"session_id\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"user_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{search_zone}-api.doofinder.com/api/v2/stats/sales")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"hashid\": \"<string>\",\n \"has_init\": true,\n \"ip\": \"<string>\",\n \"referer\": \"<string>\",\n \"session_id\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"user_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"<unknown>"{
"error": {
"code": "bad_params",
"message": "Bad parameters error"
}
}Authorizations
api_tokenjwt_token
Doofinder API key. Pass it as: Authorization: Token <api_key>
Body
application/json
Unique id of the search engine. In the search engine selector, you will find the hashid information
Pattern:
^[a-f0-9]{32}$Indicates if the sale was made after using a doofinder product or not
Unique address that identifies a device. Detected automatically by the server.
The referer header value, provides information about the URL from which the current request originated. Detected automatically by the server.
Identifier of search session
Maximum string length:
32Identifier of device. Detected automatically by the server.
Identifier of user
Maximum string length:
36Response
OK
Response returned over register stat operation.
⌘I
Sale confirm
curl --request POST \
--url https://{search_zone}-api.doofinder.com/api/v2/stats/sales \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"hashid": "<string>",
"has_init": true,
"ip": "<string>",
"referer": "<string>",
"session_id": "<string>",
"user_agent": "<string>",
"user_id": "<string>"
}
'import requests
url = "https://{search_zone}-api.doofinder.com/api/v2/stats/sales"
payload = {
"hashid": "<string>",
"has_init": True,
"ip": "<string>",
"referer": "<string>",
"session_id": "<string>",
"user_agent": "<string>",
"user_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
hashid: '<string>',
has_init: true,
ip: '<string>',
referer: '<string>',
session_id: '<string>',
user_agent: '<string>',
user_id: '<string>'
})
};
fetch('https://{search_zone}-api.doofinder.com/api/v2/stats/sales', 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://{search_zone}-api.doofinder.com/api/v2/stats/sales",
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([
'hashid' => '<string>',
'has_init' => true,
'ip' => '<string>',
'referer' => '<string>',
'session_id' => '<string>',
'user_agent' => '<string>',
'user_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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://{search_zone}-api.doofinder.com/api/v2/stats/sales"
payload := strings.NewReader("{\n \"hashid\": \"<string>\",\n \"has_init\": true,\n \"ip\": \"<string>\",\n \"referer\": \"<string>\",\n \"session_id\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"user_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://{search_zone}-api.doofinder.com/api/v2/stats/sales")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"hashid\": \"<string>\",\n \"has_init\": true,\n \"ip\": \"<string>\",\n \"referer\": \"<string>\",\n \"session_id\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"user_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{search_zone}-api.doofinder.com/api/v2/stats/sales")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"hashid\": \"<string>\",\n \"has_init\": true,\n \"ip\": \"<string>\",\n \"referer\": \"<string>\",\n \"session_id\": \"<string>\",\n \"user_agent\": \"<string>\",\n \"user_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"<unknown>"{
"error": {
"code": "bad_params",
"message": "Bad parameters error"
}
}