{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"6335cbd6-b6c1-4581-a66b-03e029f5de81","name":"Factura.com Workspace Publico","description":"# Introducción\n\nTe invitamos a utilizar la [documentación de nuestra API](https://factura.com/apidocs/). Es un  \nrecurso completo y fácil de entender que te guiará en el uso de nuestras  \nfuncionalidades. Si tienes alguna pregunta, nuestro equipo de soporte  \ntécnico está disponible para ayudarte.\n\nAprovecha las ventajas de nuestra API para automatizar tus procesos de facturación y agilizar tus operaciones comerciales.\n\n¡Explora nuestra documentación de API y descubre todo lo que Factura.com puede hacer por ti!\n\nAtentamente, El equipo de Factura.com\n\n---\n\n# Autenticación de API\n\nEl API de factura.com utiliza autenticación básica la cual requiere los siguientes datos de acceso:\n\n- \\[API_KEY\\]\n    \n- \\[SECRET_KEY\\]\n    \n\nLa autenticación del API requiere incluir en el header los datos de autorización junto a el **F-PLUGIN** cuyo valor siempre será: **9d4095c8f7ed5785cb14c0e3b033eeb8252416ed**\n\nLos métodos disponibles en el workspace ya cuentan con un header de ejemplo en donde contienen los datos antes mencionados, en el entorno existen dos variables en donde podemos ingresar nuestras llaves para usarlas de forma mas sencilla estas variables se encuentran en:\n\n- Factura.com Workspace Publico **→** Variables\n    \n\nSolo sustituye el texto **Tu API key** y **Tu Secret key** por los valores correspondientes\n\n# Genera tu API Key\n\nPuedes usar el API de factura.com en dos modos, sandbox y producción. El API Key y el Secret Key son diferentes para cada modo.\n\nPara obtener tus llaves de acceso deber seguir los siguientes pasos:\n\n- Iniciar sesión (Si es en producción en [https://factura.com/](https://factura.com/), si es en sandbox en [http://sandbox.factura.com/](http://sandbox.factura.com/) ).\n    \n- En el menú lateral dirígete a Configuraciones - API - Datos de acceso .\n    \n- Haz clic en el botón que se encuentra junto a cada token de acceso para copiarlo.\n    \n\n# Errores\n\nTodas las peticiones exitosas regresan un código de estatus HTTP 204. En caso de un error, el API regresa un JSON con los parámetros que contienen la razón del error.\n\nLa documentación completa y explicación de los métodos la puedes encontrar en nuestra documentación para developers en:\n\n[Documentación API factura.com](https://factura.com/apidocs)\n\n# Construcción de la URL\n\nA continuación se explica la estructura básica de como están compuestos los siguientes métodos para operaciones de CFDI\n\n**Host**: [https://api.factura.com/](https://api.factura.com/) (producción) / [http://sandbox.factura.com/api/](http://sandbox.factura.com/api/) (sandbox)  \n**Endpoint**: /v4/cfdi/list\n\n**Ejemplo**: [https://api.factura.com/v4/cfdi/list](https://api.factura.com/v4/cfdi/list)\n\n## Ejemplo:\n\n``` php\n$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, \"http://sandbox.factura.com/api/v4/cfdi/list\");\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\ncurl_setopt($ch, CURLOPT_HEADER, FALSE);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array(\n    \"Content-Type: application/json\",\n    \"F-PLUGIN: \" . '9d4095c8f7ed5785cb14c0e3b033eeb8252416ed',\n    \"F-Api-Key: \".'Ingresa API KEY',\n    \"F-Secret-Key: \" .'Ingresa SECRET KEY'\n));\n$response = curl_exec($ch);\nreturn die($response);\ncurl_close($ch);\n?>\n\n ```\n\n> &lt;h3 &gt;RECUERDA QUE 👀&lt;/h3&gt; \n  \n> Para probar el código de ejemplo es necesario que reemplaces el texto **Ingresa API KEY** por el API KEY de tu cuenta, e **Ingresa SECRET KEY** por el SECRET KEY correspondiente. \n  \n\n## Respuesta:\n\n## Respuesta exitosa\n\n``` jason\n{\n  \"status\": \"success\",\n  \"response\": \"success\",\n  \"total\": 2479,\n  \"per_page\": 100,\n  \"current_page\": 1,\n  \"last_page\": 25,\n  \"from\": 1,\n  \"to\": 100,\n  \"data\": [\n    {\n      \"RazonSocialReceptor\": \"Venta Al Público en General\",\n      \"Folio\": \"F 01\",\n      \"UID\": \"5c04c662exxxx\",\n      \"UUID\": \"1750d757-577d-xxxx-xxxx-518b87b24a87\",\n      \"Subtotal\": \"5.000000\",\n      \"Descuento\": null,\n      \"Total\": \"5.800000\",\n      \"ReferenceClient\": 0,\n      \"NumOrder\": null,\n      \"Receptor\": \"XAXX010101000\",\n      \"FechaTimbrado\": \"2018-12-03\",\n      \"Status\": \"enviada\",\n      \"Version\": \"3.3\"\n    },\n    {\n      \"RazonSocialReceptor\": \"Cliente ejemplo\",\n      \"Folio\": \"F 160\",\n      \"UID\": \"5c033ca2e4xxx\",\n      \"UUID\": \"c25c6c99-xxx-xxx-810e-e5ae7e12eb15\",\n      \"Subtotal\": \"10000.000000\",\n      \"Descuento\": null,\n      \"Total\": \"11600.000000\",\n      \"ReferenceClient\": 15,\n      \"NumOrder\": null,\n      \"Receptor\": \"XAXX010101000\",\n      \"FechaTimbrado\": \"2018-12-01\",\n      \"Status\": \"enviada\",\n      \"Version\": \"3.3\"\n    }\n  ]\n}\n\n ```\n\n## Respuesta erronea\n\n``` json\n{\n  \"status\": \"error\",\n  \"message\": \"La cuenta que intenta autenticarse no existe\",\n  \"Data\": \"$2y$10$dnOV7qC7ZrD1CZitpUnTReLKtKPxG29XfwZylrEuiR0KVl18pOXXX\",\n  \"Secret\": \"$2y$10$6ZN4aX5UExwz6HFlDSZcxOF1TGjHx8f40neE.CrXHHahyAfi8qiXXX\"\n}\n\n ```\n\n# Métodos disponibles:","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"17943992","team":2214052,"collectionId":"6335cbd6-b6c1-4581-a66b-03e029f5de81","publishedId":"UVJigZ53","public":true,"publicUrl":"https://documenter-api.postman.tech/view/17943992/UVJigZ53","privateUrl":"https://go.postman.co/documentation/17943992-6335cbd6-b6c1-4581-a66b-03e029f5de81","customColor":{"top-bar":"FFFFFF","right-sidebar":"34495e","highlight":"f39c12"},"documentationLayout":"classic-single-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"system_default","themes":[{"name":"dark","logo":null,"colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":null,"colors":{"top-bar":"FFFFFF","right-sidebar":"34495e","highlight":"f39c12"}}]}},"version":"8.12.10","publishDate":"2023-12-08T19:06:42.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/5b28c889b1d0d49be2941657f098cf6fc1676ce135510d020dc81bb551c99567","favicon":"https://res.cloudinary.com/postman/image/upload/v1688671558/team/p9dclp6l2h6ehh2lz0pg.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/UVJigZ53"}