Checkout
Tracks the two key steps of the checkout funnel using the CHECKOUT event.
Tracks the two key steps of the checkout funnel using the CHECKOUT event. Both requests share the same event name and differ in the step field.
Requests:
- View Basket — fires when a user views their cart before proceeding to checkout (
step: "view-basket"). Includes the fullproductListarray withproductId,price, andquantity, plustotalPrice. - Purchase — fires when an order is successfully completed (
step: "purchase"). IncludesproductList,totalPrice, and a merchantorderNofor deduplication.
These events are critical for conversion tracking and revenue attribution in the Segmentify dashboard.
View Basket
Section titled “View Basket”Example body
{ "name": "CHECKOUT", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "testMode": "true", "device": "PC", "params": {}, "recommendIds": [], "pageUrl": "", "referrer": "", "lang": "EN", "productList": [ { "productId": "PRODUCT_ID", "price": "1222", "quantity": 1 } ], "currency": "EUR", "step": "view-basket", "email": "user@example.com", "totalPrice": "1222", "basketId": "basket_1234567890123456789"}Purchase
Section titled “Purchase”Purpose
Section titled “Purpose”Sends a Purchase event (name: "CHECKOUT", step: "purchase") to Segmentify Events API. Use this event to report a completed checkout (order) together with customer/session context and purchased items.
Endpoint
Section titled “Endpoint”POST https://{dataCenterUrl}.segmentify.com/add/events/v1.json?apiKey={apikey}
This request uses query param authentication via
apiKey.
Required variables
Section titled “Required variables”These variables are referenced in the request URL / headers / body. Make sure they are defined in your active environment (or at collection/global level):
-
dataCenterUrl(string) – datacenter subdomain/prefix (e.g.,eu,us, etc.) -
apikey(string) – Segmentify API key -
domain(string) – value for theoriginheader (your site domain) -
userId(string) – your user identifier -
sessionId(string) – session identifier -
deviceType(string) – device type (e.g.,desktop,mobile,tablet) -
lang(string) – language code (e.g.,en,tr) -
productId(string) – product identifier used insideproductList[] -
currency(string) – currency code (e.g.,USD,EUR,TRY) -
region(string) – region/country code (e.g.,TR) -
email(string) – customer email
Headers
Section titled “Headers”origin: {domain}
Body (JSON)
Section titled “Body (JSON)”Content type is raw JSON.
Top-level schema
Section titled “Top-level schema”| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Event name. For this request it is CHECKOUT. |
userId |
string | yes | User identifier. |
sessionId |
string | yes | Session identifier. |
testMode |
string/boolean | recommended | When enabled, the event may be treated as test traffic. Note: this request currently sends it as a string ("false"). |
device |
string | recommended | Device type (from {deviceType}). |
params |
object | optional | Additional custom parameters. |
recommendIds |
array | optional | Recommendation IDs associated with the conversion (if any). |
pageUrl |
string | optional | Page URL where purchase occurred. |
referrer |
string | optional | Referrer URL. |
lang |
string | recommended | Language code. |
productList |
array | yes | Purchased items list. See schema below. |
currency |
string | yes | Currency code for the order. |
region |
string | recommended | Region/country. |
step |
string | yes | Checkout step. For purchase it is purchase. |
orderNo |
string | yes | Merchant order number. |
email |
string | recommended | Customer email. |
totalPrice |
string/number | yes | Total order price. Note: this request currently sends it as a string. |
productList[] item schema
Section titled “productList[] item schema”| Field | Type | Required | Description |
|---|---|---|---|
productId |
string | yes | Purchased product identifier. |
price |
string/number | yes | Unit price. Note: this request currently sends it as a string. |
quantity |
number | yes | Quantity purchased. |
Example payload
Section titled “Example payload”{ "name": "CHECKOUT", "userId": "{userId}", "sessionId": "{sessionId}", "testMode": "false", "device": "{deviceType}", "params": {}, "recommendIds": [], "pageUrl": "", "referrer": "", "lang": "{lang}", "productList": [ { "productId": "{productId}", "price": "1222", "quantity": 1 } ], "currency": "{currency}", "region": "{region}", "step": "purchase", "orderNo": "TS232323", "email": "{email}", "totalPrice": "1222"}Success / error expectations
Section titled “Success / error expectations”Because implementations may vary by account/setup, validate based on your Segmentify Events API behavior:
Success
Section titled “Success”-
HTTP status commonly 200 or 2xx
-
Response body typically includes an acknowledgement that the event is accepted/processed
-
4xx: invalid/missing
apiKey, invalid payload, missing required fields -
5xx: server-side error
Recommended validation:
-
Ensure the response is JSON (if applicable)
-
Confirm the event appears in your dashboard/logs according to your tracking setup
-
Idempotency: If you might retry requests, consider keeping
orderNostable per order to avoid duplicate purchases (behavior depends on backend deduplication rules). -
testMode****: This request sendstestModeas a string. If your backend expects a boolean, you may want to align types in your implementation. -
Money fields:
priceandtotalPriceare currently strings. If numeric values are required, ensure type consistency. -
Currency/region: Use standard ISO codes where possible (e.g.,
TRY,USD;TR,US). -
Optional URLs: Set
pageUrlandreferrerwhen available to improve analytics attribution.
Example body
{ "name": "CHECKOUT", "userId": "1234567890123456789", "sessionId": "9876543210987654321", "testMode": "false", "device": "PC", "params": {}, "recommendIds": [], "lang": "EN", "productList": [ { "productId": "PRODUCT_ID", "price": "1222", "quantity": 1 } ], "currency": "EUR", "step": "purchase", "orderNo": "TS232323", "email": "user@example.com", "totalPrice": "1222"}