Ir al contenido

Submit a document for asynchronous issuance

POST
/companies/{companyId}/documents
curl --request POST \
--url https://acme.gravitastec.com/api/v1/companies/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: example' \
--data '{ "ecfType": 31, "encf": "example", "sequenceExpiresOn": "2026-04-15", "issueDate": "2026-04-15", "incomeType": "01", "paymentType": 1, "paymentDueDate": "2026-04-15", "paymentTerms": "example", "paymentForms": [ { "form": 1, "amount": 1 } ], "paymentAccount": { "type": "example", "number": "example", "bank": "example" }, "periodFrom": "2026-04-15", "periodTo": "2026-04-15", "taxIncludedInPrice": false, "deferredSending": false, "allInclusiveService": false, "emitter": { "branch": "example", "phones": [ "example" ], "email": "hello@example.com", "website": "example", "economicActivity": "example", "salespersonCode": "example", "internalInvoiceNumber": "example", "internalOrderNumber": "example", "salesZone": "example", "salesRoute": "example", "additionalInfo": "example" }, "buyer": { "rnc": "example", "foreignId": "example", "name": "example", "contact": "example", "email": "hello@example.com", "address": "example", "municipality": "example", "province": "example", "country": "example", "deliveryDate": "2026-04-15", "deliveryContact": "example", "deliveryAddress": "example", "additionalPhone": "example", "purchaseOrderDate": "2026-04-15", "purchaseOrderNumber": "example", "internalCode": "example", "paymentResponsible": "example", "additionalInfo": "example" }, "additionalInfo": { "shippingDate": "2026-04-15", "shippingNumber": "example", "containerNumber": "example", "referenceNumber": "example", "portOfShipment": "example", "deliveryTerms": "example", "totalFob": 1, "insurance": 1, "freight": 1, "otherCharges": 1, "totalCif": 1, "customsRegime": "example", "portOfDeparture": "example", "portOfArrival": "example", "grossWeight": 1, "netWeight": 1, "grossWeightUnit": 1, "netWeightUnit": 1, "packageCount": 1, "packageUnit": 1, "packageVolume": 1, "volumeUnit": 1 }, "transport": { "mode": "01", "originCountry": "example", "destinationAddress": "example", "destinationCountry": "example", "carrierId": "example", "carrierName": "example", "tripNumber": "example", "driver": "example", "transportDocument": "example", "vehicleRecord": "example", "plate": "example", "route": "example", "zone": "example", "deliveryNote": "example" }, "lines": [ { "itemName": "example", "description": "example", "isService": false, "billingIndicator": 0, "quantity": 1, "unitCode": 1, "unitPrice": 1, "discounts": [ { "type": "%", "percentage": 1, "amount": 1 } ], "surcharges": [ { "type": "%", "percentage": 1, "amount": 1 } ], "additionalTaxCodes": [ 1 ], "retention": { "agent": "R", "itbisRetained": 1, "isrRetained": 1 }, "itemCodes": [ { "type": "example", "code": "example" } ], "iscData": { "referenceQuantity": 1, "referenceUnit": 1, "subquantities": [ { "quantity": 1, "unit": 1 } ], "alcoholGrade": 1, "referenceUnitPrice": 1 }, "manufactureDate": "2026-04-15", "expirationDate": "2026-04-15", "mining": { "netWeightKg": 1, "netMiningWeight": 1, "affiliationType": 1, "settlement": 1 } } ], "subtotals": [ { "number": 1, "description": "example", "order": 1, "lines": [ 1 ] } ], "globalAdjustments": [ { "type": "D", "description": "example", "valueType": "%", "value": 1, "amount": 1, "billingIndicator": 0, "norma1007": false } ], "pages": [ { "fromLine": 1, "toLine": 1 } ], "currency": "example", "exchangeRate": 1, "reference": { "modifiedNcf": "example", "modifiedNcfDate": "2026-04-15", "modificationCode": 1, "reason": "example", "otherTaxpayerRnc": "example" }, "previousBalance": 1, "advancePayment": 1, "totals": { "total": 1, "itbisTotal": 1, "taxableTotal": 1, "exemptTotal": 1, "additionalTaxTotal": 1 } }'
companyId
required
string format: uuid
Idempotency-Key
required
string
<= 64 characters

Canonical document model, the same for the API, the portal and the Excel upload. Each field maps to a DGII e-CF element (shown in brackets). Gravitas assigns FechaHoraFirma and the security code, and takes the emitter RNC, name and address from the company: do not send them. Gravitas also assigns the e-NCF and FechaVencimientoSecuencia unless the ERP numbers the document with encf. Unknown properties are rejected with 422. Which fields apply to each e-CF type follows the DGII obligation table (the portal form and the Excel template show it per type). Amounts are calculated; send totals only to have them verified (±0.01).

