Facturear Plantillas API
Cómo se lee y se factura cada tipo de documento, y facturas recurrentes
Cómo se lee y se factura cada tipo de documento, y facturas recurrentes
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/facture-ar:facture-ar-plantillas-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Facturear Plantillas API
description: 'API para emitir facturas electrónicas de ARCA (Argentina) desde tu sistema: facturas, notas de crédito y débito, lotes, PDF y XML, envío por email, borradores desde documentos, webhooks y reportes. Autenticación con API Key en el header x-api-key: la key de testing opera en homologación y la de producción emite comprobantes reales.'
version: 1.0.0
contact:
name: Facturear Support
email: support@facture.ar
url: https://facture.ar
license:
name: MIT
url: https://opensource.org/licenses/MIT
servers:
- url: https://www.facture.ar/api
description: Servidor de producción
security:
- apiKey: []
tags:
- name: Plantillas
description: Cómo se lee y se factura cada tipo de documento, y facturas recurrentes
paths:
/documents/templates:
get:
summary: Listar plantillas
tags:
- Plantillas
responses:
'200':
description: Plantillas
content:
application/json:
schema:
type: object
properties:
templates:
type: array
items:
$ref: '#/components/schemas/Template'
operationId: getDocumentsTemplates
x-operation-id-source: derived
post:
summary: Crear una plantilla
description: Una plantilla define cómo se lee y se factura un tipo de documento (CUIT, punto de venta, modo, cliente fijo, precios, instrucciones para la IA, columnas de la planilla) y, con recurrence, una factura que sale sola todos los meses.
tags:
- Plantillas
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TemplateInput'
responses:
'201':
description: Plantilla creada
content:
application/json:
schema:
type: object
properties:
template:
$ref: '#/components/schemas/Template'
'400':
description: Datos inválidos
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
operationId: postDocumentsTemplates
x-operation-id-source: derived
/documents/templates/{templateId}:
get:
summary: Obtener una plantilla
tags:
- Plantillas
parameters:
- name: templateId
in: path
description: ID de la plantilla
required: true
schema:
type: string
responses:
'200':
description: Plantilla
content:
application/json:
schema:
type: object
properties:
template:
$ref: '#/components/schemas/Template'
'404':
description: La plantilla no existe
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
operationId: getDocumentsTemplatesByTemplateId
x-operation-id-source: derived
put:
summary: Reemplazar una plantilla
description: 'Reemplaza la plantilla con el body completo: los campos que no mandás vuelven a su valor por defecto, salvo columnMapping, que se conserva si no lo mandás.'
tags:
- Plantillas
parameters:
- name: templateId
in: path
description: ID de la plantilla
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TemplateInput'
responses:
'200':
description: Plantilla actualizada
content:
application/json:
schema:
type: object
properties:
template:
$ref: '#/components/schemas/Template'
'400':
description: Datos inválidos o la plantilla no existe
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
operationId: putDocumentsTemplatesByTemplateId
x-operation-id-source: derived
delete:
summary: Borrar una plantilla
tags:
- Plantillas
parameters:
- name: templateId
in: path
description: ID de la plantilla
required: true
schema:
type: string
responses:
'200':
description: Plantilla borrada
content:
application/json:
schema:
type: object
properties:
ok:
type: boolean
operationId: deleteDocumentsTemplatesByTemplateId
x-operation-id-source: derived
/documents/templates/{templateId}/run:
post:
summary: Emitir ya la factura recurrente del mes
description: Genera ahora el borrador del mes de una plantilla recurrente. Como mucho una vez por mes.
tags:
- Plantillas
parameters:
- name: templateId
in: path
description: ID de la plantilla
required: true
schema:
type: string
responses:
'200':
description: Borrador del mes
content:
application/json:
schema:
type: object
properties:
draft:
$ref: '#/components/schemas/Draft'
'400':
description: La plantilla no existe o no se puede emitir
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
operationId: postDocumentsTemplatesByTemplateIdRun
x-operation-id-source: derived
components:
schemas:
DraftData:
type: object
description: Los datos de la factura propuesta
required:
- lines
properties:
receiver:
type: object
properties:
name:
type:
- string
- 'null'
maxLength: 200
docType:
type:
- string
- 'null'
description: CUIT, CUIL o DNI; null = consumidor final sin identificar
docNumber:
type:
- string
- 'null'
description: CUIT, CUIL o DNI, con o sin guiones
condicionIva:
type:
- integer
- 'null'
description: Condición frente al IVA del receptor (código de ARCA). Si falta, se busca en el padrón
email:
type:
- string
- 'null'
format: email
description: Si está, se le manda la factura
address:
type:
- string
- 'null'
maxLength: 300
concepto:
type: integer
enum:
- 1
- 2
- 3
default: 1
description: 1 productos, 2 servicios, 3 productos y servicios
serviceFrom:
type:
- string
- 'null'
format: date
description: AAAA-MM-DD, servicios
serviceTo:
type:
- string
- 'null'
format: date
description: AAAA-MM-DD, servicios
paymentDue:
type:
- string
- 'null'
format: date
description: Vencimiento del pago, AAAA-MM-DD
pricesIncludeIva:
type: boolean
default: true
description: Los precios de las líneas incluyen IVA
lines:
type: array
maxItems: 200
items:
type: object
required:
- description
- unitPrice
properties:
description:
type: string
maxLength: 200
quantity:
type: number
exclusiveMinimum: 0
default: 1
unitPrice:
type:
- number
- 'null'
minimum: 0
description: null si el documento no trae precio
ivaRate:
type: number
enum:
- 0
- 2.5
- 5
- 10.5
- 21
- 27
default: 21
description: Alícuota de IVA en porcentaje
documentTotal:
type:
- number
- 'null'
description: Total impreso en el documento, para controlar las líneas
currency:
type: string
minLength: 3
maxLength: 3
default: ARS
description: Moneda ISO 4217
documentDate:
type:
- string
- 'null'
format: date
description: Fecha del documento, AAAA-MM-DD. La factura se emite con la fecha del día
reference:
type:
- string
- 'null'
maxLength: 100
description: Número de remito, pedido o referencia
description:
type:
- string
- 'null'
maxLength: 500
description: Texto libre que va en la factura
Draft:
type: object
description: Un borrador de factura armado desde un documento, una planilla, datos enviados por API o una plantilla recurrente
properties:
id:
type: string
status:
type: string
enum:
- extracting
- review
- queued
- invoiced
- error
- discarded
description: 'extracting: leyéndose; review: espera revisión; queued: enviado a ARCA; invoiced: facturado; error: no se pudo leer o emitir; discarded: descartado'
mode:
type: string
enum:
- manual
- automatic
description: 'automatic: se emite solo si no hay observaciones'
source:
type: string
enum:
- upload
- google_drive
- zapier
- api
- recurring
- mcp
- whatsapp
sourceRef:
type:
- string
- 'null'
fileName:
type:
- string
- 'null'
mimeType:
type:
- string
- 'null'
hasFile:
type: boolean
templateId:
type:
- string
- 'null'
templateName:
type:
- string
- 'null'
cuitId:
type:
- string
- 'null'
ptoVta:
type:
- integer
- 'null'
environment:
type: string
enum:
- production
- homologation
data:
oneOf:
- $ref: '#/components/schemas/DraftData'
- type: 'null'
total:
type:
- number
- 'null'
description: Total calculado con las líneas; null si falta algún precio
voucherLetter:
type:
- string
- 'null'
enum:
- A
- B
- C
- null
confidence:
type:
- number
- 'null'
description: Confianza de la lectura con IA, de 0 a 1
issues:
type: array
description: Observaciones que hay que revisar
items:
type: object
properties:
code:
type: string
enum:
- no_cuit
- no_lines
- missing_price
- invalid_amount
- total_mismatch
- invalid_document
- unidentified_receiver
- foreign_currency
- low_confidence
- possible_duplicate
- ai_note
- ai_info
message:
type: string
errorMessage:
type:
- string
- 'null'
invoice:
type:
- object
- 'null'
description: La factura emitida desde el borrador
properties:
id:
type: string
voucherNumber:
type: integer
ptoVta:
type:
- integer
- 'null'
invoiceType:
type:
- integer
- 'null'
status:
type: string
amount:
type: number
emailStatus:
type:
- string
- 'null'
description: Estado del envío de la factura por email
url:
type: string
description: Link al borrador en el dashboard
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
Error:
type: object
description: Error de la API. Los errores de autenticación (401), validación (400), CUIT inexistente (404), conflicto (409) e internos (500) vienen como application/problem+json (RFC 9457) con code, message y resolution. Otros errores vienen como JSON con error y, a veces, details y code. En los dos casos está el campo error.
required:
- error
properties:
error:
type: string
description: Mensaje de error
code:
type: string
description: 'Código estable: unauthorized, invalid_request, cuit_not_found, conflict, internal_error, o códigos propios como SUBSCRIPTION_LIMIT_EXCEEDED'
message:
type: string
description: Qué pasó (problem+json)
resolution:
type: string
description: Qué hacer para resolverlo (problem+json)
type:
type: string
format: uri
description: URI del tipo de problema (problem+json)
title:
type: string
description: Título corto del problema (problem+json)
status:
type: integer
description: Código HTTP (problem+json)
detail:
type: string
description: Igual que message (problem+json)
details:
description: 'Detalle del error: un texto, o la lista de errores de validación'
TemplateInput:
type: object
required:
- name
properties:
name:
type: string
maxLength: 120
cuitId:
type:
- string
- 'null'
description: CUIT emisor. Obligatorio en modo automático y en las recurrentes
ptoVta:
type:
- integer
- 'null'
minimum: 1
maximum: 99999
mode:
type: string
enum:
- manual
- automatic
default: manual
concepto:
type: integer
enum:
- 1
- 2
- 3
default: 1
ivaRate:
type: number
enum:
- 0
- 2.5
- 5
- 10.5
- 21
- 27
default: 21
pricesIncludeIva:
type: boolean
default: true
receiverDocType:
type:
- string
- 'null'
enum:
- CUIT
- CUIL
- DNI
- null
description: 'Cliente fijo: todas las facturas de la plantilla van a él'
receiverDocNumber:
type:
- string
- 'null'
maxLength: 20
receiverName:
type:
- string
- 'null'
maxLength: 200
receiverCondicionIva:
type:
- integer
- 'null'
receiverEmail:
type:
- string
- 'null'
format: email
items:
type:
- array
- 'null'
maxItems: 100
description: Líneas fijas, para las facturas recurrentes
items:
type: object
required:
- description
- quantity
- unitPrice
properties:
description:
type: string
quantity:
type: number
unitPrice:
type: number
minimum: 0
priceList:
type:
- array
- 'null'
maxItems: 2000
description: Precios para documentos que no los traen (remitos)
items:
type: object
required:
- description
- unitPrice
properties:
description:
type: string
unitPrice:
type: number
minimum: 0
instructions:
type:
- string
- 'null'
maxLength: 4000
description: Lo que la IA tiene que saber para leer este tipo de documento
columnMapping:
type:
- object
- 'null'
description: Columnas de la planilla → campos de la factura
properties:
headerRow:
type: integer
minimum: 1
columns:
type: object
description: 'Campo → nombre de la columna. Campos: receiverName, receiverDoc, receiverEmail, receiverCondicionIva, receiverAddress, description, quantity, unitPrice, lineTotal, ivaRate, reference, date, concepto'
additionalProperties:
type: string
groupBy:
type:
- string
- 'null'
pricesIncludeIva:
type: boolean
paymentTermDays:
type:
- integer
- 'null'
minimum: 0
maximum: 365
sendEmail:
type: boolean
default: true
description: Mandarle la factura al cliente por email
emailCopyTo:
type:
- string
- 'null'
format: email
recurrence:
type:
- string
- 'null'
enum:
- monthly
- null
description: 'monthly: emite las líneas fijas todos los meses en dayOfMonth'
dayOfMonth:
type:
- integer
- 'null'
minimum: 1
maximum: 28
active:
type: boolean
default: true
Template:
type: object
properties:
id:
type: string
userId:
type: string
name:
type: string
maxLength: 120
cuitId:
type:
- string
- 'null'
description: CUIT emisor. Obligatorio en modo automático y en las recurrentes
ptoVta:
type:
- integer
- 'null'
minimum: 1
maximum: 99999
mode:
type: string
enum:
- manual
- automatic
default: manual
concepto:
type: integer
enum:
- 1
- 2
- 3
default: 1
ivaRate:
type: number
enum:
- 0
- 2.5
- 5
- 10.5
- 21
- 27
default: 21
pricesIncludeIva:
type: boolean
default: true
receiverDocType:
type:
- string
- 'null'
enum:
- CUIT
- CUIL
- DNI
- null
description: 'Cliente fijo: todas las facturas de la plantilla van a él'
receiverDocNumber:
type:
- string
- 'null'
maxLength: 20
receiverName:
type:
- string
- 'null'
maxLength: 200
receiverCondicionIva:
type:
- integer
- 'null'
receiverEmail:
type:
- string
- 'null'
format: email
items:
type:
- array
- 'null'
maxItems: 100
description: Líneas fijas, para las facturas recurrentes
items:
type: object
required:
- description
- quantity
- unitPrice
properties:
description:
type: string
quantity:
type: number
unitPrice:
type: number
minimum: 0
priceList:
type:
- array
- 'null'
maxItems: 2000
description: Precios para documentos que no los traen (remitos)
items:
type: object
required:
- description
- unitPrice
properties:
description:
type: string
unitPrice:
type: number
minimum: 0
instructions:
type:
- string
- 'null'
maxLength: 4000
description: Lo que la IA tiene que saber para leer este tipo de documento
columnMapping:
type:
- object
- 'null'
description: Columnas de la planilla → campos de la factura
properties:
headerRow:
type: integer
minimum: 1
columns:
type: object
description: 'Campo → nombre de la columna. Campos: receiverName, receiverDoc, receiverEmail, receiverCondicionIva, receiverAddress, description, quantity, unitPrice, lineTotal, ivaRate, reference, date, concepto'
additionalProperties:
type: string
groupBy:
type:
- string
- 'null'
pricesIncludeIva:
type: boolean
paymentTermDays:
type:
- integer
- 'null'
minimum: 0
maximum: 365
sendEmail:
type: boolean
default: true
description: Mandarle la factura al cliente por email
emailCopyTo:
type:
- string
- 'null'
format: email
recurrence:
type:
- string
- 'null'
enum:
- monthly
- null
description: 'monthly: emite las líneas fijas todos los meses en dayOfMonth'
dayOfMonth:
type:
- integer
- 'null'
minimum: 1
maximum: 28
active:
type: boolean
default: true
nextRunAt:
type:
- string
- 'null'
format: date-time
lastRunAt:
type:
- string
- 'null'
format: date-time
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
securitySchemes:
apiKey:
type: apiKey
in: header
name: x-api-key
description: 'API Key para autenticación. Formato: test_sk_xxx para testing, prod_sk_xxx para producción.'