Track sale
Эндпоинты трекинга sale‑событий поддерживают два режима:
- server-side — вызывается с бэкенда, использует секретный API‑ключ
dub_* - client-side — вызывается с фронтенда, использует publishable key
dub_pk_*
Server-side
- Method:
POST - URL:
https://api.revroute.ru/track/sale - Auth:
Authorization: Bearer dub_*(ключ из/<workspace>/settings/tokens)
curl -X POST "https://api.revroute.ru/track/sale" \
-H "Authorization: Bearer dub_xxxxxx" \
-H "Content-Type: application/json" \
-d '{
"customerExternalId": "cus_oFUYbZYqHFR0knk0MjsMC6b0",
"amount": 3000,
"paymentProcessor": "stripe",
"eventName": "Invoice paid",
"invoiceId": "INV_1234567890",
"currency": "usd"
}'Client-side
- Method:
POST - URL:
https://api.revroute.ru/track/sale/client - Auth:
Authorization: Bearer dub_pk_*(ключ из/<workspace>/settings/analytics?step=connect)
curl -X POST "https://api.revroute.ru/track/sale/client" \
-H "Authorization: Bearer dub_pk_xxxxxx" \
-H "Content-Type: application/json" \
-d '{
"customerExternalId": "cus_oFUYbZYqHFR0knk0MjsMC6b0",
"amount": 3000,
"paymentProcessor": "stripe",
"eventName": "Invoice paid",
"invoiceId": "INV_1234567890",
"currency": "usd"
}'Last updated on