Learn about webhook retry behavior, how many retries are attempted, what happens on failure, and best practices for implementing idempotent webhook handlers.
Stash retries a failed webhook delivery automatically, with exponential backoff. This page covers the uppercase events in the Webhook List, such as PURCHASE_SUCCEEDED and FREE_ITEM_REDEEMED. It does not apply to the payment, refund and subscription events on that page, such as payment.succeeded, payment.refunded and subscription.created.
How Many Retries
Success: your endpoint returns any 2xx status within 5 seconds.
Failure: any other status, no response within 5 seconds, or a connection error. Stash retries every failure, including 401, 403, 429 and 5xx.
Schedule: the first retries follow within seconds, and the gap doubles until Stash retries once an hour.
Maximum: up to 100 attempts over about 3.5 days.
Permanent rejections: if your endpoint keeps answering 400, 404, 405, 410 or 422, Stash stops retrying sooner. For PURCHASE_SUCCEEDED, PURCHASE_FAILED, PURCHASE_REFUNDED, MUTATE_CART, LOYALTY_MILESTONE_CLAIMED and FREE_ITEM_REDEEMED that is about 2 hours after the event; for every other event it is about 2 minutes.
Test environment: up to 10 attempts over about 9 minutes, with a 30-second timeout.
The retry count is included in the stash-retry-count header (see Webhook Headers below).
What Happens on Failure
When a webhook delivery fails after all retry attempts are exhausted:
No further automatic retries: The webhook will not be automatically retried again
Event is logged: The failure is logged in Stash’s internal systems for monitoring
Manual reconciliation: You may need to manually reconcile missed events by:
Querying the Stash API for transaction status
Checking your purchase history endpoints
Reviewing transaction logs in the Stash Studio dashboard
Important: Webhook delivery failures do not affect the underlying transaction. If a PURCHASE_SUCCEEDED webhook fails to deliver, the purchase is still valid and the payment was processed. You should implement idempotent webhook handlers and have a reconciliation process to catch missed events.
Webhook Headers
Each webhook request includes the following HTTP headers:
Content-Type
Value: application/json
Description: Indicates the request body is JSON
Stash-Hmac-Signature
Value: Base64-encoded HMAC-SHA256 signature of the request body
Description: Used for signature verification (optional but recommended)
Description: Current retry attempt number (0 = initial attempt, 1 = first retry, etc.)
Use Case: Track retry attempts, implement retry-specific logic, debugging
You can use the stash-retry-count header to:
Log retry attempts for debugging
Implement different handling logic for retries vs initial attempts
Monitor webhook delivery reliability
Best Practices
1. Idempotent Handlers
Design your webhook handlers to be idempotent (safe to process the same event multiple times). This ensures that if a webhook is retried, you don’t accidentally:
Grant items twice
Charge a user multiple times
Create duplicate records
Example:
async function handlePurchaseSucceeded(event) { const { orderId, userId, items } = event.purchaseSucceeded; // Check if this order has already been processed const existingOrder = await db.getOrder(orderId); if (existingOrder && existingOrder.status === 'completed') { // Already processed, return success return { status: 'ok', message: 'Already processed' }; } // Process the order await grantItemsToUser(userId, items); await db.saveOrder(orderId, { status: 'completed', ...event }); return { status: 'ok' };}
2. Use Transaction IDs
Use orderId or transactionId to deduplicate events. FREE_ITEM_REDEEMED carries neither; use its redemptionId (see the Webhook List).
// Use orderId as a unique keyconst orderId = event.purchaseSucceeded.orderId;// Check if already processedif (await isOrderProcessed(orderId)) { return; // Skip duplicate}// Process and mark as completeawait processOrder(orderId, event);await markOrderProcessed(orderId);
3. Reconciliation
Periodically query transaction status to catch missed webhooks:
// Run this periodically (e.g., daily)async function reconcileMissedWebhooks() { const recentOrders = await stashApi.getRecentOrders(); for (const order of recentOrders) { if (!await isOrderProcessed(order.id)) { // Webhook was missed, process manually await handlePurchaseSucceeded({ purchaseSucceeded: order }); } }}
4. Monitoring
Monitor webhook delivery success rates and set up alerts for failures:
Track the stash-retry-count header to identify frequently retried webhooks
Set up alerts for webhook delivery failures
Monitor your endpoint’s response times (must stay under 5 seconds)
Track error rates and response codes
5. Fast Response
Respond within 5 seconds. A slower response counts as a failure and is retried:
// Good: Process asynchronously and respond immediatelyapp.post('/webhook', async (req, res) => { // Verify signature first if (!verifySignature(req)) { return res.status(401).send(); } // Respond immediately res.status(200).json({ received: true }); // Process asynchronously processWebhookAsync(req.body).catch(err => { console.error('Webhook processing error:', err); // Handle error (e.g., queue for retry, send alert) });});
Handling Retries
You can use the stash-retry-count header to implement retry-specific logic:
app.post('/webhook', async (req, res) => { const retryCount = parseInt(req.headers['stash-retry-count'] || '0'); if (retryCount > 0) { console.log(`Processing retry attempt ${retryCount} for webhook`); // You might want to log this differently or handle retries with extra care } // Process webhook... res.status(200).json({ received: true });});
Common Issues
Duplicate Processing
Problem: Webhook is processed multiple times due to retries.Solution: Implement idempotent handlers using orderId or transactionId as unique keys.
Slow Processing
Problem: Webhook processing takes too long, causing timeouts and retries.Solution:
Respond immediately with 200 OK
Process the webhook asynchronously
Use background jobs or queues for heavy processing
Missing Events
Problem: Some webhooks are never received even after retries.Solution:
Implement reconciliation process
Monitor webhook delivery logs in Stash Studio
Set up alerts for delivery failures
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Stash Documentation","description":"Integrate Stash Pay, Stash Webshop, and Stash Launcher. Guides and partner resources for the Stash direct-to-consumer platform.","colors":{"primary":"#1e1e1e","light":"#f7f9f4","dark":"#1e1e1e"},"logo":{"light":"https://mintcdn.com/stash-gg/I_GbdmJR4L85eJZA/logo/light.svg?fit=max\u0026auto=format\u0026n=I_GbdmJR4L85eJZA\u0026q=85\u0026s=c58d1a385fd52c013aef762b9f06da39","dark":"https://mintcdn.com/stash-gg/I_GbdmJR4L85eJZA/logo/dark.svg?fit=max\u0026auto=format\u0026n=I_GbdmJR4L85eJZA\u0026q=85\u0026s=012af7b9b89de597a472667a86a65eef","href":"/guides"},"favicon":"https://mintcdn.com/stash-gg/I_GbdmJR4L85eJZA/favicon.png?fit=max\u0026auto=format\u0026n=I_GbdmJR4L85eJZA\u0026q=85\u0026s=6f4e9b8b8e5068337b7712264275bd28","api":{"playground":{"display":"interactive"}},"appearance":{"default":"system","strict":false},"background":{"color":{"light":"#f7f9f4","dark":"#1e1e1e"}},"navbar":{"primary":{"type":"button","label":"Studio","href":"https://studio.stash.gg"}},"seo":{"metatags":{"og:image":"https://docs.stash.gg/og-image.png"}},"fonts":{"heading":{"family":"Factor A","weight":500,"source":"https://storage.googleapis.com/stash_assets/fonts/FactorA-Medium.woff2","format":"woff2"},"body":{"family":"Factor A","weight":300,"source":"https://storage.googleapis.com/stash_assets/fonts/FactorA-Regular.woff2","format":"woff2"}},"icons":{"library":"lucide"},"styling":{"eyebrows":"breadcrumbs","latex":false},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"stash-gg","hasAudioNarration":false,"actualSubdomain":"stash-gg","customDomains":[],"gitSource":{"type":"github","owner":"stashgg","repo":"stash-mintlify","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6afccf82d3f0f72f2b169b4c"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6b0e1f15d09a38910d349f35:success","clientVersion":"0.0.4352","searchFilterCounts":[{"language":"default","tag":"Integration Guides","count":66},{"language":"default","tag":"API Reference","count":41},{"language":"default","tag":"Changelog","count":38},{"language":"default","tag":"Ingress","count":34},{"language":"default","tag":"Stash Webshop","count":28},{"language":"default","tag":"Features \u0026 Customizations","count":19},{"language":"default","tag":"Stash Pay","count":18},{"language":"default","tag":"Getting Started","count":11},{"language":"default","tag":"Catalog Management","count":11},{"language":"default","tag":"Partner With Us","count":10}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"privacy":{"consentBanner":{"enabled":true}},"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":":root{--sidebar-width: 286px;--stash-menu-surface: #f4f6f1;--stash-menu-glass: rgba(244, 246, 241, 0.8);--stash-menu-border: rgba(153, 153, 153, 0.2)}html.dark{--stash-menu-surface: #1c1c1c;--stash-menu-glass: rgba(28, 28, 28, 0.8);--stash-menu-border: rgba(153, 153, 153, 0.2)}#navbar>div:not(#navbar-transition),div:has(>[data-layout-item=\"sidebar\"]){max-width:none}#navbar-transition,[data-layout-item=\"sidebar\"]{background-color:var(--stash-menu-glass);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);border-color:var(--stash-menu-border)}[data-layout-item=\"sidebar\"]{border-inline-end:1px solid var(--stash-menu-border)}#sidebar-content div:has(>#navigation-items)>div:first-child{background-image:linear-gradient(to bottom, var(--stash-menu-surface), transparent)}#mobile-nav,[data-layout-item=\"mobile-nav\"],.nav-dropdown-content,[data-component-part=\"theme-preference-menu-content\"]{background-color:var(--stash-menu-surface);border-color:var(--stash-menu-border)}@media (min-width: 1024px){div:has(>[data-layout-item=\"sidebar\"]){padding-inline:0}#sidebar-content{padding-inline-start:1rem}}@font-face{font-family:\"Factor A\";src:url(\"https://storage.googleapis.com/stash_assets/fonts/FactorA-Bold.woff2\") format(\"woff2\");font-weight:700;font-style:normal;font-display:swap}@font-face{font-family:\"Factor A\";src:url(\"https://storage.googleapis.com/stash_assets/fonts/FactorA-Extrabold35.woff2\") format(\"woff2\");font-weight:900;font-style:normal;font-display:swap}:root{--stash-page-background: #f7f9f4;--stash-header-glass: rgba(244, 246, 241, 0.8);--stash-header-border: rgba(128, 128, 128, 0.2);--stash-muted: #737373;--stash-foreground: #1e1e1e;--stash-control: rgba(235, 235, 235, 0.5);--stash-control-active: #e6e6e6;--stash-header-height: 104px}html.dark{--stash-page-background: #1e1e1e;--stash-header-glass: rgba(28, 28, 28, 0.8);--stash-muted: #999;--stash-foreground: #f7f9f4;--stash-control: rgba(33, 33, 33, 0.5);--stash-control-active: #262626}body{font-feature-settings:\"kern\" 1, \"liga\" 1, \"calt\" 1;-webkit-font-smoothing:antialiased}#page-title,#page-header h1{font-size:28px;line-height:42px;font-weight:500!important;letter-spacing:normal}#content h2,#content h3,#content h4,#content h5,#content h6{font-weight:400!important;letter-spacing:normal}#content strong{font-weight:700!important}#navbar-transition{background-color:var(--stash-header-glass);border-color:var(--stash-header-border)}#navbar .nav-logo{width:96px;height:24px}#navbar .nav-tabs-item{font-weight:500!important;text-shadow:none;color:var(--stash-muted)}#navbar .nav-tabs-item[data-active=\"true\"],#navbar .nav-tabs-item:hover{color:var(--stash-foreground)}#topbar-cta-button a{height:36px;padding:6px 12px;border:1px solid var(--stash-header-border);border-radius:9999px;color:var(--stash-muted);font-weight:300!important}#topbar-cta-button a:hover{background:var(--stash-control-active);color:var(--stash-foreground)}#topbar-cta-button a>span{display:none}#topbar-cta-button a>div{gap:6px}#topbar-cta-button a>div>span{color:inherit}#topbar-cta-button a>div>svg{display:none}#topbar-cta-button a>div::before{content:\"\";width:14px;height:14px;background:currentColor;mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20105%20104%22%3E%3Cpath%20d%3D%22M3.53358%20104L3.73942%2075.4788H64.8398C68.2705%2075.4788%2070.6719%2074.8897%2072.1128%2073.7461C73.5537%2072.6025%2074.2742%2070.9044%2074.2742%2068.6864C74.2742%2064.2159%2071.5296%2061.7901%2066.0406%2061.3742L35.5761%2059.5375C11.8701%2058.1859%200%2048.3439%200%2029.9767C0%2020.5851%203.25914%2013.2383%209.81174%207.93602C16.3643%202.63379%2026.3819%200%2039.8988%200H97.8086L98.0145%2028.5212H39.9331C36.571%2028.5212%2034.2039%2029.0756%2032.7973%2030.15C31.3907%2031.2243%2030.6703%2032.8184%2030.6703%2034.9324C30.6703%2039.1256%2033.4148%2041.4822%2038.9039%2042.0366L70.3632%2043.8734C93.4174%2045.017%20104.944%2054.6858%20104.944%2072.8104C104.944%2082.4099%20101.651%2090.034%2095.0984%2095.6135C88.5458%20101.193%2078.5968%20104%2065.2515%20104H3.53358Z%22%2F%3E%3C%2Fsvg%3E\") center / contain no-repeat;-webkit-mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20105%20104%22%3E%3Cpath%20d%3D%22M3.53358%20104L3.73942%2075.4788H64.8398C68.2705%2075.4788%2070.6719%2074.8897%2072.1128%2073.7461C73.5537%2072.6025%2074.2742%2070.9044%2074.2742%2068.6864C74.2742%2064.2159%2071.5296%2061.7901%2066.0406%2061.3742L35.5761%2059.5375C11.8701%2058.1859%200%2048.3439%200%2029.9767C0%2020.5851%203.25914%2013.2383%209.81174%207.93602C16.3643%202.63379%2026.3819%200%2039.8988%200H97.8086L98.0145%2028.5212H39.9331C36.571%2028.5212%2034.2039%2029.0756%2032.7973%2030.15C31.3907%2031.2243%2030.6703%2032.8184%2030.6703%2034.9324C30.6703%2039.1256%2033.4148%2041.4822%2038.9039%2042.0366L70.3632%2043.8734C93.4174%2045.017%20104.944%2054.6858%20104.944%2072.8104C104.944%2082.4099%20101.651%2090.034%2095.0984%2095.6135C88.5458%20101.193%2078.5968%20104%2065.2515%20104H3.53358Z%22%2F%3E%3C%2Fsvg%3E\") center / contain no-repeat}.stash-theme-controls{display:inline-flex;padding:4px;border:1px solid var(--stash-header-border);border-radius:9999px}.stash-theme-controls button{display:grid;place-items:center;width:26px;height:26px;padding:6px;border-radius:9999px;color:var(--stash-muted);cursor:pointer}.stash-theme-controls button[aria-pressed=\"true\"]{background:var(--stash-control-active);color:var(--stash-foreground)}.stash-theme-controls svg{width:14px;height:14px}.stash-sidebar-toggle{display:grid;place-items:center;width:32px;height:32px;margin-inline-end:-6px;padding:6px;border-radius:9999px;border:1px solid var(--stash-header-border);background:var(--stash-control);color:var(--stash-muted);cursor:pointer}.stash-sidebar-toggle svg{width:18px;height:18px}.stash-theme-controls button:hover,.stash-sidebar-toggle:hover{color:var(--stash-foreground)}.stash-theme-controls button:focus-visible,.stash-sidebar-toggle:focus-visible{outline:2px solid var(--stash-foreground);outline-offset:2px}html[data-stash-setting-theme] [data-component-part=\"theme-preference-menu-content\"]{visibility:hidden}.stash-background{position:fixed;inset:0;z-index:-1;overflow:hidden;pointer-events:none;user-select:none}#content .stash-background img{position:absolute;max-width:none;margin:0!important;object-fit:contain;filter:brightness(0.8);border-radius:0}@media (max-width: 767px){.stash-background{display:none}}@media (min-width: 1024px){#navbar>div:not(#navbar-transition)>div>div:has(>div>div>div>a>.nav-logo)>div:first-child{padding-inline:24px;margin-inline:0;border-bottom:1px solid var(--stash-header-border)}#navbar div:has(>div>a>.nav-logo){border-bottom:0}#navbar div:has(>#search-bar-entry){position:absolute;left:50%;transform:translateX(-50%);width:384px;flex:none}#search-bar-entry{height:36px;padding:6px 6px 6px 10px;border:1px solid var(--stash-header-border);color:var(--stash-muted);box-shadow:none;background:var(--stash-control);filter:none;font-size:14px;line-height:20px}#search-bar-entry [data-search-item=\"trigger-icon\"]{color:inherit;stroke-width:2}#search-bar-entry [data-search-item=\"trigger-hint\"]{display:inline-flex;gap:2px;font-size:14px;font-weight:300!important}#search-bar-entry kbd{border:1px solid var(--stash-header-border);border-radius:6px;padding:0 6px;background:var(--stash-page-background);font:inherit}#navbar div:has(>nav[aria-label=\"Main\"]){gap:8px}#navbar div:has(>nav[aria-label=\"Main\"])>*{margin-inline:0}#navbar div:has(>nav[aria-label=\"Main\"])>.stash-sidebar-toggle{margin-inline-end:-6px}#navbar div:has(>.nav-tabs){height:40px;padding-inline:24px}#navbar .nav-tabs{width:100%;align-items:flex-end;border-bottom:1px solid transparent}#navbar .nav-tabs-item{height:28px;padding-bottom:8px;line-height:20px}#navbar .nav-tabs-item>div{height:2px}#navbar div:has(>#search-bar-entry){left:calc(50% - 192px);transform:none}[data-layout-item=\"sidebar\"]{top:var(--stash-header-height);height:calc(100vh - var(--stash-header-height))}html[data-stash-sidebar-collapsed]{--sidebar-width: 0px}}@media (max-width: 1023px){#navbar>div:not(#navbar-transition)>div>div:has(>div>div>div>a>.nav-logo)>div:first-child{height:56px;border-bottom:1px solid var(--stash-header-border)}#navbar div:has(>div>a>.nav-logo){border-bottom:0}#navbar button:has(>div>span.sr-only){position:absolute;top:10.5px;right:10px;width:34px;height:34px;padding:8px}#navbar button:has(>div>span.sr-only)>div:last-child{display:none}#navbar button:has(>div>span.sr-only)>div:first-child>svg{width:18px;height:18px}#navbar button:has(>div>span.sr-only)::after{content:\"\";position:absolute;inset:8px;background:var(--stash-muted);mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2218%22%20height%3D%2218%22%20x%3D%223%22%20y%3D%223%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M9%203v18%22%2F%3E%3C%2Fsvg%3E\") center / contain no-repeat;-webkit-mask:url(\"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2218%22%20height%3D%2218%22%20x%3D%223%22%20y%3D%223%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M9%203v18%22%2F%3E%3C%2Fsvg%3E\") center / contain no-repeat}#navbar button:has(>div>span.sr-only)>div:first-child>svg{visibility:hidden}#search-bar-entry-mobile{position:absolute;right:28px;top:10.5px;width:34px;height:34px}#navbar button[aria-label=\"More actions\"]{display:none}#content-container>div:has(>#content-area){padding-top:96px}#mobile-nav .stash-mobile-studio{flex:none;margin:12px 16px 16px 64px;padding:8px 12px;border:1px solid var(--stash-header-border);border-radius:9999px;text-align:center;font-size:14px;color:var(--stash-muted)}}#assistant-entry,#assistant-entry-mobile{display:none!important}:root{--stash-content-border: rgba(153, 153, 153, 0.2);--stash-text: #262626;--stash-heading: #0a0a0a;--stash-card: #fff;--stash-active-nav: rgba(10, 10, 10, 0.1);--stash-ease: cubic-bezier(0.4, 0, 0.2, 1);--content-width: 900px}html.dark{--stash-text: #e5e5e5;--stash-heading: #fafafa;--stash-card: #262626;--stash-active-nav: rgba(250, 250, 250, 0.1)}#header>div:first-child,#header>div:first-child>div{margin-top:0}#header nav[aria-label=\"Breadcrumb\"]{display:none}#page-title{color:var(--stash-heading)}#header>.prose{margin-top:16px;color:var(--stash-muted);line-height:28px}#header>.prose>p{margin:0;color:inherit}#header::after{content:\"\";display:block;margin-top:24px;border-bottom:1px solid var(--stash-content-border)}#content{margin-top:24px;margin-bottom:16px;color:var(--stash-text)}#content h2,#content h3,#content h4{color:var(--stash-heading)}#content h2{font-size:24px;line-height:32px;margin-top:48px;margin-bottom:24px}#content h3{font-size:20px;line-height:28px}#content>:first-child:not(.stash-background){margin-top:0}#content .card{border-radius:12px;background:var(--stash-card);border-color:var(--stash-content-border);box-shadow:none}#content [data-component-part=\"card-content-container\"]{padding:16px}#content [data-component-part=\"card-title\"]{font-size:14px;line-height:20px;font-weight:500!important;color:var(--stash-heading);margin-top:0;margin-bottom:0}#content [data-component-part=\"card-content\"]{font-size:14px;line-height:21px;margin-top:4px;color:var(--stash-muted)}#content [data-component-part=\"card-icon\"]:has(>img){width:78px;height:78px;padding:7px;margin-bottom:8px;border:1px solid var(--stash-content-border);border-radius:8px;background:#f5f5f5;box-shadow:0 2px 3px rgb(0 0 0 / 0.1)}html.dark #content [data-component-part=\"card-icon\"]:has(>img){background:#303030}#content [data-component-part=\"card-icon\"]>img{width:64px;height:64px}#content .card{margin-block:0}#content div:has(>.card){gap:12px}#content .card:hover{background:var(--stash-menu-surface);border-color:var(--stash-content-border)}#content .callout{position:relative;border-radius:12px;border-color:var(--stash-content-border);background:var(--stash-card);box-shadow:0 2px 4px rgb(0 0 0 / 0.1)}#content [data-component-part=\"callout-content\"]{color:var(--stash-muted)}#content .callout::before{content:\"\";position:absolute;inset:10px auto 10px 5px;width:2px;background:currentColor;border-radius:2px}.feedback-toolbar{margin-top:16px;margin-bottom:16px;padding:12px 0;border-block:1px solid var(--stash-content-border);color:var(--stash-heading)}#feedback-thumbs-up,#feedback-thumbs-down{border:1px solid var(--stash-content-border);border-radius:9999px;padding:8px 12px;gap:8px;color:var(--stash-muted);background:transparent}#feedback-thumbs-up>small,#feedback-thumbs-down>small{line-height:20px}.feedback-toolbar>div:first-child{justify-content:flex-start;gap:8px}.feedback-toolbar>div:first-child>p{font-weight:500;color:var(--stash-heading);margin-right:8px}.feedback-toolbar>div:first-child>div{flex-grow:0;justify-content:flex-start;gap:8px}.feedback-toolbar>div:first-child>div>div{gap:8px}.stash-verification-badge{display:inline-flex;align-items:center;gap:6px;flex:0 0 auto;margin-inline-start:auto;padding:4px 10px;border:1px solid var(--stash-content-border);border-radius:9999px;color:var(--stash-muted);background:var(--stash-menu-glass);font-size:12px;font-weight:500;line-height:18px;white-space:nowrap}.stash-verification-badge svg{width:16px;height:16px;flex-shrink:0}.stash-verification-badge[data-status=\"verified\"]{color:var(--stash-heading);background:transparent}.stash-verification-badge[data-status=\"verified\"] svg{color:#4d7c0f;fill:#b6ff00}.stash-verification-badge[data-status=\"outdated\"] svg{color:#a16207}html.dark .stash-verification-badge[data-status=\"outdated\"] svg{color:#facc15}.stash-verification-row{display:flex;align-items:center;justify-content:flex-end;min-height:64px;margin-block:16px;padding-block:12px;border-block:1px solid var(--stash-content-border)}#pagination{gap:16px;margin-top:16px;padding:0}#pagination>a{flex:1 1 0%;min-height:70px;padding:16px;gap:8px;border:1px solid var(--stash-content-border);border-radius:8px;background:var(--stash-menu-glass);backdrop-filter:blur(4px);color:var(--stash-heading);font-weight:500}#pagination>a[rel=\"next\"]{justify-content:flex-end}#pagination>a:hover{background:var(--stash-control-active)}#footer{margin-top:24px;border-color:var(--stash-content-border);padding-top:24px}[data-assistant-bar]{display:block;margin-top:24px}#sidebar-content{padding-inline:15px 0}#sidebar-content>[data-component-part=\"scroll-area-viewport\"]{padding-right:16px}#sidebar-content div:has(>#navigation-items)>div:first-child{height:40px}#sidebar-content .sidebar-group-header,#mobile-nav .sidebar-group-header{padding-left:8px;font-weight:300;color:var(--stash-heading)}#sidebar-content .sidebar-title,#mobile-nav .sidebar-title{font-weight:300!important}#navigation-items>div+div{margin-top:24px}.sidebar-group-header{margin-bottom:6px;line-height:20px}.sidebar-group>li,.sidebar-group ul>li{margin-top:0;margin-bottom:0}.sidebar-group>li>a,.sidebar-group>li>button{border-radius:8px;gap:8px;color:var(--stash-muted);text-shadow:none;padding-block:8px;line-height:20px;font-size:14px}#navigation-items>div>.sidebar-group>li>a,#navigation-items>div>.sidebar-group>li>button{padding-left:8px!important;padding-right:8px}.sidebar-group>li[data-active]>a{background:var(--stash-active-nav);color:var(--stash-heading)}.sidebar-group>li>a:hover,.sidebar-group>li>button:hover{color:var(--stash-heading);background:var(--stash-control-active)}.sidebar-group>li>button[aria-expanded]>div:last-child{margin-left:auto}.sidebar-group>li>button[aria-expanded]>div:last-child>svg{width:14px;height:14px}.sidebar-group a>div:has(>.method-nav-pill){order:2}.method-nav-pill{width:auto}.method-nav-pill>span{font-family:ui-monospace, monospace;font-size:12px;font-weight:400;padding:0;background:transparent!important}.sidebar-group a>div:has(>.method-nav-pill){align-self:center}.method-nav-pill[data-stash-method=\"get\"]>span{color:#00bc3a}.method-nav-pill[data-stash-method=\"post\"]>span{color:#2b7fff}.method-nav-pill[data-stash-method=\"put\"]>span{color:#d08700}.stash-api-switch{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;margin-bottom:32px;border:1px solid var(--stash-content-border);border-radius:8px}.stash-api-switch>a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:8px;border:1px solid transparent;border-radius:6px;color:var(--stash-muted);font-size:14px;font-weight:500;line-height:20px}.stash-api-switch svg{width:16px;height:16px}.stash-api-switch>a:hover{color:var(--stash-heading);background:var(--stash-control-active)}.stash-api-switch>a[aria-current=\"true\"]{color:var(--stash-heading);background:rgb(255 255 255 / 0.85);border-color:rgb(255 255 255 / 0.6);box-shadow:0 1px 2px rgb(0 0 0 / 0.05);backdrop-filter:blur(4px)}html.dark .stash-api-switch>a[aria-current=\"true\"]{background:rgb(255 255 255 / 0.15);border-color:rgb(255 255 255 / 0.2)}.stash-api-switch>a:focus-visible{outline:2px solid var(--stash-heading);outline-offset:2px}.nav-dropdown-trigger[data-stash-api-switch]{display:none}.stash-api-overview>.sidebar-group-header{display:none}#navigation-items>.stash-api-overview{margin-top:0}html[data-current-path^=\"/api/\"] #sidebar-content div:has(>#navigation-items)>div:first-child{height:16px}@media (min-width: 1024px){#content-container>div:has(>#content-area){gap:24px;padding:32px 0 0 24px;max-width:1200px;margin-inline:auto}#content-area{padding:0;margin:0;min-width:0;width:0;max-width:none;flex:1 1 0%}#content-side-layout{width:286px;flex-shrink:0;top:152px;height:calc(100dvh - 152px)}#table-of-contents-layout{padding-left:0;padding-right:16px;width:286px}#content-container>div:has(>#content-side-layout[data-api-example]){display:grid;grid-template-columns:minmax(0, 1fr) 400px;row-gap:0;padding-right:24px;max-width:1200px}#content-side-layout[data-api-example]{grid-column:2;grid-row:2;width:400px;top:136px;height:calc(100dvh - 160px)}#content-side-layout[data-api-example]>div{width:400px}#content-side-layout[data-api-example]+#content-area{display:contents}#content-side-layout[data-api-example]+#content-area>*{grid-column:1 / -1}#content-side-layout[data-api-example]+#content-area>#header{margin-bottom:16px}#content-side-layout[data-api-example]+#content-area>#api-playground-2-operation-page{grid-column:1;grid-row:2}#content-side-layout[data-api-example]+#content-area>[data-assistant-bar]{grid-column:1}#content-side-layout[data-api-example]+#content-area>#header::after{display:none}@media (max-width: 1279px){#content-container>div:has(>#content-area){padding-right:24px}#content-container>div:has(>#content-side-layout[data-api-example]){display:flex}#content-side-layout[data-api-example]+#content-area{display:block}}[data-layout-item=\"sidebar\"]{overflow:clip}#sidebar-content{width:285px}html[data-stash-sidebar-collapsed] [data-layout-item=\"sidebar\"]{border-right-width:0}html[data-stash-sidebar-collapsed] #sidebar-content{transform:translateX(-100%);visibility:hidden;pointer-events:none}}#api-playground-2-operation-page>div:first-child{margin-top:0}#content-area:has(>#api-playground-2-operation-page)>#header::after{display:none}.api-section-heading-title{color:var(--stash-heading);font-weight:400!important;font-size:20px;line-height:28px}html:is([data-current-path=\"/api/ingress\"],[data-current-path=\"/api/egress\"]) #content-side-layout{display:none}html:is([data-current-path=\"/api/ingress\"],[data-current-path=\"/api/egress\"]) #content-container>div:has(>#content-area){max-width:1200px}html:is([data-current-path=\"/api/ingress\"],[data-current-path=\"/api/egress\"]) #header::after{margin-top:32px}@media (min-width: 1024px){html:is([data-current-path=\"/api/ingress\"],[data-current-path=\"/api/egress\"]) #content-container>div:has(>#content-area){padding-right:24px}}@media (max-width: 1023px){#content-container>div:has(>#content-area){padding-top:88px}#content-area{padding-inline:0}#search-bar-entry-mobile{right:48px}#header>#page-context-menu{margin-top:16px}#header::after{margin-top:24px}#pagination{gap:12px}#pagination>a{padding:12px}.stash-api-switch{margin:8px 0 24px}}#stash-mobile-contents{display:none}@media (max-width: 1023px){#stash-mobile-contents{display:block;position:fixed;inset:56px 0 auto;z-index:35;color:var(--stash-muted);background:var(--stash-header-glass);border-bottom:1px solid var(--stash-content-border);backdrop-filter:blur(4px);font-size:14px;line-height:20px}#stash-mobile-contents>summary{display:flex;align-items:center;gap:8px;height:40px;padding:0 16px;cursor:pointer;list-style:none}#stash-mobile-contents>summary::-webkit-details-marker{display:none}#stash-mobile-contents>summary>span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#stash-mobile-contents svg{width:20px;height:20px;flex:none}#stash-mobile-contents svg:first-child{opacity:0.3}#stash-mobile-contents svg:last-child{width:16px;height:16px;margin-left:auto}#stash-mobile-contents[open] svg:last-child{transform:rotate(180deg)}#stash-mobile-contents nav{max-height:min(60dvh, 320px);overflow:auto;padding:8px 16px 12px;border-top:1px solid var(--stash-content-border);background:var(--stash-menu-surface)}#stash-mobile-contents nav a{display:block;padding:6px 12px;border-radius:6px}#stash-mobile-contents nav a:hover{background:var(--stash-control-active);color:var(--stash-heading)}#stash-mobile-contents :focus-visible{outline:2px solid var(--stash-heading);outline-offset:-2px}html[data-stash-mobile-contents] #content-container>div:has(>#content-area){padding-top:128px}#content :is(h2,h3,h4)[id]{scroll-margin-top:112px}}@media (max-width: 767px){#content-container>div:has(>#content-area){padding-top:80px}html[data-stash-mobile-contents] #content-container>div:has(>#content-area){padding-top:120px}}html:is([data-current-path=\"/changelog\"],[data-current-path^=\"/changelog/\"]){--sidebar-width: 0px}html:is([data-current-path=\"/changelog\"],[data-current-path^=\"/changelog/\"]) :is(#sidebar,#content-side-layout,.stash-sidebar-toggle){display:none}html:is([data-current-path=\"/changelog\"],[data-current-path^=\"/changelog/\"]) #content-container>div:has(>#content-area){max-width:768px;padding-inline:24px}html[data-current-path=\"/changelog\"] [data-component-part=\"update-tag-list\"]{gap:6px;padding-inline:0}html[data-current-path=\"/changelog\"] [data-component-part=\"update-tag\"],.stash-changelog-tag{display:inline-flex;align-items:center;padding:2px 8px;border:1px solid var(--stash-content-border);border-radius:6px;background:var(--stash-control);color:var(--stash-foreground);font-size:12px;font-weight:500;line-height:16px;white-space:nowrap}.stash-changelog-tag{margin:0 6px 6px 0}html[data-current-path=\"/changelog\"] #content h2 a{color:inherit;border-bottom:0;text-decoration:none}html[data-current-path=\"/changelog\"] #content h2 a:hover{text-decoration:underline}@property --sidebar-width{syntax:\"\u003clength>\";inherits:true;initial-value:286px}@media (prefers-reduced-motion: no-preference){:root{transition:--sidebar-width 200ms var(--stash-ease)}#sidebar-content{transition:transform 200ms var(--stash-ease), visibility 200ms}#navbar .nav-tabs-item,#topbar-cta-button a,.stash-theme-controls button,.stash-sidebar-toggle,.sidebar-group>li>a,.sidebar-group>li>button,.stash-api-switch>a,#pagination>a,#content .card,.feedback-toolbar button{transition:color 150ms var(--stash-ease), background-color 150ms var(--stash-ease), border-color 150ms var(--stash-ease), box-shadow 150ms var(--stash-ease)}.sidebar-group button[aria-expanded] svg{transition:transform 200ms var(--stash-ease)}#stash-mobile-contents svg{transition:transform 200ms var(--stash-ease)}#navbar-transition,#content-side-layout{transition:top 200ms var(--stash-ease), height 150ms var(--stash-ease)}}@media (prefers-reduced-motion: reduce){:root,#sidebar-content,.sidebar-group *,.stash-api-switch *,#mobile-nav,#content .card,#navbar *,#pagination *,.feedback-toolbar *,[data-assistant-bar] *,#stash-mobile-contents *{transition-duration:0s!important;animation-duration:0s!important}}"}]}
{"page":{"pagePath":"guides/get-started/stash-webhooks/retries","slug":"/guides/get-started/stash-webhooks/retries","pageMetadata":{"title":"Webhook Retries and Idempotency","description":"Learn about webhook retry behavior, how many retries are attempted, what happens on failure, and best practices for implementing idempotent webhook handlers.","href":"/guides/get-started/stash-webhooks/retries"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Learn about webhook retry behavior, how many retries are attempted, what happens on failure, and best practices for implementing idempotent webhook handlers.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Stash retries a failed webhook delivery automatically, with exponential backoff. This page covers the uppercase events in the `,_jsx(_components.a,{href:`/guides/get-started/stash-webhooks/webhook-list`,children:`Webhook List`}),`, such as `,_jsx(_components.code,{children:`PURCHASE_SUCCEEDED`}),` and `,_jsx(_components.code,{children:`FREE_ITEM_REDEEMED`}),`. It does not apply to the payment, refund and subscription events on that page, such as `,_jsx(_components.code,{children:`payment.succeeded`}),`, `,_jsx(_components.code,{children:`payment.refunded`}),` and `,_jsx(_components.code,{children:`subscription.created`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`how-many-retries`,children:`How Many Retries`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Success`}),`: your endpoint returns any `,_jsx(_components.code,{children:`2xx`}),` status within 5 seconds.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Failure`}),`: any other status, no response within 5 seconds, or a connection error. Stash retries every failure, including `,_jsx(_components.code,{children:`401`}),`, `,_jsx(_components.code,{children:`403`}),`, `,_jsx(_components.code,{children:`429`}),` and `,_jsx(_components.code,{children:`5xx`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Schedule`}),`: the first retries follow within seconds, and the gap doubles until Stash retries once an hour.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Maximum`}),`: up to 100 attempts over about 3.5 days.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Permanent rejections`}),`: if your endpoint keeps answering `,_jsx(_components.code,{children:`400`}),`, `,_jsx(_components.code,{children:`404`}),`, `,_jsx(_components.code,{children:`405`}),`, `,_jsx(_components.code,{children:`410`}),` or `,_jsx(_components.code,{children:`422`}),`, Stash stops retrying sooner. For `,_jsx(_components.code,{children:`PURCHASE_SUCCEEDED`}),`, `,_jsx(_components.code,{children:`PURCHASE_FAILED`}),`, `,_jsx(_components.code,{children:`PURCHASE_REFUNDED`}),`, `,_jsx(_components.code,{children:`MUTATE_CART`}),`, `,_jsx(_components.code,{children:`LOYALTY_MILESTONE_CLAIMED`}),` and `,_jsx(_components.code,{children:`FREE_ITEM_REDEEMED`}),` that is about 2 hours after the event; for every other event it is about 2 minutes.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Test environment`}),`: up to 10 attempts over about 9 minutes, with a 30-second timeout.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The retry count is included in the `,_jsx(_components.code,{children:`stash-retry-count`}),` header (see `,_jsx(_components.a,{href:`#webhook-headers`,children:`Webhook Headers`}),` below).`]}),`\n`,_jsx(Heading,{level:`2`,id:`what-happens-on-failure`,children:`What Happens on Failure`}),`\n`,_jsx(_components.p,{children:`When a webhook delivery fails after all retry attempts are exhausted:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`No further automatic retries`}),`: The webhook will not be automatically retried again`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Event is logged`}),`: The failure is logged in Stash’s internal systems for monitoring`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Manual reconciliation`}),`: You may need to manually reconcile missed events by:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Querying the Stash API for transaction status`}),`\n`,_jsx(_components.li,{children:`Checking your purchase history endpoints`}),`\n`,_jsx(_components.li,{children:`Reviewing transaction logs in the Stash Studio dashboard`}),`\n`]}),`\n`]}),`\n`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Important:`}),` Webhook delivery failures do `,_jsx(_components.strong,{children:`not`}),` affect the underlying transaction. If a `,_jsx(_components.code,{children:`PURCHASE_SUCCEEDED`}),` webhook fails to deliver, the purchase is still valid and the payment was processed. You should implement idempotent webhook handlers and have a reconciliation process to catch missed events.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`webhook-headers`,children:`Webhook Headers`}),`\n`,_jsx(_components.p,{children:`Each webhook request includes the following HTTP headers:`}),`\n`,_jsx(Heading,{level:`3`,id:`content-type`,children:_jsx(_components.code,{children:`Content-Type`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Value`}),`: `,_jsx(_components.code,{children:`application/json`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Description`}),`: Indicates the request body is JSON`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`stash-hmac-signature`,children:_jsx(_components.code,{children:`Stash-Hmac-Signature`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Value`}),`: Base64-encoded HMAC-SHA256 signature of the request body`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Description`}),`: Used for signature verification (optional but recommended)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Format`}),`: Base64-encoded string`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`See`}),`: `,_jsx(_components.a,{href:`/guides/get-started/stash-webhooks/webhook-listener#signature-verification`,children:`Signature Verification`})]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`stash-retry-count`,children:_jsx(_components.code,{children:`stash-retry-count`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Value`}),`: Integer string (e.g., `,_jsx(_components.code,{children:`\"0\"`}),`, `,_jsx(_components.code,{children:`\"1\"`}),`, `,_jsx(_components.code,{children:`\"2\"`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Description`}),`: Current retry attempt number (0 = initial attempt, 1 = first retry, etc.)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Use Case`}),`: Track retry attempts, implement retry-specific logic, debugging`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`You can use the `,_jsx(_components.code,{children:`stash-retry-count`}),` header to:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Log retry attempts for debugging`}),`\n`,_jsx(_components.li,{children:`Implement different handling logic for retries vs initial attempts`}),`\n`,_jsx(_components.li,{children:`Monitor webhook delivery reliability`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`best-practices`,children:`Best Practices`}),`\n`,_jsx(Heading,{level:`3`,id:`1-idempotent-handlers`,children:`1. Idempotent Handlers`}),`\n`,_jsxs(_components.p,{children:[`Design your webhook handlers to be `,_jsx(_components.strong,{children:`idempotent`}),` (safe to process the same event multiple times). This ensures that if a webhook is retried, you don’t accidentally:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Grant items twice`}),`\n`,_jsx(_components.li,{children:`Charge a user multiple times`}),`\n`,_jsx(_components.li,{children:`Create duplicate records`}),`\n`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Example:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` handlePurchaseSucceeded`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`orderId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`userId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`items`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`purchaseSucceeded`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Check if this order has already been processed`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` existingOrder`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` db`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getOrder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`orderId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`existingOrder`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` existingOrder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'completed'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Already processed, return success`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'ok'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`message:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Already processed'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` };`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Process the order`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` grantItemsToUser`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`userId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`items`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` db`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`saveOrder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`orderId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'completed'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`...`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'ok'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` };`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`2-use-transaction-ids`,children:`2. Use Transaction IDs`}),`\n`,_jsxs(_components.p,{children:[`Use `,_jsx(_components.code,{children:`orderId`}),` or `,_jsx(_components.code,{children:`transactionId`}),` to deduplicate events. `,_jsx(_components.code,{children:`FREE_ITEM_REDEEMED`}),` carries neither; use its `,_jsx(_components.code,{children:`redemptionId`}),` (see the `,_jsx(_components.a,{href:`/guides/get-started/stash-webhooks/webhook-list`,children:`Webhook List`}),`).`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Use orderId as a unique key`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` orderId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`purchaseSucceeded`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`orderId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Check if already processed`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` isOrderProcessed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`orderId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Skip duplicate`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Process and mark as complete`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` processOrder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`orderId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` markOrderProcessed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`orderId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`3-reconciliation`,children:`3. Reconciliation`}),`\n`,_jsx(_components.p,{children:`Periodically query transaction status to catch missed webhooks:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Run this periodically (e.g., daily)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` reconcileMissedWebhooks`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` recentOrders`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` stashApi`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`getRecentOrders`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` order`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` of`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` recentOrders`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` isOrderProcessed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`order`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Webhook was missed, process manually`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` handlePurchaseSucceeded`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` purchaseSucceeded:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` order`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`4-monitoring`,children:`4. Monitoring`}),`\n`,_jsx(_components.p,{children:`Monitor webhook delivery success rates and set up alerts for failures:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Track the `,_jsx(_components.code,{children:`stash-retry-count`}),` header to identify frequently retried webhooks`]}),`\n`,_jsx(_components.li,{children:`Set up alerts for webhook delivery failures`}),`\n`,_jsx(_components.li,{children:`Monitor your endpoint’s response times (must stay under 5 seconds)`}),`\n`,_jsx(_components.li,{children:`Track error rates and response codes`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`5-fast-response`,children:`5. Fast Response`}),`\n`,_jsx(_components.p,{children:`Respond within 5 seconds. A slower response counts as a failure and is retried:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`16`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Good: Process asynchronously and respond immediately`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`post`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'/webhook'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Verify signature first`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`verifySignature`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`401`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`send`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Respond immediately`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`received:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Process asynchronously`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` processWebhookAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`body`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Webhook processing error:'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`err`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Handle error (e.g., queue for retry, send alert)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`handling-retries`,children:`Handling Retries`}),`\n`,_jsxs(_components.p,{children:[`You can use the `,_jsx(_components.code,{children:`stash-retry-count`}),` header to implement retry-specific logic:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`app`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`post`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'/webhook'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` retryCount`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` parseInt`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`req`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'stash-retry-count'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`||`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '0'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`retryCount`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Processing retry attempt \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`retryCount`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" for webhook`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // You might want to log this differently or handle retries with extra care`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Process webhook...`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` res`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`200`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`received:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`common-issues`,children:`Common Issues`}),`\n`,_jsx(Heading,{level:`3`,id:`duplicate-processing`,children:`Duplicate Processing`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Problem:`}),` Webhook is processed multiple times due to retries.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Solution:`}),` Implement idempotent handlers using `,_jsx(_components.code,{children:`orderId`}),` or `,_jsx(_components.code,{children:`transactionId`}),` as unique keys.`]}),`\n`,_jsx(Heading,{level:`3`,id:`slow-processing`,children:`Slow Processing`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Problem:`}),` Webhook processing takes too long, causing timeouts and retries.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Solution:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Respond immediately with `,_jsx(_components.code,{children:`200 OK`})]}),`\n`,_jsx(_components.li,{children:`Process the webhook asynchronously`}),`\n`,_jsx(_components.li,{children:`Use background jobs or queues for heavy processing`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`missing-events`,children:`Missing Events`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Problem:`}),` Some webhooks are never received even after retries.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Solution:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Implement reconciliation process`}),`\n`,_jsx(_components.li,{children:`Monitor webhook delivery logs in Stash Studio`}),`\n`,_jsx(_components.li,{children:`Set up alerts for delivery failures`}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Webhook Retries and Idempotency","description":"Learn about webhook retry behavior, how many retries are attempted, what happens on failure, and best practices for implementing idempotent webhook handlers.","href":"/guides/get-started/stash-webhooks/retries"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How Many Retries","slug":"how-many-retries","depth":2,"children":[]},{"title":"What Happens on Failure","slug":"what-happens-on-failure","depth":2,"children":[]},{"title":"Webhook Headers","slug":"webhook-headers","depth":2,"children":[{"title":"Content-Type","slug":"content-type","depth":3,"children":[]},{"title":"Stash-Hmac-Signature","slug":"stash-hmac-signature","depth":3,"children":[]},{"title":"stash-retry-count","slug":"stash-retry-count","depth":3,"children":[]}]},{"title":"Best Practices","slug":"best-practices","depth":2,"children":[{"title":"1. Idempotent Handlers","slug":"1-idempotent-handlers","depth":3,"children":[]},{"title":"2. Use Transaction IDs","slug":"2-use-transaction-ids","depth":3,"children":[]},{"title":"3. Reconciliation","slug":"3-reconciliation","depth":3,"children":[]},{"title":"4. Monitoring","slug":"4-monitoring","depth":3,"children":[]},{"title":"5. Fast Response","slug":"5-fast-response","depth":3,"children":[]}]},{"title":"Handling Retries","slug":"handling-retries","depth":2,"children":[]},{"title":"Common Issues","slug":"common-issues","depth":2,"children":[{"title":"Duplicate Processing","slug":"duplicate-processing","depth":3,"children":[]},{"title":"Slow Processing","slug":"slow-processing","depth":3,"children":[]},{"title":"Missing Events","slug":"missing-events","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/stash-gg/7a02d7154563de2a/stash-header.js"],"subdomain":"stash-gg","siteName":"Stash Documentation","title":"Webhook Retries and Idempotency - Stash Documentation","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-17T23:33:16.828Z","originalFileLocation":"guides/get-started/stash-webhooks/retries.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Learn about webhook retry behavior, how many retries are attempted, what happens on failure, and best practices for implementing idempotent webhook handlers.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Stash Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Webhook Retries and Idempotency - Stash Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn about webhook retry behavior, how many retries are attempted, what happens on failure, and best practices for implementing idempotent webhook handlers.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Stash Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://stash-gg.mintlify.app/guides/get-started/stash-webhooks/retries\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://docs.stash.gg/og-image.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Webhook Retries and Idempotency - Stash Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn about webhook retry behavior, how many retries are attempted, what happens on failure, and best practices for implementing idempotent webhook handlers.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://docs.stash.gg/og-image.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/stash-gg/FPsFuW1MRa_lLsAE/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Stash Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1e1e1e\">\u003clink data-mint-head rel=\"canonical\" href=\"https://stash-gg.mintlify.app/guides/get-started/stash-webhooks/retries\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/get-started/stash-webhooks/retries.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://stash-gg.mintlify.app/#organization\",\"name\":\"Stash Documentation\",\"url\":\"https://stash-gg.mintlify.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/stash-gg/I_GbdmJR4L85eJZA/logo/light.svg?fit=max\u0026auto=format\u0026n=I_GbdmJR4L85eJZA\u0026q=85\u0026s=c58d1a385fd52c013aef762b9f06da39\"}},{\"@type\":\"WebSite\",\"@id\":\"https://stash-gg.mintlify.app#website\",\"name\":\"Stash Documentation\",\"url\":\"https://stash-gg.mintlify.app\",\"publisher\":{\"@id\":\"https://stash-gg.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://stash-gg.mintlify.app/guides/get-started/stash-webhooks/retries#webpage\",\"url\":\"https://stash-gg.mintlify.app/guides/get-started/stash-webhooks/retries\",\"name\":\"Webhook Retries and Idempotency\",\"description\":\"Learn about webhook retry behavior, how many retries are attempted, what happens on failure, and best practices for implementing idempotent webhook handlers.\",\"dateModified\":\"2026-11-17T23:33:16.828Z\",\"isPartOf\":{\"@id\":\"https://stash-gg.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://stash-gg.mintlify.app/guides/get-started/stash-webhooks/retries#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://stash-gg.mintlify.app/guides/get-started/stash-webhooks/retries#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Getting Started\",\"item\":\"https://stash-gg.mintlify.app/guides/get-started/stash-studio/getting-started\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Stash Webhooks\",\"item\":\"https://stash-gg.mintlify.app/guides/get-started/stash-webhooks/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Webhook Retries and Idempotency\",\"item\":\"https://stash-gg.mintlify.app/guides/get-started/stash-webhooks/retries\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://stash-gg.mintlify.app/guides/get-started/stash-webhooks/retries#article\",\"headline\":\"Webhook Retries and Idempotency\",\"name\":\"Webhook Retries and Idempotency\",\"description\":\"Learn about webhook retry behavior, how many retries are attempted, what happens on failure, and best practices for implementing idempotent webhook handlers.\",\"url\":\"https://stash-gg.mintlify.app/guides/get-started/stash-webhooks/retries\",\"mainEntityOfPage\":{\"@id\":\"https://stash-gg.mintlify.app/guides/get-started/stash-webhooks/retries#webpage\"},\"image\":\"https://docs.stash.gg/og-image.png\",\"dateModified\":\"2026-11-17T23:33:16.828Z\",\"publisher\":{\"@id\":\"https://stash-gg.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://stash-gg.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Stash Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Stash Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/guides/get-started/stash-webhooks/retries.md","siteName":"Stash Documentation","nav":{"global":null,"tabs":[{"tab":"Integration Guides","groups":[{"group":"Introduction","pages":[{"title":"Quick Start","icon":"circle-check","href":"/guides"},{"title":"Demo Hub","icon":"rocket","href":"/guides/get-started/demo-hub"},{"title":"Stash Docs MCP","icon":"bot","href":"/guides/stash-docs-mcp"}]},{"group":"Getting Started","pages":[{"group":"Stash Studio","icon":"square-pen","pages":[{"title":"Getting Started with Stash Studio","href":"/guides/get-started/stash-studio/getting-started"},{"title":"Project Settings","href":"/guides/get-started/stash-studio/project-settings"},{"title":"Main Dashboard","href":"/guides/get-started/stash-studio/main-dashboard"},{"title":"View Logs in Stash Studio","href":"/guides/get-started/stash-studio/view-logs"},{"title":"Roles \u0026 Permissions","href":"/guides/get-started/stash-studio/roles-and-permissions"}]},{"group":"API Keys","icon":"key","pages":[{"title":"API Keys Overview","href":"/guides/get-started/stash-api-keys/overview"}]},{"group":"Stash Webhooks","icon":"link","pages":[{"title":"Stash Webhooks","href":"/guides/get-started/stash-webhooks/overview"},{"title":"Webhook Listener","href":"/guides/get-started/stash-webhooks/webhook-listener"},{"title":"Webhook List","description":"Comprehensive list of all webhook events that Stash can send to your backend, including event types, triggers, payload structures, and detailed examples for purchase, subscription, and payment webhooks across Stash products.","href":"/guides/get-started/stash-webhooks/webhook-list"},{"title":"Webhook Retries and Idempotency","href":"/guides/get-started/stash-webhooks/retries"}]},{"title":"Test Card Numbers","description":"Use test card numbers to test your Stash Pay and Stash Webshop integrations. These test cards work with Stash's test environment and Stash Howling Woods demo.","icon":"credit-card","href":"/guides/get-started/test-cards"}]},{"group":"Stash Pay","pages":[{"title":"About Stash Pay","href":"/guides/stash-pay/about"},{"title":"High-Level Flow","href":"/guides/stash-pay/flow"},{"title":"Integrating Stash Pay","href":"/guides/stash-pay/integration"},{"group":"Subscriptions","pages":[{"title":"About Subscriptions","href":"/guides/stash-pay/subscriptions/about"},{"title":"Subscription Flow","href":"/guides/stash-pay/subscriptions/flow"},{"title":"Integrating Subscriptions","href":"/guides/stash-pay/subscriptions/integration"}]},{"group":"iOS / Android Integration","pages":[{"title":"Presentation Options","href":"/guides/stash-pay/ios-android-integration/presentation-options"},{"title":"Native Apps Integration","href":"/guides/stash-pay/ios-android-integration/native-apps"},{"title":"Unity Integration","href":"/guides/stash-pay/ios-android-integration/unity"},{"title":"Unreal Engine Integration","href":"/guides/stash-pay/ios-android-integration/unreal"}]},{"group":"Web Integration","pages":[{"title":"Web Apps \u0026 WebGL","href":"/guides/stash-pay/web-integration/web-apps"}]},{"group":"Features \u0026 Customizations","pages":[{"title":"Stash Pay Opt-In","href":"/guides/stash-pay/how-tos/opt-in"},{"title":"Customize the Checkout Appearance","href":"/guides/stash-pay/how-tos/customize-checkout-appearance"},{"title":"Configure Image Domains","href":"/guides/stash-pay/how-tos/image-domains"},{"title":"Link Generator","href":"/guides/stash-pay/how-tos/link-generator"},{"title":"Unity Opt-in Dialog","href":"/guides/stash-pay/how-tos/unity-opt-in-dialog"},{"title":"Managed Catalog","href":"/guides/stash-pay/how-tos/managed-catalog"}]}]},{"group":"Stash Webshop","pages":[{"title":"About Stash Webshop","href":"/guides/stash-webshop/about"},{"title":"High-Level Flow","href":"/guides/stash-webshop/flow"},{"title":"Integrating Stash Webshop","href":"/guides/stash-webshop/integration"},{"group":"Catalog Management","pages":[{"title":"Catalog Management","href":"/guides/stash-webshop/catalog/catalog-management"},{"title":"Managed Catalog","href":"/guides/stash-webshop/catalog/managed-catalog"},{"group":"Real-time Catalog","pages":[{"title":"Real-time Catalog","href":"/guides/stash-webshop/catalog/real-time-catalog"},{"title":"Endpoints","href":"/guides/stash-webshop/catalog/real-time-catalog/endpoints"},{"title":"Payment Flow","href":"/guides/stash-webshop/catalog/real-time-catalog/payment-flow"},{"title":"Catalog Items and Prices","href":"/guides/stash-webshop/catalog/real-time-catalog/items-and-prices"},{"title":"Free Items and Streaks","href":"/guides/stash-webshop/catalog/real-time-catalog/free-items"},{"title":"Localization and Text","href":"/guides/stash-webshop/catalog/real-time-catalog/localization-and-text"},{"title":"Offer Templates","href":"/guides/stash-webshop/catalog/real-time-catalog/offer-templates"},{"title":"Drop Rate Compliance","href":"/guides/stash-webshop/catalog/real-time-catalog/drop-rates"},{"title":"Caching","href":"/guides/stash-webshop/catalog/real-time-catalog/caching"}]}]},{"group":"Player Authentication","pages":[{"title":"Authentication Methods","href":"/guides/stash-webshop/player-authentication/authentication-methods"},{"title":"Authentication Providers","href":"/guides/stash-webshop/player-authentication/authentication-providers"},{"title":"Account Linking","href":"/guides/stash-webshop/player-authentication/account-linking"}]},{"group":"Features \u0026 Customizations","pages":[{"title":"Customize the Webshop Appearance","href":"/guides/stash-webshop/how-tos/customize-webshop-appearance"},{"title":"Create and Edit Promo Codes","href":"/guides/stash-webshop/how-tos/create-promo-codes"},{"group":"Loyalty Program","pages":[{"title":"Loyalty Program","href":"/guides/stash-webshop/how-tos/loyalty"},{"title":"Reward Types","href":"/guides/stash-webshop/how-tos/loyalty/reward-types"},{"title":"Tiers","href":"/guides/stash-webshop/how-tos/loyalty/tiers"},{"title":"Milestones \u0026 Rewards","href":"/guides/stash-webshop/how-tos/loyalty/milestones"},{"title":"Milestone SKU Rewards","href":"/guides/stash-webshop/how-tos/loyalty/milestone-sku-rewards"},{"title":"Configure in Stash Studio","href":"/guides/stash-webshop/how-tos/loyalty/configuration"},{"title":"Analytics \u0026 App Integration","href":"/guides/stash-webshop/how-tos/loyalty/analytics-app-integration"},{"title":"Refunds \u0026 XP Adjustments","href":"/guides/stash-webshop/how-tos/loyalty/refunds-and-xp"}]},{"title":"Web Shop Maintenance Mode","href":"/guides/stash-webshop/how-tos/webshop-maintenance-mode"}]}]},{"group":"Stash Launcher","pages":[{"title":"About Stash Launcher","href":"/guides/stash-launcher/about"},{"title":"Launcher Concepts","href":"/guides/stash-launcher/launcher-concepts"},{"title":"Integrating Stash Launcher","href":"/guides/stash-launcher/integration"},{"group":"Build Management","pages":[{"title":"Manage Builds, Releases, and Channels","href":"/guides/stash-launcher/build-management/build-management"},{"title":"Stash CLI","href":"/guides/stash-launcher/build-management/stash-cli"}]},{"group":"Features \u0026 Customizations","pages":[{"title":"Customize Your Launcher's Appearance","href":"/guides/stash-launcher/how-tos/customize-launcher-appearance"},{"title":"Launcher Maintenance Mode","href":"/guides/stash-launcher/how-tos/launcher-maintenance-mode"}]}]}]},{"tab":"API Reference","dropdowns":[{"dropdown":"Ingress","groups":[{"group":"Overview","pages":[{"title":"Getting Started","href":"/api/ingress"}]},{"group":"Catalog","pages":[{"title":"Abort offers","deprecated":null,"version":null,"sidebarTitle":"Abort offers","openapi":"/ingress-openapi.json post /sdk/server/catalog/offer-aborts/abort","href":"/api/ingress/catalog/abortoffers"},{"title":"Force refresh catalog","deprecated":null,"version":null,"sidebarTitle":"Force refresh catalog","openapi":"/ingress-openapi.json post /sdk/server/catalog/force-refresh","href":"/api/ingress/catalog/forcerefreshcatalog"},{"title":"List offer aborts","deprecated":null,"version":null,"sidebarTitle":"List offer aborts","openapi":"/ingress-openapi.json post /sdk/server/catalog/offer-aborts/list","href":"/api/ingress/catalog/listofferaborts"},{"title":"Un-abort offers","deprecated":null,"version":null,"sidebarTitle":"Un-abort offers","openapi":"/ingress-openapi.json post /sdk/server/catalog/offer-aborts/unabort","href":"/api/ingress/catalog/unabortoffers"}]},{"group":"Localization","pages":[{"title":"Refresh localizations","deprecated":null,"version":null,"sidebarTitle":"Refresh localizations","openapi":"/ingress-openapi.json post /sdk/studio/{shopId}/localizations/refresh","href":"/api/ingress/localization/refreshlocalizations"}]},{"group":"Loyalty","pages":[{"title":"Get loyalty program configuration","deprecated":null,"version":null,"sidebarTitle":"Get loyalty program configuration","openapi":"/ingress-openapi.json get /sdk/studio/{shopId}/loyalty","href":"/api/ingress/loyalty/getloyalty"},{"title":"Get loyalty configuration","deprecated":null,"version":null,"sidebarTitle":"Get loyalty configuration","openapi":"/ingress-openapi.json get /sdk/studio/{shopId}/loyalty/config","href":"/api/ingress/loyalty/getloyaltyconfig"},{"title":"Get a player's loyalty standing","deprecated":null,"version":null,"sidebarTitle":"Get a player's loyalty standing","openapi":"/ingress-openapi.json get /sdk/studio/{shopId}/loyalty/players/{playerId}","href":"/api/ingress/loyalty/getplayerloyalty"},{"title":"Configure a loyalty season","deprecated":null,"version":null,"sidebarTitle":"Configure a loyalty season","openapi":"/ingress-openapi.json put /sdk/studio/{shopId}/loyalty/config","href":"/api/ingress/loyalty/updateloyaltyconfig"}]},{"group":"Payments","pages":[{"title":"Get payment event by ID","deprecated":null,"version":null,"sidebarTitle":"Get payment event by ID","openapi":"/ingress-openapi.json get /sdk/server/payment/{id}","href":"/api/ingress/payments/getpaymentevent"}]},{"group":"Pricing","pages":[{"title":"Convert prices","deprecated":null,"version":null,"sidebarTitle":"Convert prices","openapi":"/ingress-openapi.json post /sdk/server/prices/convert","href":"/api/ingress/pricing/convertprices"},{"title":"Get prices","deprecated":null,"version":null,"sidebarTitle":"Get prices","openapi":"/ingress-openapi.json get /sdk/server/prices","href":"/api/ingress/pricing/getprices"}]},{"group":"Reports","pages":[{"title":"List report files","deprecated":null,"version":null,"sidebarTitle":"List report files","openapi":"/ingress-openapi.json post /sdk/studio/{shopId}/reports/files","href":"/api/ingress/reports/listreportfiles"}]},{"group":"Server URLs","pages":[{"title":"Generate authenticated URL","deprecated":null,"version":null,"sidebarTitle":"Generate authenticated URL","openapi":"/ingress-openapi.json post /sdk/server/generate_url","href":"/api/ingress/server-urls/generateauthenticatedurl"}]},{"group":"Stash Pay","pages":[{"title":"Generate Checkout","deprecated":null,"version":null,"sidebarTitle":"Generate Checkout","openapi":"/ingress-openapi.json post /sdk/server/checkout_links/generate_quick_pay_url","href":"/api/ingress/stash-pay/generatequickpayurl"}]},{"group":"Subscription Checkout Links","pages":[{"title":"Create a subscription change checkout link","deprecated":null,"version":null,"sidebarTitle":"Create a subscription change checkout link","openapi":"/ingress-openapi.json post /sdk/subscriptions/{subscriptionId}/change-checkout-links","href":"/api/ingress/subscription-checkout-links/createsubscriptionchangecheckoutlink"},{"title":"Create a subscription checkout link","deprecated":null,"version":null,"sidebarTitle":"Create a subscription checkout link","openapi":"/ingress-openapi.json post /sdk/subscriptions/checkout-links","href":"/api/ingress/subscription-checkout-links/createsubscriptioncheckoutlink"}]},{"group":"Subscription Plans","pages":[{"title":"Get plan by ID","deprecated":null,"version":null,"sidebarTitle":"Get plan by ID","openapi":"/ingress-openapi.json get /sdk/plans/{planId}","href":"/api/ingress/subscription-plans/getplan"},{"title":"Get plan by code","deprecated":null,"version":null,"sidebarTitle":"Get plan by code","openapi":"/ingress-openapi.json get /sdk/plans/code/{code}","href":"/api/ingress/subscription-plans/getplanbycode"},{"title":"List plans","deprecated":null,"version":null,"sidebarTitle":"List plans","openapi":"/ingress-openapi.json get /sdk/plans","href":"/api/ingress/subscription-plans/listplans"}]},{"group":"Subscriptions","pages":[{"title":"Cancel subscription","deprecated":null,"version":null,"sidebarTitle":"Cancel subscription","openapi":"/ingress-openapi.json post /sdk/subscriptions/{id}/cancel","href":"/api/ingress/subscriptions/cancelsubscription"},{"title":"Get payments by subscription ID","deprecated":null,"version":null,"sidebarTitle":"Get payments by subscription ID","openapi":"/ingress-openapi.json get /sdk/subscriptions/{id}/payments","href":"/api/ingress/subscriptions/getpaymentsbysubscriptionid"},{"title":"Get subscription by ID","deprecated":null,"version":null,"sidebarTitle":"Get subscription by ID","openapi":"/ingress-openapi.json get /sdk/subscriptions/{id}","href":"/api/ingress/subscriptions/getsubscription"},{"title":"List subscriptions","deprecated":null,"version":null,"sidebarTitle":"List subscriptions","openapi":"/ingress-openapi.json get /sdk/subscriptions","href":"/api/ingress/subscriptions/listsubscriptions"},{"title":"Reactivate subscription","deprecated":null,"version":null,"sidebarTitle":"Reactivate subscription","openapi":"/ingress-openapi.json post /sdk/subscriptions/{id}/reactivate","href":"/api/ingress/subscriptions/reactivatesubscription"},{"title":"Update subscription","deprecated":null,"version":null,"sidebarTitle":"Update subscription","openapi":"/ingress-openapi.json post /sdk/subscriptions/{id}","href":"/api/ingress/subscriptions/updatesubscription"}]},{"group":"User Preferences","pages":[{"title":"Get user preferences","deprecated":null,"version":null,"sidebarTitle":"Get user preferences","openapi":"/ingress-openapi.json get /sdk/server/user_preferences/{userId}","href":"/api/ingress/user-preferences/getuserpreferences"},{"title":"Set user preferences","deprecated":null,"version":null,"sidebarTitle":"Set user preferences","openapi":"/ingress-openapi.json post /sdk/server/user_preferences/{userId}","href":"/api/ingress/user-preferences/setuserpreferences"}]},{"group":"Web Shop","pages":[{"title":"Get maintenance mode","deprecated":null,"version":null,"sidebarTitle":"Get maintenance mode","openapi":"/ingress-openapi.json get /sdk/server/shop/maintenance","href":"/api/ingress/web-shop/getmaintenancemode"},{"title":"Set maintenance mode","deprecated":null,"version":null,"sidebarTitle":"Set maintenance mode","openapi":"/ingress-openapi.json post /sdk/server/shop/maintenance","href":"/api/ingress/web-shop/setmaintenancemode"}]},{"group":"Webshop Account Linking","pages":[{"title":"Approve custom login","deprecated":null,"version":null,"sidebarTitle":"Approve custom login","openapi":"/ingress-openapi.json post /sdk/custom_login/approve","href":"/api/ingress/webshop-account-linking/approvecustomlogin"},{"title":"Decline custom login","deprecated":null,"version":null,"sidebarTitle":"Decline custom login","openapi":"/ingress-openapi.json post /sdk/custom_login/decline","href":"/api/ingress/webshop-account-linking/declinecustomlogin"},{"title":"Force Logout user","deprecated":null,"version":null,"sidebarTitle":"Force Logout user","openapi":"/ingress-openapi.json post /sdk/server/custom_login/logout","href":"/api/ingress/webshop-account-linking/logoutuser"}]}]},{"dropdown":"Egress","groups":[{"group":"Overview","pages":[{"title":"Getting Started","href":"/api/egress"}]},{"group":"Catalog","pages":[{"title":"Get product catalog","deprecated":null,"version":null,"sidebarTitle":"Get product catalog","playground":"simple","openapi":"/egress-openapi.json get /api/v1/catalog","href":"/api/egress/catalog/getcatalog"},{"title":"Get offer details","deprecated":null,"version":null,"sidebarTitle":"Get offer details","playground":"simple","openapi":"/egress-openapi.json get /api/v1/catalog/offer","href":"/api/egress/catalog/getofferdetails"}]},{"group":"Players","pages":[{"title":"Get player by ID","deprecated":null,"version":null,"sidebarTitle":"Get player by ID","playground":"simple","openapi":"/egress-openapi.json get /api/v1/player","href":"/api/egress/players/getplayer"}]},{"group":"Purchase","pages":[{"title":"Cancel pending payment","deprecated":null,"version":null,"sidebarTitle":"Cancel pending payment","playground":"simple","openapi":"/egress-openapi.json post /api/v1/purchase/cancel","href":"/api/egress/purchase/cancelpayment"},{"title":"Confirm payment completion","deprecated":null,"version":null,"sidebarTitle":"Confirm payment completion","playground":"simple","openapi":"/egress-openapi.json post /api/v1/purchase/confirm","href":"/api/egress/purchase/confirmpayment"},{"title":"Register payment intent","deprecated":null,"version":null,"sidebarTitle":"Register payment intent","playground":"simple","openapi":"/egress-openapi.json post /api/v1/purchase/register","href":"/api/egress/purchase/registerpayment"}]}]}]},{"tab":"Partner With Us","pages":[{"title":"Partner With Us","href":"/partners"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Webhook Retries and Idempotency - Stash Documentation","deploymentId":"dpl_5nNsUVHqbVdUHouroPPzwztSbjmH","buildId":"dpl_5nNsUVHqbVdUHouroPPzwztSbjmH","dynamics":[],"chunks":[]}