object
ecfType
required

[TipoeCF]

integer
Allowed values: 31 32 33 34 41 43 44 45 46 47
encf

[eNCF] Optional, ERP API only: the e-NCF chosen by the ERP. It must be of the document type, fall in an active, unexpired range registered for the company and environment, and be unused (422 encf_invalid, encf_type_mismatch, encf_not_in_range, encf_already_used). Omit it and Gravitas assigns the next number.

string | null
/^E(31|32|33|34|41|43|44|45|46|47)[0-9]{10}$/
sequenceExpiresOn

[FechaVencimientoSecuencia] yyyy-MM-dd. Optional and only with encf: when sent it must be the expiry of the range that holds the e-NCF (422 sequence_expiry_mismatch).

string | null format: date
issueDate
required

[FechaEmision] yyyy-MM-dd

string format: date
incomeType

[TipoIngresos] 01 operaciones … 06 otros

string | null
Allowed values: 01 02 03 04 05 06
paymentType

[TipoPago] 1 contado, 2 crédito, 3 gratuito

integer | null
Allowed values: 1 2 3
paymentDueDate

[FechaLimitePago] required when paymentType is 2

string | null format: date
paymentTerms

[TerminoPago] e.g. “30 días”

string | null
<= 15 characters
paymentForms

[TablaFormasPago]

Array<object> | null
<= 7 items
object
form
required

[FormaPago] 1 efectivo, 2 cheque/transferencia, 3 tarjeta, 4 crédito, 5 bonos, 6 permuta, 7 nota de crédito, 8 otras

integer
>= 1 <= 8
amount
required

[MontoPago]

number
paymentAccount
One of:
object
type

[TipoCuentaPago] CT corriente, AH ahorro, OT otra

string | null
number

[NumeroCuentaPago]

string | null
bank

[BancoPago]

string | null
periodFrom

[FechaDesde] billed period start

string | null format: date
periodTo

[FechaHasta] billed period end

string | null format: date
taxIncludedInPrice

[IndicadorMontoGravado] unit prices include ITBIS

boolean
deferredSending

[IndicadorEnvioDiferido] DGII-authorized deferred sending

boolean
allInclusiveService

[IndicadorServicioTodoIncluido]

boolean
emitter
One of:

Optional emitter data for this document; RNC, name and address always come from the company.

object
branch

[Sucursal]

string | null
phones

[TablaTelefonoEmisor]

Array<string> | null
<= 3 items
email

[CorreoEmisor]

string | null format: email
website

[WebSite]

string | null
economicActivity

[ActividadEconomica]

string | null
salespersonCode

[CodigoVendedor]

string | null
internalInvoiceNumber

[NumeroFacturaInterna] your ERP invoice number

string | null
internalOrderNumber

[NumeroPedidoInterno]

string | null
salesZone

[ZonaVenta]

string | null
salesRoute

[RutaVenta]

string | null
additionalInfo

[InformacionAdicionalEmisor]

string | null
buyer
One of:

[Comprador] Send rnc (9-digit RNC or 11-digit cédula) or foreignId, never both.

object
rnc

[RNCComprador]

string | null
/^(\d{9}|\d{11})$/
foreignId

[IdentificadorExtranjero] passport or foreign tax id

string | null
<= 20 characters
name

[RazonSocialComprador]

string | null
<= 150 characters
contact

[ContactoComprador]

string | null
email

[CorreoComprador] also used to send the printed representation

string | null format: email
address

[DireccionComprador]

string | null
municipality

[MunicipioComprador] DGII location code

string | null
province

[ProvinciaComprador] DGII location code

string | null
country

[PaisComprador] type 46

string | null
deliveryDate

[FechaEntrega]

string | null format: date
deliveryContact

[ContactoEntrega]

string | null
deliveryAddress

[DireccionEntrega]

string | null
additionalPhone

[TelefonoAdicional]

string | null
purchaseOrderDate

[FechaOrdenCompra]

string | null format: date
purchaseOrderNumber

[NumeroOrdenCompra]

string | null
internalCode

[CodigoInternoComprador]

string | null
paymentResponsible

[ResponsablePago]

string | null
additionalInfo

[InformacionAdicionalComprador]

string | null
additionalInfo
One of:

[InformacionesAdicionales] shipping and customs data (mainly type 46)

object
shippingDate

[FechaEmbarque]

