Developer
Web Analytics
POST
/api/public/analytics/orders
Token + HMAC
Send order events from your server
Send up to 100 order events from your store's server. Sales fill in the orders the browser missed (a sale the page already reported is skipped, matched by order number); refunds and cancellations of paid orders appear in Conversions › E-commerce beside the sale. Each event carries your own unique id, so sending it again is safe.
Sign the exact request body with HMAC-SHA256 using the store key from Web analytics › Settings › E-commerce, and send it as X-Signature: sha256=<hex>. Send {"property": "WA-…", "test": true, "events": []} to check the key.
Rate limited.
Body parameters
|
property
string
optional
|
Your analytics property key, e.g. WA-WYA6U0. Required. |
|
source
string
optional
|
What is sending, e.g. "my-shop-connector/1.0.0". Shown on the settings card. Optional. |
|
test
string
optional
|
true to check the key without sending events. Optional. |
|
events
string
optional
|
The events, at most 100. Required unless test is true. |
Responses
200
{ "accepted": 2, "duplicates": 0, "skipped": [{ "id": "order:1100228327:placed",...
200
{ "ok": true }
401
{ "error": "Invalid signature" }
422
{ "error": "events.0.type must be purchase, refund or cancellation" }
503
{ "error": "Try again shortly" }
BODY='{"property":"WA-WYA6U0","events":[{"id":"creditmemo:1100014429","type":"refund","order_number":"1100228311","amount":84.00,"currency":"GBP","items":[{"id":"64987","name":"Fujifilm 60mm f2.4","price":84.00,"quantity":1}]}]}'
SIG=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$STORE_KEY" | awk '{print $2}')
curl -X POST https://landing.pivotal.digital/api/public/analytics/orders \
-H "Content-Type: application/json" \
-H "X-Signature: sha256=$SIG" \
-d "$BODY"
response
{
"accepted": 2,
"duplicates": 0,
"skipped": [{ "id": "order:1100228327:placed", "reason": "already_counted" }],
"rejected": []
}
{ "ok": true }
{ "error": "Invalid signature" }
{ "error": "events.0.type must be purchase, refund or cancellation" }
{ "error": "Try again shortly" }
Landing Platform