Creates a new invoice record or updates an existing one based on its unique identifier (id). This endpoint supports multiple invoice types (e.g. heat, fuel, electricity, wastes, etc.). - If the id exists, the record is updated. - If the id does not exist, a new record is inserted.
⚠️ Special rules: - emissionFactor in lines is optional. - companySplitOriginalValues is optional. - wasteType and wasteDisposalMethod are required only when type = waste.
{"docsConfig":{"theme":"maple","$schema":"https://mintlify.com/schema.json","name":"Manglai API Documentation","colors":{"primary":"#00b39b","light":"#00e6c8","dark":"#1A202C"},"logo":{"light":"https://www.manglai.io/images/logo-text.png","dark":"https://www.manglai.io/images/logo-text-teal.png"},"favicon":"https://mintcdn.com/manglai/8VYPiHtPReQk7RF1/favicon.ico?fit=max\u0026auto=format\u0026n=8VYPiHtPReQk7RF1\u0026q=85\u0026s=a1e170925c0c0e909c02177b8f20ff6c","background":{"decoration":"gradient","color":{"light":"#F7FAFC","dark":"#171923"}},"seo":{"metatags":{"robots":"index, follow"}},"fonts":{"family":"Figtree"},"icons":{"library":"lucide"},"styling":{"latex":false},"navigation":{"languages":[{"language":"es","default":true,"href":"intro"},{"language":"en","href":"intro"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"manglai","hasAudioNarration":false,"actualSubdomain":"manglai","customDomains":["developers.manglai.io"],"gitSource":{"type":"github","owner":"sustainability-solutions","repo":"manglai","deployBranch":"main","contentDirectory":"apps/api-docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ab69c32669e314d29e98b14","clientVersion":"0.0.4087","searchFilterCounts":[{"language":"default","tag":"API Reference","count":67},{"language":"en","tag":"Documentation","count":27},{"language":"es","tag":"Documentación","count":27},{"language":"en","tag":"MCP Tools","count":11},{"language":"es","tag":"MCP Tools","count":11},{"language":"default","tag":"companies","count":11},{"language":"en","tag":"REST API","count":10},{"language":"es","tag":"API REST","count":10},{"language":"default","tag":"Documentación","count":9},{"language":"default","tag":"invoices","count":6},{"language":"default","tag":"Ejemplos","count":4},{"language":"default","tag":"consumptions","count":4},{"language":"default","tag":"goals","count":4},{"language":"default","tag":"service-footprint-glec","count":4},{"language":"default","tag":"users","count":4},{"language":"default","tag":"vehicles","count":4},{"language":"en","tag":"MCP Integrations","count":3},{"language":"en","tag":"MCP (Model Context Protocol)","count":3},{"language":"es","tag":"Integraciones MCP","count":3},{"language":"es","tag":"MCP (Model Context Protocol)","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"api-reference/invoices/insert-or-update-an-invoice","slug":"/api-reference/invoices/insert-or-update-an-invoice","pageMetadata":{"title":"Insert or update an invoice","description":"Creates a new invoice record or updates an existing one based on its unique identifier (`id`). This endpoint supports multiple invoice types (e.g. heat, fuel, electricity, wastes, etc.). - If the `id` exists, the record is updated. - If the `id` does not exist, a new record is inserted.\n⚠️ **Special rules:** - `emissionFactor` in `lines` is **optional**. - `companySplitOriginalValues` is **optional**. - `wasteType` and `wasteDisposalMethod` are **required only when `type = waste`**.\n","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/invoices","href":"/api-reference/invoices/insert-or-update-an-invoice","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n strong: \"strong\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_components.p, {\n children: [\"Creates a new invoice record or updates an existing one based on its unique identifier (\", _jsx(_components.code, {\n children: \"id\"\n }), \"). This endpoint supports multiple invoice types (e.g. heat, fuel, electricity, wastes, etc.). - If the \", _jsx(_components.code, {\n children: \"id\"\n }), \" exists, the record is updated. - If the \", _jsx(_components.code, {\n children: \"id\"\n }), \" does not exist, a new record is inserted.\\n⚠️ \", _jsx(_components.strong, {\n children: \"Special rules:\"\n }), \" - \", _jsx(_components.code, {\n children: \"emissionFactor\"\n }), \" in \", _jsx(_components.code, {\n children: \"lines\"\n }), \" is \", _jsx(_components.strong, {\n children: \"optional\"\n }), \". - \", _jsx(_components.code, {\n children: \"companySplitOriginalValues\"\n }), \" is \", _jsx(_components.strong, {\n children: \"optional\"\n }), \". - \", _jsx(_components.code, {\n children: \"wasteType\"\n }), \" and \", _jsx(_components.code, {\n children: \"wasteDisposalMethod\"\n }), \" are \", _jsxs(_components.strong, {\n children: [\"required only when \", _jsx(_components.code, {\n children: \"type = waste\"\n })]\n }), \".\"]\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}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Insert or update an invoice","description":"Creates a new invoice record or updates an existing one based on its unique identifier (`id`). This endpoint supports multiple invoice types (e.g. heat, fuel, electricity, wastes, etc.). - If the `id` exists, the record is updated. - If the `id` does not exist, a new record is inserted.\n⚠️ **Special rules:** - `emissionFactor` in `lines` is **optional**. - `companySplitOriginalValues` is **optional**. - `wasteType` and `wasteDisposalMethod` are **required only when `type = waste`**.\n","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/invoices","href":"/api-reference/invoices/insert-or-update-an-invoice","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"summary":"Insert or update an invoice","description":"Creates a new invoice record or updates an existing one based on its unique identifier (`id`). This endpoint supports multiple invoice types (e.g. heat, fuel, electricity, wastes, etc.). - If the `id` exists, the record is updated. - If the `id` does not exist, a new record is inserted.\n⚠️ **Special rules:** - `emissionFactor` in `lines` is **optional**. - `companySplitOriginalValues` is **optional**. - `wasteType` and `wasteDisposalMethod` are **required only when `type = waste`**.\n","tags":["invoices"],"responses":{"200":"1e134dfa-b183-468e-b3e4-b5262e1a8e0e","400":"efc7f462-2de9-4958-8de2-b8bced2997b6","500":"ea029232-4598-41fa-ae20-b7a58f3a1b5a"},"requestBody":"1c136079-0b46-457c-9460-5412a8420bd8","method":"post","type":"path","servers":["4ebb8f27-dfb9-4645-8719-020c916af2bf"],"security":["c0c6ad3b-d7be-435b-a086-c68d9c7a4719"],"path":"/api/v1/invoices","baseUrlOptions":["https://www.manglai.io"],"title":"Insert or update an invoice","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","type","companyId","totalCost","currency","startDate","endDate"],"properties":{"id":{"type":"string","description":"Unique identifier of the invoice.","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"type":{"type":"string","description":"Type of the invoice.","enum":["heat","fuel","electricity","generated-energy","process-emissions","water","wastes","wastes-expenses","others","waste-water"],"isRequired":true,"uniqueKey":"type","typeLabel":"enum\u003cstring>"},"companyId":{"type":"string","description":"Company associated with the invoice.","isRequired":true,"uniqueKey":"companyId","typeLabel":"string"},"totalCost":{"type":"number","description":"Total cost of the invoice.","isRequired":true,"uniqueKey":"totalCost","typeLabel":"number"},"currency":{"type":"string","description":"Currency of the invoice (e.g., USD, EUR).","isRequired":true,"uniqueKey":"currency","typeLabel":"string"},"startDate":{"type":"string","format":"date","description":"Start date of the invoice period.","isRequired":true,"uniqueKey":"startDate","typeLabel":"string\u003cdate>"},"endDate":{"type":"string","format":"date","description":"End date of the invoice period.","isRequired":true,"uniqueKey":"endDate","typeLabel":"string\u003cdate>"},"buildingId":{"type":"string","description":"Building associated with the invoice.","uniqueKey":"buildingId","typeLabel":"string"},"cup":{"type":"string","description":"Unique identifier for the invoice (e.g., CUP code).","uniqueKey":"cup","typeLabel":"string"},"supplier":{"type":"string","description":"Supplier name.","uniqueKey":"supplier","typeLabel":"string"},"rawProvider":{"type":"string","description":"Raw provider for the invoice.","uniqueKey":"rawProvider","typeLabel":"string"},"wasteType":{"type":"string","description":"Waste type (⚠️ required only if `type = waste`).","uniqueKey":"wasteType","typeLabel":"string"},"wasteDisposalMethod":{"type":"string","description":"Waste disposal method (⚠️ required only if `type = waste`).","uniqueKey":"wasteDisposalMethod","typeLabel":"string"},"status":{"type":"string","description":"Invoice status.","enum":["valid","draft"],"uniqueKey":"status","typeLabel":"enum\u003cstring>"},"lines":{"type":"array","description":"Line items associated with the invoice.","items":{"type":"object","required":["quantity","unit"],"properties":{"quantity":{"type":"number","description":"Quantity of the item.","isRequired":true,"uniqueKey":"lines.items.[INDEX].quantity","typeLabel":"number"},"unit":{"type":"string","description":"Measurement unit (e.g., kWh, liters).","isRequired":true,"uniqueKey":"lines.items.[INDEX].unit","typeLabel":"string"},"fuel":{"type":"string","uniqueKey":"lines.items.[INDEX].fuel","typeLabel":"string"},"type":{"type":"string","uniqueKey":"lines.items.[INDEX].type","typeLabel":"string"},"emissions":{"type":"number","description":"Emissions associated with the line item (in kg of CO2e).","uniqueKey":"lines.items.[INDEX].emissions","typeLabel":"number"},"emissionFactor":{"type":"number","description":"Emission factor (optional).","uniqueKey":"lines.items.[INDEX].emissionFactor","typeLabel":"number"},"gdo":{"type":"string","uniqueKey":"lines.items.[INDEX].gdo","typeLabel":"string"},"prevGdo":{"type":"string","uniqueKey":"lines.items.[INDEX].prevGdo","typeLabel":"string"},"regoId":{"type":"string","uniqueKey":"lines.items.[INDEX].regoId","typeLabel":"string"},"renewablePercentage":{"type":"number","uniqueKey":"lines.items.[INDEX].renewablePercentage","typeLabel":"number"},"emissionEntityId":{"type":"string","uniqueKey":"lines.items.[INDEX].emissionEntityId","typeLabel":"string"}},"uniqueKey":"lines.items.[INDEX]","typeLabel":"object"},"uniqueKey":"lines","typeLabel":"object[]"},"attachedFilePath":{"type":"string","description":"Path to the attached file.","uniqueKey":"attachedFilePath","typeLabel":"string"},"removedAt":{"type":"string","format":"date","description":"Date when the invoice was removed.","uniqueKey":"removedAt","typeLabel":"string\u003cdate>"},"countryCode":{"type":"string","description":"ISO country code of the company (e.g., ES, FR).","uniqueKey":"countryCode","typeLabel":"string"},"externalId":{"type":"string","description":"External identifier for the invoice.","uniqueKey":"externalId","typeLabel":"string"},"splitPercentage":{"type":"number","description":"Percentage for splitting the invoice.","uniqueKey":"splitPercentage","typeLabel":"number"},"splitYear":{"type":"number","description":"Year associated with the split.","uniqueKey":"splitYear","typeLabel":"number"},"splitId":{"type":"string","description":"Identifier of the split.","uniqueKey":"splitId","typeLabel":"string"},"wasValidated":{"type":"boolean","description":"Indicates if the invoice was validated.","uniqueKey":"wasValidated","typeLabel":"boolean"},"validation":{"type":"object","description":"Validation data for the invoice.","uniqueKey":"validation","typeLabel":"object"},"relationalId":{"type":"string","description":"Relational ID for the invoice.","uniqueKey":"relationalId","typeLabel":"string"},"companySplitOriginalValues":{"type":"object","description":"Snapshot of values before splitting. ⚠️ Optional: only provided if the invoice was split.\n","properties":{"quantity":{"type":"number","uniqueKey":"companySplitOriginalValues.quantity","typeLabel":"number"},"totalCost":{"type":"number","uniqueKey":"companySplitOriginalValues.totalCost","typeLabel":"number"},"configurationSnapshot":{"type":"object","uniqueKey":"companySplitOriginalValues.configurationSnapshot","typeLabel":"object"}},"uniqueKey":"companySplitOriginalValues","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"\u003cstring>","companyId":"\u003cstring>","totalCost":123,"currency":"\u003cstring>","startDate":"2023-12-25","endDate":"2023-12-25","buildingId":"\u003cstring>","cup":"\u003cstring>","supplier":"\u003cstring>","rawProvider":"\u003cstring>","wasteType":"\u003cstring>","wasteDisposalMethod":"\u003cstring>","lines":[{"quantity":123,"unit":"\u003cstring>","fuel":"\u003cstring>","type":"\u003cstring>","emissions":123,"emissionFactor":123,"gdo":"\u003cstring>","prevGdo":"\u003cstring>","regoId":"\u003cstring>","renewablePercentage":123,"emissionEntityId":"\u003cstring>"}],"attachedFilePath":"\u003cstring>","removedAt":"2023-12-25","countryCode":"\u003cstring>","externalId":"\u003cstring>","splitPercentage":123,"splitYear":123,"splitId":"\u003cstring>","wasValidated":true,"validation":{},"relationalId":"\u003cstring>","companySplitOriginalValues":{"quantity":123,"totalCost":123,"configurationSnapshot":{}}}}},"exampleType":"generated"}},"description":"Invoice data to be inserted or updated.","exampleType":"generated"},"responses":{"1e134dfa-b183-468e-b3e4-b5262e1a8e0e":{"description":"Invoice successfully inserted or updated.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"ok","uniqueKey":"status","typeLabel":"string"},"invoice":{"type":"object","description":"The invoice object","uniqueKey":"invoice","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"status":"ok","invoice":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"efc7f462-2de9-4958-8de2-b8bced2997b6":{"description":"Bad request — missing required fields or invalid data.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"ea029232-4598-41fa-ae20-b7a58f3a1b5a":{"description":"Internal server error during upsert operation.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"c0c6ad3b-d7be-435b-a086-c68d9c7a4719":{"apiTokenAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","scopes":[]}}},"servers":{"4ebb8f27-dfb9-4645-8719-020c916af2bf":{"url":"https://www.manglai.io","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"JWT","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"apiTokenAuth","name":"Authorization"}],"title":"apiTokenAuth"}]},"originalFileLocation":"openapi.json"},"subdomain":"manglai","siteName":"Manglai API Documentation","title":"Insert or update an invoice - Manglai API Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"es":{"href":"/api-reference/invoices/insert-or-update-an-invoice","matchLevel":0},"en":{"href":"/api-reference/invoices/insert-or-update-an-invoice","matchLevel":0}}},"lastModified":"2026-08-03T20:51:05.737Z","originalFileLocation":"api-reference/invoices/insert-or-update-an-invoice.mdx","locale":"es"},"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=\"Creates a new invoice record or updates an existing one based on its unique identifier (id). This endpoint supports multiple invoice types (e.g. heat, fuel, electricity, wastes, etc.). - If the id exists, the record is updated. - If the id does not exist, a new record is inserted. ⚠️ Special rules: - emissionFactor in lines is optional. - companySplitOriginalValues is optional. - wasteType and wasteDisposalMethod are required only when type = waste.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Manglai API Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/manglai/7brNhcThYY-KmqW1/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/manglai/7brNhcThYY-KmqW1/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/manglai/7brNhcThYY-KmqW1/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/manglai/7brNhcThYY-KmqW1/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/manglai/7brNhcThYY-KmqW1/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/manglai/7brNhcThYY-KmqW1/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/manglai/7brNhcThYY-KmqW1/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/manglai/7brNhcThYY-KmqW1/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/manglai/7brNhcThYY-KmqW1/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Insert or update an invoice - Manglai API Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Creates a new invoice record or updates an existing one based on its unique identifier (id). This endpoint supports multiple invoice types (e.g. heat, fuel, electricity, wastes, etc.). - If the id exists, the record is updated. - If the id does not exist, a new record is inserted. ⚠️ Special rules: - emissionFactor in lines is optional. - companySplitOriginalValues is optional. - wasteType and wasteDisposalMethod are required only when type = waste.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Manglai API Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developers.manglai.io/api-reference/invoices/insert-or-update-an-invoice\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://manglai.mintlify.site/_mintlify/api/og/v2?division=invoices\u0026amp;title=Insert+or+update+an+invoice\u0026amp;description=Creates+a+new+invoice+record+or+updates+an+existing+one+based+on+its+unique+identifier+%28%60id%60%29.+This+endpoint+supports+multiple+invoice+types+%28e.g.+heat%2C+fuel%2C+e\u0026amp;theme=80bb70e5edd519f3b8652bcc\u0026amp;signature=3de45a030b828f6d1c6e270be57f37578e20b8810b70f8b7a10816b682901e68\">\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=\"Insert or update an invoice - Manglai API Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Creates a new invoice record or updates an existing one based on its unique identifier (id). This endpoint supports multiple invoice types (e.g. heat, fuel, electricity, wastes, etc.). - If the id exists, the record is updated. - If the id does not exist, a new record is inserted. ⚠️ Special rules: - emissionFactor in lines is optional. - companySplitOriginalValues is optional. - wasteType and wasteDisposalMethod are required only when type = waste.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://manglai.mintlify.site/_mintlify/api/og/v2?division=invoices\u0026amp;title=Insert+or+update+an+invoice\u0026amp;description=Creates+a+new+invoice+record+or+updates+an+existing+one+based+on+its+unique+identifier+%28%60id%60%29.+This+endpoint+supports+multiple+invoice+types+%28e.g.+heat%2C+fuel%2C+e\u0026amp;theme=80bb70e5edd519f3b8652bcc\u0026amp;signature=3de45a030b828f6d1c6e270be57f37578e20b8810b70f8b7a10816b682901e68\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/manglai/7brNhcThYY-KmqW1/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Manglai API Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#00b39b\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developers.manglai.io/api-reference/invoices/insert-or-update-an-invoice\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/invoices/insert-or-update-an-invoice.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developers.manglai.io/#organization\",\"name\":\"Manglai API Documentation\",\"url\":\"https://developers.manglai.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://www.manglai.io/images/logo-text.png\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developers.manglai.io#website\",\"name\":\"Manglai API Documentation\",\"url\":\"https://developers.manglai.io\",\"publisher\":{\"@id\":\"https://developers.manglai.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developers.manglai.io/api-reference/invoices/insert-or-update-an-invoice#webpage\",\"url\":\"https://developers.manglai.io/api-reference/invoices/insert-or-update-an-invoice\",\"name\":\"Insert or update an invoice\",\"description\":\"Creates a new invoice record or updates an existing one based on its unique identifier (id). This endpoint supports multiple invoice types (e.g. heat, fuel, electricity, wastes, etc.). - If the id exists, the record is updated. - If the id does not exist, a new record is inserted. ⚠️ Special rules: - emissionFactor in lines is optional. - companySplitOriginalValues is optional. - wasteType and wasteDisposalMethod are required only when type = waste.\",\"dateModified\":\"2026-08-03T20:51:05.737Z\",\"isPartOf\":{\"@id\":\"https://developers.manglai.io#website\"},\"breadcrumb\":{\"@id\":\"https://developers.manglai.io/api-reference/invoices/insert-or-update-an-invoice#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developers.manglai.io/api-reference/invoices/insert-or-update-an-invoice#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"invoices\",\"item\":\"https://developers.manglai.io/api-reference/invoices/list-invoices\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Insert or update an invoice\",\"item\":\"https://developers.manglai.io/api-reference/invoices/insert-or-update-an-invoice\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://developers.manglai.io/api-reference/invoices/insert-or-update-an-invoice#apireference\",\"headline\":\"Insert or update an invoice\",\"name\":\"Insert or update an invoice\",\"description\":\"Creates a new invoice record or updates an existing one based on its unique identifier (id). This endpoint supports multiple invoice types (e.g. heat, fuel, electricity, wastes, etc.). - If the id exists, the record is updated. - If the id does not exist, a new record is inserted. ⚠️ Special rules: - emissionFactor in lines is optional. - companySplitOriginalValues is optional. - wasteType and wasteDisposalMethod are required only when type = waste.\",\"url\":\"https://developers.manglai.io/api-reference/invoices/insert-or-update-an-invoice\",\"mainEntityOfPage\":{\"@id\":\"https://developers.manglai.io/api-reference/invoices/insert-or-update-an-invoice#webpage\"},\"dateModified\":\"2026-08-03T20:51:05.737Z\",\"publisher\":{\"@id\":\"https://developers.manglai.io/#organization\"},\"isPartOf\":{\"@id\":\"https://developers.manglai.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Manglai API Documentation\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Manglai API Documentation","nav":{"global":null,"languages":[{"language":"es","default":true,"tabs":[{"tab":"Documentación","pages":[{"title":"Documentación","href":"/intro"}]},{"tab":"API Reference","groups":[{"group":"buildings","pages":[{"title":"Move","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/buildings/move","href":"/api-reference/buildings/move"}]},{"group":"comments","pages":[{"title":"List Comments","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/comments","href":"/api-reference/comments/list-comments"}]},{"group":"consumptions","pages":[{"title":"Get Consumptions Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/consumptions/dashboard","href":"/api-reference/consumptions/get-consumptions-dashboard"},{"title":"Retrieve a specific consumption record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/consumptions/{id}","href":"/api-reference/consumptions/retrieve-a-specific-consumption-record"},{"title":"List Consumptions","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/consumptions","href":"/api-reference/consumptions/list-consumptions"},{"title":"Create or update a consumption record","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/consumptions","href":"/api-reference/consumptions/create-or-update-a-consumption-record"}]},{"group":"custom-metrics","pages":[{"title":"Get Custom Metrics Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/custom-metrics/dashboard","href":"/api-reference/custom-metrics/get-custom-metrics-dashboard"},{"title":"List Custom Metrics","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/custom-metrics","href":"/api-reference/custom-metrics/list-custom-metrics"}]},{"group":"effluents","pages":[{"title":"Delete an effluent","deprecated":null,"version":null,"openapi":"/openapi.json delete /api/v1/effluents/{id}","href":"/api-reference/effluents/delete-an-effluent"},{"title":"List Effluents","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/effluents","href":"/api-reference/effluents/list-effluents"},{"title":"Insert or update an effluent","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/effluents","href":"/api-reference/effluents/insert-or-update-an-effluent"}]},{"group":"goals","pages":[{"title":"List Goals","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/goals","href":"/api-reference/goals/list-goals"},{"title":"List Goals Tasks","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/goals/tasks","href":"/api-reference/goals/list-goals-tasks"},{"title":"Retrieve a specific scenario record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/goals/scenarios/{id}","href":"/api-reference/goals/retrieve-a-specific-scenario-record"},{"title":"List Goals Scenarios","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/goals/scenarios","href":"/api-reference/goals/list-goals-scenarios"}]},{"group":"investments","pages":[{"title":"Get Investments Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/investments/dashboard","href":"/api-reference/investments/get-investments-dashboard"},{"title":"List Investments","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/investments","href":"/api-reference/investments/list-investments"}]},{"group":"invoices","pages":[{"title":"List Invoices","description":"Get a list of invoices","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/invoices","href":"/api-reference/invoices/list-invoices"},{"title":"Insert or update an invoice","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/invoices","href":"/api-reference/invoices/insert-or-update-an-invoice"},{"title":"Upload, scan \u0026 save an invoice","description":"Uploads an invoice file together with its metadata. The system will automatically scan the document, extract relevant data, and create or update the invoice in the database. If any step of the process (upload, scan, or save) fails, an exception is thrown.\n","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/invoices/upload-invoice","href":"/api-reference/invoices/upload-scan-\u0026-save-an-invoice"},{"title":"Retrieve a specific invoice record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/invoices/{id}","href":"/api-reference/invoices/retrieve-a-specific-invoice-record"},{"title":"Delete a specific invoice record","deprecated":null,"version":null,"openapi":"/openapi.json delete /api/v1/invoices/{id}","href":"/api-reference/invoices/delete-a-specific-invoice-record"},{"title":"Get Invoices Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/invoices/dashboard","href":"/api-reference/invoices/get-invoices-dashboard"}]},{"group":"purchased-goods","pages":[{"title":"List Purchased Goods Expenses","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/purchased-goods/expenses","href":"/api-reference/purchased-goods/list-purchased-goods-expenses"}]},{"group":"auth","pages":[{"title":"Login","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/auth/login","href":"/api-reference/auth/login"},{"title":"Logout","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/auth/logout","href":"/api-reference/auth/logout"},{"title":"Who Am I","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/auth/who-am-i","href":"/api-reference/auth/who-am-i"}]},{"group":"business-travels","pages":[{"title":"Get Business Travels Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/business-travels/dashboard","href":"/api-reference/business-travels/get-business-travels-dashboard"},{"title":"List Business Travels","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/business-travels","href":"/api-reference/business-travels/list-business-travels"}]},{"group":"categories","pages":[{"title":"List Categories","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/categories","href":"/api-reference/categories/list-categories"}]},{"group":"certificates","pages":[{"title":"Retrieve a specific certificate record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/certificates/{id}","href":"/api-reference/certificates/retrieve-a-specific-certificate-record"},{"title":"List Certificates","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/certificates","href":"/api-reference/certificates/list-certificates"}]},{"group":"companies","pages":[{"title":"List Companies {id} Buildings","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/buildings","href":"/api-reference/companies/list-companies--buildings"},{"title":"List Companies {id} Buildings Regos Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/buildings/regos-dashboard","href":"/api-reference/companies/list-companies--buildings-regos-dashboard"},{"title":"List Companies {id} Buildings Regos","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/buildings/regos","href":"/api-reference/companies/list-companies--buildings-regos"},{"title":"List Companies {id} Departments","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/departments","href":"/api-reference/companies/list-companies--departments"},{"title":"Get Organization Limit","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/organization-limits/{limitId}","href":"/api-reference/companies/get-organization-limit"},{"title":"Update Company","deprecated":null,"version":null,"openapi":"/openapi.json put /api/v1/companies/{id}/organization-limits/{limitId}","href":"/api-reference/companies/update-company"},{"title":"Delete Company","deprecated":null,"version":null,"openapi":"/openapi.json delete /api/v1/companies/{id}/organization-limits/{limitId}","href":"/api-reference/companies/delete-company"},{"title":"List Companies {id} Organization Limits","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/organization-limits","href":"/api-reference/companies/list-companies--organization-limits"},{"title":"Organization Limits","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/companies/{id}/organization-limits","href":"/api-reference/companies/organization-limits"},{"title":"List Companies {id} Year Configuration","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/year-configuration","href":"/api-reference/companies/list-companies--year-configuration"},{"title":"List Companies","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies","href":"/api-reference/companies/list-companies"}]},{"group":"emission-factors","pages":[{"title":"List Emission Factors Custom","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/emission-factors/custom","href":"/api-reference/emission-factors/list-emission-factors-custom"}]},{"group":"emissions","pages":[{"title":"Get Emissions Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/emissions/dashboard","href":"/api-reference/emissions/get-emissions-dashboard"},{"title":"List Emissions","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/emissions","href":"/api-reference/emissions/list-emissions"}]},{"group":"employees","pages":[{"title":"Retrieve a specific employee record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/employees/{id}","href":"/api-reference/employees/retrieve-a-specific-employee-record"},{"title":"List Employees","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/employees","href":"/api-reference/employees/list-employees"}]},{"group":"inputs","pages":[{"title":"Retrieve a specific custom input record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/inputs/custom/{id}","href":"/api-reference/inputs/retrieve-a-specific-custom-input-record"},{"title":"List Inputs Custom","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/inputs/custom","href":"/api-reference/inputs/list-inputs-custom"},{"title":"List Inputs Recommended","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/inputs/recommended","href":"/api-reference/inputs/list-inputs-recommended"}]},{"group":"service-footprint-glec","pages":[{"title":"Delete a GLEC service footprint entry","deprecated":null,"version":null,"openapi":"/openapi.json delete /api/v1/service-footprint/glec/{id}","href":"/api-reference/service-footprint-glec/delete-a-glec-service-footprint-entry"},{"title":"Retrieve the dashboard of the GLEC service footprint","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/service-footprint/glec/dashboard","href":"/api-reference/service-footprint-glec/retrieve-the-dashboard-of-the-glec-service-footprint"},{"title":"Retrieve the list of GLEC service footprint","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/service-footprint/glec","href":"/api-reference/service-footprint-glec/retrieve-the-list-of-glec-service-footprint"},{"title":"Create a new GLEC service footprint entry","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/service-footprint/glec","href":"/api-reference/service-footprint-glec/create-a-new-glec-service-footprint-entry"}]},{"group":"suppliers","pages":[{"title":"List Suppliers","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/suppliers","href":"/api-reference/suppliers/list-suppliers"},{"title":"Create Supplier","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/suppliers","href":"/api-reference/suppliers/create-supplier"}]},{"group":"users","pages":[{"title":"List Users","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/users","href":"/api-reference/users/list-users"},{"title":"Create User","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/users","href":"/api-reference/users/create-user"},{"title":"Update User","deprecated":null,"version":null,"openapi":"/openapi.json patch /api/v1/users","href":"/api-reference/users/update-user"},{"title":"Invite","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/users/invite","href":"/api-reference/users/invite"}]},{"group":"vehicles","pages":[{"title":"Retrieve a specific vehicle record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/vehicles/{id}","href":"/api-reference/vehicles/retrieve-a-specific-vehicle-record"},{"title":"Get Vehicles Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/vehicles/dashboard","href":"/api-reference/vehicles/get-vehicles-dashboard"},{"title":"List Vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/vehicles","href":"/api-reference/vehicles/list-vehicles"},{"title":"Create Vehicle","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/vehicles","href":"/api-reference/vehicles/create-vehicle"}]},{"group":"waste-operators","pages":[{"title":"List Waste Operators","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/waste-operators","href":"/api-reference/waste-operators/list-waste-operators"},{"title":"Create Waste Operator","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/waste-operators","href":"/api-reference/waste-operators/create-waste-operator"}]}]}]},{"language":"en","tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/intro"}]},{"tab":"API Reference","groups":[{"group":"buildings","pages":[{"title":"Move","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/buildings/move","href":"/api-reference/buildings/move"}]},{"group":"comments","pages":[{"title":"List Comments","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/comments","href":"/api-reference/comments/list-comments"}]},{"group":"consumptions","pages":[{"title":"Get Consumptions Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/consumptions/dashboard","href":"/api-reference/consumptions/get-consumptions-dashboard"},{"title":"Retrieve a specific consumption record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/consumptions/{id}","href":"/api-reference/consumptions/retrieve-a-specific-consumption-record"},{"title":"List Consumptions","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/consumptions","href":"/api-reference/consumptions/list-consumptions"},{"title":"Create or update a consumption record","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/consumptions","href":"/api-reference/consumptions/create-or-update-a-consumption-record"}]},{"group":"custom-metrics","pages":[{"title":"Get Custom Metrics Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/custom-metrics/dashboard","href":"/api-reference/custom-metrics/get-custom-metrics-dashboard"},{"title":"List Custom Metrics","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/custom-metrics","href":"/api-reference/custom-metrics/list-custom-metrics"}]},{"group":"effluents","pages":[{"title":"Delete an effluent","deprecated":null,"version":null,"openapi":"/openapi.json delete /api/v1/effluents/{id}","href":"/api-reference/effluents/delete-an-effluent"},{"title":"List Effluents","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/effluents","href":"/api-reference/effluents/list-effluents"},{"title":"Insert or update an effluent","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/effluents","href":"/api-reference/effluents/insert-or-update-an-effluent"}]},{"group":"goals","pages":[{"title":"List Goals","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/goals","href":"/api-reference/goals/list-goals"},{"title":"List Goals Tasks","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/goals/tasks","href":"/api-reference/goals/list-goals-tasks"},{"title":"Retrieve a specific scenario record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/goals/scenarios/{id}","href":"/api-reference/goals/retrieve-a-specific-scenario-record"},{"title":"List Goals Scenarios","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/goals/scenarios","href":"/api-reference/goals/list-goals-scenarios"}]},{"group":"investments","pages":[{"title":"Get Investments Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/investments/dashboard","href":"/api-reference/investments/get-investments-dashboard"},{"title":"List Investments","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/investments","href":"/api-reference/investments/list-investments"}]},{"group":"invoices","pages":[{"title":"List Invoices","description":"Get a list of invoices","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/invoices","href":"/api-reference/invoices/list-invoices"},{"title":"Insert or update an invoice","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/invoices","href":"/api-reference/invoices/insert-or-update-an-invoice"},{"title":"Upload, scan \u0026 save an invoice","description":"Uploads an invoice file together with its metadata. The system will automatically scan the document, extract relevant data, and create or update the invoice in the database. If any step of the process (upload, scan, or save) fails, an exception is thrown.\n","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/invoices/upload-invoice","href":"/api-reference/invoices/upload-scan-\u0026-save-an-invoice"},{"title":"Retrieve a specific invoice record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/invoices/{id}","href":"/api-reference/invoices/retrieve-a-specific-invoice-record"},{"title":"Delete a specific invoice record","deprecated":null,"version":null,"openapi":"/openapi.json delete /api/v1/invoices/{id}","href":"/api-reference/invoices/delete-a-specific-invoice-record"},{"title":"Get Invoices Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/invoices/dashboard","href":"/api-reference/invoices/get-invoices-dashboard"}]},{"group":"purchased-goods","pages":[{"title":"List Purchased Goods Expenses","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/purchased-goods/expenses","href":"/api-reference/purchased-goods/list-purchased-goods-expenses"}]},{"group":"auth","pages":[{"title":"Login","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/auth/login","href":"/api-reference/auth/login"},{"title":"Logout","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/auth/logout","href":"/api-reference/auth/logout"},{"title":"Who Am I","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/auth/who-am-i","href":"/api-reference/auth/who-am-i"}]},{"group":"business-travels","pages":[{"title":"Get Business Travels Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/business-travels/dashboard","href":"/api-reference/business-travels/get-business-travels-dashboard"},{"title":"List Business Travels","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/business-travels","href":"/api-reference/business-travels/list-business-travels"}]},{"group":"categories","pages":[{"title":"List Categories","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/categories","href":"/api-reference/categories/list-categories"}]},{"group":"certificates","pages":[{"title":"Retrieve a specific certificate record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/certificates/{id}","href":"/api-reference/certificates/retrieve-a-specific-certificate-record"},{"title":"List Certificates","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/certificates","href":"/api-reference/certificates/list-certificates"}]},{"group":"companies","pages":[{"title":"List Companies {id} Buildings","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/buildings","href":"/api-reference/companies/list-companies--buildings"},{"title":"List Companies {id} Buildings Regos Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/buildings/regos-dashboard","href":"/api-reference/companies/list-companies--buildings-regos-dashboard"},{"title":"List Companies {id} Buildings Regos","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/buildings/regos","href":"/api-reference/companies/list-companies--buildings-regos"},{"title":"List Companies {id} Departments","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/departments","href":"/api-reference/companies/list-companies--departments"},{"title":"Get Organization Limit","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/organization-limits/{limitId}","href":"/api-reference/companies/get-organization-limit"},{"title":"Update Company","deprecated":null,"version":null,"openapi":"/openapi.json put /api/v1/companies/{id}/organization-limits/{limitId}","href":"/api-reference/companies/update-company"},{"title":"Delete Company","deprecated":null,"version":null,"openapi":"/openapi.json delete /api/v1/companies/{id}/organization-limits/{limitId}","href":"/api-reference/companies/delete-company"},{"title":"List Companies {id} Organization Limits","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/organization-limits","href":"/api-reference/companies/list-companies--organization-limits"},{"title":"Organization Limits","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/companies/{id}/organization-limits","href":"/api-reference/companies/organization-limits"},{"title":"List Companies {id} Year Configuration","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies/{id}/year-configuration","href":"/api-reference/companies/list-companies--year-configuration"},{"title":"List Companies","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/companies","href":"/api-reference/companies/list-companies"}]},{"group":"emission-factors","pages":[{"title":"List Emission Factors Custom","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/emission-factors/custom","href":"/api-reference/emission-factors/list-emission-factors-custom"}]},{"group":"emissions","pages":[{"title":"Get Emissions Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/emissions/dashboard","href":"/api-reference/emissions/get-emissions-dashboard"},{"title":"List Emissions","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/emissions","href":"/api-reference/emissions/list-emissions"}]},{"group":"employees","pages":[{"title":"Retrieve a specific employee record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/employees/{id}","href":"/api-reference/employees/retrieve-a-specific-employee-record"},{"title":"List Employees","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/employees","href":"/api-reference/employees/list-employees"}]},{"group":"inputs","pages":[{"title":"Retrieve a specific custom input record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/inputs/custom/{id}","href":"/api-reference/inputs/retrieve-a-specific-custom-input-record"},{"title":"List Inputs Custom","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/inputs/custom","href":"/api-reference/inputs/list-inputs-custom"},{"title":"List Inputs Recommended","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/inputs/recommended","href":"/api-reference/inputs/list-inputs-recommended"}]},{"group":"service-footprint-glec","pages":[{"title":"Delete a GLEC service footprint entry","deprecated":null,"version":null,"openapi":"/openapi.json delete /api/v1/service-footprint/glec/{id}","href":"/api-reference/service-footprint-glec/delete-a-glec-service-footprint-entry"},{"title":"Retrieve the dashboard of the GLEC service footprint","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/service-footprint/glec/dashboard","href":"/api-reference/service-footprint-glec/retrieve-the-dashboard-of-the-glec-service-footprint"},{"title":"Retrieve the list of GLEC service footprint","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/service-footprint/glec","href":"/api-reference/service-footprint-glec/retrieve-the-list-of-glec-service-footprint"},{"title":"Create a new GLEC service footprint entry","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/service-footprint/glec","href":"/api-reference/service-footprint-glec/create-a-new-glec-service-footprint-entry"}]},{"group":"suppliers","pages":[{"title":"List Suppliers","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/suppliers","href":"/api-reference/suppliers/list-suppliers"},{"title":"Create Supplier","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/suppliers","href":"/api-reference/suppliers/create-supplier"}]},{"group":"users","pages":[{"title":"List Users","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/users","href":"/api-reference/users/list-users"},{"title":"Create User","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/users","href":"/api-reference/users/create-user"},{"title":"Update User","deprecated":null,"version":null,"openapi":"/openapi.json patch /api/v1/users","href":"/api-reference/users/update-user"},{"title":"Invite","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/users/invite","href":"/api-reference/users/invite"}]},{"group":"vehicles","pages":[{"title":"Retrieve a specific vehicle record","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/vehicles/{id}","href":"/api-reference/vehicles/retrieve-a-specific-vehicle-record"},{"title":"Get Vehicles Dashboard","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/vehicles/dashboard","href":"/api-reference/vehicles/get-vehicles-dashboard"},{"title":"List Vehicles","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/vehicles","href":"/api-reference/vehicles/list-vehicles"},{"title":"Create Vehicle","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/vehicles","href":"/api-reference/vehicles/create-vehicle"}]},{"group":"waste-operators","pages":[{"title":"List Waste Operators","deprecated":null,"version":null,"openapi":"/openapi.json get /api/v1/waste-operators","href":"/api-reference/waste-operators/list-waste-operators"},{"title":"Create Waste Operator","deprecated":null,"version":null,"openapi":"/openapi.json post /api/v1/waste-operators","href":"/api-reference/waste-operators/create-waste-operator"}]}]}]}]},"basePath":"","title":"Insert or update an invoice - Manglai API Documentation","buildId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","deploymentId":"dpl_FWZhTb2vab28gFGFH4ojka6qEznQ","dynamics":["c2aa737661","b0f84f53ff","a9bb46feb3","2b790eda92"],"chunks":["OpenApiReferenceProvider-CBsVopKK.js","utils-DZAk68jJ.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-D32AYZrP.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-D_A5_cny.js","snippetPresets-xNRfS9th.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","Page-Dr40SSJq.js","ApiExamples-BIB25-tq.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-CydJ4w4j.js","shallow-CYPBeQSG.js","getApiPlaygroundDisplay-A5xJVBOu.js","CodeSnippet-BVRTgi3m.js","CodeSnippets-DjD6BSlt.js","getPastedJson-D4V4JyrR.js","icon-uhcnG22T.js","MethodPill-CM-ZQdGH.js","DuplicateIcon-B_WnOiNf.js","createIcon-CJsb8utt.js","DynamicMarkdown-D-2HDKEp.js","SectionHeading-KP5xmMgQ.js","axios-vUo_bRtp.js","Markdown-D_k0dg6k.js","clsx-DK3K4Z1S.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DE3EVdvd.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-fN9H9n9g.js"]}