string | null format: date
shippingNumber

[NumeroEmbarque]

string | null
containerNumber

[NumeroContenedor]

string | null
referenceNumber

[NumeroReferencia]

string | null
portOfShipment

[NombrePuertoEmbarque]

string | null
deliveryTerms

[CondicionesEntrega] Incoterm

string | null
totalFob

[TotalFob]

number | null
insurance

[Seguro]

number | null
freight

[Flete]

number | null
otherCharges

[OtrosGastos]

number | null
totalCif

[TotalCif]

number | null
customsRegime

[RegimenAduanero]

string | null
portOfDeparture

[NombrePuertoSalida]

string | null
portOfArrival

[NombrePuertoDesembarque]

string | null
grossWeight

[PesoBruto]

number | null
netWeight

[PesoNeto]

number | null
grossWeightUnit

[UnidadPesoBruto] Table IV

integer | null
netWeightUnit

[UnidadPesoNeto] Table IV

integer | null
packageCount

[CantidadBulto]

number | null
packageUnit

[UnidadBulto] Table IV

integer | null
packageVolume

[VolumenBulto]

number | null
volumeUnit

[UnidadVolumen] Table IV

integer | null
transport
One of:

[Transporte]

object
mode

[ViaTransporte] 01 terrestre, 02 marítimo, 03 aéreo (type 46)

string | null
Allowed values: 01 02 03
originCountry

[PaisOrigen]

string | null
destinationAddress

[DireccionDestino]

string | null
destinationCountry

[PaisDestino]

string | null
carrierId

[RNCIdentificacionCompaniaTransportista]

string | null
carrierName

[NombreCompaniaTransportista]

string | null
tripNumber

[NumeroViaje]

string | null
driver

[Conductor]

string | null
transportDocument

[DocumentoTransporte]

string | null
vehicleRecord

[Ficha]

string | null
plate

[Placa]

string | null
route

[RutaTransporte]

string | null
zone

[ZonaTransporte]

string | null
deliveryNote

[NumeroAlbaran]

string | null
lines
required

[DetallesItems] numbered 1…n in order

Array<object>
>= 1 items <= 1000 items

[Item] one line of the detail

object
itemName
required

[NombreItem]

string
<= 80 characters
description

[DescripcionItem]

string | null
<= 1000 characters
isService

[IndicadorBienoServicio] false good (1), true service (2)

boolean
billingIndicator
required

[IndicadorFacturacion] 0 no facturable, 1 ITBIS 18%, 2 ITBIS 16%, 3 ITBIS 0%, 4 exento

integer
Allowed values: 0 1 2 3 4
quantity
required

[CantidadItem] up to 2 decimals

number
> 0
unitCode

[UnidadMedida] Table IV (e.g. 43 unidad)

integer | null
>= 1 <= 62
unitPrice
required

[PrecioUnitarioItem] in the document currency, up to 4 decimals

number
discounts

[TablaSubDescuento] line discounts

Array<object> | null
object
type
required

[TipoSubDescuento]/[TipoSubRecargo] percentage or amount

string
Allowed values: % $
percentage

For type %

number | null
amount

For type $, in the document currency

number | null
surcharges

[TablaSubRecargo] line surcharges

Array<object> | null
object
type
required

[TipoSubDescuento]/[TipoSubRecargo] percentage or amount

string
Allowed values: % $
percentage

For type %

number | null
amount

For type $, in the document currency

number | null
additionalTaxCodes

[TablaImpuestoAdicional] Table I codes (ISC, CDT, propina…)

Array<integer> | null
<= 2 items
retention
One of:

[Retencion]

object
agent
required

[IndicadorAgenteRetencionoPercepcion] R retención, P percepción

string
Allowed values: R P
itbisRetained

[MontoITBISRetenido]

number | null
isrRetained

[MontoISRRetenido]

number | null
itemCodes

[TablaCodigosItem]

Array<object> | null
<= 5 items
object
type
required

[TipoCodigo] e.g. EAN, interno

string
<= 14 characters
code
required

[CodigoItem]

string
<= 35 characters
iscData
One of:

ISC data for additional tax codes 006–039

object
referenceQuantity

[CantidadReferencia]

number | null
referenceUnit

[UnidadReferencia] Table IV

integer | null
subquantities

[TablaSubcantidad]

Array<object> | null
object
quantity
required

[Subcantidad]

number
unit

[CodigoSubcantidad] Table IV

integer | null
alcoholGrade

[GradosAlcohol]

number | null
referenceUnitPrice

[PrecioUnitarioReferencia]

number | null
manufactureDate

