Month: October 2023

Sitecore CDP – Send Checkout Event

Last Updated on December 5, 2023 by sandeeppote

TheĀ CHECKOUTĀ event captures a guest’s action of checking out an order.

After you send this event, you can view the event in the guest profile.

API url for CHECKOUT event

https://{{apiEndpoint}}/{{apiVersion}}/event/create.json?client_key={{CLIENT_KEY}}&message={{message}}

Request payload for CHECKOUT event

In the session event you should be able to see the Purchase Complete event with the Order Number where the customer completed the checkout.

This should help to get the revenue earned.

cURL code snippet-

curl --location -g --request GET 'https://api.boxever.com/v1.2/event/create.json?client_key=<<Client Key>>&message={"channel":"WEB","type":"CHECKOUT","language":"EN","currency":"GBP","page":"home page","pos":"pastoral-witty-grill","browser_id":"7ed103bd-08c2-47f4-8f69-91141ca3200d","status":"PURCHASED","reference_id":"ORDER_1"}'

C# code snippet-

var client = new RestClient("https://api.boxever.com/v1.2/event/create.json?client_key=<<Client Key>>&message={\"channel\":\"WEB\",\"type\":\"CHECKOUT\",\"language\":\"EN\",\"currency\":\"GBP\",\"page\":\"home page\",\"pos\":\"pastoral-witty-grill\",\"browser_id\":\"7ed103bd-08c2-47f4-8f69-91141ca3200d\",\"status\":\"PURCHASED\",\"reference_id\":\"ORDER_1\"}");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Python code snippet-

import http.client

conn = http.client.HTTPSConnection("api.boxever.com")
payload = ''
headers = {}
conn.request("GET", "/v1.2/event/create.json?client_key=<<Client Key>>&message=%7B%22channel%22:%22WEB%22,%22type%22:%22CHECKOUT%22,%22language%22:%22EN%22,%22currency%22:%22GBP%22,%22page%22:%22home%20page%22,%22pos%22:%22pastoral-witty-grill%22,%22browser_id%22:%227ed103bd-08c2-47f4-8f69-91141ca3200d%22,%22status%22:%22PURCHASED%22,%22reference_id%22:%22ORDER_1%22%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Reference- https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform–data-model-2-1/send-a-checkout-event-to-sitecore-cdp.html

Loading

Sitecore CDP – Send Confirm Event

Last Updated on October 28, 2023 by sandeeppote

The CONFIRM event captures the confirmation of purchased products.

Use the following endpoint for sending the confirm event.

https://{{apiEndpoint}}/{{apiVersion}}/event/create.json?client_key={{CLIENT_KEY}}&message={{message}}

ADD event

See how to create a browser id and Add Event before a confirm event is sent.

CONFIRM Event

Search Customer by browserid or Name.

You should be able to see the customer Online at that point odf instance

Click on Timeline and View Session details

Get the session details and should see the Order Confirmed event

Clieck on the settings icon to see more details-

cURL code snippet-

curl --location -g --request GET 'https://api.boxever.com/v1.2/event/create.json?client_key=<<Client Key>>&message={"channel":"WEB","type":"CONFIRM","language":"EN","currency":"GBP","page":"home page","pos":"pastoral-witty-grill","browser_id":"7ed103bd-08c2-47f4-8f69-91141ca3200d","product":[{"item_id":"EXACT_90"}]}'

C# code snippet-

var client = new RestClient("https://api.boxever.com/v1.2/event/create.json?client_key=<<Client Key>>&message={\"channel\":\"WEB\",\"type\":\"CONFIRM\",\"language\":\"EN\",\"currency\":\"GBP\",\"page\":\"home page\",\"pos\":\"pastoral-witty-grill\",\"browser_id\":\"7ed103bd-08c2-47f4-8f69-91141ca3200d\",\"product\":[{\"item_id\":\"EXACT_90\"}]}");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Python code snippet-

import http.client

conn = http.client.HTTPSConnection("api.boxever.com")
payload = ''
headers = {}
conn.request("GET", "/v1.2/event/create.json?client_key=<<Client Key>>&message=%7B%22channel%22:%22WEB%22,%22type%22:%22CONFIRM%22,%22language%22:%22EN%22,%22currency%22:%22GBP%22,%22page%22:%22home%20page%22,%22pos%22:%22pastoral-witty-grill%22,%22browser_id%22:%227ed103bd-08c2-47f4-8f69-91141ca3200d%22,%22product%22:%5B%7B%22item_id%22:%22EXACT_90%22%7D%5D%7D", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Reference- https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform–data-model-2-1/send-a-confirm-event-to-sitecore-cdp.html

Loading

Sitecore CDP Intergration Series

Last Updated on October 28, 2023 by sandeeppote

Sitecore CDP and Personalize FAQs

How to get the Client Key and API Token?

How to create and get the point of sale?

How to debug?

How to get the base URL for Sitecore CDP Rest API?

What is the latest version of Javascript Library?

How to get Fullstack Experience friendly id?

What if the size of the compressed batch file exceeds the max limit i.e. 50MB?

Why I recieve HTTP 400 response when uploading the batch file?

Why I recieve HTTP 409 response when uploading the batch file?

How to delete a guest profile without using Batch API?

What access do you need to setup the Point of sale for Sitecore CDP and Personalize?

How to generate the browser id using postman?

Integrate using direct HTTP requests

Sending VIEW Event using direct HTTP requests

Send IDENTITY Event using direct HTTP request

Send ADD Event using direct HTTP request

Send CONFIRM Event using direct HTTP request

Send CHECKOUT Event using direct HTTP request

Upload guest data

Abandon cart with force close event

Loading