Track Sale
Events API
Track Sale
Create a sale conversion event
POST
Track Sale
Endpoint
Authentication
- Server-side (Recommended)
- Client-side
Use your secret API key:
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
trackingId | string | ✓ | The ta_tid from the cookie or URL parameter |
customer | object | ✓ | Customer information |
customer.externalId | string | ✓ | Your internal user/customer ID |
customer.email | string | Customer’s email address | |
customer.firstname | string | Customer’s first name | |
customer.lastname | string | Customer’s last name | |
customer.phoneNumber | string | Customer’s phone number | |
customer.avatarUrl | string | URL to customer’s avatar image | |
amount | number | ✓ | Transaction amount in currency units (not cents) |
currency | string | ✓ | ISO 4217 currency code (e.g., eur, usd) |
metadata | object | Additional custom data (key-value pairs) |
Examples
- cURL
- Node.js SDK
- React Hook
- JavaScript
Response
- 200 OK
- 400 Bad Request
- 404 Not Found
Currency Codes
Use standard ISO 4217 currency codes:| Currency | Code |
|---|---|
| Euro | eur |
| US Dollar | usd |
| British Pound | gbp |
| Japanese Yen | jpy |
| Swiss Franc | chf |
| Canadian Dollar | cad |
| Australian Dollar | aud |
Error Codes
| HTTP Code | Error | Description |
|---|---|---|
| 400 | Invalid payload | Request body validation failed |
| 400 | Missing customer.externalId | Required field not provided |
| 401 | Invalid API key | API key is invalid or revoked |
| 401 | Hostname not in allowed list | Origin not whitelisted (client-side) |
| 403 | This click does not belong to your workspace | trackingId is for a different workspace |
| 404 | Click not found for this trackingId | trackingId doesn’t exist or has expired |