{"_id":"5b6083b27c5f0e0003c19ab3","project":"56abd2434e4b730d009eb10a","version":{"_id":"56abd2434e4b730d009eb10d","project":"56abd2434e4b730d009eb10a","__v":22,"createdAt":"2016-01-29T20:57:39.712Z","releaseDate":"2016-01-29T20:57:39.712Z","categories":["56abd2444e4b730d009eb10e","56abd4c8f25f160d00e17f81","56abd72ff25f160d00e17f84","56b3b8ea9f97020d0012d936","56b3b91ac25dea2b00b0cac9","56b4b2faeed075230097d688","56b4b32deed075230097d689","56b4b37327d9c00d005d6bc4","56b4b3bf3d5f130d00dad120","56b4b3d9eed075230097d68a","56b4b3eb7bccae0d00e9a12e","56b4b4085997532100bc6b61","56fbce6e2885e80e006c855f","5739ed9aad40e23200f674b6","573dd672b3f88f0e00dcae1c","58ad0922e570c62500512a82","58ad092b55018f1900218fda","58e412a5aa544d1b0005f7da","59e62c2a3ccab100263e800a","59e63126b4f8b0002edbe92c","5b5bbc98eaf71700031c2fda","5bedb529a56934002ee522b9"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"category":{"_id":"5b5bbc98eaf71700031c2fda","project":"56abd2434e4b730d009eb10a","version":"56abd2434e4b730d009eb10d","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2018-07-28T00:45:12.731Z","from_sync":false,"order":9999,"slug":"facturas-globales","title":"Facturas globales"},"user":"56abd213d4432d1900eed227","githubsync":"","__v":2,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-07-31T15:43:46.228Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"method":"put","results":{"codes":[{"language":"json","code":"{\n  \"id\": \"125\",\n  \"date\": \"2018-07-25\",\n  \"status\": \"open\",\n  \"numberTemplate\": {\n    \"id\": \"1\",\n    \"prefix\": null,\n    \"number\": \"422\"\n  },\n  \"saleTickets\": [\n    {\n      \"id\": \"357\",\n      \"date\": \"2018-06-19\",\n      \"dueDate\": \"2018-06-19\",\n      \"observations\": \"\",\n      \"anotation\": \"\",\n      \"termsConditions\": \"Términos y condiciones\",\n      \"status\": \"open\",\n      \"client\": {\n        \"id\": \"6\",\n        \"name\": \"Ventas al público general\",\n        \"identification\": \"XAXX010101000\",\n        \"phonePrimary\": null,\n        \"phoneSecondary\": null,\n        \"fax\": null,\n        \"mobile\": null,\n        \"email\": null,\n        \"address\": {\n          \"street\": null,\n          \"exteriorNumber\": null,\n          \"interiorNumber\": null,\n          \"colony\": null,\n          \"locality\": null,\n          \"municipality\": null,\n          \"zipCode\": null,\n          \"state\": null,\n          \"country\": null\n        }\n      },\n      \"numberTemplate\": {\n        \"id\": \"7\",\n        \"prefix\": \"T\",\n        \"number\": \"7\",\n        \"text\": null\n      },\n      \"total\": 1000,\n      \"totalPaid\": 0,\n      \"balance\": 1000,\n      \"decimalPrecision\": \"2\",\n      \"warehouse\": {\n        \"id\": \"1\",\n        \"name\": \"Principal\"\n      },\n      \"cfdiUse\": null,\n      \"paymentType\": \"PUE\",\n      \"paymentMethod\": \"cash\",\n      \"seller\": null,\n      \"priceList\": {\n        \"id\": \"1\",\n        \"name\": \"General\"\n      },\n      \"items\": [\n        {\n          \"id\": 1,\n          \"name\": \"Camisa\",\n          \"description\": \"\",\n          \"price\": 1000,\n          \"discount\": \"0.00\",\n          \"reference\": \"\",\n          \"quantity\": \"1.00\",\n          \"productKey\": \"01010101\",\n          \"tax\": [],\n          \"total\": 1000\n        }\n      ]\n    },\n    {\n      \"id\": \"411\",\n      \"date\": \"2018-06-25\",\n      \"dueDate\": \"2018-06-28\",\n      \"observations\": \"\",\n      \"anotation\": \"\",\n      \"termsConditions\": \"Términos y condiciones\",\n      \"status\": \"open\",\n      \"client\": {\n        \"id\": \"6\",\n        \"name\": \"Ventas al público general\",\n        \"identification\": \"XAXX010101000\",\n        \"phonePrimary\": null,\n        \"phoneSecondary\": null,\n        \"fax\": null,\n        \"mobile\": null,\n        \"email\": null,\n        \"address\": {\n          \"street\": null,\n          \"exteriorNumber\": null,\n          \"interiorNumber\": null,\n          \"colony\": null,\n          \"locality\": null,\n          \"municipality\": null,\n          \"zipCode\": null,\n          \"state\": null,\n          \"country\": null\n        }\n      },\n      \"numberTemplate\": {\n        \"id\": \"7\",\n        \"prefix\": \"T\",\n        \"number\": \"7\",\n        \"text\": null\n      },\n      \"total\": 1000,\n      \"totalPaid\": 0,\n      \"balance\": 1000,\n      \"decimalPrecision\": \"2\",\n      \"warehouse\": {\n        \"id\": \"1\",\n        \"name\": \"Principal\"\n      },\n      \"cfdiUse\": null,\n      \"paymentType\": \"PUE\",\n      \"paymentMethod\": \"cash\",\n      \"seller\": null,\n      \"priceList\": {\n        \"id\": \"1\",\n        \"name\": \"General\"\n      },\n      \"items\": [\n        {\n          \"id\": 1,\n          \"name\": \"Pantalón\",\n          \"description\": \"\",\n          \"price\": 1000,\n          \"discount\": \"0.00\",\n          \"reference\": \"\",\n          \"quantity\": \"1.00\",\n          \"productKey\": \"01010101\",\n          \"tax\": [],\n          \"total\": 1000\n        }\n      ]\n    }\n  ],\n    \"total\": 2000,\n    \"stamp\": {\n      \"uuid\": \"1579E004-A899-47CF-915C-674ED4B54D3E\",\n      \"satSeal\": \"WV9Deh8uAPVsHUnO44kQe6SD9g2cjk+KUPZxjHvoWatMO3Ik902q8CJyc+qeUXQl5wAbYjsXXkVTGf7twFWaHy2X7EM9LOeZ4sF9uQie6TGqFKb0PvR9i/rqUzdo11OxxKVcCrGWCwtfAcb1NUJ4tNNIrNqwqB4hOJW2gZmRiyi1fhv9IlLrd3Bv1jjSWrORa9hB7nn4ZTjXruSZK8HtCxedXjL0BDKQpjusTRdIzSgovrMHwVIch9KXQXOe6YvDSKGfehm2Y2W4CX2GCtGQlmW8BAPsnJu9fYuQ97RgLlZnQxtNKADl9t39Sf2wVXUcfjrgG5tlaaVBxAunfh8ZeQ==\",\n      \"stampDate\": \"2018-07-25 17:33:09\",\n      \"cfdSeal\": \"rW1L6dCA0O3XhOfpWqC1txos7FdIZVu+yg/EiQAOadMI4oqPsWByocjF7+wEaXM3YDrb8b4ZiMn756fGN1a8rKrxrZS1k1cT/1TeVON4KCJ0x43F0tn6HCsFNHIvfcAOw8NzWKpdgUBJfMKuWujfqHaH6GvOX+A9dD4oNJBmVXUoflF8UGeZovtf45QgJrFRxX8ta7bIybN3m2X31ywAa8miYjqy+53WEX44WLPW0jiBQlF+tUwxYRcwG538l9Wu21arDfJP9L+ZV1NknVbXxDHapYmZ86QlQqkHqFf09Tw62Y/+idT6cPDbN6cKiCKhoRoUCTCReJD67O8WVzoL+Q==\",\n      \"satCertificateNumber\": \"20001000000300022323\",\n      \"expeditionPlace\": \"01030\",\n      \"certificateNumber\": \"20001000000300005692\",\n      \"datetime\": \"2018-07-25 17:32:58\",\n      \"paymentMethod\": \"cash\",\n      \"accountNumber\": null\n    }\n  }","name":"","status":200},{"name":"México -Proceso timbre no exitoso","status":400,"language":"json","code":"{\n  \"error\": {\n    \"message\": \"La factura de venta no se pudo timbrar porque  la fecha de generación tiene más de 72 horas de diferencia de la fecha actual\",\n    \"code\": 3051\n  },\n  {\n  \"id\": \"125\",\n  \"date\": \"2018-07-25\",\n  \"status\": \"draft\",\n  \"numberTemplate\": {\n    \"id\": \"1\",\n    \"prefix\": null,\n    \"number\": \"422\"\n  },\n  \"saleTickets\": [\n    {\n      \"id\": \"357\",\n      \"date\": \"2018-06-19\",\n      \"dueDate\": \"2018-06-19\",\n      \"observations\": \"\",\n      \"anotation\": \"\",\n      \"termsConditions\": \"Términos y condiciones\",\n      \"status\": \"open\",\n      \"client\": {\n        \"id\": \"6\",\n        \"name\": \"Ventas al público general\",\n        \"identification\": \"XAXX010101000\",\n        \"phonePrimary\": null,\n        \"phoneSecondary\": null,\n        \"fax\": null,\n        \"mobile\": null,\n        \"email\": null,\n        \"address\": {\n          \"street\": null,\n          \"exteriorNumber\": null,\n          \"interiorNumber\": null,\n          \"colony\": null,\n          \"locality\": null,\n          \"municipality\": null,\n          \"zipCode\": null,\n          \"state\": null,\n          \"country\": null\n        }\n      },\n      \"numberTemplate\": {\n        \"id\": \"7\",\n        \"prefix\": \"T\",\n        \"number\": \"7\",\n        \"text\": null\n      },\n      \"total\": 1000,\n      \"totalPaid\": 0,\n      \"balance\": 1000,\n      \"decimalPrecision\": \"2\",\n      \"warehouse\": {\n        \"id\": \"1\",\n        \"name\": \"Principal\"\n      },\n      \"cfdiUse\": null,\n      \"paymentType\": \"PUE\",\n      \"paymentMethod\": \"cash\",\n      \"seller\": null,\n      \"priceList\": {\n        \"id\": \"1\",\n        \"name\": \"General\"\n      },\n      \"items\": [\n        {\n          \"id\": 1,\n          \"name\": \"Camisa\",\n          \"description\": \"\",\n          \"price\": 1000,\n          \"discount\": \"0.00\",\n          \"reference\": \"\",\n          \"quantity\": \"1.00\",\n          \"productKey\": \"01010101\",\n          \"tax\": [],\n          \"total\": 1000\n        }\n      ]\n    },\n    {\n      \"id\": \"411\",\n      \"date\": \"2018-06-25\",\n      \"dueDate\": \"2018-06-28\",\n      \"observations\": \"\",\n      \"anotation\": \"\",\n      \"termsConditions\": \"Términos y condiciones\",\n      \"status\": \"open\",\n      \"client\": {\n        \"id\": \"6\",\n        \"name\": \"Ventas al público general\",\n        \"identification\": \"XAXX010101000\",\n        \"phonePrimary\": null,\n        \"phoneSecondary\": null,\n        \"fax\": null,\n        \"mobile\": null,\n        \"email\": null,\n        \"address\": {\n          \"street\": null,\n          \"exteriorNumber\": null,\n          \"interiorNumber\": null,\n          \"colony\": null,\n          \"locality\": null,\n          \"municipality\": null,\n          \"zipCode\": null,\n          \"state\": null,\n          \"country\": null\n        }\n      },\n      \"numberTemplate\": {\n        \"id\": \"7\",\n        \"prefix\": \"T\",\n        \"number\": \"7\",\n        \"text\": null\n      },\n      \"total\": 1000,\n      \"totalPaid\": 0,\n      \"balance\": 1000,\n      \"decimalPrecision\": \"2\",\n      \"warehouse\": {\n        \"id\": \"1\",\n        \"name\": \"Principal\"\n      },\n      \"cfdiUse\": null,\n      \"paymentType\": \"PUE\",\n      \"paymentMethod\": \"cash\",\n      \"seller\": null,\n      \"priceList\": {\n        \"id\": \"1\",\n        \"name\": \"General\"\n      },\n      \"items\": [\n        {\n          \"id\": 1,\n          \"name\": \"Pantalón\",\n          \"description\": \"\",\n          \"price\": 1000,\n          \"discount\": \"0.00\",\n          \"reference\": \"\",\n          \"quantity\": \"1.00\",\n          \"productKey\": \"01010101\",\n          \"tax\": [],\n          \"total\": 1000\n        }\n      ]\n    }\n  ],\n    \"total\": 2000,\n    \"stamp\": {\n      \"uuid\": \"1579E004-A899-47CF-915C-674ED4B54D3E\",\n      \"satSeal\": \"WV9Deh8uAPVsHUnO44kQe6SD9g2cjk+KUPZxjHvoWatMO3Ik902q8CJyc+qeUXQl5wAbYjsXXkVTGf7twFWaHy2X7EM9LOeZ4sF9uQie6TGqFKb0PvR9i/rqUzdo11OxxKVcCrGWCwtfAcb1NUJ4tNNIrNqwqB4hOJW2gZmRiyi1fhv9IlLrd3Bv1jjSWrORa9hB7nn4ZTjXruSZK8HtCxedXjL0BDKQpjusTRdIzSgovrMHwVIch9KXQXOe6YvDSKGfehm2Y2W4CX2GCtGQlmW8BAPsnJu9fYuQ97RgLlZnQxtNKADl9t39Sf2wVXUcfjrgG5tlaaVBxAunfh8ZeQ==\",\n      \"stampDate\": \"2018-07-25 17:33:09\",\n      \"cfdSeal\": \"rW1L6dCA0O3XhOfpWqC1txos7FdIZVu+yg/EiQAOadMI4oqPsWByocjF7+wEaXM3YDrb8b4ZiMn756fGN1a8rKrxrZS1k1cT/1TeVON4KCJ0x43F0tn6HCsFNHIvfcAOw8NzWKpdgUBJfMKuWujfqHaH6GvOX+A9dD4oNJBmVXUoflF8UGeZovtf45QgJrFRxX8ta7bIybN3m2X31ywAa8miYjqy+53WEX44WLPW0jiBQlF+tUwxYRcwG538l9Wu21arDfJP9L+ZV1NknVbXxDHapYmZ86QlQqkHqFf09Tw62Y/+idT6cPDbN6cKiCKhoRoUCTCReJD67O8WVzoL+Q==\",\n      \"satCertificateNumber\": \"20001000000300022323\",\n      \"expeditionPlace\": \"01030\",\n      \"certificateNumber\": \"20001000000300005692\",\n      \"datetime\": \"2018-07-25 17:32:58\",\n      \"paymentMethod\": \"cash\",\n      \"accountNumber\": null\n    }\n  }\n}"}]},"settings":"","examples":{"codes":[{"name":"Factura sencilla","language":"json","code":"{\n  \"date\": \"2018-07-25\",\n  \"saleTickets\": [\n    {\n      \"id\": \"357\"\n    },\n    {\n      \"id\": \"411\"\n    }\n  ],\n  \"stamp\": {\n    \"generateStamp\": \"true\"\n  }\n}"},{"name":"Factura completa","language":"json","code":"{\n  \"date\": \"2018-07-25\",\n  \"numberTemplate\" : {\n    \"id\" : 1,\n    \"prefix\" : \"A-\",\n    \"number\" : 525,\n    },\n  \"saleTickets\": [\n    {\n      \"id\": \"357\"\n    },\n    {\n      \"id\": \"411\"\n    }\n  ],\n  \"stamp\": {\n    \"generateStamp\": \"true\"\n  }\n}\n "}]},"auth":"required","params":[{"_id":"56b0cbcbce5f410d0056c9c7","ref":"","in":"body","required":true,"desc":"Fecha de la factura. Formato yyyy-MM-dd.","default":"","type":"yyyy-mm-dd","name":"date"},{"_id":"56b0cd936d004b17008065ca","ref":"","in":"body","required":true,"desc":"Array de objetos que contienen el id de los tickets de venta que se desean asociar a la factura global.","default":"","type":"array_object","name":"saleTickets"},{"_id":"56b210797ae4550d00062925","ref":"","in":"body","required":false,"desc":"Objeto que contiene la información de la numeración de la factura. Para numeraciones automáticas solo debe incluir el id de la numeración, para numeraciones manuales se debe enviar como mínimo el id de la numeración y el número de la factura. Si no se envía este atributo la aplicación intenta crear la factura con la numeración preferida que tiene configurada la empresa. Si no es posible retorna error. Para la creación de tickets de venta (México) es necesario enviar la numeración de tipo Ticket de venta.","default":"","type":"mixed","name":"numberTemplate"},{"_id":"5b6083b27c5f0e0003c19ab5","ref":"","in":"path","required":true,"desc":"Id de la factura global que se desea editar. Se debe enviar en la URL","default":"","type":"int","name":"id"},{"_id":"5b6083b27c5f0e0003c19ab4","ref":"","in":"body","required":false,"desc":"El objeto stamp indica que se desea timbrar la factura en Alegra o que se está ingresando una factura que ya contiene timbre.    Si se desea timbrar la factura en Alegra, se debe mandar este objeto con los siguientes atributos :  `generateStamp (boolean)` : Enviar en true para indicar que se desea timbrar la factura en la aplicación.  Se debe tener en cuenta que la compañía debe tener configurada la información del certificado y llave privada para timbrar la factura correctamente.   Nota: Se debe tener en cuenta que si se desea timbrar una factura por medio de la API y el proceso resulta exitoso, se convierte automáticamente a estado Abierta.","default":"","type":"object","name":"stamp"}],"url":"/global-invoices/:id"},"isReference":false,"order":4,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Únicamente se modifican los atributos que se envían en el request, los otros atributos del objeto que no se envían quedan intactos.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Solo se pueden editar facturas globales que no hayan sido timbradas.\"\n}\n[/block]","excerpt":"","slug":"crear-factura-global","type":"endpoint","title":"Editar factura global"}

putEditar factura global


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
required
integer
Id de la factura global que se desea editar. Se debe enviar en la URL

Body Params

date:
required
yyyy-mm-dd
Fecha de la factura. Formato yyyy-MM-dd.
saleTickets:
required
array of objects
Array de objetos que contienen el id de los tickets de venta que se desean asociar a la factura global.
numberTemplate:
mixed
Objeto que contiene la información de la numeración de la factura. Para numeraciones automáticas solo debe incluir el id de la numeración, para numeraciones manuales se debe enviar como mínimo el id de la numeración y el número de la factura. Si no se envía este atributo la aplicación intenta crear la factura con la numeración preferida que tiene configurada la empresa. Si no es posible retorna error. Para la creación de tickets de venta (México) es necesario enviar la numeración de tipo Ticket de venta.
stamp:
object
El objeto stamp indica que se desea timbrar la factura en Alegra o que se está ingresando una factura que ya contiene timbre. Si se desea timbrar la factura en Alegra, se debe mandar este objeto con los siguientes atributos : `generateStamp (boolean)` : Enviar en true para indicar que se desea timbrar la factura en la aplicación. Se debe tener en cuenta que la compañía debe tener configurada la información del certificado y llave privada para timbrar la factura correctamente. Nota: Se debe tener en cuenta que si se desea timbrar una factura por medio de la API y el proceso resulta exitoso, se convierte automáticamente a estado Abierta.

Examples


Result Format


Documentation

[block:callout] { "type": "warning", "title": "Únicamente se modifican los atributos que se envían en el request, los otros atributos del objeto que no se envían quedan intactos." } [/block] [block:callout] { "type": "warning", "title": "Solo se pueden editar facturas globales que no hayan sido timbradas." } [/block]

User Information

Try It Out

put
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}