curl -X GET "https://api.linquid.io/api/conversions/postback?lw_cid=abc123xyz789&amount=99.99¤cy=USD&event=purchase&orderId=ORD-12345" \
-H "X-API-Key: lw_your_api_key_here"
{
"success": true,
"data": {
"conversionId": "conv_def456",
"clickId": "abc123xyz789",
"tracked": true
}
}
Track a conversion via server-to-server postback
curl -X GET "https://api.linquid.io/api/conversions/postback?lw_cid=abc123xyz789&amount=99.99¤cy=USD&event=purchase&orderId=ORD-12345" \
-H "X-API-Key: lw_your_api_key_here"
{
"success": true,
"data": {
"conversionId": "conv_def456",
"clickId": "abc123xyz789",
"tracked": true
}
}
curl -X GET "https://api.linquid.io/api/conversions/postback?lw_cid=abc123xyz789&amount=99.99¤cy=USD&event=purchase&orderId=ORD-12345" \
-H "X-API-Key: lw_your_api_key_here"
{
"success": true,
"data": {
"conversionId": "conv_def456",
"clickId": "abc123xyz789",
"tracked": true
}
}
// Shopify order webhook handler
app.post('/webhooks/shopify/order', async (req, res) => {
const order = req.body;
// Extract click ID from order note attributes or URL params
const clickId = order.note_attributes?.find(
attr => attr.name === 'lw_cid'
)?.value;
if (clickId) {
await fetch(
`https://api.linquid.io/api/conversions/postback?` +
`lw_cid=${clickId}&amount=${order.total_price}¤cy=${order.currency}&orderId=${order.id}`,
{ headers: { 'X-API-Key': process.env.LINQUID_API_KEY } }
);
}
res.sendStatus(200);
});
// WooCommerce order completed hook
add_action('woocommerce_thankyou', function($order_id) {
$order = wc_get_order($order_id);
$click_id = WC()->session->get('lw_cid');
if ($click_id) {
$url = 'https://api.linquid.io/api/conversions/postback?' . http_build_query([
'lw_cid' => $click_id,
'amount' => $order->get_total(),
'currency' => $order->get_currency(),
'orderId' => $order_id,
]);
wp_remote_get($url, [
'headers' => ['X-API-Key' => LINQUID_API_KEY]
]);
}
});
lw_cid from the landing page URL and store it in session/cookie immediately. Pass it through your checkout flow.orderId to prevent duplicate conversions if the postback is retried.Was this page helpful?