When revenue lives in a warehouse (BigQuery, Snowflake, Redshift, a Postgres replica) rather than in one payment tool, push each paid row to Wexlyn as a sale. Wexlyn ties it to the person's click journey by the identity on the row and the sale shows under CRM → Sales, in every report and in the conversions sent back to the ad platforms.
What each row must carry
| Field | Required | What it is |
|---|---|---|
email | one of these three | The buyer's email. The best key: it matches the opt-in captured by the tracking script. |
external_id | one of these three | Your own user id for the buyer. Matches when the site identified the person with the same id. |
phone | one of these three | E.164 is safest (+14155551234). |
amount | yes | The amount in currency, as a number (49, not "$49"). Net of tax if you report net. |
currency | yes | ISO code, USD. |
order_id | yes | A stable id for the row (your order id, invoice id, commission id). Re-sending the same id updates instead of duplicating, which is how refunds and corrections work. |
product | recommended | What was bought, in the words you want in reports: Shopify trial commission, Subscription (Stripe), Coaching program. |
date | recommended | When the money was earned, ISO 8601 with timezone (2026-10-30T14:02:00Z). Missing = now. |
status | optional | paid (default), refunded, partially_refunded, pending, failed. |
provider | optional | A label for the source of the row, bigquery. Shows on the sale. |
name | optional | The buyer's full name. |
items | optional | [{ "name", "quantity", "amount" }] when one row holds several products. |
A row with no email, phone or external id is rejected: there is nothing to attach it to.
Affiliate commissions (a Shopify trial earned through Impact, for example) rarely carry the buyer's email on their own. Put your user id or the opt-in email into the tracking link's sub id when you generate the link, so the commission row can be joined back to the person before it is sent.
The request
curl -X POST https://app.wexlyn.ai/api/v1/sales \
-H "Authorization: Bearer wx_live_..." \
-H "Content-Type: application/json" \
-d '{
"email": "buyer@business.com",
"external_id": "user_8841",
"amount": 49,
"currency": "USD",
"order_id": "commission-98765",
"product": "Shopify trial commission",
"status": "paid",
"date": "2026-10-30T14:02:00Z",
"provider": "bigquery"
}'
The key comes from Settings → Developers → API keys (scope read + write). It is shown once. Errors come back as { "error": { "code", "message" } }: 401 bad key, 403 the key is read-only, 422 a field is wrong (the message names it), 429 slow down.
Three ways to run it
- Scheduled query → small function. A BigQuery scheduled query writes new or changed rows since the last run to a staging table; a Cloud Function or Cloud Run job reads them and POSTs one request per row (or a few hundred in parallel), then marks them sent. Idempotent on
order_id, so a re-run is harmless. - Zapier or Make. Zapier's BigQuery trigger (new row) → Wexlyn's Send Sale / Conversion action. Make: BigQuery module → HTTP module to the endpoint above, or to the Make / n8n / Webhook endpoint under Settings → Integrations, which needs no key and takes
{ "type": "sale", ... }with the same fields. - A one-off backfill. Post history with its real
date. Rows from before the tracking script was installed will have no source, so they count as revenue but not as attributed revenue.
Refunds and corrections
Send the same order_id again with "status": "refunded" (or partially_refunded and the remaining amount). The sale updates in place and the refund flows to the ad platforms that received the purchase.
Timezones
Send date with its offset or in UTC. Wexlyn files the sale in the account's timezone (Settings → Data), the same one the ad accounts use, so days line up with spend.
Check it works
Send one row for a person who opted in through a tracked page. Within seconds it appears under CRM → Sales with a first and last source, and the person's journey shows the sale after their clicks. Settings → Developers → Request logs lists every call with its status and the error message when one was rejected.