A usage event cannot be edited or deleted. To correct usage later, give each usage event an identity and a revision from the start. A billable metric can then keep only the latest revision of each usage event.
You need a role with the Can Create Usage Event and Can Read Usage Event permissions to create a usage-event collection. To add data fields, you need Can Update Usage Event. See Permissions.
Send a corrected version of a usage event. Build the billable metric so that it keeps only the latest revision of each usage event. This method works for every calculation.
You need a role with the Can Create Usage Event permission to send usage events. You need the Can Update Billable Metric permission to change the billable metric. Both also need their read permissions. See Permissions.
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. The query then 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.
Charges that Zenskar already calculated change only when they are recalculated. See Recalculate charges.
Send a usage event that cancels out part of the usage that was recorded wrongly. This method works for billable metrics that add values up: sums, and counts that you rebuild as sums. It needs no change to a billable metric that already sums.
An offsetting usage event with a timestamp in another billing period changes that 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.
A count cannot go down by adding usage events. Count with a sum of a number instead.
Add an Int64 data field, such as units, to the usage-event collection. See Add a data field.
Send 1 in units with every usage event.
Usage events that arrived before you added units have no value for it. 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.
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. The old row stays. Correct such a table by adding new rows with the revision method. You can also sync it without a cursor column.
In a table without a cursor column, each sync replaces the whole table in the synced usage data. The next sync therefore picks up the fix.The revision method also works for the rows of a table of synced usage data. See Replace usage events.
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 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":""},"chroma":{"liveDeploymentHistoryId":"6aec1077764efbd8f998fce2","collectionId":"d9195d82-8cf1-4b5f-a913-01b9febdb399","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aec1077764efbd8f998fce2"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6aec1077764efbd8f998fce2","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"Documentation","count":324},{"language":"default","tag":"Product modules","count":193},{"language":"default","tag":"API Reference","count":164},{"language":"default","tag":"Third-party integrations","count":68},{"language":"default","tag":"How-to guides","count":43},{"language":"default","tag":"Contracts","count":40},{"language":"default","tag":"Data sources","count":39},{"language":"default","tag":"Concepts","count":36},{"language":"default","tag":"Accounting","count":35},{"language":"default","tag":"Products","count":34}]},"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":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"20260301/product-modules/usage/how-to-guides/historical-usage","slug":"/20260301/product-modules/usage/how-to-guides/historical-usage","pageMetadata":{"title":"Correct historical usage","excerpt":"Steps to correct usage that Zenskar already recorded or read, so that billable metrics give the right number.","deprecated":false,"hidden":false,"metadata":{"robots":"index"},"next":null,"description":null,"href":"/20260301/product-modules/usage/how-to-guides/historical-usage","hiddenSetByFrontmatter":true},"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/product-modules/usage/glossary#usage-event`,children:`usage event`}),` cannot be edited or deleted. To correct `,_jsx(_components.a,{href:`/20260301/product-modules/usage/glossary#usage`,children:`usage`}),` later, give each usage event an identity and a revision from the start. A `,_jsx(_components.a,{href:`/20260301/product-modules/usage/glossary#billable-metric`,children:`billable metric`}),` can then keep only the latest revision of each usage event.`]}),`\n`,_jsx(Heading,{level:`3`,id:`prerequisites`,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 to create a `,_jsx(_components.a,{href:`/20260301/product-modules/usage/glossary#usage-event-collection`,children:`usage-event collection`}),`. To add `,_jsx(_components.a,{href:`/20260301/product-modules/usage/glossary#data-field`,children:`data fields`}),`, you need `,_jsx(_components.strong,{children:`Can Update Usage Event`}),`. See `,_jsx(_components.a,{href:`/20260301/product-modules/usage/reference/usage-events#permissions`,children:`Permissions`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`add-the-correction-fields`,children:`Add the correction fields`}),`\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 `,_jsx(_components.a,{href:`/20260301/product-modules/usage/glossary#data-field`,children:`data fields`}),` to the `,_jsx(_components.a,{href:`/20260301/product-modules/usage/glossary#data-schema`,children:`data schema`}),` of the `,_jsx(_components.a,{href:`/20260301/product-modules/usage/glossary#usage-event-collection`,children:`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 version of a usage event.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/20260301/product-modules/usage/how-to-guides/usage-events#create-a-usage-event-collection`,children:`Create a usage-event collection`}),` or `,_jsx(_components.a,{href:`/20260301/product-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`,_jsx(Heading,{level:`2`,id:`replace-usage-events`,children:`Replace usage events`}),`\n`,_jsx(_components.p,{children:`Send a corrected version of a usage event. Build the billable metric so that it keeps only the latest revision of each usage event. 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:[`You need a role with the `,_jsx(_components.strong,{children:`Can Create Usage Event`}),` permission to send usage events. You need the `,_jsx(_components.strong,{children:`Can Update Billable Metric`}),` permission to change the billable metric. Both also need their read permissions. See `,_jsx(_components.a,{href:`/20260301/product-modules/usage/reference/billable-metrics#permissions`,children:`Permissions`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`send-the-corrected-usage-event`,children:`Send the corrected usage event`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`A corrected usage event with a different `,_jsx(_components.code,{children:`timestamp`}),` can fall in another `,_jsx(_components.a,{href:`/20260301/product-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:[`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/product-modules/usage/how-to-guides/usage-events#send-usage-events-through-the-api`,children:`Send usage events through the API`}),`.`]}),`\n`,_jsx(_components.li,{children:`Put the corrected values in the other data fields.`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`keep-the-latest-revision-in-the-billable-metric`,children:`Keep the latest revision in the billable metric`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`\n`,_jsxs(_components.p,{children:[`Open the billable metric in the `,_jsx(_components.a,{href:`/20260301/product-modules/usage/glossary#sql-builder`,children:`SQL builder`}),`. If it uses the `,_jsx(_components.a,{href:`/20260301/product-modules/usage/glossary#visual-builder`,children:`visual builder`}),`, move it first. See `,_jsx(_components.a,{href:`/20260301/product-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. The query then keeps only the first row of each `,_jsx(_components.code,{children:`event_id`}),`. 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/product-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:[`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-events`,children:`Offset usage events`}),`\n`,_jsx(_components.p,{children:`Send a usage event that cancels out part of the usage that was recorded wrongly. This method works for billable metrics that add values up: sums, and counts that you rebuild as sums. It needs no change to a billable metric that already sums.`}),`\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. See `,_jsx(_components.a,{href:`/20260301/product-modules/usage/reference/usage-events#permissions`,children:`Permissions`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`offset-a-sum`,children:`Offset a sum`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`An offsetting usage event with a `,_jsx(_components.code,{children:`timestamp`}),` in another billing period changes that 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 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`,_jsx(_components.p,{children:`The sum of the billing period then includes the negative value.`}),`\n`,_jsx(Heading,{level:`3`,id:`offset-a-count`,children:`Offset a count`}),`\n`,_jsx(_components.p,{children:`A count cannot go down by adding usage events. Count with a sum of a number instead.`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Add an Int64 data field, such as `,_jsx(_components.code,{children:`units`}),`, to the usage-event collection. See `,_jsx(_components.a,{href:`/20260301/product-modules/usage/how-to-guides/usage-events#add-a-data-field`,children:`Add a data field`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Send `,_jsx(_components.code,{children:`1`}),` in `,_jsx(_components.code,{children:`units`}),` with every usage event.`]}),`\n`]}),`\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. A sum over `,_jsx(_components.code,{children:`units`}),` leaves them out. Change the billable metric only from the first billing period in which every usage event has `,_jsx(_components.code,{children:`units`}),`.`]})}),`\n`,_jsxs(_components.ol,{start:`3`,children:[`\n`,_jsxs(_components.li,{children:[`Change the billable metric to use the `,_jsx(_components.a,{href:`/20260301/product-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/product-modules/usage/how-to-guides/billable-metrics#edit-a-billable-metric`,children:`Edit a billable metric`}),`.`]}),`\n`,_jsxs(_components.li,{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`,_jsx(Heading,{level:`2`,id:`correct-usage-in-a-data-source`,children:`Correct usage in a data source`}),`\n`,_jsxs(_components.p,{children:[`Correct usage that a `,_jsx(_components.a,{href:`/20260301/product-modules/usage/glossary#data-source`,children:`data source`}),` reads by fixing the data in your system. When Zenskar picks up the fix depends on the access of the data source.`]}),`\n`,_jsx(Heading,{level:`3`,id:`prerequisites-4`,children:`Prerequisites`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`You need access to the system that the data source connects to.`}),`\n`,_jsxs(_components.li,{children:[`To sync right away, you need a role with the `,_jsx(_components.strong,{children:`Can Read Data Source`}),` permission. See `,_jsx(_components.a,{href:`/20260301/product-modules/usage/reference/data-sources#permissions`,children:`Permissions`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`correct-a-remote-data-source`,children:`Correct a remote data source`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Fix the data in your system.`}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Zenskar queries a `,_jsx(_components.a,{href:`/20260301/product-modules/usage/glossary#remote-data-source`,children:`remote data source`}),` each time it calculates. The next preview or calculation therefore uses the fix.`]}),`\n`,_jsx(Heading,{level:`3`,id:`correct-a-synced-data-source`,children:`Correct a synced data source`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`In a table with a `,_jsx(_components.a,{href:`/20260301/product-modules/usage/glossary#cursor-column`,children:`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. The old row stays. Correct such a table by adding new rows with the revision method. You can also sync it without a cursor column.`]})}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Fix the data in your system.`}),`\n`,_jsxs(_components.li,{children:[`Wait for the next scheduled sync, or start one. See `,_jsx(_components.a,{href:`/20260301/product-modules/usage/how-to-guides/data-sources#sync-now-pause-or-resume-syncing`,children:`Sync now, pause, or resume syncing`}),`.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`In a table without a cursor column, each sync replaces the whole table in the synced usage data. The next sync therefore picks up the fix.`}),`\n`,_jsxs(_components.p,{children:[`The revision method also works for the rows of a table of synced usage data. See `,_jsx(_components.a,{href:`#replace-usage-events`,children:`Replace usage events`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`recalculate-charges`,children:`Recalculate charges`}),`\n`,_jsxs(_components.p,{children:[`A corrected usage event or a fixed data source changes a `,_jsx(_components.a,{href:`/20260301/product-modules/contracts/glossary#quantity`,children:`quantity`}),` only when Zenskar calculates it again. Zenskar calculates the quantity of a billing period when it builds the invoice of that period.`]}),`\n`,_jsx(Heading,{level:`3`,id:`prerequisites-5`,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-events`,children:`Offset usage events`}),`, 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:`recalculate-the-invoices-of-a-contract`,children:`Recalculate the invoices of a contract`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`For each contract that the correction affects, regenerate its invoices. See `,_jsx(_components.a,{href:`/20260301/product-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:[_jsx(_components.a,{href:`/20260301/product-modules/contracts/glossary#invoice-regeneration`,children:`Invoice regeneration`}),` recalculates the draft and upcoming invoices of an active contract. A change to a period whose invoice is already approved follows the `,_jsx(_components.a,{href:`/20260301/product-modules/contracts/glossary#invoicing-config`,children:`invoicing config`}),` of the contract. See `,_jsx(_components.a,{href:`/20260301/product-modules/contracts/concepts/contracts#invoicing-configs-increases-after-approval`,children:`Invoicing configs: 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":"Correct historical usage","excerpt":"Steps to correct usage that Zenskar already recorded or read, so that billable metrics give the right number.","deprecated":false,"hidden":false,"metadata":{"robots":"index"},"next":null,"description":null,"href":"/20260301/product-modules/usage/how-to-guides/historical-usage","hiddenSetByFrontmatter":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Plan for corrections","slug":"plan-for-corrections","depth":2,"children":[{"title":"Prerequisites","slug":"prerequisites","depth":3,"children":[]},{"title":"Add the correction fields","slug":"add-the-correction-fields","depth":3,"children":[]}]},{"title":"Replace usage events","slug":"replace-usage-events","depth":2,"children":[{"title":"Prerequisites","slug":"prerequisites-2","depth":3,"children":[]},{"title":"Send the corrected usage event","slug":"send-the-corrected-usage-event","depth":3,"children":[]},{"title":"Keep the latest revision in the billable metric","slug":"keep-the-latest-revision-in-the-billable-metric","depth":3,"children":[]}]},{"title":"Offset usage events","slug":"offset-usage-events","depth":2,"children":[{"title":"Prerequisites","slug":"prerequisites-3","depth":3,"children":[]},{"title":"Offset a sum","slug":"offset-a-sum","depth":3,"children":[]},{"title":"Offset a count","slug":"offset-a-count","depth":3,"children":[]}]},{"title":"Correct usage in a data source","slug":"correct-usage-in-a-data-source","depth":2,"children":[{"title":"Prerequisites","slug":"prerequisites-4","depth":3,"children":[]},{"title":"Correct a remote data source","slug":"correct-a-remote-data-source","depth":3,"children":[]},{"title":"Correct a synced data source","slug":"correct-a-synced-data-source","depth":3,"children":[]}]},{"title":"Recalculate charges","slug":"recalculate-charges","depth":2,"children":[{"title":"Prerequisites","slug":"prerequisites-5","depth":3,"children":[]},{"title":"Recalculate the invoices of a contract","slug":"recalculate-the-invoices-of-a-contract","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"zenskar-3d451781","siteName":"Zenskar Documentation","title":"Correct historical usage - Zenskar Documentation","contextualStarterQuestions":[{"_id":"6ae44f180b1540aa06ec3a53","deploymentId":"69e0a11c3e5ca76e4bd3f576","questionText":"How do I correct usage events?","status":"active","generatedBy":"contextual","path":"20260301/product-modules/usage/how-to-guides/historical-usage","createdAt":"2026-10-30T08:02:32.021Z","updatedAt":"2026-10-30T08:02:32.021Z","__v":0},{"_id":"6ae44f180b1540aa06ec3a55","deploymentId":"69e0a11c3e5ca76e4bd3f576","questionText":"How does revision tracking work?","status":"active","generatedBy":"contextual","path":"20260301/product-modules/usage/how-to-guides/historical-usage","createdAt":"2026-10-30T08:02:32.021Z","updatedAt":"2026-10-30T08:02:32.021Z","__v":0},{"_id":"6ae44f180b1540aa06ec3a54","deploymentId":"69e0a11c3e5ca76e4bd3f576","questionText":"What fields do I need to add?","status":"active","generatedBy":"contextual","path":"20260301/product-modules/usage/how-to-guides/historical-usage","createdAt":"2026-10-30T08:02:32.021Z","updatedAt":"2026-10-30T08:02:32.021Z","__v":0}],"navMaps":{"firstHrefInVersion":{"cedar.ALPHA.20260301":{"href":"/20260301/product-modules/usage/how-to-guides/historical-usage","matchLevel":0},"baobab.20240301":{"href":"/20240301/product-modules/accounting/concepts/chart-of-accounts","matchLevel":2}},"firstHrefInLanguage":{}},"lastModified":"2026-10-30T08:02:25.070Z","originalFileLocation":"20260301/product-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=\"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=\"Correct historical usage - Zenskar Documentation\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Zenskar Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://zenskar.com/docs/20260301/product-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=Correct+historical+usage\u0026amp;theme=a962312433b97c96be242726\u0026amp;signature=663bdce1eadf8e962c9590383712ac9c71aa5680e91a2c337e22582b3a0d2b79\">\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=\"Correct historical usage - Zenskar Documentation\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://zenskar-3d451781.mintlify.site/docs/_mintlify/api/og/v2?division=How-to+guides\u0026amp;title=Correct+historical+usage\u0026amp;theme=a962312433b97c96be242726\u0026amp;signature=663bdce1eadf8e962c9590383712ac9c71aa5680e91a2c337e22582b3a0d2b79\">\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/product-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/product-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/product-modules/usage/how-to-guides/historical-usage#webpage\",\"url\":\"https://zenskar.com/docs/20260301/product-modules/usage/how-to-guides/historical-usage\",\"name\":\"Correct historical usage\",\"dateModified\":\"2026-10-30T08:02:25.070Z\",\"isPartOf\":{\"@id\":\"https://zenskar.com/docs#website\"},\"breadcrumb\":{\"@id\":\"https://zenskar.com/docs/20260301/product-modules/usage/how-to-guides/historical-usage#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://zenskar.com/docs/20260301/product-modules/usage/how-to-guides/historical-usage#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Product modules\",\"item\":\"https://zenskar.com/docs/20260301/product-modules/accounting/concepts/chart-of-accounts\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Usage\",\"item\":\"https://zenskar.com/docs/20260301/product-modules/usage/concepts/usage\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How-to guides\",\"item\":\"https://zenskar.com/docs/20260301/product-modules/usage/how-to-guides/usage-events\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Correct historical usage\",\"item\":\"https://zenskar.com/docs/20260301/product-modules/usage/how-to-guides/historical-usage\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://zenskar.com/docs/20260301/product-modules/usage/how-to-guides/historical-usage#article\",\"headline\":\"Correct historical usage\",\"name\":\"Correct historical usage\",\"url\":\"https://zenskar.com/docs/20260301/product-modules/usage/how-to-guides/historical-usage\",\"mainEntityOfPage\":{\"@id\":\"https://zenskar.com/docs/20260301/product-modules/usage/how-to-guides/historical-usage#webpage\"},\"dateModified\":\"2026-10-30T08:02:25.070Z\",\"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\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","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":"Product modules","pages":[{"group":"Accounting","pages":[{"group":"Concepts","expanded":false,"pages":[{"title":"Chart of accounts","deprecated":false,"hidden":false,"href":"/20260301/product-modules/accounting/concepts/chart-of-accounts"},{"title":"ASC 606 and IFRS 15: Five steps of revenue recognition","deprecated":false,"hidden":false,"href":"/20260301/product-modules/accounting/concepts/five-steps-of-revenue-recognition"},{"title":"Revenue lifecycle","deprecated":false,"hidden":false,"href":"/20260301/product-modules/accounting/concepts/revenue-lifecycle"}]},{"group":"How-to guides","expanded":false,"pages":[{"title":"Create a revenue recognition rule","deprecated":false,"hidden":false,"href":"/20260301/product-modules/accounting/how-to-guides/create-a-revenue-recognition-rule"},{"title":"Revenue distribution and redistribution methods","deprecated":false,"hidden":false,"href":"/20260301/product-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/product-modules/accounting/reference/revenue-adjustment-methods"},{"title":"Revenue distribution methods","deprecated":false,"hidden":false,"href":"/20260301/product-modules/accounting/reference/revenue-distribution-methods"},{"title":"Performance obligation policies","deprecated":false,"hidden":false,"href":"/20260301/product-modules/accounting/reference/performance-obligation-policies"}]}]},{"group":"Customers","pages":[{"group":"Concepts","expanded":false,"pages":[{"title":"Customers","sidebarTitle":"Customers","href":"/20260301/product-modules/customers/concepts/customers"},{"title":"Customer-facing portal","sidebarTitle":"Customer-facing portal","href":"/20260301/product-modules/customers/concepts/customer-facing-portal"}]},{"group":"Walkthroughs","expanded":false,"pages":[{"title":"Customers","sidebarTitle":"Customers","href":"/20260301/product-modules/customers/walkthroughs/customers"}]},{"group":"How-to guides","expanded":false,"pages":[{"title":"Add customers to Zenskar","sidebarTitle":"Add customers","href":"/20260301/product-modules/customers/how-to-guides/add-customers"},{"title":"Manage customers","sidebarTitle":"Manage customers","href":"/20260301/product-modules/customers/how-to-guides/manage-customers"},{"title":"Use the customer-facing portal","sidebarTitle":"Customer-facing portal","href":"/20260301/product-modules/customers/how-to-guides/customer-facing-portal"}]},{"group":"Reference","expanded":false,"pages":[{"title":"Customers reference","sidebarTitle":"Customers","href":"/20260301/product-modules/customers/reference/customers"},{"title":"Customer-facing portal reference","sidebarTitle":"Customer-facing portal","href":"/20260301/product-modules/customers/reference/customer-facing-portal"}]}]},{"group":"Contracts","pages":[{"group":"Concepts","expanded":false,"pages":[{"title":"Contracts","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/concepts/contracts"},{"title":"Payment terms","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/concepts/payment-terms"},{"group":"Line items","pages":[{"title":"Line item: pricing","sidebarTitle":"Pricing","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/concepts/line-items/pricing"},{"title":"Line item: billing","sidebarTitle":"Billing","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/concepts/line-items/billing"},{"title":"Line item: quantity","sidebarTitle":"Quantity","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/concepts/line-items/quantity"},{"title":"Line item: minimum commitments","sidebarTitle":"Minimum commitments","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/concepts/line-items/minimum-commitments"},{"title":"Line item: discounts","sidebarTitle":"Discounts","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/concepts/line-items/discounts"},{"title":"Line item: anchor dates","sidebarTitle":"Anchor dates","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/concepts/line-items/anchor-dates"}]}]},{"group":"Walkthroughs","expanded":false,"pages":[{"title":"Sell Acme Corp a contract for API calls and seats","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/walkthroughs/contracts"}]},{"group":"How-to guides","expanded":false,"pages":[{"title":"Contracts","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/how-to-guides/contracts"},{"title":"Payment terms","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/how-to-guides/payment-terms"},{"title":"Line items","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/how-to-guides/line-items"},{"title":"Discounts","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/how-to-guides/discounts"},{"title":"Minimum commitments","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/how-to-guides/minimum-commitments"},{"title":"Invoices of a contract","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/how-to-guides/invoices"}]},{"group":"Reference","expanded":false,"pages":[{"title":"Contracts","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/reference/contracts"},{"title":"Line items","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/reference/line-items"}]},{"title":"Glossary","deprecated":false,"hidden":false,"href":"/20260301/product-modules/contracts/glossary"}]},{"group":"Products","pages":[{"group":"Concepts","expanded":false,"pages":[{"title":"Products","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/concepts/products"}]},{"group":"Walkthroughs","expanded":false,"pages":[{"title":"Point-in-time products: end-to-end walkthrough","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/walkthroughs/point-in-time-product"},{"title":"Period-of-time products: end-to-end walkthrough","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/walkthroughs/period-of-time-product"},{"title":"Recurring quantity strategy: focused walkthrough","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/walkthroughs/recurring-quantity-strategy"}]},{"group":"How-to guides","expanded":false,"pages":[{"title":"Products","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/how-to-guides/products"},{"title":"Pricing presets","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/how-to-guides/pricing-presets"},{"group":"Pricing models","expanded":false,"pages":[{"title":"Set up the per-unit pricing model","sidebarTitle":"Per unit","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/how-to-guides/pricing-models/per-unit"},{"title":"Set up the percent pricing model","sidebarTitle":"Percent","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/how-to-guides/pricing-models/percent"},{"title":"Set up the volume pricing model","sidebarTitle":"Volume","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/how-to-guides/pricing-models/volume"},{"title":"Set up the tiered pricing model","sidebarTitle":"Tiered","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/how-to-guides/pricing-models/tiered"},{"title":"Set up the dimensional pricing model","sidebarTitle":"Dimensional","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/how-to-guides/pricing-models/dimensional"}]},{"title":"Metered usage","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/how-to-guides/metered-usage"}]},{"group":"Reference","expanded":false,"pages":[{"title":"Reference","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/reference/products"},{"title":"Pricing presets","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/reference/pricing-presets"}]},{"title":"Glossary","deprecated":false,"hidden":false,"href":"/20260301/product-modules/products/glossary"}]},{"group":"Usage","pages":[{"group":"Concepts","expanded":false,"pages":[{"title":"Usage","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/concepts/usage"},{"title":"Usage events","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/concepts/usage-events"},{"title":"S3 ingestion","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/concepts/s3-ingestion"},{"title":"Data sources","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/concepts/data-sources"},{"title":"Billable metrics","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/concepts/billable-metrics"}]},{"group":"Walkthroughs","expanded":false,"pages":[{"title":"Usage: end-to-end walkthrough","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/walkthroughs/usage"}]},{"group":"How-to guides","expanded":false,"pages":[{"title":"Usage events","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/how-to-guides/usage-events"},{"title":"S3 ingestion","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/how-to-guides/s3-ingestion"},{"title":"Data sources","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/how-to-guides/data-sources"},{"title":"Billable metrics","deprecated":false,"hidden":false,"description":null,"href":"/20260301/product-modules/usage/how-to-guides/billable-metrics"},{"title":"Correct historical usage","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/how-to-guides/historical-usage"}]},{"group":"Reference","expanded":false,"pages":[{"title":"Usage events","deprecated":false,"hidden":false,"description":null,"href":"/20260301/product-modules/usage/reference/usage-events"},{"title":"S3 ingestion","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/reference/s3-ingestion"},{"title":"Data sources","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/reference/data-sources"},{"title":"Billable metrics","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/reference/billable-metrics"}]},{"title":"Glossary","deprecated":false,"hidden":false,"href":"/20260301/product-modules/usage/glossary"}]},{"group":"Settings","pages":[{"title":"General settings","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/general"},{"title":"Business entity","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/business-entity"},{"title":"Payment instructions","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/payment-instructions"},{"title":"Payment","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/payment"},{"title":"Communications settings","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/communications"},{"group":"Contract \u0026 Invoices","expanded":false,"pages":[{"title":"Contract \u0026 Invoices","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/contract-invoices"},{"group":"Invoice date configuration","expanded":false,"pages":[{"title":"Concepts","href":"/20260301/product-modules/settings/invoice-date-configuration/concepts"},{"title":"How-to guides","href":"/20260301/product-modules/settings/invoice-date-configuration/how-to-guides"},{"title":"Reference","href":"/20260301/product-modules/settings/invoice-date-configuration/reference"}]}]},{"title":"Webhook alerts","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/webhook-alerts"},{"group":"Tax configuration","expanded":false,"pages":[{"group":"Concepts","expanded":false,"pages":[{"title":"Tax configuration","sidebarTitle":"Tax configuration","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/tax-configuration/concepts/tax-configuration"},{"title":"Tax rates","sidebarTitle":"Tax rates","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/tax-configuration/concepts/tax-rates"}]},{"title":"Walkthroughs","sidebarTitle":"Walkthroughs","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/tax-configuration/walkthroughs"},{"title":"How-to guides","sidebarTitle":"How-to guides","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/tax-configuration/how-to-guides"},{"title":"Reference","sidebarTitle":"Reference","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/tax-configuration/reference"}]},{"title":"S3 Ingestion","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/s3-ingestion"},{"title":"Custom attributes","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/custom-attributes"},{"title":"API keys","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/api-keys"},{"title":"Glossary","deprecated":false,"hidden":false,"href":"/20260301/product-modules/settings/glossary"}]},{"group":"More","pages":[{"title":"Entitlements","deprecated":false,"hidden":false,"href":"/20260301/product-modules/more/entitlements"},{"group":"Communications","expanded":false,"pages":[{"title":"Communications","deprecated":false,"hidden":false,"href":"/20260301/product-modules/more/communications/index"},{"title":"Email templates","deprecated":false,"hidden":false,"href":"/20260301/product-modules/more/communications/email-templates"},{"title":"Email alerts","deprecated":false,"hidden":false,"href":"/20260301/product-modules/more/communications/email-alerts"},{"title":"Document templates","deprecated":false,"hidden":false,"href":"/20260301/product-modules/more/communications/document-templates"},{"group":"Template guides","expanded":false,"pages":[{"title":"Templating guide","deprecated":false,"hidden":false,"href":"/20260301/product-modules/more/communications/templating-guide"},{"title":"Invoice template variables","deprecated":false,"hidden":false,"href":"/20260301/product-modules/more/communications/invoice-template-variables"},{"title":"Credit note template variables","deprecated":false,"hidden":false,"href":"/20260301/product-modules/more/communications/credit-note-template-variables"},{"title":"Payment receipt template variables","deprecated":false,"hidden":false,"href":"/20260301/product-modules/more/communications/payment-receipt-template-variables"},{"title":"Usage report template variables","deprecated":false,"hidden":false,"href":"/20260301/product-modules/more/communications/usage-report-template-variables"}]},{"title":"Senders","deprecated":false,"hidden":false,"href":"/20260301/product-modules/more/communications/senders"},{"title":"Sent emails","deprecated":false,"hidden":false,"href":"/20260301/product-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":"Pricing models","deprecated":false,"hidden":false,"href":"/20260301/pricing-models/concepts/pricing-models"},{"title":"Per-unit pricing model","sidebarTitle":"Per unit","deprecated":false,"hidden":false,"href":"/20260301/pricing-models/concepts/per-unit"},{"title":"Percent pricing model","sidebarTitle":"Percent","deprecated":false,"hidden":false,"href":"/20260301/pricing-models/concepts/percent"},{"title":"Volume pricing model","sidebarTitle":"Volume","deprecated":false,"hidden":false,"href":"/20260301/pricing-models/concepts/volume"},{"title":"Tiered pricing model","sidebarTitle":"Tiered","deprecated":false,"hidden":false,"href":"/20260301/pricing-models/concepts/tiered"},{"title":"Dimensional pricing model","sidebarTitle":"Dimensional","deprecated":false,"hidden":false,"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/product-modules/accounting/concepts/chart-of-accounts"}]}]},"basePath":"","title":"Correct historical usage - Zenskar Documentation","buildId":"dpl_ATnXPMW25DMPUr9VBw6kL6MfBt6T","deploymentId":"dpl_ATnXPMW25DMPUr9VBw6kL6MfBt6T","dynamics":[],"chunks":[]}