{"_id":"56b20ae3a5a1020d00cf4c49","project":"56abd2434e4b730d009eb10a","parentDoc":null,"version":{"_id":"56abd2434e4b730d009eb10d","project":"56abd2434e4b730d009eb10a","__v":18,"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"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"__v":2,"editedParams":true,"editedParams2":true,"category":{"_id":"56b4b32deed075230097d689","__v":0,"project":"56abd2434e4b730d009eb10a","version":"56abd2434e4b730d009eb10d","pages":[],"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-02-05T14:35:25.879Z","from_sync":false,"order":3,"slug":"facturas-de-venta","title":"Facturas de venta"},"user":"56abd213d4432d1900eed227","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-03T14:12:51.824Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"get","results":{"codes":[{"code":"[ \n  {\n    \"id\": 1,\n    \"date\": \"2015-09-15\",\n    \"dueDate\": \"2015-10-15\",\n    \"observations\": \"\",\n    \"anotation\": \"Favor consignar a la cuenta XXXXXX\",\n    \"termsConditions\": \"Garantía de 1 año\",\n    \"status\": \"open\",\n    \"client\": {\n      \"id\": 1,\n      \"name\": \"Coorporación Alegrate\",\n      \"identification\": \"159.549.847\",\n      \"email\": \"prueba:::at:::alegra.com\",\n      \"phonePrimary\": \"999-99-99\",\n      \"phoneSecondary\": \"\",\n      \"fax\": \"\",\n      \"mobile\": \"(333) 555-55-55\",\n      \"address\": {\n        \"address\": \"Calle principal #45\",\n        \"city\": \"Barcelona\"\n      }\n    },\n    \"numberTemplate\": {\n      \"id\": 1,\n      \"prefix\": \"A-\",\n      \"number\": 520,\n      \"text\": \"Resolución de la DIAN # 45112\"\n    },\n    \"retentions\": [\n      {\n        \"id\": 1,\n        \"name\": \"Compras\",\n        \"percentage\": 3.5,\n        \"amount\": 500\n      }\n     ],\n    \"seller\": {\n      \"id\": \"12\",\n      \"name\": \"Diana Giraldo\",\n      \"identification\": \"520.526.21\",\n      \"observations\": \"Líder de Ventas\"\n    },\n    \"priceList\": {\n      \"id\": 5,\n      \"name\": \"Distribuidor\"\n      },\n    \"currency\": {\n      \"code\": \"USD\",\n      \"symbol\": \"$\",\n      \"exchangeRate\": 2950\n      },\n    \"total\": 609,\n    \"totalPaid\": 9,\n    \"balance\": 600,\n    \"decimalPrecision\" : 2,\n    \"items\": [\n      {\n        \"id\": 1,\n        \"name\": \"Billetera\",\n        \"description\": \"Billetera de cuero negro\",\n        \"reference\": \"REF-005\",\n        \"tax\": [\n          {\n            \"id\": 6,\n            \"name\": \"IVA\",\n            \"percentage\": 16,\n            \"description\": \"Impuesto de valor agregado\",\n            \"type\": \"IVA\",\n            \"status\": \"active\"\n            }\n          ],\n        \"price\": 80,\n        \"quantity\": 5\n        },\n      {\n        \"id\": 2,\n        \"name\": \"Cartera\",\n        \"description\": \"Cartera de cuero color café\",\n        \"reference\": \"CAR-195\",\n        \"price\": 125,\n        \"tax\": [\n          {\n            \"id\": 6,\n            \"name\": \"IVA\",\n            \"percentage\": 16,\n            \"description\": \"Impuesto de valor agregado\",\n            \"status\": \"active\"\n            }\n          ],\n        \"quantity\": 1\n        }\n      ],\n    \"payments\": []\n    },\n  {\n    \"id\": 2,\n    \"date\": \"2015-11-15\",\n    \"dueDate\": \"2015-12-15\",\n    \"observations\": \"Observaciones de la factura.\",\n    \"anotation\": \"Nota : Favor consignar a la cuenta XXXXXX\",\n    \"termsConditions\": \"Términos y condiciones de mi empresa\",\n    \"status\": \"draft\",\n    \"client\": {\n      \"id\": 2,\n      \"name\": \"Acrecer\",\n      \"identification\": \"963.654.988\",\n      \"email\": \"prueba2@alegra.com\",\n      \"phonePrimary\": \"111 11 11\",\n      \"phoneSecondary\": \"\",\n      \"fax\": \"\",\n      \"mobile\": \"(333) 555-55-55\",\n      \"observations\": \"\",\n      \"address\": {\n        \"address\": \"Avenida Madison\",\n        \"city\": \"New York, USA\"\n        }\n      },\n    \"numberTemplate\": [\n      {\n        \"id\": 1,\n        \"prefix\": \"A-\",\n        \"number\": 525,\n        \"text\": \"Resolución de la DIAN # 45112\"\n        }\n      ],\n    \"retentions\": [\n      {\n        \"id\": 1,\n        \"name\": \"Compras\",\n        \"percentage\": 3.5,\n        \"amount\": 22.12\n        },\n      {\n        \"id\": 6,\n        \"name\": \"Honorarios\",\n        \"percentage\": 11,\n        \"amount\": 500\n        }\n      ],\n    \"seller\": {\n      \"id\": \"52\",\n      \"name\": \"Carmen López\",\n      \"identification\": \"\",\n      \"observations\": \"\"\n      },\n    \"priceList\": {},\n    \"currency\": {\n      \"code\": \"USD\",\n      \"symbol\": \"$\",\n      \"exchangeRate\": 3100\n      },\n    \"total\": 632,\n    \"totalPaid\": 500,\n    \"balance\": 132,\n    \"decimalPrecision\" : 2,\n    \"items\": [\n      {\n        \"id\": 1,\n        \"name\": \"Billetera\",\n        \"description\": \"Billetera de cuero negro\",\n        \"reference\": \"REF-005\",\n        \"tax\": [\n          {\n            \"id\": 6,\n            \"name\": \"IVA\",\n            \"percentage\": 16,\n            \"description\": \"Impuesto de valor agregado\",\n            \"type\": \"IVA\",\n            \"status\": \"active\"\n            }\n          ],\n        \"price\": 85,\n        \"quantity\": 5\n        },\n      {\n        \"id\": 2,\n        \"name\": \"Cartera\",\n        \"description\": \"Cartera de cuero color café\",\n        \"reference\": \"CAR-195\",\n        \"price\": 120,\n        \"tax\": [\n          {\n            \"id\": 6,\n            \"name\": \"IVA\",\n            \"percentage\": 16,\n            \"description\": \"Impuesto de valor agregado\",\n            \"type\": \"IVA\",\n            \"status\": \"active\"\n            }\n          ],\n        \"quantity\": 1\n        }\n      ],\n    \"payments\": [\n      {\n        \"id\": \"125\",\n        \"number\": \"150\",\n        \"date\": \"2015-11-23\",\n        \"amount\": \"500\",\n        \"paymentMethod\": \"transfer\",\n        \"observations\": \"\",\n        \"anotation\": \"\",\n        \"status\": \"open\"\n      }\n    ]\n  }\n]","language":"json","name":"Ejemplo consulta exitosa","status":200},{"name":"Bad Request - Límite sobrepasa máximo permitido","status":400,"language":"text","code":"{ \n\t\"error\": \"El límite de facturas para retornar debe ser menor o igual a 30\",\n\t\"code\" : 903\n}"},{"code":"{\n  \"metadata\" : {\n    \"total\" : 15\n    },\n  \"data\" : [\n    {\n      \"id\": 1,\n      \"date\": \"2015-09-15\",\n      \"dueDate\": \"2015-10-15\",\n      \"observations\": \"\",\n      \"anotation\" : \"Favor consignar a la cuenta XXXXXX\",\n      \"termsConditions\" : \"Garantía de 1 año\",\n      \"status\" : \"open\",\n      \"client\": {\n        \"id\": 1,\n        \"name\": \"Coorporación Alegrate\",\n        \"identification\": \"159.549.847\",\n        \"email\": \"prueba@alegra.com\",\n        \"phonePrimary\": \"999-99-99\",\n        \"phoneSecondary\": \"\",\n        \"fax\": \"\",\n        \"mobile\": \"(333) 555-55-55\",\n        \"address\" : {\n          \"address\" : \"Calle principal #45\",\n          \"city\" : \"Barcelona\"\n          }\n        },\n      \"numberTemplate\" : {\n        \"id\" : 1,\n        \"prefix\" : \"A-\",\n        \"number\" : 520,\n        \"text\" : \"Resolución de la DIAN # 45112\"\n        },\n      \"retentions\" : [\n        {\n          \"id\": 1,\n          \"name\" : \"Compras\",\n          \"percentage\" : 3.5,\n          \"amount\" : 500\n          }\n        ],\n      \"seller\" : {\n        \"id\" : \"12\",\n        \"name\" : \"Diana Giraldo\",\n        \"identification\" : \"520.526.21\",\n        \"observations\" : \"Líder de Ventas\"\n        },\n      \"priceList\" : {\n        \"id\" : 5,\n        \"name\" : \"Distribuidor\"\n        },\n      \"currency\" : {\n        \"code\" : \"USD\",\n        \"exchangeRate\" : 2950\n        },\n      \"total\" : 609,\n      \"totalPaid\" : 0,\n      \"items\" : [\n        {\n          \"id\": 1,\n          \"name\": \"Billetera\",\n          \"description\": \"Billetera de cuero negro\",\n          \"reference\": \"REF-005\",\n          \"tax\" : [\n            {\n              \"id\" : 6,\n              \"name\" : \"IVA\",\n              \"percentage\" : 16,\n              \"description\" : \"Impuesto de valor agregado\",\n              \"status\" : \"active\"\n              }\n            ],\n          \"price\" : 80,\n          \"quantity\" : 5\n          },\n        {\n          \"id\": 2,\n          \"name\": \"Cartera\",\n          \"description\": \"Cartera de cuero color café\",\n          \"reference\": \"CAR-195\",\n          \"price\": 125,\n          \"tax\" : [\n            {\n              \"id\" : 6,\n              \"name\" : \"IVA\",\n              \"percentage\" : 16,\n              \"description\" : \"Impuesto de valor agregado\",\n              \"status\" : \"active\"\n              }\n            ],\n          \"quantity\" : 1\n          }   \n        ],\n      \"payments\" : []\n      },\n    {\n      \"id\": 2,\n      \"date\": \"2015-11-15\",\n      \"dueDate\": \"2015-12-15\",\n      \"observations\": \"Observaciones de la factura.\",\n      \"anotation\" : \"Nota : Favor consignar a la cuenta XXXXXX\",\n      \"termsConditions\" : \"Términos y condiciones de mi empresa\",\n      \"status\" : \"draft\",\n      \"client\" : {\n        \"id\": 2,\n        \"name\": \"Acrecer\",\n        \"identification\": \"963.654.988\",\n        \"email\": \"prueba2@alegra.com\",\n        \"phonePrimary\": \"111 11 11\",\n        \"phoneSecondary\" : \"\",\n        \"fax\": \"\",\n        \"mobile\": \"(333) 555-55-55\",\n        \"observations\": \"\",\n        \"address\" : {\n          \"address\" : \"Avenida Madison\",\n          \"city\" : \"New York, USA\"\n          }\n        },\n      \"numberTemplate\" : [\n        {\n          \"id\" : 1,\n          \"prefix\" : \"A-\",\n          \"number\" : 525,\n          \"text\" : \"Resolución de la DIAN # 45112\"\n          }\n        ],\n      \"retentions\" : [\n        {\n          \"id\": 1,\n          \"name\" : \"Compras\",\n          \"percentage\" : 3.5,\n          \"amount\" : 22.12\n          },\n        {\n          \"id\": 6,\n          \"name\" : \"Honorarios\",\n          \"percentage\" :11,\n          \"amount\" : 500\n          }\n        ],\n      \"seller\": {\n        \"id\" : \"52\",\n        \"name\" : \"Carmen López\",\n        \"identification\" : \"\",\n        \"observations\" : \"\"\n        },\n      \"priceList\" : {},\n      \"currency\" : {\n        \"code\" : \"USD\",\n        \"exchangeRate\" : 3100\n        },\n      \"total\" : 632,\n      \"totalPaid\" : 500,\n      \"items\" : [\n        {\n          \"id\": 1,\n          \"name\": \"Billetera\",\n          \"description\": \"Billetera de cuero negro\",\n          \"reference\": \"REF-005\",\n          \"tax\" : [\n            {\n              \"id\" : 6,\n              \"name\" : \"IVA\",\n              \"percentage\" : 16,\n              \"description\" : \"Impuesto de valor agregado\",\n              \"status\" : \"active\"\n              }\n            ],\n          \"price\" : 85,\n          \"quantity\" : 5\n          },\n        {\n          \"id\": 2,\n          \"name\": \"Cartera\",\n          \"description\": \"Cartera de cuero color café\",\n          \"reference\": \"CAR-195\",\n          \"price\": 120,\n          \"tax\" : [\n            {\n              \"id\" : 6,\n              \"name\" : \"IVA\",\n              \"percentage\" : 16,\n              \"description\" : \"Impuesto de valor agregado\",\n              \"status\" : \"active\"\n              }\n            ],\n          \"quantity\" : 1\n          }\n        ],\n      \"payments\" : [\n        {\n          id: \"125\",\n          number: \"150\",\n          date: \"2015-11-23\",\n          amount: \"500\",\n          paymentMethod: \"transfer\",\n          observations: \"\",\n          anotation: \"\",\n          status: \"open\"\n          }\n        ]\n      }\n  ]\n}","language":"json","status":200,"name":"Consulta exitosa con metadatos"}]},"settings":"","examples":{"codes":[{"code":"curl -v -H \"Accept: application/json\" -H \"Content-type: application/json\" -X GET  https://app.alegra.com/api/v1/invoices/ -u 'usuario@alegra.co:mitoken'","language":"curl"}]},"auth":"required","params":[{"_id":"56afd9393c70b01700facf25","ref":"","in":"query","required":false,"desc":"Desde cual factura se quiere consultar. Por ejemplo para consultar desde la factura 20, se envía start=20.","default":"0","type":"int","name":"start"},{"_id":"56b0b7da36d2580d002477d7","ref":"","in":"query","required":false,"desc":"Cantidad de facturas a partir del inicio que se desea retornar.  Por defecto retorna 30 facturas. Si este valor es mayor que 30, la aplicación retorna error.","default":"30","type":"int","name":"limit"},{"_id":"56b0b7da36d2580d002477d6","ref":"","in":"query","required":false,"desc":"Orden ascendente o descendente en el cual se quieren retornar las facturas.  Opciones disponibles son DESC o ASC.  Por defecto es ASC (ascendente).","default":"ASC","type":"string","name":"order_direction"},{"_id":"56b0b7da36d2580d002477d5","ref":"","in":"query","required":false,"desc":"Campo por el cual se desea ordenar, las opciones posibles son id, name, date, dueDate, status.","default":"date","type":"string","name":"order_field"},{"_id":"56fae8e4283ee90e004acaf1","ref":"","in":"query","required":false,"desc":"Incluir en los resultados metadatos. Se debe tener en cuenta que si se envía este parámetro el objeto que retorna la aplicación incluye un atributo \"metadata\" y otro \"data\" en donde se envían las facturas.  Actualmente la información que se envía en metadata incluye el total de facturas que tiene registrada la empresa.","default":"","type":"boolean","name":"metadata"}],"url":"/invoices/"},"isReference":true,"order":1,"body":"Endpoint que retorna las facturas registradas en la cuenta de Alegra. Si no se envía límite de facturas, por defecto se envían 30 facturas.  \n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Atención\",\n  \"body\": \"Se debe tener en cuenta que el valor máximo para el atributo limit es 30, si se supera ese valor la aplicación retorna el código de error:\\n```\\n{\\n  \\\"code\\\": 903,\\n  \\\"message\\\" : \\\"El límite debe ser menor o igual a 30\\\"\\n}\\n```\"\n}\n[/block]","excerpt":"Endpoint que permite consultar las facturas de venta registradas en la aplicación","slug":"lista-de-facturas-de-venta","type":"endpoint","title":"Lista de facturas de venta"}

