Cómo usar idempotency_key para evitar comprobantes duplicados
POST /documents acepta un campo idempotency_key en el body. Si reenvías
la misma emisión con la misma key, Factio devuelve el documento existente en
lugar de crear otro.
En esta respuesta status puede venir con un valor interno (por ejemplo
RECEIVED_BY_SRI). Para el estado público y el detalle completo, consulta
GET /documents/{document_id}.
La key es única por emisor y ambiente del SRI: el mismo emisor puede reusar
una key en pruebas y en producción sin conflicto.
Las keys no expiran.
Usa un valor estable y único por comprobante. El identificador de la factura en
tu sistema es una buena opción (por ejemplo erp-factura-000123). Genera una
key nueva solo cuando quieras emitir un comprobante distinto.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Factio","colors":{"primary":"#0F6FFF","light":"#3B8EFF","dark":"#0047CC"},"logo":{"light":"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/logo/factio-light.svg?fit=max\u0026auto=format\u0026n=5bVkgcL-lfIQwY19\u0026q=85\u0026s=9425e17ca9555aa016ad9333f09072b1","dark":"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/logo/factio-dark.svg?fit=max\u0026auto=format\u0026n=5bVkgcL-lfIQwY19\u0026q=85\u0026s=c8a58d6e201fc17ea18bbb93f40fc6c4","href":"https://factioapp.com"},"favicon":"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/favicon.png?fit=max\u0026auto=format\u0026n=5bVkgcL-lfIQwY19\u0026q=85\u0026s=dc2a0f2d4bdcdd41c0a99318ba4a6413","api":{"playground":{"display":"interactive"}},"variables":{"API_PRODUCTION_URL":"https://api.factioapp.com","API_STAGING_URL":"https://api.staging.factioapp.com","APP_DOMAIN":"https://factioapp.com","WEB_DOMAIN":"https://factioapp.com","DOCS_DOMAIN":"https://docs.factioapp.com"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"me-94224791","hasAudioNarration":false,"actualSubdomain":"me-94224791","customDomains":["docs.factioapp.com"],"gitSource":{"type":"github","owner":"rommel96","repo":"factio-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adadc96fa05280e66cb96eb","collectionId":"3a57dcf4-8616-4b38-a4ba-be618591770d","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adadc96fa05280e66cb96eb"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6adadc96fa05280e66cb96eb","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"Referencia API","count":88},{"language":"default","tag":"Authentication","count":21},{"language":"default","tag":"documents","count":21},{"language":"default","tag":"Guías","count":17},{"language":"default","tag":"establishments","count":11},{"language":"default","tag":"Buyers","count":8},{"language":"default","tag":"issuers","count":8},{"language":"default","tag":"tenant","count":6},{"language":"default","tag":"certificates","count":5},{"language":"default","tag":"Products","count":5}]},"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":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"idempotency","slug":"/idempotency","pageMetadata":{"title":"Idempotencia","description":"Cómo usar idempotency_key para evitar comprobantes duplicados","href":"/idempotency"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Cómo usar idempotency_key para evitar comprobantes duplicados\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,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:[_jsxs(_components.p,{children:[_jsx(_components.code,{children:`POST /documents`}),` acepta un campo `,_jsx(_components.strong,{children:_jsx(_components.code,{children:`idempotency_key`})}),` en el body. Si reenvías\nla misma emisión con la misma key, Factio devuelve el documento existente en\nlugar de crear otro.`]}),`\n`,_jsx(Heading,{level:`2`,id:`cuándo-usarla`,children:`Cuándo usarla`}),`\n`,_jsx(_components.p,{children:`Siempre que exista riesgo de reenvío:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Timeouts de red o del cliente HTTP.`}),`\n`,_jsx(_components.li,{children:`Reintentos automáticos de tu sistema o de tu cola de trabajos.`}),`\n`,_jsx(_components.li,{children:`Reintentos de Zapier, Make u otras integraciones.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`cómo-funciona`,children:`Cómo funciona`}),`\n`,_jsxs(_components.p,{children:[`Incluye `,_jsx(_components.code,{children:`idempotency_key`}),` en el body del request (texto de hasta 255 caracteres):`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`shellscript`,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:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`8`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://api.factioapp.com/documents`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"X-API-Key: fac_TU_API_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"idempotency_key\": \"erp-factura-000123\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"document_type\": \"01\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ...`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Factio `,_jsxs(_components.strong,{children:[`no lee un header `,_jsx(_components.code,{children:`Idempotency-Key`})]}),`. La key va en el body. Si la\nenvías como header, se ignora y un reenvío crea un comprobante nuevo.`]})}),`\n`,_jsx(_components.p,{children:`Si reenvías el request con una key que ya usaste:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`No se reserva un secuencial nuevo.`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.strong,{children:`No se crea un comprobante nuevo.`})}),`\n`,_jsxs(_components.li,{children:[`Recibes `,_jsx(_components.code,{children:`200 OK`}),` con el documento existente:`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"document_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"0f6c1d52-8a3e-4b7a-9c21-5d4e7b8a1f90\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"AUTHORIZED\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"access_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2010202601179214673900110010010000000011234567811\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`En esta respuesta `,_jsx(_components.code,{children:`status`}),` puede venir con un valor interno (por ejemplo\n`,_jsx(_components.code,{children:`RECEIVED_BY_SRI`}),`). Para el estado público y el detalle completo, consulta\n`,_jsx(_components.code,{children:`GET /documents/{document_id}`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`reglas`,children:`Reglas`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`La key es única por `,_jsx(_components.strong,{children:`emisor y ambiente del SRI`}),`: el mismo emisor puede reusar\nuna key en pruebas y en producción sin conflicto.`]}),`\n`,_jsx(_components.li,{children:`Las keys no expiran.`}),`\n`,_jsxs(_components.li,{children:[`Usa un valor estable y único por comprobante. El identificador de la factura en\ntu sistema es una buena opción (por ejemplo `,_jsx(_components.code,{children:`erp-factura-000123`}),`). Genera una\nkey nueva solo cuando quieras emitir un comprobante distinto.`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`python`,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:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"/documents\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_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\":`#D4D4D4`},children:`**`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`payload, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"idempotency_key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"erp-factura-`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`invoice.id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`60`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})})]})}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":"Idempotencia","description":"Cómo usar idempotency_key para evitar comprobantes duplicados","href":"/idempotency"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Cuándo usarla","slug":"cuándo-usarla","depth":2,"children":[]},{"title":"Cómo funciona","slug":"cómo-funciona","depth":2,"children":[]},{"title":"Reglas","slug":"reglas","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"me-94224791","siteName":"Factio","title":"Idempotencia - Factio","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-23T04:03:41.388Z","originalFileLocation":"idempotency.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Cómo usar idempotency_key para evitar comprobantes duplicados\">\u003cmeta data-mint-head name=\"application-name\" content=\"Factio\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/favicon.png?fit=max\u0026amp;auto=format\u0026amp;n=5bVkgcL-lfIQwY19\u0026amp;q=85\u0026amp;s=dc2a0f2d4bdcdd41c0a99318ba4a6413\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/favicon.png?fit=max\u0026amp;auto=format\u0026amp;n=5bVkgcL-lfIQwY19\u0026amp;q=85\u0026amp;s=dc2a0f2d4bdcdd41c0a99318ba4a6413\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/favicon.png?fit=max\u0026amp;auto=format\u0026amp;n=5bVkgcL-lfIQwY19\u0026amp;q=85\u0026amp;s=dc2a0f2d4bdcdd41c0a99318ba4a6413\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/png\" href=\"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/favicon.png?fit=max\u0026amp;auto=format\u0026amp;n=5bVkgcL-lfIQwY19\u0026amp;q=85\u0026amp;s=dc2a0f2d4bdcdd41c0a99318ba4a6413\">\u003cmeta data-mint-head property=\"og:title\" content=\"Idempotencia - Factio\">\u003cmeta data-mint-head property=\"og:description\" content=\"Cómo usar idempotency_key para evitar comprobantes duplicados\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Factio\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.factioapp.com/idempotency\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://me-94224791.mintlify.app/_mintlify/api/og/v2?division=Conceptos+clave\u0026amp;title=Idempotencia\u0026amp;description=C%C3%B3mo+usar+idempotency_key+para+evitar+comprobantes+duplicados\u0026amp;theme=e04c22958a665de58c7f2931\u0026amp;signature=69a4b02328b0d852c1e9d4eba4fa6bfa32d1779cf76285c9f187c752f0d94000\">\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=\"Idempotencia - Factio\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Cómo usar idempotency_key para evitar comprobantes duplicados\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://me-94224791.mintlify.app/_mintlify/api/og/v2?division=Conceptos+clave\u0026amp;title=Idempotencia\u0026amp;description=C%C3%B3mo+usar+idempotency_key+para+evitar+comprobantes+duplicados\u0026amp;theme=e04c22958a665de58c7f2931\u0026amp;signature=69a4b02328b0d852c1e9d4eba4fa6bfa32d1779cf76285c9f187c752f0d94000\">\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=\"https://mintlify.s3.us-west-1.amazonaws.com/me-94224791/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Factio\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0F6FFF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.factioapp.com/idempotency\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/idempotency.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.factioapp.com/#organization\",\"name\":\"Factio\",\"url\":\"https://docs.factioapp.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/me-94224791/5bVkgcL-lfIQwY19/logo/factio-light.svg?fit=max\u0026auto=format\u0026n=5bVkgcL-lfIQwY19\u0026q=85\u0026s=9425e17ca9555aa016ad9333f09072b1\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.factioapp.com#website\",\"name\":\"Factio\",\"url\":\"https://docs.factioapp.com\",\"publisher\":{\"@id\":\"https://docs.factioapp.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.factioapp.com/idempotency#webpage\",\"url\":\"https://docs.factioapp.com/idempotency\",\"name\":\"Idempotencia\",\"description\":\"Cómo usar idempotency_key para evitar comprobantes duplicados\",\"dateModified\":\"2026-10-23T04:03:41.388Z\",\"isPartOf\":{\"@id\":\"https://docs.factioapp.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.factioapp.com/idempotency#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.factioapp.com/idempotency#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Conceptos clave\",\"item\":\"https://docs.factioapp.com/sri-lifecycle\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Idempotencia\",\"item\":\"https://docs.factioapp.com/idempotency\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.factioapp.com/idempotency#article\",\"headline\":\"Idempotencia\",\"name\":\"Idempotencia\",\"description\":\"Cómo usar idempotency_key para evitar comprobantes duplicados\",\"url\":\"https://docs.factioapp.com/idempotency\",\"mainEntityOfPage\":{\"@id\":\"https://docs.factioapp.com/idempotency#webpage\"},\"dateModified\":\"2026-10-23T04:03:41.388Z\",\"publisher\":{\"@id\":\"https://docs.factioapp.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.factioapp.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Factio\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Factio","nav":{"global":null,"tabs":[{"tab":"Guías","groups":[{"group":"Introducción","pages":[{"title":"Bienvenido a Factio","href":"/introduction"},{"title":"Quickstart","href":"/quickstart"},{"title":"Autenticación","href":"/authentication"},{"title":"Entornos","href":"/environments"}]},{"group":"Conceptos clave","pages":[{"title":"Ciclo de vida de un comprobante","description":"Cómo el SRI procesa los documentos electrónicos y qué significa cada estado","href":"/sri-lifecycle"},{"title":"Idempotencia","href":"/idempotency"},{"title":"Manejo de errores","description":"Formato de errores de la API de Factio y cómo manejarlos","href":"/errors"}]},{"group":"Guías","pages":[{"title":"Emitir Factura","href":"/guides/emit-invoice"},{"title":"Emitir Nota de Crédito","href":"/guides/emit-credit-note"},{"title":"Consultar Estado","href":"/guides/check-status"},{"title":"Subir Certificado","href":"/guides/upload-certificate"},{"title":"Manejar Rechazos","href":"/guides/handle-rejections"}]}]},{"tab":"Referencia API","pages":[{"title":"Referencia API","href":"/api-reference/authentication/google-oauth-callback"}]}]},"basePath":"","title":"Idempotencia - Factio","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":[],"chunks":[]}