Technical documentation for the SharpDuel Zapier integration API.
https://api.sharpduel.com/api/v1/zapierAll API requests require authentication via API key in the header:
X-Zapier-API-Key: zap_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxzap_/auth/testVerify API key and get store information
{
"success": true,
"message": "Authentication successful",
"store_id": "64abc123def456789012345",
"store_name": "Premium Picks"
}/hooksSubscribe a webhook URL to receive events
{
"hookUrl": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
"event": "new_subscription"
}{
"success": true,
"id": "a1b2c3d4e5f6789012345678"
}/hooks/:hookIdUnsubscribe a webhook
{
"success": true,
"message": "Webhook unsubscribed successfully"
}/events/:eventTypeGet recent events for testing/polling
[
{
"id": "evt_abc123def456",
"event_name": "new_subscription",
"timestamp": "2025-01-15T10:30:00Z",
"store": {
"id": "64abc123def456789012345",
"name": "Premium Picks",
"slug": "premium-picks"
},
"customer": {
"id": "cust_xyz789",
"email": "[email protected]",
"name": "John Doe"
},
"subscription": {
"id": "sub_123456789",
"packageName": "Pro Package",
"amount": 4999,
"currency": "usd"
}
}
]new_subscriptionCustomer subscribes to a packagesubscription_renewedRecurring payment succeedssubscription_cancelledSubscription is fully cancelledpending_cancellationSubscription scheduled for cancellation at period endpayment_failedPayment attempt failscustomer_createdNew customer record createdrefund_issuedRefund processed for a subscriptioncoupon_redeemedCoupon/discount applied to subscriptionreview_submittedCustomer submits a reviewreview_approvedAdmin approves a reviewaffiliate_commission_earnedAffiliate earns commission from referralaffiliate_payout_processedAffiliate payout is approvedpackage_createdNew package created in storeWhen events occur, SharpDuel sends a POST request to registered webhook URLs with the following payload structure:
new_subscription{
"id": "evt_abc123",
"event_name": "new_subscription",
"timestamp": "2025-01-15T10:30:00Z",
"store": {
"id": "64abc123def456789012345",
"name": "Premium Picks",
"slug": "premium-picks"
},
"customer": {
"id": "cust_xyz789",
"email": "[email protected]",
"name": "John Doe"
},
"subscription": {
"id": "sub_stripe_id",
"packageName": "Pro Package",
"amount": 4999,
"currency": "usd",
"status": "active",
"interval": "month",
"renewalCount": 1
}
}subscription_cancelled{
"id": "evt_abc123",
"event_name": "subscription_cancelled",
"timestamp": "2025-01-15T10:30:00Z",
"store": { ... },
"customer": {
"id": "cust_xyz789",
"email": "[email protected]",
"name": "John Doe"
},
"subscription": {
"id": "sub_stripe_id",
"packageName": "Pro Package",
"cancelledAt": "2025-01-15T10:30:00Z"
}
}affiliate_commission_earned{
"id": "evt_abc123",
"event_name": "affiliate_commission_earned",
"timestamp": "2025-01-15T10:30:00Z",
"store": { ... },
"affiliate": {
"id": "aff_mongodb_id",
"email": "[email protected]",
"name": "Jane Smith"
},
"commission": {
"amount": 1000,
"currency": "usd",
"percentage": 20,
"referredCustomer": "[email protected]",
"packageName": "Pro Package",
"subscriptionId": "sub_stripe_id"
}
}sub_ are Stripe subscription IDs| Status | Code | Description |
|---|---|---|
| 400 | missing_fields | Required fields not provided |
| 400 | invalid_webhook_url | Webhook URL not from Zapier |
| 401 | invalid_api_key | API key is invalid or expired |
| 401 | missing_api_key | No API key provided |
| 403 | integration_disabled | Zapier integration is disabled |
| 404 | webhook_not_found | Webhook subscription not found |
| 429 | rate_limit_exceeded | Too many requests |
| 500 | internal_error | Server error |