Authentication
Request
Must be
"create_purchase".The lead to record the purchase against. Your company must have access to this lead’s channel.
A product ID from your company’s product catalog. The product must belong to your company.
The purchase amount in the channel’s currency.
The date of the purchase. Defaults to the current time if omitted.
A description of the purchase.
Response
Returns the created purchase record.Side effects
- Purchase event: An event record is created logging the purchase amount.
- Reward triggers: If the channel has active reward triggers for
purchase, reward events are calculated automatically. Fixed rewards use the trigger’s configured amount; percentage rewards are calculated from thepurchase_amount.
Example
Request
Response
Errors
| Status | Error | Cause |
|---|---|---|
400 | "lead_id required" | The lead_id field is missing. |
401 | "Invalid API key" | Missing or invalid X-Api-Key header. |
403 | "Lead not accessible" | Your company does not have access to this lead’s channel. |
403 | "Product not found or not owned by your company" | The product_id does not exist or belongs to a different company. |