Recommendations for building reliable webhook integrations
Respond Quickly
Return a 2xx status code as fast as possible (ideally within 1-2 seconds). Process the event payload asynchronously — for example, by adding it to a message queue.
// Good - acknowledge immediately, process laterapp.post('/webhooks', (req, res) => { res.status(200).send('OK'); queue.push(req.body); // Process asynchronously});// Bad - processing blocks the responseapp.post('/webhooks', async (req, res) => { await processOrder(req.body); // This might take 10+ seconds await updateDatabase(req.body); await sendNotification(req.body); res.status(200).send('OK');});
Always Verify Signatures
Never trust a webhook payload without verifying the signature. See the Security guide for implementation examples in Node.js, Python, and Go.
Handle Duplicates
In rare cases, the same event may be delivered more than once (e.g., due to network issues or retries). Use the X-BitByBit-Webhook-Id header to deduplicate:
const processedEvents = new Set();app.post('/webhooks', (req, res) => { const eventId = req.headers['x-bitbybit-webhook-id']; if (processedEvents.has(eventId)) { return res.status(200).send('Already processed'); } processedEvents.add(eventId); // Process the event... res.status(200).send('OK');});
For production use, store processed event IDs in a database or Redis with a TTL of 24 hours instead of an in-memory Set.
Use HTTPS
Webhook endpoint URLs must use HTTPS. This ensures the payload is encrypted in transit and prevents man-in-the-middle attacks.
Handle Retries Gracefully
If your endpoint is temporarily unavailable, bitbybit will retry with exponential backoff. Make sure your processing logic is idempotent — processing the same event twice should produce the same result.
Monitor Your Endpoints
Check the Delivery History in Settings > Developer to monitor webhook health. Watch for:
High failure rates (check server logs)
Slow response times (optimize your handler)
Suspended endpoints (reactivate after fixing the issue)
Prevent Timeouts
bitbybit will wait up to 30 seconds for a response. If your handler needs more time:
Acknowledge the webhook immediately with a 200 response
Process the event in a background job or queue
Track processing status separately
Test Before Going Live
Use the Send Test button in webhook settings to verify your endpoint is correctly:
Receiving the POST request
Parsing the JSON payload
Verifying the signature
Returning a 2xx response
Firewall Configuration
If your server has a firewall, ensure it allows incoming POST requests from bitbybit’s servers. The User-Agent header is always BitByBit-Webhooks/1.0.
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"bitbybit","colors":{"primary":"#ff734c","light":"#fc7b54","dark":"#ff734c"},"logo":{"light":"https://mintcdn.com/asmaraku/WlT_6AuzhITpdgTf/logo/bbb-logo-default.png?fit=max\u0026auto=format\u0026n=WlT_6AuzhITpdgTf\u0026q=85\u0026s=7690f415d4b16eb95a47bd01fe7c938d","dark":"https://mintcdn.com/asmaraku/WlT_6AuzhITpdgTf/logo/bbb-logo-light.png?fit=max\u0026auto=format\u0026n=WlT_6AuzhITpdgTf\u0026q=85\u0026s=4aaa8d3bd2de358414b495349a279a6b"},"favicon":{"light":"https://mintcdn.com/asmaraku/cHM4z2t-1XWdSut8/bbb-icon.png?fit=max\u0026auto=format\u0026n=cHM4z2t-1XWdSut8\u0026q=85\u0026s=7f39b6b551ded4c62302624137f090e3","dark":"https://mintcdn.com/asmaraku/cHM4z2t-1XWdSut8/bbb-icon.png?fit=max\u0026auto=format\u0026n=cHM4z2t-1XWdSut8\u0026q=85\u0026s=7f39b6b551ded4c62302624137f090e3"},"api":{"openapi":["api-reference/openapi/customers.json","api-reference/openapi/messaging.json","api-reference/openapi/analytics.json","api-reference/openapi/loyalty-bitlogin.json","api-reference/openapi/loyalty-customers.json","api-reference/openapi/shipping.json"]},"navbar":{"primary":{"type":"button","label":"Support","href":"https://api.whatsapp.com/send/?phone=6281514231000\u0026text=Hello+bitbybit+team%2C+I+need+some+assistance"}},"footer":{"socials":{"x":"https://x.com/mintlify","github":"https://github.com/mintlify","linkedin":"https://linkedin.com/company/mintlify"}},"integrations":{"gtm":{"tagId":"GTM-KQ6RZZG"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"asmaraku","hasAudioNarration":false,"actualSubdomain":"asmaraku","customDomains":["knowledge.bitbybit.studio"],"gitSource":{"type":"github","owner":"asmaraku","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b05447f03f9e460a0a40d6f","clientVersion":"0.0.4304","searchFilterCounts":[{"language":"default","tag":"API Reference","count":122},{"language":"default","tag":"bitCRM","count":100},{"language":"default","tag":"bitChat","count":98},{"language":"default","tag":"AI Studio","count":50},{"language":"default","tag":"bitLink","count":44},{"language":"default","tag":"WhatsApp Commerce","count":44},{"language":"default","tag":"bitApp","count":42},{"language":"default","tag":"Integrations","count":34},{"language":"default","tag":"bitLoyalty","count":26},{"language":"default","tag":"Settings","count":24}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"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":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","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":"snapshot-serving","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":"site-roles","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":"assistant-v5","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":"workos-sso-scim","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":"workos-signup","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":"workos-enabled","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":"sso-setup-deadline-banner","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":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"custom.css","content":":is(#sidebar-content,#mobile-nav):has(a[href=\"/integrations/overview\"],a[href=\"/bitcrm/overview\"],a[href=\"/bitchat/overview\"],a[href=\"/bitapp/overview\"],a[href=\"/bitlink/overview\"],a[href=\"/loyalty/overview\"],a[href=\"/ai-studio/overview\"],a[href=\"/whatsapp-commerce/overview\"],a[href=\"/settings/overview\"],a[href=\"/api-reference/introduction\"]) .sidebar-group-header{display:none}:is(#sidebar-content,#mobile-nav):has(a[href=\"/integrations/overview\"],a[href=\"/bitcrm/overview\"],a[href=\"/bitchat/overview\"],a[href=\"/bitapp/overview\"],a[href=\"/bitlink/overview\"],a[href=\"/loyalty/overview\"],a[href=\"/ai-studio/overview\"],a[href=\"/whatsapp-commerce/overview\"],a[href=\"/settings/overview\"],a[href=\"/api-reference/introduction\"]) li>:is(a,button){padding-block:10px}:is(#sidebar-content,#mobile-nav) li[data-active=\"true\"]>button{font-weight:700}#body-content:has(#sidebar-content a[href=\"/integrations/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/bitcrm/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/bitchat/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/bitapp/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/bitlink/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/loyalty/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/ai-studio/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/whatsapp-commerce/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/settings/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/api-reference/introduction\"][aria-current=\"page\"]) #header .eyebrow{display:none}#body-content:has(#sidebar-content a[href=\"/integrations/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/bitcrm/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/bitchat/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/bitapp/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/bitlink/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/loyalty/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/ai-studio/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/whatsapp-commerce/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/settings/overview\"][aria-current=\"page\"],#sidebar-content a[href=\"/api-reference/introduction\"][aria-current=\"page\"]) #header .eyebrow+div{margin-block-start:0}"}]}
{"page":{"pagePath":"api-reference/webhooks/best-practices","slug":"/api-reference/webhooks/best-practices","pageMetadata":{"title":"Best Practices","description":"Recommendations for building reliable webhook integrations","type":"reference","last_verified":"2026-05-26","href":"/api-reference/webhooks/best-practices"},"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: \"Recommendations for building reliable webhook integrations\"\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,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`respond-quickly`,children:`Respond Quickly`}),`\n`,_jsxs(_components.p,{children:[`Return a `,_jsx(_components.strong,{children:`2xx`}),` status code as fast as possible (ideally within 1-2 seconds). Process the event payload asynchronously — for example, by adding it to a message queue.`]}),`\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:`// Good - acknowledge immediately, process later`})}),`\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:`'/webhooks'`}),_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:`#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:`send`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'OK'`}),_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:` queue`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`push`}),_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:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Process asynchronously`})]}),`\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:`// Bad - processing blocks the response`})}),`\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:`'/webhooks'`}),_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\":`#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:`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:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// This might take 10+ seconds`})]}),`\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:` updateDatabase`}),_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:`);`})]}),`\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:` sendNotification`}),_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:`);`})]}),`\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:`send`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_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:`2`,id:`always-verify-signatures`,children:`Always Verify Signatures`}),`\n`,_jsxs(_components.p,{children:[`Never trust a webhook payload without verifying the signature. See the `,_jsx(_components.a,{href:`/api-reference/webhooks/security`,children:`Security guide`}),` for implementation examples in Node.js, Python, and Go.`]}),`\n`,_jsx(Heading,{level:`2`,id:`handle-duplicates`,children:`Handle Duplicates`}),`\n`,_jsxs(_components.p,{children:[`In rare cases, the same event may be delivered more than once (e.g., due to network issues or retries). Use the `,_jsx(_components.code,{children:`X-BitByBit-Webhook-Id`}),` header to deduplicate:`]}),`\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:[_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:` processedEvents`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Set`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\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:`'/webhooks'`}),_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:` eventId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--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:`'x-bitbybit-webhook-id'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`];`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\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:`processedEvents`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`has`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`eventId`}),_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:`200`}),_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:`(`}),_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`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` processedEvents`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`add`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`eventId`}),_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 event...`})}),`\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:`send`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_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(Tip,{children:_jsx(_components.p,{children:`For production use, store processed event IDs in a database or Redis with a TTL of 24 hours instead of an in-memory Set.`})}),`\n`,_jsx(Heading,{level:`2`,id:`use-https`,children:`Use HTTPS`}),`\n`,_jsxs(_components.p,{children:[`Webhook endpoint URLs `,_jsx(_components.strong,{children:`must`}),` use HTTPS. This ensures the payload is encrypted in transit and prevents man-in-the-middle attacks.`]}),`\n`,_jsx(Heading,{level:`2`,id:`handle-retries-gracefully`,children:`Handle Retries Gracefully`}),`\n`,_jsx(_components.p,{children:`If your endpoint is temporarily unavailable, bitbybit will retry with exponential backoff. Make sure your processing logic is idempotent — processing the same event twice should produce the same result.`}),`\n`,_jsx(Heading,{level:`2`,id:`monitor-your-endpoints`,children:`Monitor Your Endpoints`}),`\n`,_jsxs(_components.p,{children:[`Check the `,_jsx(_components.strong,{children:`Delivery History`}),` in Settings > Developer to monitor webhook health. Watch for:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`High failure rates (check server logs)`}),`\n`,_jsx(_components.li,{children:`Slow response times (optimize your handler)`}),`\n`,_jsx(_components.li,{children:`Suspended endpoints (reactivate after fixing the issue)`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`prevent-timeouts`,children:`Prevent Timeouts`}),`\n`,_jsxs(_components.p,{children:[`bitbybit will wait up to `,_jsx(_components.strong,{children:`30 seconds`}),` for a response. If your handler needs more time:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Acknowledge the webhook immediately with a `,_jsx(_components.code,{children:`200`}),` response`]}),`\n`,_jsx(_components.li,{children:`Process the event in a background job or queue`}),`\n`,_jsx(_components.li,{children:`Track processing status separately`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`test-before-going-live`,children:`Test Before Going Live`}),`\n`,_jsxs(_components.p,{children:[`Use the `,_jsx(_components.strong,{children:`Send Test`}),` button in webhook settings to verify your endpoint is correctly:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Receiving the POST request`}),`\n`,_jsx(_components.li,{children:`Parsing the JSON payload`}),`\n`,_jsx(_components.li,{children:`Verifying the signature`}),`\n`,_jsx(_components.li,{children:`Returning a 2xx response`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`firewall-configuration`,children:`Firewall Configuration`}),`\n`,_jsxs(_components.p,{children:[`If your server has a firewall, ensure it allows incoming POST requests from bitbybit’s servers. The `,_jsx(_components.code,{children:`User-Agent`}),` header is always `,_jsx(_components.code,{children:`BitByBit-Webhooks/1.0`}),`.`]})]})}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":"Best Practices","description":"Recommendations for building reliable webhook integrations","type":"reference","last_verified":"2026-05-26","href":"/api-reference/webhooks/best-practices"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Respond Quickly","slug":"respond-quickly","depth":2,"children":[]},{"title":"Always Verify Signatures","slug":"always-verify-signatures","depth":2,"children":[]},{"title":"Handle Duplicates","slug":"handle-duplicates","depth":2,"children":[]},{"title":"Use HTTPS","slug":"use-https","depth":2,"children":[]},{"title":"Handle Retries Gracefully","slug":"handle-retries-gracefully","depth":2,"children":[]},{"title":"Monitor Your Endpoints","slug":"monitor-your-endpoints","depth":2,"children":[]},{"title":"Prevent Timeouts","slug":"prevent-timeouts","depth":2,"children":[]},{"title":"Test Before Going Live","slug":"test-before-going-live","depth":2,"children":[]},{"title":"Firewall Configuration","slug":"firewall-configuration","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/asmaraku/fc5a36b1d957f891/gtm.js","/_mintlify/custom/asmaraku/1c64b6fee57ecbb2/support-whatsapp.js","/_mintlify/custom/asmaraku/a513d42309b690fd/livechat-widget.js"],"subdomain":"asmaraku","siteName":"bitbybit","title":"Best Practices - bitbybit","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-03-27T07:11:49.915Z","originalFileLocation":"api-reference/webhooks/best-practices.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=\"Recommendations for building reliable webhook integrations\">\u003cmeta data-mint-head name=\"application-name\" content=\"bitbybit\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/asmaraku/mcooRqJTgM6wbzpL/_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/asmaraku/mcooRqJTgM6wbzpL/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/asmaraku/mcooRqJTgM6wbzpL/_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/asmaraku/mcooRqJTgM6wbzpL/_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/asmaraku/mcooRqJTgM6wbzpL/_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/asmaraku/mcooRqJTgM6wbzpL/_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/asmaraku/mcooRqJTgM6wbzpL/_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/asmaraku/mcooRqJTgM6wbzpL/_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/asmaraku/mcooRqJTgM6wbzpL/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Best Practices - bitbybit\">\u003cmeta data-mint-head property=\"og:description\" content=\"Recommendations for building reliable webhook integrations\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"bitbybit\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://knowledge.bitbybit.studio/api-reference/webhooks/best-practices\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://asmaraku.mintlify.site/_mintlify/api/og/v2?division=Webhooks\u0026amp;title=Best+Practices\u0026amp;description=Recommendations+for+building+reliable+webhook+integrations\u0026amp;theme=a473618703c526131e2b8363\u0026amp;signature=c4d71b9ac9bc257cdeebb8f62a60972277f1c22ad16902a6965828037bce3981\">\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=\"Best Practices - bitbybit\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Recommendations for building reliable webhook integrations\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://asmaraku.mintlify.site/_mintlify/api/og/v2?division=Webhooks\u0026amp;title=Best+Practices\u0026amp;description=Recommendations+for+building+reliable+webhook+integrations\u0026amp;theme=a473618703c526131e2b8363\u0026amp;signature=c4d71b9ac9bc257cdeebb8f62a60972277f1c22ad16902a6965828037bce3981\">\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/asmaraku/mcooRqJTgM6wbzpL/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"bitbybit\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#ff734c\">\u003clink data-mint-head rel=\"canonical\" href=\"https://knowledge.bitbybit.studio/api-reference/webhooks/best-practices\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/webhooks/best-practices.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://knowledge.bitbybit.studio/#organization\",\"name\":\"bitbybit\",\"url\":\"https://knowledge.bitbybit.studio\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/asmaraku/WlT_6AuzhITpdgTf/logo/bbb-logo-default.png?fit=max\u0026auto=format\u0026n=WlT_6AuzhITpdgTf\u0026q=85\u0026s=7690f415d4b16eb95a47bd01fe7c938d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://knowledge.bitbybit.studio#website\",\"name\":\"bitbybit\",\"url\":\"https://knowledge.bitbybit.studio\",\"publisher\":{\"@id\":\"https://knowledge.bitbybit.studio/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://knowledge.bitbybit.studio/api-reference/webhooks/best-practices#webpage\",\"url\":\"https://knowledge.bitbybit.studio/api-reference/webhooks/best-practices\",\"name\":\"Best Practices\",\"description\":\"Recommendations for building reliable webhook integrations\",\"dateModified\":\"2026-03-27T07:11:49.915Z\",\"isPartOf\":{\"@id\":\"https://knowledge.bitbybit.studio#website\"},\"breadcrumb\":{\"@id\":\"https://knowledge.bitbybit.studio/api-reference/webhooks/best-practices#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://knowledge.bitbybit.studio/api-reference/webhooks/best-practices#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Reference\",\"item\":\"https://knowledge.bitbybit.studio/api-reference/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Webhooks\",\"item\":\"https://knowledge.bitbybit.studio/api-reference/webhooks/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Best Practices\",\"item\":\"https://knowledge.bitbybit.studio/api-reference/webhooks/best-practices\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://knowledge.bitbybit.studio/api-reference/webhooks/best-practices#article\",\"headline\":\"Best Practices\",\"name\":\"Best Practices\",\"description\":\"Recommendations for building reliable webhook integrations\",\"url\":\"https://knowledge.bitbybit.studio/api-reference/webhooks/best-practices\",\"mainEntityOfPage\":{\"@id\":\"https://knowledge.bitbybit.studio/api-reference/webhooks/best-practices#webpage\"},\"dateModified\":\"2026-03-27T07:11:49.915Z\",\"publisher\":{\"@id\":\"https://knowledge.bitbybit.studio/#organization\"},\"isPartOf\":{\"@id\":\"https://knowledge.bitbybit.studio#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"bitbybit\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"bitbybit\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/webhooks/best-practices.md","siteName":"bitbybit","nav":{"global":null,"tabs":[{"tab":"Overview","pages":[{"title":"Overview","href":""}]},{"tab":"bitCRM","pages":[{"title":"bitCRM","href":"/bitcrm/overview"}]},{"tab":"bitChat","pages":[{"title":"bitChat","href":"/bitchat/overview"}]},{"tab":"bitApp","pages":[{"title":"bitApp","href":"/bitapp/overview"}]},{"tab":"bitLink","pages":[{"title":"bitLink","href":"/bitlink/overview"}]},{"tab":"bitLoyalty","pages":[{"title":"bitLoyalty","href":"/loyalty/overview"}]},{"tab":"AI Studio","pages":[{"title":"AI Studio","href":"/ai-studio/overview"}]},{"tab":"WhatsApp Commerce","pages":[{"title":"WhatsApp Commerce","href":"/whatsapp-commerce/overview"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/overview"}]},{"tab":"Settings","pages":[{"title":"Settings","href":"/settings/overview"}]},{"tab":"API Reference","groups":[{"group":"API Reference","pages":[{"title":"Introduction","sidebarTitle":"API Reference overview","href":"/api-reference/introduction"},{"group":"Getting Started","icon":"rocket","expanded":false,"pages":[{"title":"Authentication","href":"/api-reference/authentication"},{"title":"IP Whitelisting","href":"/api-reference/ip-whitelisting"},{"title":"Rate Limiting","href":"/api-reference/rate-limiting"},{"title":"Errors","href":"/api-reference/errors"}]},{"group":"Customers","icon":"users","expanded":false,"pages":[{"title":"List Customers","openapi":"GET /customers","href":"/api-reference/endpoint/customers/list"},{"title":"Get Customer","openapi":"GET /customers/{id}","href":"/api-reference/endpoint/customers/get"},{"title":"Create Customer","openapi":"POST /customers","href":"/api-reference/endpoint/customers/create"},{"title":"Update Customer","openapi":"PUT /customers/{id}","href":"/api-reference/endpoint/customers/update"},{"title":"Delete Customer","openapi":"DELETE /customers/{id}","href":"/api-reference/endpoint/customers/delete"}]},{"group":"Loyalty (bitLogin)","icon":"coins","expanded":false,"pages":[{"title":"Get Loyalty Integration","openapi":"GET /bitlogin/api/open/v1/loyalty/integration","href":"/api-reference/endpoint/loyalty-bitlogin/integration-get"},{"title":"Set Loyalty Integration","openapi":"POST /bitlogin/api/open/v1/loyalty/integration","href":"/api-reference/endpoint/loyalty-bitlogin/integration-set"},{"title":"Get Point Conversion","openapi":"GET /bitlogin/api/open/v1/loyalty/point-conversion","href":"/api-reference/endpoint/loyalty-bitlogin/point-conversion-get"},{"title":"Set Point Conversion","openapi":"POST /bitlogin/api/open/v1/loyalty/point-conversion","href":"/api-reference/endpoint/loyalty-bitlogin/point-conversion-set"},{"title":"List Reward Options","openapi":"GET /bitlogin/api/open/v1/loyalty/reward-options","href":"/api-reference/endpoint/loyalty-bitlogin/reward-options-list"},{"title":"Create Reward Option","openapi":"POST /bitlogin/api/open/v1/loyalty/reward-options","href":"/api-reference/endpoint/loyalty-bitlogin/reward-options-create"},{"title":"Get Reward Option","openapi":"GET /bitlogin/api/open/v1/loyalty/reward-options/{id}","href":"/api-reference/endpoint/loyalty-bitlogin/reward-options-get"},{"title":"Update Reward Option","openapi":"PUT /bitlogin/api/open/v1/loyalty/reward-options/{id}","href":"/api-reference/endpoint/loyalty-bitlogin/reward-options-update"},{"title":"Delete Reward Option","openapi":"DELETE /bitlogin/api/open/v1/loyalty/reward-options/{id}","href":"/api-reference/endpoint/loyalty-bitlogin/reward-options-delete"}]},{"group":"Loyalty (Customer)","icon":"gift","expanded":false,"pages":[{"title":"Loyalty API Overview","href":"/api-reference/endpoint/loyalty-customers/overview"},{"title":"Get Loyalty Reward Options","openapi":"GET /customer/api/open/v1/loyalty/reward-options","href":"/api-reference/endpoint/loyalty-customers/reward-options"},{"title":"Get Loyalty Wallet","openapi":"GET /customer/api/open/v1/loyalty/customers/{customerId}/wallet","href":"/api-reference/endpoint/loyalty-customers/wallet"},{"title":"Adjust Loyalty Points","openapi":"POST /customer/api/open/v1/loyalty/customers/{customerId}/points/adjust","href":"/api-reference/endpoint/loyalty-customers/points-adjust"},{"title":"Redeem Loyalty Reward","openapi":"POST /customer/api/open/v1/loyalty/customers/{customerId}/redeem","href":"/api-reference/endpoint/loyalty-customers/redeem"},{"title":"Get Customer Redemptions","openapi":"GET /customer/api/open/v1/loyalty/customers/{customerId}/redemptions","href":"/api-reference/endpoint/loyalty-customers/redemptions"},{"title":"Get Redeemed Points Summary","openapi":"GET /customer/api/open/v1/loyalty/customers/{customerId}/redemptions/summary","href":"/api-reference/endpoint/loyalty-customers/redeemed-summary"},{"title":"Get Point History","openapi":"GET /customer/api/open/v1/loyalty/customers/{customerId}/history","href":"/api-reference/endpoint/loyalty-customers/point-history"},{"title":"Get Customer Timeline","openapi":"GET /customer/api/open/v1/loyalty/customers/{customerId}/timeline","href":"/api-reference/endpoint/loyalty-customers/timeline"},{"title":"Reward Redemption Summary List","openapi":"GET /customer/api/open/v1/loyalty/rewards/redemptions/summary","href":"/api-reference/endpoint/loyalty-customers/redeem-summary-list"},{"title":"Reward Redemption Summary Detail","openapi":"GET /customer/api/open/v1/loyalty/rewards/{rewardOptionId}/redemptions/summary","href":"/api-reference/endpoint/loyalty-customers/redeem-summary-detail"},{"title":"Reward Redeemers","openapi":"GET /customer/api/open/v1/loyalty/rewards/{rewardOptionId}/redeemers","href":"/api-reference/endpoint/loyalty-customers/redeemers"}]},{"group":"Orders","icon":"receipt","expanded":false,"pages":[{"title":"List Orders","openapi":"GET /orders","href":"/api-reference/endpoint/orders/list"},{"title":"Get Order","openapi":"GET /orders/{id}","href":"/api-reference/endpoint/orders/get"},{"title":"Get Order Shipping","openapi":"GET /orders/{id}/shipping","href":"/api-reference/endpoint/orders/get-shipping"},{"title":"Create Order","openapi":"POST /orders","href":"/api-reference/endpoint/orders/create"},{"title":"Update Order","openapi":"PUT /orders/{id}","href":"/api-reference/endpoint/orders/update"}]},{"group":"Shipping","icon":"truck","expanded":false,"pages":[{"title":"Shipping overview","href":"/api-reference/endpoint/shipping/overview"},{"group":"Store Locations","icon":"location-dot","expanded":false,"pages":[{"title":"List store locations","openapi":"GET /shipping/store-locations","href":"/api-reference/endpoint/shipping/list-store-locations"},{"title":"Get store location","openapi":"GET /shipping/store-locations/{id}","href":"/api-reference/endpoint/shipping/get-store-location"},{"title":"Create store location","openapi":"POST /shipping/store-locations","href":"/api-reference/endpoint/shipping/create-store-location"},{"title":"Update store location","openapi":"PUT /shipping/store-locations/{id}","href":"/api-reference/endpoint/shipping/update-store-location"},{"title":"Delete store location","openapi":"DELETE /shipping/store-locations/{id}","href":"/api-reference/endpoint/shipping/delete-store-location"}]},{"group":"Providers","icon":"truck-fast","expanded":false,"pages":[{"title":"List shipping providers","openapi":"GET /shipping/providers","href":"/api-reference/endpoint/shipping/list-providers"},{"title":"Get provider services","openapi":"GET /shipping/providers/{provider}/services","href":"/api-reference/endpoint/shipping/get-provider-services"}]},{"group":"Coverage","icon":"map-location-dot","expanded":false,"pages":[{"title":"List provinces","openapi":"GET /shipping/coverage/provinces","href":"/api-reference/endpoint/shipping/coverage-provinces"},{"title":"List cities","openapi":"GET /shipping/coverage/cities","href":"/api-reference/endpoint/shipping/coverage-cities"},{"title":"List districts","openapi":"GET /shipping/coverage/districts","href":"/api-reference/endpoint/shipping/coverage-districts"},{"title":"List sub-districts","openapi":"GET /shipping/coverage/sub-districts","href":"/api-reference/endpoint/shipping/coverage-sub-districts"}]},{"title":"Calculate shipping fee","openapi":"POST /shipping/calculate-fee","href":"/api-reference/endpoint/shipping/calculate-fee"},{"group":"Shipments","icon":"boxes-stacked","expanded":false,"pages":[{"title":"List shipments","openapi":"GET /shipping/shipments","href":"/api-reference/endpoint/shipping/list-shipments"},{"title":"Get shipment","openapi":"GET /shipping/shipments/{id}","href":"/api-reference/endpoint/shipping/get-shipment"},{"title":"Create shipment","openapi":"POST /shipping/shipments","href":"/api-reference/endpoint/shipping/create-shipment"},{"title":"Update shipment","openapi":"PATCH /shipping/shipments/{id}","href":"/api-reference/endpoint/shipping/update-shipment"},{"title":"Cancel shipment","openapi":"POST /shipping/shipments/{id}/cancel","href":"/api-reference/endpoint/shipping/cancel-shipment"},{"title":"Get shipment tracking","openapi":"GET /shipping/shipments/{id}/tracking","href":"/api-reference/endpoint/shipping/get-shipment-tracking"}]}]},{"group":"Products","icon":"box","expanded":false,"pages":[{"title":"List Products","openapi":"GET /products","href":"/api-reference/endpoint/products/list"},{"title":"Get Product","openapi":"GET /products/{id}","href":"/api-reference/endpoint/products/get"},{"title":"Create Product","openapi":"POST /products","href":"/api-reference/endpoint/products/create"},{"title":"Update Product","openapi":"PUT /products/{id}","href":"/api-reference/endpoint/products/update"},{"title":"Delete Product","openapi":"DELETE /products/{id}","href":"/api-reference/endpoint/products/delete"}]},{"group":"Messaging","icon":"comments","expanded":false,"pages":[{"title":"Send Message","openapi":"POST /messages/send","href":"/api-reference/endpoint/messages/send"},{"title":"Send Template Message","openapi":"POST /messages/send-template","href":"/api-reference/endpoint/messages/send-template"},{"title":"List Request History","openapi":"GET /messages/requests","href":"/api-reference/endpoint/messages/requests"},{"title":"Get Message","openapi":"GET /messages/{messageId}","href":"/api-reference/endpoint/messages/get"}]},{"group":"Analytics","icon":"chart-column","expanded":false,"pages":[{"title":"Overview","href":"/api-reference/endpoint/analytics/overview"},{"title":"Get Agent Analytics","openapi":"GET /analytics/agents","href":"/api-reference/endpoint/analytics/agents"}]},{"group":"Webhooks","icon":"webhook","expanded":false,"pages":[{"title":"Webhooks Overview","href":"/api-reference/webhooks/overview"},{"title":"Webhook Security","href":"/api-reference/webhooks/security"},{"title":"Webhook Events","description":"Complete catalog of available webhook event types","href":"/api-reference/webhooks/events"},{"title":"Best Practices","href":"/api-reference/webhooks/best-practices"}]}]}]}]},"basePath":"","title":"Best Practices - bitbybit","deploymentId":"dpl_57NA6NKtrcUBhuxv6Tm2hAi21TK4","buildId":"dpl_57NA6NKtrcUBhuxv6Tm2hAi21TK4","dynamics":[],"chunks":[]}