Purchase Webhook

Track purchases from external stores and platforms

Purchase Webhook

POST/api/webhooks/purchase/:contestId
Webhook Secret

Receive purchase events from your store or payment platform to automatically award points to contest participants.

Endpoint

POST https://blitzrocket.com/api/webhooks/purchase/:contestId

Path Parameters

contestIdstring required

The unique contest identifier

Request Body

emailstring required

Email address of the purchaser

orderIdstring required

Unique order identifier from your system

amountnumber required

Purchase amount (positive number)

currencystring

Currency code (default: 'USD')

Request

curl -X POST https://blitzrocket.com/api/webhooks/purchase/clx1abc123 \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "orderId": "order-12345",
    "amount": 79.99,
    "currency": "USD"
  }'
const contestId = "clx1abc123";
const response = await fetch(
  `https://blitzrocket.com/api/webhooks/purchase/${contestId}`,
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      email: "[email protected]",
      orderId: "order-12345",
      amount: 79.99,
      currency: "USD",
    }),
  }
);

const data = await response.json();
console.log(data);
import requests

contest_id = "clx1abc123"
response = requests.post(
    f"https://blitzrocket.com/api/webhooks/purchase/{contest_id}",
    json={
        "email": "[email protected]",
        "orderId": "order-12345",
        "amount": 79.99,
        "currency": "USD"
    }
)

data = response.json()
print(data)

Response

{
  "success": true,
  "data": {
    "purchaseId": "purchase_xyz789",
    "entryId": "entry_abc123",
    "pointsAwarded": 80,
    "alreadyExists": false,
    "message": "Purchase recorded successfully"
  }
}

Duplicate Handling

If the same orderId is sent multiple times, the webhook will return a success response but will not create a duplicate purchase or award additional points:

{
  "success": true,
  "data": {
    "purchaseId": "purchase_xyz789",
    "entryId": "entry_abc123",
    "pointsAwarded": 0,
    "alreadyExists": true,
    "message": "Purchase already recorded"
  }
}

Supported Store Integrations

Shopify

Use your contest webhook URL in Shopify's webhook settings:

  1. Go to Shopify AdminSettingsNotificationsWebhooks
  2. Add a webhook for orders/paid
  3. Set the URL to https://blitzrocket.com/api/webhooks/purchase/{contestId}

Blitz Rocket also supports the dedicated Shopify referral webhook at:

POST /api/webhooks/referral/shopify/:contestId

Stripe

Use your contest webhook URL in Stripe's webhook settings:

  1. Go to Stripe DashboardDevelopersWebhooks
  2. Add an endpoint for checkout.session.completed
  3. Set the URL to https://blitzrocket.com/api/webhooks/referral/stripe/{contestId}

Setup Guide

  1. Navigate to your contest in the Blitz Rocket dashboard
  2. Enable Purchase Tracking in the contest settings
  3. Configure point rules (e.g., 1 point per dollar spent)
  4. Copy your webhook URL and configure it in your store/payment platform
  5. Test with a small purchase to verify the integration