- Blitz Rocket API DocumentationGetting StartedAPI ReferenceWebhooksReferral Tracking
Purchase Webhook
Track purchases from external stores and platforms
On this page
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)
currencystringCurrency 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:
- Go to Shopify Admin → Settings → Notifications → Webhooks
- Add a webhook for
orders/paid - 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:
- Go to Stripe Dashboard → Developers → Webhooks
- Add an endpoint for
checkout.session.completed - Set the URL to
https://blitzrocket.com/api/webhooks/referral/stripe/{contestId}
Setup Guide
- Navigate to your contest in the Blitz Rocket dashboard
- Enable Purchase Tracking in the contest settings
- Configure point rules (e.g., 1 point per dollar spent)
- Copy your webhook URL and configure it in your store/payment platform
- Test with a small purchase to verify the integration