getLista de facturas de venta

Endpoint que permite consultar las facturas de venta registradas en la aplicación

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

start:
integer0
Desde cual factura se quiere consultar. Por ejemplo para consultar desde la factura 20, se envía start=20.
limit:
integer30
Cantidad de facturas a partir del inicio que se desea retornar. Por defecto retorna 30 facturas. Si este valor es mayor que 30, la aplicación retorna error.
order_direction:
stringASC
Orden ascendente o descendente en el cual se quieren retornar las facturas. Opciones disponibles son DESC o ASC. Por defecto es ASC (ascendente).
order_field:
stringdate
Campo por el cual se desea ordenar, las opciones posibles son id, name, date, dueDate, status.
metadata:
boolean
Incluir en los resultados metadatos. Se debe tener en cuenta que si se envía este parámetro el objeto que retorna la aplicación incluye un atributo "metadata" y otro "data" en donde se envían las facturas. Actualmente la información que se envía en metadata incluye el total de facturas que tiene registrada la empresa.

Examples


Result Format


Documentation

Endpoint que retorna las facturas registradas en la cuenta de Alegra. Si no se envía límite de facturas, por defecto se envían 30 facturas. [block:callout] { "type": "warning", "title": "Atención", "body": "Se debe tener en cuenta que el valor máximo para el atributo limit es 30, si se supera ese valor la aplicación retorna el código de error:\n```\n{\n \"code\": 903,\n \"message\" : \"El límite debe ser menor o igual a 30\"\n}\n```" } [/block]

User Information

Try It Out

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