Last Updated on November 16, 2024 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