curl --request POST \
--url https://e-cf.acpay.do/sandbox/v1/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"ecfType": 31,
"buyer": {
"taxId": "131793916",
"name": "Distribuidora del Caribe SRL",
"email": "compras@distribuidoracaribe.com.do"
},
"paymentType": "credit",
"dueDate": "2026-10-31",
"description": "Servicios de septiembre 2026",
"items": [
{
"description": "Servicio de mantenimiento mensual",
"quantity": 2,
"unitPrice": 1500.5
},
{
"description": "Libro de texto",
"quantity": 1,
"unitPrice": 850,
"itbisRate": 0
}
]
}
'{
"id": "3f1c2b9e-8a4d-4f6e-9c1a-2b7d5e8f0a13",
"status": "accepted",
"statusMessage": null,
"securityCode": "a1B2c3",
"stampUrl": "https://ecf.dgii.gov.do/testecf/ConsultaTimbre?RncEmisor=101000000&RncComprador=131793916&ENCF=E310000000001&FechaEmision=27-09-2026&MontoTotal=3541.18&FechaFirma=27-09-2026%2010:15:00&CodigoSeguridad=a1B2c3",
"signedAt": "2026-09-27T14:15:00.000Z",
"issuedAt": "2026-09-27T14:14:58.000Z",
"environment": "test",
"currency": "DOP",
"subtotal": 3001,
"itbis": 540.18,
"total": 3541.18,
"encf": "E310000000001",
"ecfType": 31,
"buyer": {
"taxId": "131793916",
"name": "Distribuidora del Caribe SRL"
},
"paymentType": "credit",
"dueDate": "2026-10-31",
"items": [
{
"description": "Servicio de mantenimiento mensual",
"quantity": 2,
"unitPrice": 1500.5,
"itbisRate": 18,
"subtotal": 3001
}
]
}Emitir un e-CF de venta
Emite una factura electrónica (31, 32, 44 o 45), la firma y la envía a la DGII. La respuesta suele llegar con status: pending; el estado se actualiza solo hasta accepted, accepted_with_observations o rejected: recíbelo con un webhook o consúltalo con GET /v1/invoices/{id}.
Límite mensual: si alcanzaste el límite mensual de este tipo de e-CF responde 429 sin Retry-After (el 429 por exceso de solicitudes sí lo trae); consulta tu consumo con GET /v1/limits. Consultar, descargar y anular siguen funcionando, y reintentar un documento ya emitido no vuelve a contar. Ese 429 no se guarda: cuando se amplíe el límite puedes reintentar con la misma Idempotency-Key.
curl --request POST \
--url https://e-cf.acpay.do/sandbox/v1/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"ecfType": 31,
"buyer": {
"taxId": "131793916",
"name": "Distribuidora del Caribe SRL",
"email": "compras@distribuidoracaribe.com.do"
},
"paymentType": "credit",
"dueDate": "2026-10-31",
"description": "Servicios de septiembre 2026",
"items": [
{
"description": "Servicio de mantenimiento mensual",
"quantity": 2,
"unitPrice": 1500.5
},
{
"description": "Libro de texto",
"quantity": 1,
"unitPrice": 850,
"itbisRate": 0
}
]
}
'{
"id": "3f1c2b9e-8a4d-4f6e-9c1a-2b7d5e8f0a13",
"status": "accepted",
"statusMessage": null,
"securityCode": "a1B2c3",
"stampUrl": "https://ecf.dgii.gov.do/testecf/ConsultaTimbre?RncEmisor=101000000&RncComprador=131793916&ENCF=E310000000001&FechaEmision=27-09-2026&MontoTotal=3541.18&FechaFirma=27-09-2026%2010:15:00&CodigoSeguridad=a1B2c3",
"signedAt": "2026-09-27T14:15:00.000Z",
"issuedAt": "2026-09-27T14:14:58.000Z",
"environment": "test",
"currency": "DOP",
"subtotal": 3001,
"itbis": 540.18,
"total": 3541.18,
"encf": "E310000000001",
"ecfType": 31,
"buyer": {
"taxId": "131793916",
"name": "Distribuidora del Caribe SRL"
},
"paymentType": "credit",
"dueDate": "2026-10-31",
"items": [
{
"description": "Servicio de mantenimiento mensual",
"quantity": 2,
"unitPrice": 1500.5,
"itbisRate": 18,
"subtotal": 3001
}
]
}Autorizaciones
Llave de API de AC-PAY del ambiente de esta URL.
Encabezados
Identificador único que generas por operación (p. ej. un UUID), de 1 a 255 caracteres ASCII imprimibles. Si repites la solicitud con la misma llave en las siguientes 24 h recibes la respuesta original (con Idempotent-Replayed: true) sin ejecutarla de nuevo.
"5b0f7c1e-2f7a-4d8e-9d3c-7f1e2a9b4c60"
Cuerpo
Tipo de e-CF: 31 crédito fiscal, 32 consumo, 44 regímenes especiales, 45 gubernamental.
31, 32, 44, 45 31
Condición de pago.
cash, credit "credit"
Líneas de la factura (1 a 500).
Show child attributes
Show child attributes
Comprador. Obligatorio salvo en e-CF 32 (consumo); en un 32 de RD$250,000 o más también lo exige la DGII.
Show child attributes
Show child attributes
Fecha de vencimiento (YYYY-MM-DD). Obligatoria si paymentType es credit.
"2026-10-31"
Nota o descripción general de la factura.
500"Servicios de septiembre 2026"
Respuesta
Documento creado y enviado a la DGII.
"3f1c2b9e-8a4d-4f6e-9c1a-2b7d5e8f0a13"
pending: enviado, esperando a la DGII (se actualiza solo en segundo plano, y también al consultar). accepted / accepted_with_observations: válido. rejected: la DGII lo rechazó (ver statusMessage). cancelled: anulado. error: no se pudo procesar (se puede reintentar).
pending, accepted, accepted_with_observations, rejected, cancelled, error "accepted"
Detalle del estado (motivo de rechazo u observaciones).
null
Código de seguridad del e-CF (va impreso en la representación impresa).
"a1B2c3"
URL de consulta de la DGII (contenido del código QR).
"https://ecf.dgii.gov.do/testecf/ConsultaTimbre?RncEmisor=101000000&RncComprador=131793916&ENCF=E310000000001&FechaEmision=27-09-2026&MontoTotal=3541.18&FechaFirma=27-09-2026%2010:15:00&CodigoSeguridad=a1B2c3"
"2026-09-27T14:15:00.000Z"
"2026-09-27T14:14:58.000Z"
test, live "test"
DOP "DOP"
Monto sin ITBIS.
3001
ITBIS total.
540.18
Total con ITBIS.
3541.18
e-NCF asignado. null mientras no se haya asignado.
"E310000000001"
31, 32, 44, 45 31
Show child attributes
Show child attributes
cash, credit "credit"
"2026-10-31"
Show child attributes
Show child attributes