Meta Tracking
Register a sale from an ad lead
Reports that a lead that came from an ad became a sale. It is what allows Meta to learn who actually buys, instead of optimizing only for who replies to messages. Use it when the payment is confirmed in your system. Calling it twice for the same sale does not duplicate it.
POST
https://api.zapzapapi.com/api/v1/{instanceId}/tracking/conversionAuthentication with the x-api-key and x-api-secret headers.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
phone | string | body | Yes | |
value | number | body | No | |
event | string | body | No | |
occurred_at | string | body | No |
Request example
curl
curl -X POST "https://api.zapzapapi.com/api/v1/{instanceId}/tracking/conversion" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-api-secret: YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{"phone":"phone"}'Node.js
const res = await fetch("https://api.zapzapapi.com/api/v1/{instanceId}/tracking/conversion", {
method: "POST",
headers: {
"x-api-key": "YOUR_API_KEY",
"x-api-secret": "YOUR_API_SECRET",
"Content-Type": "application/json",
},
body: JSON.stringify({
"phone": "phone"
}),
});
console.log(await res.json());Python
import requests
res = requests.post(
"https://api.zapzapapi.com/api/v1/{instanceId}/tracking/conversion",
headers={"x-api-key": "YOUR_API_KEY", "x-api-secret": "YOUR_API_SECRET"},
json={"phone":"phone"},
)
print(res.json())Response example
JSON
{
"ok": true,
"message": "Venda registrada e enviada para a Meta.",
"event": "Purchase",
"value": 700,
"ad_id": "120243748541570695",
"lead_status": "won",
"status": "queued"
}Values are illustrative; the fields follow the real response format.
See the full referenceGet your API keys
Create your account, connect a number in minutes and start using the API. R$15 per active number/month, with a welcome credit when you create the account, subject to the current campaign.
