Skip to main content

Send a Conversion to Meta

Report to Meta that a conversation which started from one of your Click-to-WhatsApp ads turned into a lead or a sale. Meta receives it through its Conversions API for business messaging, so Ads Manager and Events Manager show which ads bring leads and customers, and Meta can optimize your campaigns for them.

Use it from your own system, your CRM or an automation tool (Zapier, Make, n8nโ€ฆ) when something happens outside 2Chat: for example, when a lead becomes a customer. You only send the two phone numbers and the event: 2Chat already keeps the ad's click ID (ctwa_clid) from the person's first message and sends it to Meta for you.

Requirements
  • A WhatsApp Business API (WABA) number connected straight to Meta from 2Chat, including numbers that also keep using the WhatsApp Business app (coexistence).
  • Conversions turned on for that number: open the number in the webapp, go to its Conversions tab and click Connect with Meta.

Step by step: How to send leads and sales from your Click-to-WhatsApp ads to Meta.

How events are reportedโ€‹

  • Only conversations that started from an ad. The person has to have written to your number by tapping a Click-to-WhatsApp ad. Conversations that started any other way answer skipped with no_ad_click, and so do ads shown in WhatsApp Status, because Meta doesn't send a click ID for them.
  • Up to 7 days after the click. Meta takes events for 7 days from the last time the person wrote to you from the ad. After that the answer is click_expired.
  • Once per click and event. Each event_name is reported once for each ad click. You can report LeadSubmitted and later Purchase for the same conversation, but sending Purchase twice answers already_sent the second time.
  • No amount. Events go to Meta without a value or currency. The event time is the moment of your call.
  • In the background. queued means 2Chat registered the event and is sending it to Meta, so the call doesn't wait for Meta. The number's Conversions tab in the webapp lists the latest events and whether Meta accepted them.
Prefer tags?

Tags can report the same events. Give a tag a Meta rule in the webapp, and when that tag is added to a conversation that came from an ad (from the live chat, a flow or the Add Tag to Conversation endpoint), 2Chat reports its event, with the same once-per-click rule. Adding a tag the conversation already has reports nothing. This endpoint is for when you only have the phone numbers.

Endpointโ€‹

POST https://api.p.2chat.io/open/waba/conversions

Authenticationโ€‹

Send your API key in the X-User-API-Key header. See Authentication.

API costโ€‹

0API credits

Each call to this endpoint deducts 0 API credits from your plan's API credit pool.

Reporting conversions is free: this endpoint doesn't consume API credits.

Parametersโ€‹

Send them as a JSON body.

ParameterDescriptionExample
from_numberYour WABA number, in E.164 format. The leading + is optional. Required.+15550001111
to_numberThe phone number of the person you are talking to, in E.164 format, as WhatsApp reports it (the remote_phone_number of the webhooks). The leading + is optional. For Brazilian numbers, both forms work, with or without the ninth digit. Argentine mobile numbers need the 9 after +54 (+549โ€ฆ): without it the conversation isn't found. Required.+15552223333
event_nameWhat happened in the conversation: LeadSubmitted, QualifiedLead or Purchase (see below). Required.Purchase
event_nameUse it when
LeadSubmittedThe person is a lead: they asked for a price, left their details or showed interest
QualifiedLeadThe lead is qualified: for example, they fit your offer or booked a call
PurchaseThe person bought from you or became a customer

Invocationโ€‹

curl --location --request POST 'https://api.p.2chat.io/open/waba/conversions' \
--header 'X-User-API-Key: your_api_key_here' \
--header 'Content-Type: application/json' \
--data '{
"from_number": "+15550001111",
"to_number": "+15552223333",
"event_name": "Purchase"
}'

Responseโ€‹

The event was registered and is being sent to Meta:

{
"success": true,
"data": {
"status": "queued",
"reason": null
}
}

Nothing was sent, with the reason. It is still a 200, so check data.status:

{
"success": true,
"data": {
"status": "skipped",
"reason": "no_ad_click"
}
}
FieldDescription
successtrue when the request was valid
data.statusqueued: 2Chat is sending the event to Meta. skipped: nothing was sent, see reason
data.reasonnull when queued. When skipped, one of the reasons below
reasonWhy nothing was sent
not_meta_channelfrom_number isn't connected straight to Meta, so it can't report conversions
no_ad_clickThe conversation with to_number didn't start from a Click-to-WhatsApp ad, there is no conversation with that number, or the ad was shown in WhatsApp Status. Also when the contact hides their number from you (see the note below)
channel_disabledConversions are turned off for from_number. Turn them on in the number's Conversions tab
click_expiredMore than 7 days went by since the person last wrote to you from the ad
already_sentThis event_name was already reported for this ad click. It isn't sent again, even if Meta refused it the first time
Contacts who hide their number

When a contact hides their phone number from you, their conversation has only a WhatsApp user ID (the remote_id of the webhooks, like CO.4815162342108421), and this endpoint can't find it by phone: it answers no_ad_click even if they came from an ad. To report those conversations, add a tag with a Meta rule instead.

Error responsesโ€‹

Errors return a 4xx status. Errors from the endpoint itself come in this shape:

{
"error": true,
"error_message": "Payload is invalid: `event_name` must be one of LeadSubmitted, QualifiedLead, Purchase"
}

Authentication errors and missing body parameters come with a detail field instead, as the table shows:

{
"detail": "Invalid API Key"
}
StatusBodyWhen
400error_message: Payload is invalid: `event_name` must be one of LeadSubmitted, QualifiedLead, Purchaseevent_name isn't one of the three events
400error_message: Payload is invalid: to_number is not valid or not in international format: [...] (or from_number)from_number or to_number isn't a valid number in international format
401{"detail": "Invalid API Key"}The API key doesn't exist
402{"detail": "Account Expired. Please check your Billing Portal."}Your account's plan has expired
403{"detail": "Not authenticated"}The request has no X-User-API-Key header
403{"detail": "API key is no longer active"}The API key was deactivated
404error_message: WhatsApp Profile setup not foundfrom_number isn't a WABA number of your account
422{"detail": [{"loc": ["body", "event_name"], "msg": "field required", ...}]}A body parameter is missing

Typical flowโ€‹

  1. Someone taps your Click-to-WhatsApp ad and writes to your WABA number. 2Chat keeps the ad and its click ID with the conversation (you can see them in the whatsapp.waba.message.received webhook).
  2. When the person becomes a lead or a customer in your system, call this endpoint with your number, theirs and the event, within 7 days of the click.
  3. If data.status is skipped, data.reason tells you why. To see how many conversations each ad started, use the Ads Report.

From Zapier, Make or n8n: use their HTTP step (in Zapier, Webhooks by Zapier โ€บ POST or Custom Request) with the URL above, the X-User-API-Key header and the three body parameters as JSON.