This document shows how to correct usage that Zenskar already recorded or read, so that billable metrics give the right number, and how to recalculate the charges that it affects.
Plan for corrections
A usage event cannot be edited or deleted. To correct usage later, give each usage event an identity and a revision from the start.
Prerequisites
To create a usage-event collection, you need a role with the Can Create Usage Event and Can Read Usage Event permissions.
To add data fields to an existing usage-event collection, you need a role with the Can Update Usage Event and Can Read Usage Event permissions.
Steps
Usage events that arrive before you add the correction fields have no value for them. Add the fields before you send usage events.
Add two data fields to the data schema of the usage-event collection, when you create the usage-event collection or later:
event_id, with the data type String. It holds an identifier that you choose for each usage event.
revision, with the data type Int64. It holds 1 for the first revision of a usage event.
To send usage events, you need a role with the Can Create Usage Event and Can Read Usage Event permissions.
To change the billable metric, you need a role with the Can Update Billable Metric and Can Read Billable Metric permissions.
Steps
A corrected usage event with a different timestamp can fall in another billing period. Zenskar then counts it next to the original. Keep the original timestamp.
Send a new usage event with the same event_id, customer_id, and timestamp as the usage event that it corrects. Set revision one higher. See Send usage events through the API.
Put the corrected values in the other data fields.
Change the query so that it numbers the revisions of each event_id, newest first, and keeps only the first row of each event_id.The following query counts API calls with only the latest revision of each usage event:
SELECT COUNT(*) AS quantityFROM ( SELECT *, ROW_NUMBER() OVER (PARTITION BY data.event_id ORDER BY data.revision DESC) AS row_number FROM "raw_metric_api_calls" WHERE customer_id = {{customer.external_id}} AND DATE(timestamp) >= DATE({{start_date}}) AND DATE(timestamp) <= DATE({{end_date}}))WHERE row_number = 1
Preview the billable metric for a period with a corrected usage event. See Preview a billable metric.
Click SAVE CHANGES.
The billable metric now keeps only the latest revision of each usage event. Charges that Zenskar already calculated change only when they are recalculated. See Recalculate charges.
Offset usage in a sum
Send a usage event that cancels out part of the usage that was recorded wrongly. A billable metric that already sums needs no change.
Prerequisites
You need a role with the Can Create Usage Event and Can Read Usage Event permissions.
Steps
An offsetting usage event with a timestamp in another billing period changes that billing period instead. Use a timestamp in the same billing period as the usage that it corrects.
Send a usage event with the same customer_id, a timestamp in the same billing period, and a negative value in the data field that the billable metric sums. For example, to remove 40 GB that were recorded twice, send -40 in the field.
The sum of the billing period then includes the negative value. Charges that Zenskar already calculated change only when they are recalculated. See Recalculate charges.
Offset usage in a count
A count cannot go down by adding usage events. Count with a sum of a number instead.
Prerequisites
To add a data field, you need a role with the Can Update Usage Event and Can Read Usage Event permissions.
To send usage events, you need a role with the Can Create Usage Event and Can Read Usage Event permissions.
To change the billable metric, you need a role with the Can Update Billable Metric and Can Read Billable Metric permissions.
Usage events that arrived before you added units have no value for it, and a sum over units leaves them out. Change the billable metric only from the first billing period in which every usage event has units.
To remove a usage event that was recorded wrongly, send a usage event with -1 in units, with the same customer_id and a timestamp in the same billing period.
Charges that Zenskar already calculated change only when they are recalculated. See Recalculate charges.
Correct usage in a data source
Prerequisites
You need access to the system that the data source connects to.
To sync a synced data source right away, you need a role with the Can Read Data Source permission.
Steps
Fix the data in your system.Zenskar queries a remote data source each time it calculates. For a remote data source, the next preview or calculation uses the fix.
In a table with a cursor column, a sync copies a changed row only when its cursor value goes up. The sync then adds it next to the old row, and the old row stays. Correct such a table by adding new rows with the revision method, as in Replace usage events. You can also sync the table without a cursor column.
Charges that Zenskar already calculated change only when they are recalculated. See Recalculate charges.
Recalculate charges
A corrected usage event or a fixed data source changes a quantity only when Zenskar calculates it again. Zenskar calculates the quantity of a billing period when it builds the invoice of that billing period.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Zenskar Documentation","colors":{"primary":"#0A1633","light":"#3B82F6","dark":"#1D3461"},"logo":{"light":"https://mintcdn.com/zenskar-3d451781/8zM5vHUy4GbBMWvZ/logo/for-light-themes.svg?fit=max\u0026auto=format\u0026n=8zM5vHUy4GbBMWvZ\u0026q=85\u0026s=7b3708e348af5e2ca4bd6f302186ccc2","dark":"https://mintcdn.com/zenskar-3d451781/8zM5vHUy4GbBMWvZ/logo/for-dark-themes.svg?fit=max\u0026auto=format\u0026n=8zM5vHUy4GbBMWvZ\u0026q=85\u0026s=591296922399ed1050dc1ee22842edbc"},"favicon":"https://mintcdn.com/zenskar-3d451781/8zM5vHUy4GbBMWvZ/favicon.svg?fit=max\u0026auto=format\u0026n=8zM5vHUy4GbBMWvZ\u0026q=85\u0026s=9a4afe8a43b76270c67c367963907132","navbar":{"links":[{"href":"mailto:help@zenskar.com","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.zenskar.com"}},"footer":{"socials":{"x":"https://x.com/zenskar","github":"https://github.com/zenskar","linkedin":"https://linkedin.com/company/zenskar"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://www.zenskar.com/blog"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"zenskar-3d451781","hasAudioNarration":false,"actualSubdomain":"zenskar-3d451781","customDomains":["zenskar.com"],"gitSource":{"type":"github","owner":"zenskar","repo":"documentation-public","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6b10e2b29ffae5051c41208a"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6b13140b80afc45e2b54adff","clientVersion":"0.0.4458","searchFilterCounts":[{"language":"default","tag":"Documentation","count":332},{"language":"default","tag":"API Reference","count":164},{"language":"default","tag":"Zenskar modules","count":105},{"language":"default","tag":"Product modules","count":97},{"language":"default","tag":"Third-party integrations","count":68},{"language":"default","tag":"Contracts","count":43},{"language":"default","tag":"Data sources","count":39},{"language":"default","tag":"Concepts","count":38},{"language":"default","tag":"Settings","count":38},{"language":"default","tag":"How-to guides","count":36}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@zenskar.com","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"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":"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":"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":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"20260301/zenskar-modules/usage/how-to-guides/historical-usage","slug":"/20260301/zenskar-modules/usage/how-to-guides/historical-usage","pageMetadata":{"title":"How-to guides: Correct historical usage","description":"This document shows how to correct usage that Zenskar already recorded or read, so that billable metrics give the right number, and how to recalculate the charges that it affects.","sidebarTitle":"Historical usage","href":"/20260301/zenskar-modules/usage/how-to-guides/historical-usage"},"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: \"This document shows how to correct usage that Zenskar already recorded or read, so that billable metrics give the right number, and how to recalculate the charges that it affects.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`plan-for-corrections`,children:`Plan for corrections`}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#usage-event`,children:`usage event`}),` cannot be edited or deleted. To correct `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#usage`,children:`usage`}),` later, give each usage event an identity and a revision from the start.`]}),`\n`,_jsx(Heading,{level:`3`,id:`prerequisites`,children:`Prerequisites`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`To create a `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#usage-event-collection`,children:`usage-event collection`}),`, you need a role with the `,_jsx(_components.strong,{children:`Can Create Usage Event`}),` and `,_jsx(_components.strong,{children:`Can Read Usage Event`}),` permissions.`]}),`\n`,_jsxs(_components.li,{children:[`To add `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#data-field`,children:`data fields`}),` to an existing usage-event collection, you need a role with the `,_jsx(_components.strong,{children:`Can Update Usage Event`}),` and `,_jsx(_components.strong,{children:`Can Read Usage Event`}),` permissions.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`steps`,children:`Steps`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Usage events that arrive before you add the correction fields have no value for them. Add the fields before you send usage events.`})}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Add two data fields to the `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#data-schema`,children:`data schema`}),` of the usage-event collection, when you create the usage-event collection or later:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`event_id`}),`, with the data type String. It holds an identifier that you choose for each usage event.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`revision`}),`, with the data type Int64. It holds 1 for the first revision of a usage event.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/how-to-guides/usage-events#create-a-usage-event-collection`,children:`Create a usage-event collection`}),` or `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/how-to-guides/usage-events#add-a-data-field`,children:`Add a data field`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`In every usage event that your systems send, fill in `,_jsx(_components.code,{children:`event_id`}),` and `,_jsx(_components.code,{children:`revision`}),`.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#billable-metric`,children:`billable metric`}),` can then keep only the latest revision of each usage event. See `,_jsx(_components.a,{href:`#replace-usage-events`,children:`Replace usage events`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`replace-usage-events`,children:`Replace usage events`}),`\n`,_jsx(_components.p,{children:`This method works for every calculation.`}),`\n`,_jsx(Heading,{level:`3`,id:`prerequisites-2`,children:`Prerequisites`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`The usage-event collection has the correction fields. See `,_jsx(_components.a,{href:`#plan-for-corrections`,children:`Plan for corrections`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`To send usage events, you need a role with the `,_jsx(_components.strong,{children:`Can Create Usage Event`}),` and `,_jsx(_components.strong,{children:`Can Read Usage Event`}),` permissions.`]}),`\n`,_jsxs(_components.li,{children:[`To change the billable metric, you need a role with the `,_jsx(_components.strong,{children:`Can Update Billable Metric`}),` and `,_jsx(_components.strong,{children:`Can Read Billable Metric`}),` permissions.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`steps-2`,children:`Steps`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`A corrected `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#usage-event`,children:`usage event`}),` with a different `,_jsx(_components.code,{children:`timestamp`}),` can fall in another `,_jsx(_components.a,{href:`/20260301/zenskar-modules/contracts/glossary#billing-period`,children:`billing period`}),`. Zenskar then counts it next to the original. Keep the original `,_jsx(_components.code,{children:`timestamp`}),`.`]})}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Send a new usage event with the same `,_jsx(_components.code,{children:`event_id`}),`, `,_jsx(_components.code,{children:`customer_id`}),`, and `,_jsx(_components.code,{children:`timestamp`}),` as the usage event that it corrects. Set `,_jsx(_components.code,{children:`revision`}),` one higher. See `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/how-to-guides/usage-events#send-usage-events-through-the-api`,children:`Send usage events through the API`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Put the corrected values in the other `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#data-field`,children:`data fields`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Open the `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#billable-metric`,children:`billable metric`}),` in the `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#sql-builder`,children:`SQL builder`}),`. If it uses the `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#visual-builder`,children:`visual builder`}),`, move it first. See `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/how-to-guides/billable-metrics#move-a-billable-metric-to-the-sql-builder`,children:`Move a billable metric to the SQL builder`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Change the query so that it numbers the revisions of each `,_jsx(_components.code,{children:`event_id`}),`, newest first, and keeps only the first row of each `,_jsx(_components.code,{children:`event_id`}),`.`]}),`\n`,_jsx(_components.p,{children:`The following query counts API calls with only the latest revision of each usage event:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`sql`,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:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`11`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` COUNT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` quantity`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SELECT`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` *`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` ROW_NUMBER`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`OVER`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`PARTITION`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` BY`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`event_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ORDER BY`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:` data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`revision`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` DESC`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`AS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` row_number`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` FROM`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"raw_metric_api_calls\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` customer_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {{`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`customer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`external_id`}),_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:` AND`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` DATE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`timestamp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` DATE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({{`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`start_date`}),_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:` AND`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` DATE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`timestamp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` DATE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({{end_date}})`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` row_number `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`})]}),`\n`]})})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Preview the billable metric for a period with a corrected usage event. See `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/how-to-guides/billable-metrics#preview-a-billable-metric`,children:`Preview a billable metric`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Click `,_jsx(_components.strong,{children:`SAVE CHANGES`}),`.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The billable metric now keeps only the latest revision of each usage event. Charges that Zenskar already calculated change only when they are recalculated. See `,_jsx(_components.a,{href:`#recalculate-charges`,children:`Recalculate charges`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`offset-usage-in-a-sum`,children:`Offset usage in a sum`}),`\n`,_jsxs(_components.p,{children:[`Send a `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#usage-event`,children:`usage event`}),` that cancels out part of the usage that was recorded wrongly. A `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#billable-metric`,children:`billable metric`}),` that already sums needs no change.`]}),`\n`,_jsx(Heading,{level:`3`,id:`prerequisites-3`,children:`Prerequisites`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`You need a role with the `,_jsx(_components.strong,{children:`Can Create Usage Event`}),` and `,_jsx(_components.strong,{children:`Can Read Usage Event`}),` permissions.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`steps-3`,children:`Steps`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`An offsetting usage event with a `,_jsx(_components.code,{children:`timestamp`}),` in another `,_jsx(_components.a,{href:`/20260301/zenskar-modules/contracts/glossary#billing-period`,children:`billing period`}),` changes that billing period instead. Use a `,_jsx(_components.code,{children:`timestamp`}),` in the same billing period as the usage that it corrects.`]})}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Send a usage event with the same `,_jsx(_components.code,{children:`customer_id`}),`, a `,_jsx(_components.code,{children:`timestamp`}),` in the same billing period, and a negative value in the `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#data-field`,children:`data field`}),` that the billable metric sums. For example, to remove 40 GB that were recorded twice, send `,_jsx(_components.code,{children:`-40`}),` in the field.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`The sum of the billing period then includes the negative value. Charges that Zenskar already calculated change only when they are recalculated. See `,_jsx(_components.a,{href:`#recalculate-charges`,children:`Recalculate charges`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`offset-usage-in-a-count`,children:`Offset usage in a count`}),`\n`,_jsxs(_components.p,{children:[`A count cannot go down by adding `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#usage-event`,children:`usage events`}),`. Count with a sum of a number instead.`]}),`\n`,_jsx(Heading,{level:`3`,id:`prerequisites-4`,children:`Prerequisites`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`To add a `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#data-field`,children:`data field`}),`, you need a role with the `,_jsx(_components.strong,{children:`Can Update Usage Event`}),` and `,_jsx(_components.strong,{children:`Can Read Usage Event`}),` permissions.`]}),`\n`,_jsxs(_components.li,{children:[`To send usage events, you need a role with the `,_jsx(_components.strong,{children:`Can Create Usage Event`}),` and `,_jsx(_components.strong,{children:`Can Read Usage Event`}),` permissions.`]}),`\n`,_jsxs(_components.li,{children:[`To change the `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#billable-metric`,children:`billable metric`}),`, you need a role with the `,_jsx(_components.strong,{children:`Can Update Billable Metric`}),` and `,_jsx(_components.strong,{children:`Can Read Billable Metric`}),` permissions.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`steps-4`,children:`Steps`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Add an Int64 data field, such as `,_jsx(_components.code,{children:`units`}),`, to the `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#usage-event-collection`,children:`usage-event collection`}),`. See `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/how-to-guides/usage-events#add-a-data-field`,children:`Add a data field`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Send `,_jsx(_components.code,{children:`1`}),` in `,_jsx(_components.code,{children:`units`}),` with every usage event.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Change the billable metric to use the `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#calculation-type`,children:`calculation type`}),` `,_jsx(_components.strong,{children:`SUM`}),` over `,_jsx(_components.code,{children:`units`}),`. See `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/how-to-guides/billable-metrics#edit-a-billable-metric`,children:`Edit a billable metric`}),`.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Usage events that arrived before you added `,_jsx(_components.code,{children:`units`}),` have no value for it, and a sum over `,_jsx(_components.code,{children:`units`}),` leaves them out. Change the billable metric only from the first `,_jsx(_components.a,{href:`/20260301/zenskar-modules/contracts/glossary#billing-period`,children:`billing period`}),` in which every usage event has `,_jsx(_components.code,{children:`units`}),`.`]})}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`To remove a usage event that was recorded wrongly, send a usage event with `,_jsx(_components.code,{children:`-1`}),` in `,_jsx(_components.code,{children:`units`}),`, with the same `,_jsx(_components.code,{children:`customer_id`}),` and a `,_jsx(_components.code,{children:`timestamp`}),` in the same billing period.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Charges that Zenskar already calculated change only when they are recalculated. See `,_jsx(_components.a,{href:`#recalculate-charges`,children:`Recalculate charges`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`correct-usage-in-a-data-source`,children:`Correct usage in a data source`}),`\n`,_jsx(Heading,{level:`3`,id:`prerequisites-5`,children:`Prerequisites`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`You need access to the system that the `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#data-source`,children:`data source`}),` connects to.`]}),`\n`,_jsxs(_components.li,{children:[`To sync a `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#synced-data-source`,children:`synced data source`}),` right away, you need a role with the `,_jsx(_components.strong,{children:`Can Read Data Source`}),` permission.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`steps-5`,children:`Steps`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsx(_components.p,{children:`Fix the data in your system.`}),`\n`,_jsxs(_components.p,{children:[`Zenskar queries a `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#remote-data-source`,children:`remote data source`}),` each time it calculates. For a remote data source, the next preview or calculation uses the fix.`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`For a synced data source, wait for the next scheduled sync, or start one. See `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/how-to-guides/data-sources#sync-now-pause-or-resume-syncing`,children:`Sync now, pause, or resume syncing`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`In a table without a `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#cursor-column`,children:`cursor column`}),`, each sync replaces the whole table in the `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#synced-usage-data`,children:`synced usage data`}),`. The next sync therefore picks up the fix.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`In a table with a cursor column, a sync copies a changed row only when its cursor value goes up. The sync then adds it next to the old row, and the old row stays. Correct such a table by adding new rows with the revision method, as in `,_jsx(_components.a,{href:`#replace-usage-events`,children:`Replace usage events`}),`. You can also sync the table without a cursor column.`]})}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Charges that Zenskar already calculated change only when they are recalculated. See `,_jsx(_components.a,{href:`#recalculate-charges`,children:`Recalculate charges`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`recalculate-charges`,children:`Recalculate charges`}),`\n`,_jsxs(_components.p,{children:[`A corrected `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#usage-event`,children:`usage event`}),` or a fixed `,_jsx(_components.a,{href:`/20260301/zenskar-modules/usage/glossary#data-source`,children:`data source`}),` changes a `,_jsx(_components.a,{href:`/20260301/zenskar-modules/contracts/glossary#quantity`,children:`quantity`}),` only when Zenskar calculates it again. Zenskar calculates the quantity of a `,_jsx(_components.a,{href:`/20260301/zenskar-modules/contracts/glossary#billing-period`,children:`billing period`}),` when it builds the invoice of that billing period.`]}),`\n`,_jsx(Heading,{level:`3`,id:`prerequisites-6`,children:`Prerequisites`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`The correction is in place, through usage events or a data source. See `,_jsx(_components.a,{href:`#replace-usage-events`,children:`Replace usage events`}),`, `,_jsx(_components.a,{href:`#offset-usage-in-a-sum`,children:`Offset usage in a sum`}),`, `,_jsx(_components.a,{href:`#offset-usage-in-a-count`,children:`Offset usage in a count`}),`, or `,_jsx(_components.a,{href:`#correct-usage-in-a-data-source`,children:`Correct usage in a data source`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`steps-6`,children:`Steps`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`For each `,_jsx(_components.a,{href:`/20260301/zenskar-modules/contracts/glossary#contract`,children:`contract`}),` that the correction affects, regenerate its invoices. See `,_jsx(_components.a,{href:`/20260301/zenskar-modules/contracts/how-to-guides/invoices#regenerate-the-invoices-of-a-contract`,children:`Regenerate the invoices of a contract`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Invoice regeneration recalculates the draft and upcoming invoices of an `,_jsx(_components.a,{href:`/20260301/zenskar-modules/contracts/glossary#active-contract`,children:`active contract`}),`. A change to a billing period whose invoice is already approved follows the `,_jsx(_components.a,{href:`/20260301/zenskar-modules/contracts/glossary#invoicing-configuration`,children:`invoicing configuration`}),` of the contract. See `,_jsx(_components.a,{href:`/20260301/zenskar-modules/contracts/concepts/contracts#invoicing-configurations-increases-after-approval`,children:`Invoicing configurations: increases after approval`}),`.`]})]})}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 guides: Correct historical usage","description":"This document shows how to correct usage that Zenskar already recorded or read, so that billable metrics give the right number, and how to recalculate the charges that it affects.","sidebarTitle":"Historical usage","href":"/20260301/zenskar-modules/usage/how-to-guides/historical-usage"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Plan for corrections","slug":"plan-for-corrections","depth":2,"children":[{"title":"Prerequisites","slug":"prerequisites","depth":3,"children":[]},{"title":"Steps","slug":"steps","depth":3,"children":[]}]},{"title":"Replace usage events","slug":"replace-usage-events","depth":2,"children":[{"title":"Prerequisites","slug":"prerequisites-2","depth":3,"children":[]},{"title":"Steps","slug":"steps-2","depth":3,"children":[]}]},{"title":"Offset usage in a sum","slug":"offset-usage-in-a-sum","depth":2,"children":[{"title":"Prerequisites","slug":"prerequisites-3","depth":3,"children":[]},{"title":"Steps","slug":"steps-3","depth":3,"children":[]}]},{"title":"Offset usage in a count","slug":"offset-usage-in-a-count","depth":2,"children":[{"title":"Prerequisites","slug":"prerequisites-4","depth":3,"children":[]},{"title":"Steps","slug":"steps-4","depth":3,"children":[]}]},{"title":"Correct usage in a data source","slug":"correct-usage-in-a-data-source","depth":2,"children":[{"title":"Prerequisites","slug":"prerequisites-5","depth":3,"children":[]},{"title":"Steps","slug":"steps-5","depth":3,"children":[]}]},{"title":"Recalculate charges","slug":"recalculate-charges","depth":2,"children":[{"title":"Prerequisites","slug":"prerequisites-6","depth":3,"children":[]},{"title":"Steps","slug":"steps-6","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"zenskar-3d451781","siteName":"Zenskar Documentation","title":"How-to guides: Correct historical usage - Zenskar Documentation","contextualStarterQuestions":[{"_id":"6af3132a9d233d4e712e45db","deploymentId":"69e0a11c3e5ca76e4bd3f576","questionText":"What fields enable usage correction?","status":"active","generatedBy":"contextual","path":"20260301/zenskar-modules/usage/how-to-guides/historical-usage","createdAt":"2026-11-10T12:50:50.496Z","updatedAt":"2026-11-10T12:50:50.496Z","__v":0},{"_id":"6af3132a9d233d4e712e45da","deploymentId":"69e0a11c3e5ca76e4bd3f576","questionText":"How do I correct past usage?","status":"active","generatedBy":"contextual","path":"20260301/zenskar-modules/usage/how-to-guides/historical-usage","createdAt":"2026-11-10T12:50:50.496Z","updatedAt":"2026-11-10T12:50:50.496Z","__v":0},{"_id":"6af3132a9d233d4e712e45dc","deploymentId":"69e0a11c3e5ca76e4bd3f576","questionText":"How do I replace usage events?","status":"active","generatedBy":"contextual","path":"20260301/zenskar-modules/usage/how-to-guides/historical-usage","createdAt":"2026-11-10T12:50:50.496Z","updatedAt":"2026-11-10T12:50:50.496Z","__v":0}],"navMaps":{"firstHrefInVersion":{"cedar.ALPHA.20260301":{"href":"/20260301/zenskar-modules/usage/how-to-guides/historical-usage","matchLevel":0},"baobab.20240301":{"href":"/20240301/getting-started/introduction","matchLevel":4}},"firstHrefInLanguage":{}},"lastModified":"2026-11-10T12:50:42.764Z","originalFileLocation":"20260301/zenskar-modules/usage/how-to-guides/historical-usage.md"},"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=\"This document shows how to correct usage that Zenskar already recorded or read, so that billable metrics give the right number, and how to recalculate the charges that it affects.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Zenskar Documentation\">\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/zenskar-3d451781/MYgNV77YbtdSqIUY/_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/zenskar-3d451781/MYgNV77YbtdSqIUY/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/zenskar-3d451781/MYgNV77YbtdSqIUY/_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/zenskar-3d451781/MYgNV77YbtdSqIUY/_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/zenskar-3d451781/MYgNV77YbtdSqIUY/_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/zenskar-3d451781/MYgNV77YbtdSqIUY/_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/zenskar-3d451781/MYgNV77YbtdSqIUY/_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/zenskar-3d451781/MYgNV77YbtdSqIUY/_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/zenskar-3d451781/MYgNV77YbtdSqIUY/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"How-to guides: Correct historical usage - Zenskar Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"This document shows how to correct usage that Zenskar already recorded or read, so that billable metrics give the right number, and how to recalculate the charges that it affects.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Zenskar Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/historical-usage\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://zenskar-3d451781.mintlify.site/docs/_mintlify/api/og/v2?division=How-to+guides\u0026amp;title=How-to+guides%3A+Correct+historical+usage\u0026amp;description=This+document+shows+how+to+correct+usage+that+Zenskar+already+recorded+or+read%2C+so+that+billable+metrics+give+the+right+number%2C+and+how+to+recalculate+the+charg\u0026amp;theme=6c804ef19428345e056a0f21\u0026amp;signature=362b4b410fb271902dcc61240426f12c5dc2686d92ee55258a0db135b2c36a78\">\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 guides: Correct historical usage - Zenskar Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"This document shows how to correct usage that Zenskar already recorded or read, so that billable metrics give the right number, and how to recalculate the charges that it affects.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://zenskar-3d451781.mintlify.site/docs/_mintlify/api/og/v2?division=How-to+guides\u0026amp;title=How-to+guides%3A+Correct+historical+usage\u0026amp;description=This+document+shows+how+to+correct+usage+that+Zenskar+already+recorded+or+read%2C+so+that+billable+metrics+give+the+right+number%2C+and+how+to+recalculate+the+charg\u0026amp;theme=6c804ef19428345e056a0f21\u0026amp;signature=362b4b410fb271902dcc61240426f12c5dc2686d92ee55258a0db135b2c36a78\">\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/zenskar-3d451781/MYgNV77YbtdSqIUY/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Zenskar Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0A1633\">\u003clink data-mint-head rel=\"canonical\" href=\"https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/historical-usage\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/20260301/zenskar-modules/usage/how-to-guides/historical-usage.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://zenskar.com/#organization\",\"name\":\"Zenskar Documentation\",\"url\":\"https://zenskar.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/zenskar-3d451781/8zM5vHUy4GbBMWvZ/logo/for-light-themes.svg?fit=max\u0026auto=format\u0026n=8zM5vHUy4GbBMWvZ\u0026q=85\u0026s=7b3708e348af5e2ca4bd6f302186ccc2\"}},{\"@type\":\"WebSite\",\"@id\":\"https://zenskar.com/docs#website\",\"name\":\"Zenskar Documentation\",\"url\":\"https://zenskar.com/docs\",\"publisher\":{\"@id\":\"https://zenskar.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/historical-usage#webpage\",\"url\":\"https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/historical-usage\",\"name\":\"How-to guides: Correct historical usage\",\"description\":\"This document shows how to correct usage that Zenskar already recorded or read, so that billable metrics give the right number, and how to recalculate the charges that it affects.\",\"dateModified\":\"2026-11-10T12:50:42.764Z\",\"isPartOf\":{\"@id\":\"https://zenskar.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/historical-usage#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/historical-usage#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Zenskar modules\",\"item\":\"https://zenskar.com/docs/20260301/zenskar-modules/accounting/concepts/chart-of-accounts\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Usage\",\"item\":\"https://zenskar.com/docs/20260301/zenskar-modules/usage/concepts/usage\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How-to guides\",\"item\":\"https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/usage-events\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"How-to guides: Correct historical usage\",\"item\":\"https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/historical-usage\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/historical-usage#article\",\"headline\":\"How-to guides: Correct historical usage\",\"name\":\"How-to guides: Correct historical usage\",\"description\":\"This document shows how to correct usage that Zenskar already recorded or read, so that billable metrics give the right number, and how to recalculate the charges that it affects.\",\"url\":\"https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/historical-usage\",\"mainEntityOfPage\":{\"@id\":\"https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/historical-usage#webpage\"},\"dateModified\":\"2026-11-10T12:50:42.764Z\",\"publisher\":{\"@id\":\"https://zenskar.com/#organization\"},\"isPartOf\":{\"@id\":\"https://zenskar.com/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Zenskar Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Zenskar Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/20260301/zenskar-modules/usage/how-to-guides/historical-usage.md","siteName":"Zenskar Documentation","nav":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://www.zenskar.com/blog"}]},"versions":[{"version":"cedar.ALPHA.20260301","default":false,"tabs":[{"tab":"Documentation","groups":[{"group":"Getting started","pages":[{"title":"Welcome to Zenskar","href":"/20260301/getting-started/introduction"},{"group":"Your first invoice","expanded":false,"pages":[{"title":"Quickstart guide","deprecated":false,"hidden":false,"href":"/20260301/getting-started/your-first-invoice/index"},{"title":"Step 1: Add a customer","deprecated":false,"hidden":false,"href":"/20260301/getting-started/your-first-invoice/add-a-customer"},{"title":"Step 2: Ingest usage events via API","deprecated":false,"hidden":false,"href":"/20260301/getting-started/your-first-invoice/ingest-usage-events-api"},{"title":"Step 3: Define billable metrics","deprecated":false,"hidden":false,"href":"/20260301/getting-started/your-first-invoice/define-billable-metrics"},{"title":"Step 4: Create contract and add products","deprecated":false,"hidden":false,"href":"/20260301/getting-started/your-first-invoice/create-contract-products"},{"title":"Step 5: Generate invoice","deprecated":false,"hidden":false,"href":"/20260301/getting-started/your-first-invoice/generate-invoice"}]}]},{"group":"Zenskar modules","pages":[{"group":"Accounting","pages":[{"group":"Concepts","expanded":false,"pages":[{"title":"Chart of accounts","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/accounting/concepts/chart-of-accounts"},{"title":"ASC 606 and IFRS 15: Five steps of revenue recognition","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/accounting/concepts/five-steps-of-revenue-recognition"},{"title":"Revenue lifecycle","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/accounting/concepts/revenue-lifecycle"}]},{"group":"How-to guides","expanded":false,"pages":[{"title":"Create a revenue recognition rule","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/accounting/how-to-guides/create-a-revenue-recognition-rule"},{"title":"Revenue distribution and redistribution methods","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/accounting/how-to-guides/revenue-distribution-and-redistribution-methods"}]},{"group":"Reference","expanded":false,"pages":[{"title":"Revenue adjustment methods","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/accounting/reference/revenue-adjustment-methods"},{"title":"Revenue distribution methods","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/accounting/reference/revenue-distribution-methods"},{"title":"Performance obligation policies","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/accounting/reference/performance-obligation-policies"}]}]},{"group":"Customers","pages":[{"title":"Concepts: How customers work","sidebarTitle":"Concepts","href":"/20260301/zenskar-modules/customers/concepts"},{"title":"End-to-end walkthrough: How customers work","sidebarTitle":"Walkthroughs","href":"/20260301/zenskar-modules/customers/walkthroughs"},{"title":"How-to guides: Manage customers","sidebarTitle":"How-to guides","href":"/20260301/zenskar-modules/customers/how-to-guides"},{"title":"Reference: Customers","sidebarTitle":"Reference","href":"/20260301/zenskar-modules/customers/reference"},{"title":"Glossary","href":"/20260301/zenskar-modules/customers/glossary"}]},{"group":"Contracts","pages":[{"group":"Concepts","expanded":false,"pages":[{"title":"Concepts: How contracts work","sidebarTitle":"Contracts","href":"/20260301/zenskar-modules/contracts/concepts/contracts"},{"title":"Concepts: How payment terms work","sidebarTitle":"Payment terms","href":"/20260301/zenskar-modules/contracts/concepts/payment-terms"},{"title":"Concepts: How contract-level minimum commitments work","sidebarTitle":"Contract-level minimum commitments","href":"/20260301/zenskar-modules/contracts/concepts/contract-level-minimum-commitments"},{"title":"Concepts: How contract-level discounts work","sidebarTitle":"Contract-level discounts","href":"/20260301/zenskar-modules/contracts/concepts/contract-level-discounts"},{"group":"Line items","pages":[{"title":"Concepts: How the pricing of a line item works","sidebarTitle":"Pricing of a line item","href":"/20260301/zenskar-modules/contracts/concepts/line-items/pricing"},{"title":"Concepts: How the billing of a line item works","sidebarTitle":"Billing of a line item","href":"/20260301/zenskar-modules/contracts/concepts/line-items/billing"},{"title":"Concepts: How the quantity of a line item works","sidebarTitle":"Quantity of a line item","href":"/20260301/zenskar-modules/contracts/concepts/line-items/quantity"},{"title":"Concepts: How the minimum commitments of a line item work","sidebarTitle":"Minimum commitments of a line item","href":"/20260301/zenskar-modules/contracts/concepts/line-items/minimum-commitments"},{"title":"Concepts: How line-item discounts work","sidebarTitle":"Line-item discounts","href":"/20260301/zenskar-modules/contracts/concepts/line-items/discounts"},{"title":"Concepts: How the anchor dates of a line item work","sidebarTitle":"Anchor dates of a line item","href":"/20260301/zenskar-modules/contracts/concepts/line-items/anchor-dates"}]}]},{"group":"Walkthroughs","expanded":false,"pages":[{"title":"End-to-end walkthrough: How contracts work","sidebarTitle":"End-to-end: Contracts","href":"/20260301/zenskar-modules/contracts/walkthroughs/contracts"},{"title":"Single-concept walkthrough: How contract-level discounts work","sidebarTitle":"Single-concept: Contract-level discounts","href":"/20260301/zenskar-modules/contracts/walkthroughs/contract-level-discounts"}]},{"group":"How-to guides","expanded":false,"pages":[{"title":"How-to guides: Manage contracts","sidebarTitle":"Contracts","href":"/20260301/zenskar-modules/contracts/how-to-guides/contracts"},{"title":"How-to guides: Manage payment terms","sidebarTitle":"Payment terms","href":"/20260301/zenskar-modules/contracts/how-to-guides/payment-terms"},{"title":"How-to guides: Manage line items","sidebarTitle":"Line items","href":"/20260301/zenskar-modules/contracts/how-to-guides/line-items"},{"title":"How-to guides: Manage discounts","sidebarTitle":"Discounts","href":"/20260301/zenskar-modules/contracts/how-to-guides/discounts"},{"title":"How-to guides: Manage minimum commitments","sidebarTitle":"Minimum commitments","href":"/20260301/zenskar-modules/contracts/how-to-guides/minimum-commitments"},{"title":"How-to guides: Manage the invoices of a contract","sidebarTitle":"Invoices of a contract","href":"/20260301/zenskar-modules/contracts/how-to-guides/invoices"}]},{"group":"Reference","expanded":false,"pages":[{"title":"Reference: Contracts","sidebarTitle":"Contracts","href":"/20260301/zenskar-modules/contracts/reference/contracts"},{"title":"Reference: Line items","sidebarTitle":"Line items","href":"/20260301/zenskar-modules/contracts/reference/line-items"}]},{"title":"Glossary","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/contracts/glossary"}]},{"group":"Invoices","pages":[{"group":"Concepts","expanded":false,"pages":[{"title":"Concepts: How invoices work","sidebarTitle":"Invoices","href":"/20260301/zenskar-modules/invoices/concepts/invoices"},{"title":"Concepts: How credit notes work","sidebarTitle":"Credit notes","href":"/20260301/zenskar-modules/invoices/concepts/credit-notes"}]},{"group":"Walkthroughs","expanded":false,"pages":[{"title":"End-to-end walkthrough: How invoices work","sidebarTitle":"Invoices","href":"/20260301/zenskar-modules/invoices/walkthroughs/invoices"},{"title":"End-to-end walkthrough: How credit notes work","sidebarTitle":"Credit notes","href":"/20260301/zenskar-modules/invoices/walkthroughs/credit-notes"}]},{"group":"How-to guides","expanded":false,"pages":[{"title":"How-to guides: Manage invoices","sidebarTitle":"Invoices","href":"/20260301/zenskar-modules/invoices/how-to-guides/invoices"},{"title":"How-to guides: Manage credit notes","sidebarTitle":"Credit notes","href":"/20260301/zenskar-modules/invoices/how-to-guides/credit-notes"}]},{"group":"Reference","expanded":false,"pages":[{"title":"Reference: Invoices","sidebarTitle":"Invoices","href":"/20260301/zenskar-modules/invoices/reference/invoices"},{"title":"Reference: Credit notes","sidebarTitle":"Credit notes","href":"/20260301/zenskar-modules/invoices/reference/credit-notes"}]},{"title":"Glossary","href":"/20260301/zenskar-modules/invoices/glossary"}]},{"group":"Products","pages":[{"group":"Concepts","expanded":false,"pages":[{"title":"Concepts: How products work","sidebarTitle":"Products","href":"/20260301/zenskar-modules/products/concepts/products"}]},{"group":"Walkthroughs","expanded":false,"pages":[{"title":"End-to-end walkthrough: How point-in-time products work","sidebarTitle":"End-to-end: Point-in-time products","href":"/20260301/zenskar-modules/products/walkthroughs/point-in-time-products"},{"title":"End-to-end walkthrough: How period-of-time products work","sidebarTitle":"End-to-end: Period-of-time products","href":"/20260301/zenskar-modules/products/walkthroughs/period-of-time-products"},{"title":"Single-concept walkthrough: How the recurring quantity strategy works","sidebarTitle":"Single-concept: Recurring quantity strategy","href":"/20260301/zenskar-modules/products/walkthroughs/recurring-quantity-strategy"}]},{"group":"How-to guides","expanded":false,"pages":[{"title":"How-to guides: Manage products","sidebarTitle":"Products","href":"/20260301/zenskar-modules/products/how-to-guides/products"},{"title":"How-to guides: Manage pricing presets","sidebarTitle":"Pricing presets","href":"/20260301/zenskar-modules/products/how-to-guides/pricing-presets"}]},{"group":"Reference","expanded":false,"pages":[{"title":"Reference: Products","sidebarTitle":"Products","href":"/20260301/zenskar-modules/products/reference/products"},{"title":"Reference: Pricing presets","sidebarTitle":"Pricing presets","href":"/20260301/zenskar-modules/products/reference/pricing-presets"}]},{"title":"Pricing models","sidebarTitle":"Pricing models","href":"/20260301/zenskar-modules/products/pricing-models"},{"title":"Glossary","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/products/glossary"}]},{"group":"Usage","pages":[{"group":"Concepts","expanded":false,"pages":[{"title":"Concepts: How usage works","sidebarTitle":"Usage","href":"/20260301/zenskar-modules/usage/concepts/usage"},{"title":"Concepts: How usage events work","sidebarTitle":"Usage events","href":"/20260301/zenskar-modules/usage/concepts/usage-events"},{"title":"Concepts: How data sources work","sidebarTitle":"Data sources","href":"/20260301/zenskar-modules/usage/concepts/data-sources"},{"title":"Concepts: How billable metrics work","sidebarTitle":"Billable metrics","href":"/20260301/zenskar-modules/usage/concepts/billable-metrics"},{"title":"Concepts: How S3 ingestion works","sidebarTitle":"S3 ingestion","href":"/20260301/zenskar-modules/usage/concepts/s3-ingestion"}]},{"group":"Walkthroughs","expanded":false,"pages":[{"title":"End-to-end walkthrough: How usage works","sidebarTitle":"End-to-end: Usage","href":"/20260301/zenskar-modules/usage/walkthroughs/usage"},{"title":"Single-concept walkthrough: How the SQL builder works","sidebarTitle":"Single-concept: SQL builder","href":"/20260301/zenskar-modules/usage/walkthroughs/sql-builder"}]},{"group":"How-to guides","expanded":false,"pages":[{"title":"How-to guides: Manage usage events","sidebarTitle":"Usage events","href":"/20260301/zenskar-modules/usage/how-to-guides/usage-events"},{"title":"How-to guides: Manage data sources","sidebarTitle":"Data sources","href":"/20260301/zenskar-modules/usage/how-to-guides/data-sources"},{"title":"How-to guides: Manage billable metrics","description":"This document shows how to find, create, preview, edit, rename, and delete billable metrics, and how to move a billable metric to the SQL builder.","sidebarTitle":"Billable metrics","href":"/20260301/zenskar-modules/usage/how-to-guides/billable-metrics"},{"title":"How-to guides: Correct historical usage","sidebarTitle":"Historical usage","href":"/20260301/zenskar-modules/usage/how-to-guides/historical-usage"},{"title":"How-to guides: Manage S3 ingestion","description":"This document shows how to prepare an S3 bucket in AWS, connect it to Zenskar, change or disconnect the bucket connection, and check that S3 ingestion reads its files.","sidebarTitle":"S3 ingestion","href":"/20260301/zenskar-modules/usage/how-to-guides/s3-ingestion"}]},{"group":"Reference","expanded":false,"pages":[{"title":"Reference: Usage events","sidebarTitle":"Usage events","href":"/20260301/zenskar-modules/usage/reference/usage-events"},{"title":"Reference: Data sources","sidebarTitle":"Data sources","href":"/20260301/zenskar-modules/usage/reference/data-sources"},{"title":"Reference: Billable metrics","sidebarTitle":"Billable metrics","href":"/20260301/zenskar-modules/usage/reference/billable-metrics"},{"title":"Reference: S3 ingestion","sidebarTitle":"S3 ingestion","href":"/20260301/zenskar-modules/usage/reference/s3-ingestion"}]},{"title":"Glossary","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/usage/glossary"}]},{"group":"Settings","pages":[{"title":"General settings","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/settings/general"},{"title":"Business entity","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/settings/business-entity"},{"title":"Payment instructions","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/settings/payment-instructions"},{"title":"Payment","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/settings/payment"},{"title":"Communications settings","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/settings/communications"},{"group":"Contract \u0026 Invoices","expanded":false,"pages":[{"title":"Contract \u0026 Invoices","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/settings/contract-invoices"},{"group":"Invoice date configuration","expanded":false,"pages":[{"title":"Concepts","href":"/20260301/zenskar-modules/settings/invoice-date-configuration/concepts"},{"title":"How-to guides","href":"/20260301/zenskar-modules/settings/invoice-date-configuration/how-to-guides"},{"title":"Reference","href":"/20260301/zenskar-modules/settings/invoice-date-configuration/reference"}]}]},{"title":"Webhook alerts","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/settings/webhook-alerts"},{"group":"Tax configuration","expanded":false,"pages":[{"group":"Concepts","expanded":false,"pages":[{"title":"Concepts: How tax configuration works","sidebarTitle":"Tax configuration","href":"/20260301/zenskar-modules/settings/tax-configuration/concepts/tax-configuration"},{"title":"Concepts: How tax rates work","sidebarTitle":"Tax rates","href":"/20260301/zenskar-modules/settings/tax-configuration/concepts/tax-rates"}]},{"group":"Walkthroughs","expanded":false,"pages":[{"title":"End-to-end walkthrough: How tax configuration works","sidebarTitle":"End-to-end: Tax configuration","href":"/20260301/zenskar-modules/settings/tax-configuration/walkthroughs/tax-configuration"},{"title":"Single-concept walkthrough: How third-party tax engines work","sidebarTitle":"Single-concept: Third-party tax engines","href":"/20260301/zenskar-modules/settings/tax-configuration/walkthroughs/third-party-tax-engines"}]},{"title":"How-to guides: Manage tax configuration","sidebarTitle":"How-to guides","href":"/20260301/zenskar-modules/settings/tax-configuration/how-to-guides"},{"title":"Reference: Tax configuration","sidebarTitle":"Reference","href":"/20260301/zenskar-modules/settings/tax-configuration/reference"}]},{"title":"S3 Ingestion","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/settings/s3-ingestion"},{"group":"Custom attributes","expanded":false,"pages":[{"title":"Concepts: How custom attributes work","sidebarTitle":"Concepts","href":"/20260301/zenskar-modules/settings/custom-attributes/concepts"},{"title":"End-to-end walkthrough: How custom attributes work","sidebarTitle":"Walkthroughs","href":"/20260301/zenskar-modules/settings/custom-attributes/walkthroughs"},{"title":"How-to guides: Manage custom attributes","sidebarTitle":"How-to guides","href":"/20260301/zenskar-modules/settings/custom-attributes/how-to-guides"},{"title":"Reference: Custom attributes","sidebarTitle":"Reference","href":"/20260301/zenskar-modules/settings/custom-attributes/reference"}]},{"title":"API keys","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/settings/api-keys"},{"title":"Glossary","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/settings/glossary"}]},{"group":"More","pages":[{"title":"Entitlements","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/more/entitlements"},{"group":"Communications","expanded":false,"pages":[{"title":"Communications","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/more/communications/index"},{"title":"Email templates","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/more/communications/email-templates"},{"title":"Email alerts","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/more/communications/email-alerts"},{"title":"Document templates","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/more/communications/document-templates"},{"group":"Template guides","expanded":false,"pages":[{"title":"Templating guide","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/more/communications/templating-guide"},{"title":"Invoice template variables","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/more/communications/invoice-template-variables"},{"title":"Credit note template variables","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/more/communications/credit-note-template-variables"},{"title":"Payment receipt template variables","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/more/communications/payment-receipt-template-variables"},{"title":"Usage report template variables","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/more/communications/usage-report-template-variables"}]},{"title":"Senders","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/more/communications/senders"},{"title":"Sent emails","deprecated":false,"hidden":false,"href":"/20260301/zenskar-modules/more/communications/sent-emails"}]}]}]},{"group":"Security","pages":[{"group":"Role-based access control","expanded":false,"pages":[{"title":"Role-based access control","deprecated":false,"hidden":false,"href":"/20260301/security/role-based-access-control/index"},{"title":"Roles","deprecated":false,"hidden":false,"href":"/20260301/security/role-based-access-control/roles"},{"title":"Users","deprecated":false,"hidden":false,"href":"/20260301/security/role-based-access-control/users"}]},{"group":"SAML authentication","expanded":false,"pages":[{"title":"Concepts","href":"/20260301/security/saml-authentication/concepts"},{"group":"How-to guides","expanded":false,"pages":[{"title":"SAML authentication with Microsoft Entra ID","deprecated":false,"hidden":false,"href":"/20260301/security/saml-authentication/how-to-guides/saml-authentication-with-microsoft-entra-id"},{"title":"SAML authentication with Google Workspace","deprecated":false,"hidden":false,"href":"/20260301/security/saml-authentication/how-to-guides/saml-authentication-with-google-workspace"},{"title":"SAML authentication with Okta","deprecated":false,"hidden":false,"href":"/20260301/security/saml-authentication/how-to-guides/saml-authentication-with-okta"}]},{"title":"Reference","href":"/20260301/security/saml-authentication/reference"}]},{"title":"Two-factor authentication","deprecated":false,"hidden":false,"href":"/20260301/security/two-factor-authentication"}]},{"group":"Model context protocol (MCP)","pages":[{"title":"Concepts","href":"/20260301/model-context-protocol/concepts"},{"title":"Walkthroughs","href":"/20260301/model-context-protocol/walkthroughs"},{"title":"How-to guides","deprecated":false,"hidden":false,"href":"/20260301/model-context-protocol/how-to-guides"},{"title":"Reference","deprecated":false,"hidden":false,"href":"/20260301/model-context-protocol/reference"}]},{"group":"Pricing models","pages":[{"title":"Concepts: How the per-unit pricing model works","sidebarTitle":"Per-unit pricing model","href":"/20260301/pricing-models/concepts/per-unit"},{"title":"Concepts: How the percent pricing model works","sidebarTitle":"Percent pricing model","href":"/20260301/pricing-models/concepts/percent"},{"title":"Concepts: How the volume pricing model works","sidebarTitle":"Volume pricing model","href":"/20260301/pricing-models/concepts/volume"},{"title":"Concepts: How the tiered pricing model works","sidebarTitle":"Tiered pricing model","href":"/20260301/pricing-models/concepts/tiered"},{"title":"Concepts: How the dimensional pricing model works","sidebarTitle":"Dimensional pricing model","href":"/20260301/pricing-models/concepts/dimensional"}]},{"group":"Third-party integrations","pages":[{"group":"Data sources","expanded":false,"pages":[{"title":"Auth0","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/data-sources/auth0"},{"title":"Amazon Athena","href":"/20260301/third-party-integrations/data-sources/amazon-athena"},{"title":"Amazon Redshift","href":"/20260301/third-party-integrations/data-sources/amazon-redshift"},{"title":"BigQuery","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/data-sources/bigquery"},{"title":"ClickHouse","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/data-sources/clickhouse"},{"title":"CockroachDB","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/data-sources/cockroachdb"},{"title":"Databricks Lakehouse","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/data-sources/databricks-lakehouse"},{"title":"Google Sheets","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/data-sources/google-sheets"},{"title":"Looker","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/data-sources/looker"},{"title":"Metabase","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/data-sources/metabase"},{"title":"MongoDB","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/data-sources/mongodb"},{"title":"MySQL","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/data-sources/mysql"},{"title":"PostgreSQL","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/data-sources/postgresql"},{"title":"QuickBooks","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/data-sources/quickbooks"},{"title":"Shopify","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/data-sources/shopify"},{"group":"Snowflake","expanded":false,"pages":[{"title":"Snowflake","href":"/20260301/third-party-integrations/data-sources/snowflake/index"},{"title":"Set up Snowflake for integration with Zenskar","sidebarTitle":"Set up Snowflake","href":"/20260301/third-party-integrations/data-sources/snowflake/set-up-snowflake"},{"title":"Configure Zenskar's Snowflake connector","sidebarTitle":"Configure Snowflake","href":"/20260301/third-party-integrations/data-sources/snowflake/configure-snowflake"}]}]},{"group":"ERPs","expanded":false,"pages":[{"title":"NetSuite","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/ERPs/netsuite"},{"title":"QuickBooks","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/ERPs/quickbooks"},{"title":"Rillet","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/ERPs/rillet"},{"title":"Xero","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/ERPs/xero"},{"title":"Zoho Books","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/ERPs/zoho-books"}]},{"group":"CRMs and CPQs","expanded":false,"pages":[{"title":"HubSpot","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/CRMs-and-CPQs/hubspot"},{"group":"Salesforce","expanded":false,"pages":[{"title":"Salesforce integration guide","href":"/20260301/third-party-integrations/CRMs-and-CPQs/salesforce/index"},{"title":"Installation and setup of Zenskar’s package for Salesforce","href":"/20260301/third-party-integrations/CRMs-and-CPQs/salesforce/install-and-set-up-zenskar-package"},{"title":"Use default Flow","href":"/20260301/third-party-integrations/CRMs-and-CPQs/salesforce/default-flow"},{"title":"Create your own Flow","href":"/20260301/third-party-integrations/CRMs-and-CPQs/salesforce/custom-flow"}]}]},{"group":"Tax automation","expanded":false,"pages":[{"group":"Avalara AvaTax","expanded":false,"pages":[{"title":"Avalara AvaTax","sidebarTitle":"Concepts","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/tax-automation/avalara-avatax/concepts"},{"title":"How-to guides","sidebarTitle":"How-to guides","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/tax-automation/avalara-avatax/how-to-guides"},{"title":"Reference","sidebarTitle":"Reference","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/tax-automation/avalara-avatax/reference"}]},{"group":"Anrok","expanded":false,"pages":[{"title":"Anrok","sidebarTitle":"Concepts","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/tax-automation/anrok/concepts"},{"title":"How-to guides","sidebarTitle":"How-to guides","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/tax-automation/anrok/how-to-guides"},{"title":"Reference","sidebarTitle":"Reference","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/tax-automation/anrok/reference"}]}]},{"group":"Payment gateways","expanded":false,"pages":[{"title":"Stripe","deprecated":false,"hidden":false,"href":"/20260301/third-party-integrations/payment-gateways/stripe"}]}]},{"group":"Zenskar versioning","pages":[{"title":"Versioning logic","href":"/meta/versioning-logic"},{"title":"Documentation version to backend build compatibility matrix","href":"/meta/matrix"}]},{"group":"Roadmap","pages":[{"title":"Coming soon","sidebarTitle":"Coming soon","href":"/20260301/roadmap"}]}]},{"tab":"API Guides","pages":[{"title":"API Guides","href":"/20260301/api-guides/authentication"}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/api-reference/accounting/get-chart-of-accounts"}]}]},{"version":"baobab.20240301","default":true,"pages":[{"title":"baobab.20240301","href":"/20240301/getting-started/introduction"}]}]},"basePath":"","title":"How-to guides: Correct historical usage - Zenskar Documentation","deploymentId":"dpl_BsHU5ynwUyfZMwoLvGC66duJuw65","buildId":"dpl_BsHU5ynwUyfZMwoLvGC66duJuw65","dynamics":[],"chunks":[]}