How to Detect and Process Charging Sessions with Webhooks
Learn how to use Smartcar webhooks to detect when a vehicle starts and ends charging, and how to process charging session data.
Smartcar webhooks make it easy to detect and process vehicle charging sessions in real time. This guide explains how to configure your webhook, handle charging events, and process charging session data in your backend.
1
Configure Your Webhook for Charging Events
In the Smartcar Dashboard, create or edit a webhook integration. Under Triggers, select the following events:
Charge.IsCharging
Charge.IsChargingCableConnected
These signals will act as triggers for detecting when a vehicle starts and stops charging and when it is plugged in or unplugged. Whenever these signals change, Smartcar will send a webhook event to your configured endpoint.
Next, you’ll configure your data. This is the information you want to receive in your webhook payload every time you receive a webhook event. Triggers are included by default, but you can also add additional signals to the data payload, such as:
Charge.StateOfCharge (included as a trigger)
Charge.ChargingCurrent (included as a trigger)
Charge.ActiveLimit
Charge.Amperage
Charge.Voltage
Charge.Wattage
Charge.EnergyAdded
Charge.TimeToComplete
TractionBattery.Range
TractionBattery.NominalCapacity
Location.PreciseLocation
These data signals will be delivered for every webhook event, allowing you to track the state of charge and other relevant metrics while the vehicle is charging.
Next, provide your webhook URL where Smartcar will send the events. Make sure your endpoint is publicly accessible and can handle POST requests. You can choose to auto enroll all your vehicles to this webhook or manually subscribe vehicles later (you can do this from the Dashboard). For this guide, select “don’t subscribe any vehicles”.
Now it is time to save and verify your webhook.
2
Validate Webhook Events
Smartcar will send a verification request to your endpoint, which you must respond to with a 200 OK status code to complete the setup (see Webhook Verification guide).
Once verified, you will start to receive vehicle data for the vehicles you have subscribed to this webhook. For this guide, we chose not to auto subscribe vehicles, so let’s head over to the Smartcar Dashboard to manually subscribe a vehicle to your webhook.
Select a vehicle from your list of connected vehicles and click on the three dots action menu to the right of the row and click subscribe. Select your newly created webhook from the options and click subscribe.
Subscribe a vehicle to a webhook in the Smartcar Dashboard
At this point, your webhook is fully configured to receive charging events from the subscribed vehicle. Now let’s handle the incoming webhook events in your backend.Every webhook will include an eventId and an eventType field. The eventType will indicate the type of event that occurred, such as VEHICLE_STATE or VEHICLE_ERROR.
Your handler should gracefully handle both event types. For VEHICLE_STATE events, you will receive the updated vehicle data. For VEHICLE_ERROR events, you may want to log the error.
For VEHICLE_STATE events, you will receive the data in a data property of the payload. There will also be an array of signals under a triggers property that caused the event to be sent. Lastly, you will also receive a meta property with additional context about the event, such as the webhook ID, name, delivery ID, delivery timestamp, etc.
When a vehicle starts charging, you will receive a webhook event with the eventType of VEHICLE_STATE and the Charge.IsCharging signal set to true. When the vehicle stops charging, you will receive another event with Charge.IsCharging set to false. You can use these events to track the start and end of each charging session.Example event payload:
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"smartcar","colors":{"primary":"#3E577D","light":"#3E577D","dark":"#3E577D"},"logo":{"light":"https://mintcdn.com/smartcar-docs/YqcNJdgEDgXpXtEG/logo/light.png?fit=max\u0026auto=format\u0026n=YqcNJdgEDgXpXtEG\u0026q=85\u0026s=c8947958467fe403a12f769afada9b53","dark":"https://mintcdn.com/smartcar-docs/YqcNJdgEDgXpXtEG/logo/dark.png?fit=max\u0026auto=format\u0026n=YqcNJdgEDgXpXtEG\u0026q=85\u0026s=af6b6bcabc2fe0bc4bbd976ee5b71a36","href":"https://smartcar.com/"},"favicon":"https://mintcdn.com/smartcar-docs/NtuX9OSBHLxFwWIa/favicon.png?fit=max\u0026auto=format\u0026n=NtuX9OSBHLxFwWIa\u0026q=85\u0026s=de01fc4e56d5368d441e322ac50e3f81","api":{"playground":{"display":"interactive","proxy":false},"examples":{"prefill":true}},"navbar":{"links":[{"href":"https://dashboard.smartcar.com/login/","label":"Log in"},{"href":"https://dashboard.smartcar.com/signup/","label":"Sign up"}],"primary":{"type":"button","label":"Request a Demo","href":"https://smartcar.com/pricing/"}},"footer":{"socials":{"linkedin":"https://www.linkedin.com/company/smartcar","github":"https://github.com/smartcar","facebook":"https://www.facebook.com/smartcar","instagram":"https://www.instagram.com/mysmartcar","x":"https://x.com/mysmartcar"},"links":[{"header":"Product","items":[{"label":"Vehicle signals","href":"https://smartcar.com/product/signals"},{"label":"Vehicle commands","href":"https://smartcar.com/product/commands"},{"label":"Compatible brands","href":"https://smartcar.com/product/compatible-vehicles"},{"label":"Connect","href":"https://smartcar.com/product/connect"},{"label":"Integrations","href":"https://smartcar.com/product/integrations"},{"label":"Global coverage","href":"https://smartcar.com/global"},{"label":"Teams","href":"https://smartcar.com/product/teams"},{"label":"Vehicle management","href":"https://smartcar.com/product/vehicle-management"},{"label":"Analytics","href":"https://smartcar.com/product/analytics"},{"label":"Pricing","href":"https://smartcar.com/pricing"},{"label":"Status","href":"https://status.smartcar.com/"},{"label":"Brand reliability","href":"https://brandreliability.smartcar.com/"},{"label":"Data security","href":"https://smartcar.com/data-security"}]},{"header":"Energy Solutions","items":[{"label":"DERMs","href":"https://smartcar.com/industries/derms-software"},{"label":"Virtual Power Plants (VPPs)","href":"https://smartcar.com/industries/virtual-power-plant"},{"label":"Utilities","href":"https://smartcar.com/utilities"},{"label":"Home energy management","href":"https://smartcar.com/industries/home-energy-management"},{"label":"EV charging networks","href":"https://smartcar.com/industries/ev-charging"},{"label":"Charge point operators","href":"https://smartcar.com/industries/charge-point-operator"},{"label":"E-mobility service providers","href":"https://smartcar.com/industries/e-mobility-service-providers"}]},{"header":"Solutions","items":[{"label":"Repair and maintenance","href":"https://smartcar.com/industries/repair-maintenance"},{"label":"Autocare software","href":"https://smartcar.com/industries/autocare-software"},{"label":"Auto dealership","href":"https://smartcar.com/industries/auto-dealership-software"},{"label":"Roadside assistance","href":"https://smartcar.com/industries/roadside-assistance"},{"label":"Vehicle history reports","href":"https://smartcar.com/industries/vehicle-history-reports"},{"label":"Small fleet management","href":"https://smartcar.com/industries/fleet-management"},{"label":"Car subscription service","href":"https://smartcar.com/industries/car-subscription-services"},{"label":"Car sharing","href":"https://smartcar.com/industries/car-sharing"},{"label":"Ride hailing","href":"https://smartcar.com/industries/ride-sharing"},{"label":"Car rentals","href":"https://smartcar.com/industries/car-rental"},{"label":"Auto insurance","href":"https://smartcar.com/industries/auto-insurance"},{"label":"Warranty software","href":"https://smartcar.com/industries/warranty-management-software"},{"label":"Road usage charge","href":"https://smartcar.com/industries/road-usage-charge"}]},{"header":"Resources","items":[{"label":"Customers","href":"https://smartcar.com/customers"},{"label":"Blog","href":"https://smartcar.com/blog"},{"label":"For vehicle owners","href":"https://smartcar.com/vehicle-owners"},{"label":"For automakers","href":"https://smartcar.com/automakers"},{"label":"Terms of service","href":"https://smartcar.com/legal/terms"},{"label":"Privacy policy","href":"https://smartcar.com/legal/privacy"},{"label":"End user privacy policy","href":"https://smartcar.com/legal/end-user-privacy"},{"label":"Acceptable use","href":"https://smartcar.com/legal/acceptable-use"},{"label":"Data processing","href":"https://smartcar.com/legal/dpa"},{"label":"Vulnerability disclosure program","href":"https://smartcar.com/vdp"},{"label":"mySmartcar","href":"https://my.smartcar.com"}]}]},"search":{"prompt":"✨ Ask Smartcar"},"integrations":{"koala":{"publicApiKey":"pk_3a64cc4d12d7b978edffae0afd143df5b291"},"ga4":{"measurementId":"G-QHNXS91VZC"}},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"smartcar-docs","hasAudioNarration":false,"actualSubdomain":"smartcar-docs","customDomains":["smartcar.com"],"gitSource":{"type":"github","owner":"smartcar","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adbe250d05dd52d1c87e7c2","collectionId":"4e81bf89-a564-4084-82d5-a2f1a4b41ad6","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adbe250d05dd52d1c87e7c2"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6adbe250d05dd52d1c87e7c2","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"API \u0026 Integrations Reference","count":147},{"language":"default","tag":"API 2.0 Reference (Legacy)","count":64},{"language":"default","tag":"Vehicle Data","count":48},{"language":"default","tag":"Help Center","count":36},{"language":"default","tag":"Getting Started","count":28},{"language":"default","tag":"Make Specific","count":27},{"language":"default","tag":"Introduction","count":26},{"language":"default","tag":"Tesla","count":26},{"language":"default","tag":"Webhooks","count":25},{"language":"default","tag":"Errors","count":20}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","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":"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":"llms-txt-v2","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":"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":"byok-sep-25","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":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","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":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":".hsfc-Form .hsfc-FieldLabel span:is(.dark *),.hsfc-Form .hsfc-RichText p:is(.dark *),.hsfc-PostSubmit .hsfc-RichText p:is(.dark *){color:#a0a1a2}.dark\\:text-primary-light:is(.dark *){color:#378ff0}.hsfc-FormWrapper .hsfc-Step .hsfc-Step__Content{padding:0 10px 20px;background-color:rgb(113 113 122/10%);border-radius:10px}.hsfc-FormWrapper .hsfc-Step .hsfc-Step__Content .hsfc-Row{margin-bottom:4px}.hsfc-FormWrapper .hsfc-Step .hsfc-Step__Content .hsfc-NavigationRow{margin-top:4px}.osano-cm-powered-by__link.osano-cm-link,.osano-cm-window__widget{display:none}.osano-cm-close svg{stroke:#fff!important}.osano-cm-dialog{font-family:Inter,ui-sans-serif,system-ui,sans-serif;border-radius:12px;box-shadow:0 -4px 24px rgba(0,0,0,.08);padding:20px 24px;background-color:#fff;color:#374151;border-top:1px solid #e5e7eb}.osano-cm-dialog__title{font-size:.9rem;font-weight:600;color:#111827;margin-bottom:6px}.osano-cm-dialog__description,.osano-cm-message{font-size:.825rem;color:#6b7280;line-height:1.5}.osano-cm-storage-policy{font-size:.825rem;line-height:1.5}.osano-cm-message:is(.dark *){color:#fff}.osano-cm-info a,.osano-cm-storage-policy{color:#3e577d}.osano-cm-button{font-family:Inter,ui-sans-serif,system-ui,sans-serif;font-size:.825rem;font-weight:500;border-radius:6px;padding:7px 14px;transition:opacity .15s ease}.osano-cm-button:hover{opacity:.85}.osano-cm-accept,.osano-cm-button--save,.osano-cm-save{background-color:#3e577d!important;color:#fff!important;border:0!important}.osano-cm-deny,.osano-cm-manage{background-color:transparent!important;color:#3e577d!important;border:1px solid #3e577d!important}.osano-cm-manage{border:0!important;padding-left:4px!important;padding-right:4px!important;text-decoration:underline;text-underline-offset:2px}.osano-cm-dialog:is(.dark *){background-color:#1f2937;color:#d1d5db;border-top-color:#374151;box-shadow:0 -4px 24px rgba(0,0,0,.3)}.osano-cm-dialog__title:is(.dark *){color:#f9fafb}.osano-cm-dialog__description:is(.dark *){color:#9ca3af}.osano-cm-info a:is(.dark *),.osano-cm-storage-policy:is(.dark *){color:#93b4d8}.osano-cm-deny:is(.dark *){color:#93b4d8!important;border-color:#93b4d8!important}.osano-cm-manage:is(.dark *){color:#93b4d8!important}.osano-cm-info{font-family:Inter,ui-sans-serif,system-ui,sans-serif;border-radius:0;box-shadow:0 -4px 24px rgba(0,0,0,.08);background-color:#fff;color:#374151;border-top:1px solid #e5e7eb;min-width:480px;overflow-y:visible}.osano-cm-header,.osano-cm-info-dialog-header{background-color:#fff!important}.osano-cm-info__title{font-size:.9rem;font-weight:600;color:#111827}.osano-cm-info__description,.osano-cm-info__list{font-size:.825rem;color:#6b7280;line-height:1.5}.osano-cm-toggle__switch{background-color:#e5e7eb!important;border-color:#3e577d!important}.osano-cm-toggle__input:checked+.osano-cm-toggle__switch{background-color:#3e577d!important;border-color:#3e577d!important}.osano-cm-toggle__input:checked+.osano-cm-toggle__switch::after{background-color:#e5e7eb!important}.osano-cm-info:is(.dark *){background-color:#1f2937;color:#d1d5db;border-top-color:#374151;box-shadow:0 -4px 24px rgba(0,0,0,.3)}.osano-cm-header:is(.dark *),.osano-cm-info-dialog-header:is(.dark *){background-color:#1f2937!important}.osano-cm-info__title:is(.dark *){color:#f9fafb}.osano-cm-info__description:is(.dark *),.osano-cm-info__list:is(.dark *){color:#9ca3af}.osano-cm-toggle__switch:is(.dark *){background-color:#374151!important}"}],"page":{"pagePath":"getting-started/how-to/detect-charging-session","slug":"/getting-started/how-to/detect-charging-session","pageMetadata":{"title":"How to Detect and Process Charging Sessions with Webhooks","sidebarTitle":"Detect Charging Sessions","description":"Learn how to use Smartcar webhooks to detect when a vehicle starts and ends charging, and how to process charging session data.","href":"/getting-started/how-to/detect-charging-session"},"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 how to use Smartcar webhooks to detect when a vehicle starts and ends charging, and how to process charging session data.\"\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`,hr:`hr`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,OptimizedImage,Step,Steps}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Smartcar webhooks make it easy to detect and process vehicle charging sessions in real time. This guide explains how to configure your webhook, handle charging events, and process charging session data in your backend.`}),`\n`,_jsxs(Steps,{children:[_jsxs(Step,{title:`Configure Your Webhook for Charging Events`,children:[_jsxs(_components.p,{children:[`In the `,_jsx(_components.a,{href:`https://dashboard.smartcar.com/integrations`,children:`Smartcar Dashboard`}),`, create or edit a webhook integration. Under `,_jsx(`b`,{children:`Triggers`}),`, select the following events:`]}),_jsxs(`ul`,{children:[_jsx(`li`,{children:`Charge.IsCharging`}),_jsx(`li`,{children:`Charge.IsChargingCableConnected`})]}),_jsxs(_components.p,{children:[`These signals will act as triggers for detecting when a vehicle starts and stops charging and when it is plugged in or unplugged. Whenever these signals change, Smartcar will send a webhook event to your configured endpoint.\nNext, you’ll configure your `,_jsx(_components.strong,{children:`data`}),`. This is the information you want to receive in your webhook payload every time you receive a webhook event. Triggers are included by default, but you can also add additional signals to the data payload, such as:`]}),_jsxs(`ul`,{children:[_jsx(`li`,{children:`Charge.StateOfCharge (included as a trigger)`}),_jsx(`li`,{children:`Charge.ChargingCurrent (included as a trigger)`}),_jsx(`li`,{children:`Charge.ActiveLimit`}),_jsx(`li`,{children:`Charge.Amperage`}),_jsx(`li`,{children:`Charge.Voltage`}),_jsx(`li`,{children:`Charge.Wattage`}),_jsx(`li`,{children:`Charge.EnergyAdded`}),_jsx(`li`,{children:`Charge.TimeToComplete`}),_jsx(`li`,{children:`TractionBattery.Range`}),_jsx(`li`,{children:`TractionBattery.NominalCapacity`}),_jsx(`li`,{children:`Location.PreciseLocation`})]}),_jsx(_components.p,{children:`These data signals will be delivered for every webhook event, allowing you to track the state of charge and other relevant metrics while the vehicle is charging.\nNext, provide your webhook URL where Smartcar will send the events. Make sure your endpoint is publicly accessible and can handle POST requests. You can choose to auto enroll all your vehicles to this webhook or manually subscribe vehicles later (you can do this from the Dashboard). For this guide, select “don’t subscribe any vehicles”.\nNow it is time to save and verify your webhook.`})]}),_jsxs(Step,{title:`Validate Webhook Events`,children:[_jsxs(_components.p,{children:[`Smartcar will send a verification request to your endpoint, which you must respond to with a 200 OK status code to complete the setup (see `,_jsx(_components.a,{href:`/integrations/webhooks/callback-verification`,children:`Webhook Verification guide`}),`).\nOnce verified, you will start to receive vehicle data for the vehicles you have subscribed to this webhook. For this guide, we chose not to auto subscribe vehicles, so let’s head over to the `,_jsx(_components.a,{href:`https://dashboard.smartcar.com/vehicles`,children:`Smartcar Dashboard`}),` to manually subscribe a vehicle to your webhook.\nSelect a vehicle from your list of connected vehicles and click on the three dots action menu to the right of the row and click subscribe. Select your newly created webhook from the options and click subscribe.`]}),_jsx(Frame,{type:`simple`,caption:`Subscribe a vehicle to a webhook in the Smartcar Dashboard`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/smartcar-docs/YqcNJdgEDgXpXtEG/images/how-to/subscribe-vehicles-from-dashboard.png?fit=max\u0026auto=format\u0026n=YqcNJdgEDgXpXtEG\u0026q=85\u0026s=5bd20bb10e660b3297ef2de1dbf4c022`,alt:`Smartcar Dashboard showing how to subscribe a vehicle to a webhook.`,\"data-og-width\":`3298`,width:`3298`,\"data-og-height\":`2048`,height:`2048`,\"data-path\":`images/how-to/subscribe-vehicles-from-dashboard.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/smartcar-docs/YqcNJdgEDgXpXtEG/images/how-to/subscribe-vehicles-from-dashboard.png?w=280\u0026fit=max\u0026auto=format\u0026n=YqcNJdgEDgXpXtEG\u0026q=85\u0026s=051e639fdee31c606c0980f8f304b8ff 280w, https://mintcdn.com/smartcar-docs/YqcNJdgEDgXpXtEG/images/how-to/subscribe-vehicles-from-dashboard.png?w=560\u0026fit=max\u0026auto=format\u0026n=YqcNJdgEDgXpXtEG\u0026q=85\u0026s=f4cbba0bde2464efdc3cf1c78ad78bdf 560w, https://mintcdn.com/smartcar-docs/YqcNJdgEDgXpXtEG/images/how-to/subscribe-vehicles-from-dashboard.png?w=840\u0026fit=max\u0026auto=format\u0026n=YqcNJdgEDgXpXtEG\u0026q=85\u0026s=782a6977e48b8e3ba1c8e40cd7cc5433 840w, https://mintcdn.com/smartcar-docs/YqcNJdgEDgXpXtEG/images/how-to/subscribe-vehicles-from-dashboard.png?w=1100\u0026fit=max\u0026auto=format\u0026n=YqcNJdgEDgXpXtEG\u0026q=85\u0026s=953979e3045a081ab1b20c6f792e0b14 1100w, https://mintcdn.com/smartcar-docs/YqcNJdgEDgXpXtEG/images/how-to/subscribe-vehicles-from-dashboard.png?w=1650\u0026fit=max\u0026auto=format\u0026n=YqcNJdgEDgXpXtEG\u0026q=85\u0026s=aa7e740e2f42c98206dd735f89a48286 1650w, https://mintcdn.com/smartcar-docs/YqcNJdgEDgXpXtEG/images/how-to/subscribe-vehicles-from-dashboard.png?w=2500\u0026fit=max\u0026auto=format\u0026n=YqcNJdgEDgXpXtEG\u0026q=85\u0026s=7655f451c559dd4ca247423a4f9884d4 2500w`})})]})]}),`\n`,_jsx(_components.p,{children:`At this point, your webhook is fully configured to receive charging events from the subscribed vehicle. Now let’s handle the incoming webhook events in your backend.`}),`\n`,_jsxs(_components.p,{children:[`Every webhook will include an `,_jsx(_components.code,{children:`eventId`}),` and an `,_jsx(_components.code,{children:`eventType`}),` field. The `,_jsx(_components.code,{children:`eventType`}),` will indicate the type of event that occurred, such as `,_jsx(_components.code,{children:`VEHICLE_STATE`}),` or `,_jsx(_components.code,{children:`VEHICLE_ERROR`}),`.\nYour handler should gracefully handle both event types. For `,_jsx(_components.code,{children:`VEHICLE_STATE`}),` events, you will receive the updated vehicle data. For `,_jsx(_components.code,{children:`VEHICLE_ERROR`}),` events, you may want to log the error.\nFor `,_jsx(_components.code,{children:`VEHICLE_STATE`}),` events, you will receive the data in a `,_jsx(_components.code,{children:`data`}),` property of the payload. There will also be an array of signals under a `,_jsx(_components.code,{children:`triggers`}),` property that caused the event to be sent. Lastly, you will also receive a `,_jsx(_components.code,{children:`meta`}),` property with additional context about the event, such as the webhook ID, name, delivery ID, delivery timestamp, etc.`]}),`\n`,_jsx(Heading,{level:`3`,id:`how-to-track-charging-sessions`,children:`How to track charging sessions`}),`\n`,_jsxs(_components.p,{children:[`When a vehicle starts charging, you will receive a webhook event with the `,_jsx(_components.code,{children:`eventType`}),` of `,_jsx(_components.code,{children:`VEHICLE_STATE`}),` and the `,_jsx(_components.code,{children:`Charge.IsCharging`}),` signal set to `,_jsx(_components.code,{children:`true`}),`. When the vehicle stops charging, you will receive another event with `,_jsx(_components.code,{children:`Charge.IsCharging`}),` set to `,_jsx(_components.code,{children:`false`}),`. You can use these events to track the start and end of each charging session.`]}),`\n`,_jsx(_components.p,{children:`Example event payload:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`52`,language:`json`,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:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`52`,children:[_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"eventId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"a7738a15-7ee2-40b3-9815-823d146230cd\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"eventType\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"VEHICLE_STATE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"user\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"deee49b6-d638-4be4-82dc-121ea613eed9\"`})]}),`\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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"vehicle\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"829e30ab-5a13-40b5-9f8a-8538af86ed95\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"make\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Tesla\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Model 3\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"year\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`2020`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"mode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"live\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"powertrainType\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"BEV\"`})]}),`\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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"signals\"`}),_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"charge-ischarging\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"IsCharging\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"group\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Charge\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`})]}),`\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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SUCCESS\"`})]}),`\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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"meta\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"oemUpdatedAt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1754365413366`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"retrievedAt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1754365413366`})]}),`\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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"triggers\"`}),_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:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SIGNAL_UPDATED\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"signal\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"charge-ischarging\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"IsCharging\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"group\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Charge\"`})]}),`\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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"meta\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"webhookId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"f1c2d3e4-5678-90ab-cdef-1234567890ab\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"webhookName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"My Charging Webhook\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"deliveryId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"b1c2d3e4-5678-90ab-cdef-1234567890ab\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"deliveryTimestamp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2024-08-04T17:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"mode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"LIVE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"signalCount\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`})]}),`\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(_components.p,{children:`Tip: Always validate the webhook signature to ensure the request is from Smartcar.`}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`what’s-next`,children:`What’s Next`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/getting-started/how-to/configure-permissions`,children:`How to Configure Permissions`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/getting-started/how-to/api-authentication`,children:`API Authentication Setup`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/api-reference/webhooks/subscribe-webhook`,children:`API Reference: Webhooks`})}),`\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":"How to Detect and Process Charging Sessions with Webhooks","sidebarTitle":"Detect Charging Sessions","description":"Learn how to use Smartcar webhooks to detect when a vehicle starts and ends charging, and how to process charging session data.","href":"/getting-started/how-to/detect-charging-session"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"How to track charging sessions","slug":"how-to-track-charging-sessions","depth":3,"children":[]},{"title":"What’s Next","slug":"what’s-next","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/smartcar-docs/079ff91450d16dd6/osano.js"],"subdomain":"smartcar-docs","siteName":"smartcar","title":"How to Detect and Process Charging Sessions with Webhooks - smartcar","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-06-17T18:09:01.545Z","originalFileLocation":"getting-started/how-to/detect-charging-session.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 how to use Smartcar webhooks to detect when a vehicle starts and ends charging, and how to process charging session data.\">\u003cmeta data-mint-head name=\"application-name\" content=\"smartcar\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/smartcar-docs/mm2dBjYiMlWQ-TlV/_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=\"/docs/mintlify-assets/_mintlify/favicons/smartcar-docs/mm2dBjYiMlWQ-TlV/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/smartcar-docs/mm2dBjYiMlWQ-TlV/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/smartcar-docs/mm2dBjYiMlWQ-TlV/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/smartcar-docs/mm2dBjYiMlWQ-TlV/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/smartcar-docs/mm2dBjYiMlWQ-TlV/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/smartcar-docs/mm2dBjYiMlWQ-TlV/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/smartcar-docs/mm2dBjYiMlWQ-TlV/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/smartcar-docs/mm2dBjYiMlWQ-TlV/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"How to Detect and Process Charging Sessions with Webhooks - smartcar\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn how to use Smartcar webhooks to detect when a vehicle starts and ends charging, and how to process charging session data.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"smartcar\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://smartcar.com/docs/getting-started/how-to/detect-charging-session\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://smartcar-docs.mintlify.app/_mintlify/api/og/v2?division=How-To+Guides\u0026amp;title=How+to+Detect+and+Process+Charging+Sessions+with+Webhooks\u0026amp;description=Learn+how+to+use+Smartcar+webhooks+to+detect+when+a+vehicle+starts+and+ends+charging%2C+and+how+to+process+charging+session+data.\u0026amp;theme=254a1f83924c8d0c1b4b5b15\u0026amp;signature=8906409d09d4ec364ecc779dc1e51c7f6121346299fbf36fca59155fd0c30b58\">\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=\"How to Detect and Process Charging Sessions with Webhooks - smartcar\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn how to use Smartcar webhooks to detect when a vehicle starts and ends charging, and how to process charging session data.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://smartcar-docs.mintlify.app/_mintlify/api/og/v2?division=How-To+Guides\u0026amp;title=How+to+Detect+and+Process+Charging+Sessions+with+Webhooks\u0026amp;description=Learn+how+to+use+Smartcar+webhooks+to+detect+when+a+vehicle+starts+and+ends+charging%2C+and+how+to+process+charging+session+data.\u0026amp;theme=254a1f83924c8d0c1b4b5b15\u0026amp;signature=8906409d09d4ec364ecc779dc1e51c7f6121346299fbf36fca59155fd0c30b58\">\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=\"/docs/mintlify-assets/_mintlify/favicons/smartcar-docs/mm2dBjYiMlWQ-TlV/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"smartcar\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3E577D\">\u003clink data-mint-head rel=\"canonical\" href=\"https://smartcar.com/docs/getting-started/how-to/detect-charging-session\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/getting-started/how-to/detect-charging-session.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://smartcar.com/#organization\",\"name\":\"smartcar\",\"url\":\"https://smartcar.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/smartcar-docs/YqcNJdgEDgXpXtEG/logo/light.png?fit=max\u0026auto=format\u0026n=YqcNJdgEDgXpXtEG\u0026q=85\u0026s=c8947958467fe403a12f769afada9b53\"}},{\"@type\":\"WebSite\",\"@id\":\"https://smartcar.com/docs#website\",\"name\":\"smartcar\",\"url\":\"https://smartcar.com/docs\",\"publisher\":{\"@id\":\"https://smartcar.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://smartcar.com/docs/getting-started/how-to/detect-charging-session#webpage\",\"url\":\"https://smartcar.com/docs/getting-started/how-to/detect-charging-session\",\"name\":\"How to Detect and Process Charging Sessions with Webhooks\",\"description\":\"Learn how to use Smartcar webhooks to detect when a vehicle starts and ends charging, and how to process charging session data.\",\"dateModified\":\"2026-06-17T18:09:01.545Z\",\"isPartOf\":{\"@id\":\"https://smartcar.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://smartcar.com/docs/getting-started/how-to/detect-charging-session#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://smartcar.com/docs/getting-started/how-to/detect-charging-session#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"How-To Guides\",\"item\":\"https://smartcar.com/docs/getting-started/how-to/configure-permissions\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Detect and Process Charging Sessions with Webhooks\",\"item\":\"https://smartcar.com/docs/getting-started/how-to/detect-charging-session\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://smartcar.com/docs/getting-started/how-to/detect-charging-session#article\",\"headline\":\"How to Detect and Process Charging Sessions with Webhooks\",\"name\":\"How to Detect and Process Charging Sessions with Webhooks\",\"description\":\"Learn how to use Smartcar webhooks to detect when a vehicle starts and ends charging, and how to process charging session data.\",\"url\":\"https://smartcar.com/docs/getting-started/how-to/detect-charging-session\",\"mainEntityOfPage\":{\"@id\":\"https://smartcar.com/docs/getting-started/how-to/detect-charging-session#webpage\"},\"dateModified\":\"2026-06-17T18:09:01.545Z\",\"publisher\":{\"@id\":\"https://smartcar.com/#organization\"},\"isPartOf\":{\"@id\":\"https://smartcar.com/docs#website\"}}]}\u003c/script>","siteName":"smartcar","nav":{"global":null,"tabs":[{"tab":"Getting Started","groups":[{"group":"Getting Started","pages":[{"title":"Getting Started with Smartcar","sidebarTitle":"Introduction","href":"/getting-started/introduction"},{"title":"Configure Your Application","sidebarTitle":"Configuration","href":"/getting-started/configure-application"},{"title":"Connect Vehicles","sidebarTitle":"Connect","href":"/getting-started/connect-vehicles"},{"title":"API Authentication Setup","sidebarTitle":"API Auth Setup","href":"/getting-started/how-to/api-authentication"},{"title":"Integrate with Smartcar To Receive Vehicle Data","sidebarTitle":"Integrations","href":"/getting-started/integration-overview"},{"title":"Implementation Checklist","href":"/getting-started/Implementation-Checklist"}]},{"group":"How-To Guides","pages":[{"title":"How to Configure Permissions for Vehicle Data Collection","sidebarTitle":"Configure Permissions","href":"/getting-started/how-to/configure-permissions"},{"title":"Making API Requests","sidebarTitle":"Making API Requests","href":"/getting-started/how-to/making-api-requests"},{"group":"Migrating to API V3","pages":[{"title":"Migrating from V2 to V3 APIs","sidebarTitle":"Migration Guide","href":"/getting-started/how-to/m2m/migration-guide"},{"title":"API Authentication FAQ","sidebarTitle":"FAQ","description":"Frequently asked questions about API Authentication and API credentials.","href":"/getting-started/how-to/m2m/faq"}]},{"title":"How to Detect and Process Charging Sessions with Webhooks","sidebarTitle":"Detect Charging Sessions","href":"/getting-started/how-to/detect-charging-session"}]},{"group":"Tutorials","pages":[{"title":"Webhook Receiver Recipe","sidebarTitle":"Webhook Receiver Recipe","tag":"NEW","description":"Deploy a production-ready AWS serverless webhook receiver in minutes using our complete TypeScript template with built-in validation, error handling, and scalability.","href":"/getting-started/tutorials/webhook-receiver-recipe"},{"title":"iOS Tutorial","sidebarTitle":"Integrating with iOS","href":"/getting-started/tutorials/ios"},{"title":"Android Tutorial","sidebarTitle":"Integrating with Android","href":"/getting-started/tutorials/android"},{"title":"React Tutorial","sidebarTitle":"Integrate with a React App","href":"/getting-started/tutorials/react"},{"title":"Testing with Postman","sidebarTitle":"Testing with Postman","href":"/getting-started/using-vs-with-postman"}]},{"group":"Dashboard","pages":[{"title":"Dashboard Overview","sidebarTitle":"Overview","href":"/getting-started/dashboard/overview"},{"title":"Dashboard Multi-Factor Authentication (MFA)","sidebarTitle":"Dashboard MFA","href":"/getting-started/dashboard/dashboard-mfa"},{"title":"Vehicle Simulator","sidebarTitle":"Simulator","href":"/getting-started/dashboard/simulator"},{"title":"Connect Insights","href":"/getting-started/dashboard/connect-insights"},{"title":"Team Settings","href":"/getting-started/dashboard/teams"},{"title":"Single Sign-on (SSO)","href":"/getting-started/dashboard/single-sign-on"}]}]},{"tab":"Connecting Vehicles","pages":[{"title":"Connecting Vehicles","href":"/connect/what-is-connect"}]},{"tab":"API \u0026 Integrations Reference","pages":[{"title":"API \u0026 Integrations Reference","href":"/api-reference/intro"}]},{"tab":"Vehicle Signals","pages":[{"title":"Vehicle Signals","href":"/api-reference/signals/schema"}]},{"tab":"Help Center","pages":[{"title":"Help Center","href":"/help/what-is-smartcar"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/latest"}]}]},"basePath":"","title":"How to Detect and Process Charging Sessions with Webhooks - smartcar","buildId":"dpl_6cCEiK8XNNvaLBBkWzcBhdE9QfLC","deploymentId":"dpl_6cCEiK8XNNvaLBBkWzcBhdE9QfLC","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-Bj1PpgeO.js","DynamicMarkdown-Bas9A7wq.js","zoom-image-lightbox-B-WKhCOL.js","lightbox-handle-r17bVUz3.js"]}