[FechaElaboracion]

string | null format: date
expirationDate

[FechaVencimientoItem]

string | null format: date
mining
One of:
object
netWeightKg

[PesoNetoKilogramo]

number | null
netMiningWeight

[PesoNetoMineria]

number | null
affiliationType

[TipoAfiliacion]

integer | null
settlement

[Liquidacion]

integer | null
subtotals

[Subtotales] informative subtotals

Array<object> | null
object
number

[NumeroSubTotal]

integer | null
description

[DescripcionSubtotal]

string | null
order

[Orden]

integer | null
lines
required

Line numbers included; amounts are calculated

Array<integer>
globalAdjustments

[DescuentosORecargos]

Array<object> | null
object
type

[TipoAjuste] D descuento, R recargo

string
default: D
Allowed values: D R
description

[DescripcionDescuentooRecargo]

string | null
valueType

[TipoValor]

string
default: $
Allowed values: % $
value

[ValorDescuentooRecargo] percentage when valueType is %

number | null
amount

[MontoDescuentooRecargo] in the document currency

number | null
billingIndicator

[IndicadorFacturacionDescuentooRecargo] which billing indicator it applies to

integer
default: 1
Allowed values: 0 1 2 3 4
norma1007

[IndicadorNorma1007]

boolean
pages

[Paginacion] line ranges per printed page; page subtotals are calculated

Array<object> | null
object
fromLine
required

[NoLineaDesde]

integer
>= 1
toLine
required

[NoLineaHasta]

integer
>= 1
currency

[TipoMoneda] Table II code (USD, EUR…); default DOP. Prices are in this currency

string | null
>= 3 characters <= 3 characters
exchangeRate

[TipoCambio] required when currency is not DOP

number | null
> 0
reference
One of:

[InformacionReferencia] required on 33 and 34; optional on other types (e.g. code 4 replacing a contingency document)

object
modifiedNcf
required

[NCFModificado] e-NCF (E + 12) or NCF (B/A + 10) modified; a 33 cannot modify a 33, nor a 34 a 34

string
modifiedNcfDate

[FechaNCFModificado]

string | null format: date
modificationCode

[CodigoModificacion] 1 anula, 2 corrige texto, 3 corrige montos, 4 reemplazo de contingencia, 5 referencia factura de consumo

integer | null
Allowed values: 1 2 3 4 5
reason

[RazonModificacion]

string | null
<= 90 characters
otherTaxpayerRnc

[RNCOtroContribuyente]

string | null
previousBalance

[SaldoAnterior]

number | null
advancePayment

[MontoAvancePago]

number | null
totals
One of:

Totals to verify (±0.01); omit to let Gravitas calculate them

object
total

[MontoTotal]

number | null
itbisTotal

[TotalITBIS]

number | null
taxableTotal

[MontoGravadoTotal]

number | null
exemptTotal

[MontoExento]

number | null
additionalTaxTotal

[MontoImpuestoAdicional]

number | null

Repeated idempotency key with the same payload; original result

Media typeapplication/json
object
documentId
required
string format: uuid
status
required
string
statusUrl
required
string

Example generated

{
"documentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"status": "example",
"statusUrl": "example"
}

Accepted for processing

Media typeapplication/json
object
documentId
required
string format: uuid
status
required
string
statusUrl
required
string

Example generated

{
"documentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"status": "example",
"statusUrl": "example"
}
Location
string

Production_not_enabled, quota denied (trial limit)

Not found or outside the credential scope

Media typeapplication/problem+json
object
type
string
title
string
status
integer
code
string
errors
Array<object>
object
path
string
message
string
code

Stable snake_case rule code when the rule has one (e.g. modified_same_type, foreign_id_in_rnc, emitter_rnc_mismatch, encf_invalid, encf_type_mismatch, encf_not_in_range, encf_already_used, sequence_expiry_mismatch).

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"errors": [
{
"path": "example",
"message": "example",
"code": "example"
}
]
}

Idempotency_conflict (same key

Payload too large

All validation errors with field paths; the document is not numbered

Media typeapplication/problem+json
object
type
string
title
string
status
integer
code
string
errors
Array<object>
object
path
string
message
string
code

Stable snake_case rule code when the rule has one (e.g. modified_same_type, foreign_id_in_rnc, emitter_rnc_mismatch, encf_invalid, encf_type_mismatch, encf_not_in_range, encf_already_used, sequence_expiry_mismatch).

string

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"code": "example",
"errors": [
{
"path": "example",
"message": "example",
"code": "example"
}
]
}

Rate limit exceeded

Retry-After
integer