Tracking orders and purchases

This example outlines sending a purchase / order server side to the Seeka API, including the customer details and the products purchased.

Organisation ID and public key can be retrieved from the Seeka app. The public key is Seeka brand specific.

Considerations for software vendors: The organisation ID and public key provided in your request will linked to the Seeka brand you are sending data on behalf of.

Deduplication

If tracking events via Seeka's Browser SDK alongside using the Seeka HTTP API, the activity ID provided in the HTTP request should match the activity ID used when firing an Order event in the Browser SDK to ensure correct deduplication.

To specify activity ID in browser SDK:

Converge.track.order({
  ....
 currencyCode: 'USD',
 totalTax: 87.1,
 totalShippingPrice: 12.10
}, {
  activityIdentifier: 'order_12345'
});

Sending an order to Seeka

The below tokens in the code example should be replaced with your own values.
TokenRequiredDescriptionExample
<organisation ID>YesYour organisation ID or the organisation ID of the Seeka organisation you are sending data on behalf of
<public key>YesYour public key or the public key of the Seeka brand you are sending data on behalf of
<activity ID>YesUnique identifier used to de-duplicate events. This should be the order ID or a unique identifier for the purchase.

See Deduplication above.
order_12345
<activity time>YesISO formatted The time the order was placed / created.2025-02-24T14:15:22Z
<seeka profile ID>Seeka profile ID retrieved from the browser SDK.

See retrieving the SeekaPId.

Highly recommended
sk.1.1709215400100.4182463348
<integration version>Version of your software build or the version of your integration.1.0.0
<integration name>Name of your software or the name of your integration.ticketsaurus
<TCF consent>TCF v2.2 consent string that will replace the existing consent for the identity.See privacy SDK for formatting and requirements
Node.js - AxiosNode.js - Axios
Node.js - FetchNode.js - Fetch
PHP - cURLPHP - cURL
C# - HttpClientC# - HttpClient
C# - RestSharpC# - RestSharp
Go - HTTP ClientGo - HTTP Client
const axios = require('axios');
async function sendOrderToSeeka(data) {
try {
// Headers
const headers = {
"Content-Type": "application/json",
"X-OrgId": "<organisation ID>",
"X-Converge-Key": "<public key>",
"X-Sdk-Client-Version": "<integration version>",
"X-Sdk-Client-Type": "<integration name>/server"
};
const response = await axios({
url: 'https://router.seeka.services/api/ingest',
method: 'POST',
data: data,
headers: headers
});
if(response.status !== 202) {
console.error('Unexpected response code when trying to send order to Seeka', response.status);
}
else {
console.log('Completed send order to Seeka');
}
}
catch (error) {
console.error('Error when attempting to send order to Seeka', error);
}
}
// Create order
const order = {
"data": [
{
"ev": {
"id": {
"seekaPId": "<seeka profile ID>",
"email": [
"jane.doe@gmail.com"
],
"phone": [
"+61422333444"
],
"firstName": [
"Jane"
],
"lastName": [
"Doe"
],
"address": [
{
"addressLine1": "Shop 6",
"addressLine2": "2500 Gold Coast Hwy",
"locality": "Mermaid Waters",
"state": "Queensland",
"stateCode": "QLD",
"postcode": "4218",
"country": "Australia",
"countryCode": "AU"
}
],
"dob": [
"1991-04-24"
],
"privacy": {
"tcfConsentString": "<TCF consent>"
}
},
"payload": {
"activityName": "Order",
"activityId": "<activity ID>",
"commerce": {
"products": [
{
"currencyCode": "USD",
"productIdentifier": 12345,
"variantIdentifier": 1454854719669,
"sku": "AU5121",
"productName": "Long neck t-shirt",
"variantName": "Green",
"categoryName": "T-shirts",
"brandName": "Tees R US",
"unitPrice": 42,
"quantity": 2
}
],
"checkoutIdentifier": "3646074f511748b887f516b6267f8b9c",
"cartIdentifier": "00839db672e54c2caa154470522fca9e",
"orderIdentifier": "d20e83734528455ca9bc4d82c1ab9ae2",
"orderNumber": "4515222587",
"customerIdentifier": "eaf43d8985844fc499af9079a1ff2045",
"paymentMethodName": "Credit card",
"currencyCode": "USD",
"totalPrice": 84
},
"time": "<activity time>"
}
}
}
]
};
// Send order
await sendOrderToSeeka(order);

Batch sending orders to Seeka

Multiple orders can be tracked by providing a maximum of 20 events in the data array in the request payload body.