Rápido Pagos

Follow an e-CF

The statuses and events of an issued e-CF, its delivery to the buyer and the buyer's commercial approval.

After POST /ecf, a workflow signs the e-CF with your certificate, sends it to the DGII and asks for the result until it is final. It then delivers the e-CF to an electronic buyer. GET /ecf/{id} returns the e-CF at any time, and events report the verdict, the delivery and the buyer's approval.

The statuses

statusMeaning
pendingThe e-CF has its e-NCF and is not signed yet
signedThe signed XML is stored
submittedThe DGII holds the e-CF and its result is not final
acceptedThe DGII accepted the e-CF
conditionally-acceptedThe DGII accepted the e-CF with observations, which dgii.messages holds
rejectedThe DGII rejected the e-CF, and dgii.messages says why
erroredThe e-CF ended without a verdict, and statusReason says why

The last four statuses are final. For a verdict, statusReason holds the DGII's estado, or rejected when the DGII refuses the e-CF as it arrives. For an errored e-CF it names the cause, such as certificate-expired or reference-not-accepted.

  • The e-CF is signed once, and its signed XML never changes.
  • The workflow asks the DGII for the result 2 seconds, 5 seconds, 15 seconds, 1 minute, 5 minutes and 15 minutes after the send, then every hour. An e-CF without a final result after 30 days ends errored.
  • After a lost answer of the DGII, the workflow waits at least 5 minutes, then asks the DGII whether it holds the e-CF before it sends again. certification lacks that service for a full e-CF, so the workflow sends a full e-CF again there. When the DGII rejects a second send, the e-CF ends errored with the reason rejected-after-resend, since the DGII may hold the first one.
  • A type 32 under RD$250,000 goes to the DGII as a Resumen Factura de Consumo (RFCE). The DGII answers it at once and gives no trackId, so dgii.trackId stays null. The summary is signed with the certificate that signed the e-CF. When you upload a new certificate between the two signatures, nothing goes to the DGII and the e-CF ends errored with the reason certificate-changed. Cancel its number and issue the sale again.

A rejected e-CF keeps its e-NCF, and dgii.sequenceUsed tells whether the DGII counts that number as used. Fix the request and issue a new e-CF with a new externalId, and the new e-CF takes the next number. An errored e-CF that was never sent keeps a number that the DGII never saw, so cancel it. An errored e-CF whose send was attempted cannot be cancelled, since the DGII may hold it. Look it up in the Consulta e-NCF Emitidos of the Oficina Virtual before you issue the sale again.

Events

Each final status sends one event to your organization's webhook endpoint. Its data is the e-CF as GET /ecf/{id} returns it.

TypeEvent IDSent when
ecf.accepted{ecfId}:accepted or {ecfId}:conditionally-acceptedThe e-CF turns accepted or conditionally-accepted
ecf.rejected{ecfId}:rejectedThe e-CF turns rejected
ecf.errored{ecfId}:erroredThe e-CF turns errored

ecf.accepted covers both acceptances, and the status of its data tells them apart. An e-CF sends one of these three events once, and a later delivery of the same event carries the same ID. Once the e-CF is signed, you can print it.

List the e-CF

GET /ecf lists your e-CF newest first, 25 per page, in every environment. It filters by status, type, encf and externalId, and its nextCursor goes in the cursor of the next request.

const response = await fetch('https://api.rapidopagos.com/ecf?status=rejected', {
  headers: {
    authorization: `Bearer ${process.env.PAYMENTS_API_KEY}`
  }
});
const { ecfs, nextCursor } = await response.json();

Delivery to the buyer

When the e-CF has a buyer.rnc, the API delivers it to the buyer after the DGII accepts it, in test and production. It looks the buyer up in the DGII's directory of electronic receptors, sends the signed XML to the buyer's receptor and checks the acuse de recibo (ARECF) that the receptor answers. buyerDelivery.status tells how the delivery went.

buyerDelivery.statusMeaning
pendingThe delivery has not ended
not-applicableThe e-CF has no buyer.rnc, it was not accepted, or it is in certification
not-electronicThe buyer is not in the DGII's directory of electronic receptors
acknowledgedThe buyer's receptor received the e-CF
refusedThe buyer's receptor refused the e-CF, and buyerDelivery.reason holds its code
failedThe delivery cannot go on, and buyerDelivery.reason says why

The code of a refusal is the CodigoMotivoNoRecibido of the ARECF, 1 for a format error, 2 for a signature error, 3 for a duplicate e-CF or 4 for an RNC that is not the buyer's. A delivery fails at once when the DGII's directory or the buyer's receptor refuses the request, when the buyer's URL in the directory is not usable, or when your certificate cannot sign. It fails after 3 days when the receptor cannot be reached, or when its acuse de recibo never verifies. Until then, an acuse de recibo that does not verify keeps the delivery pending with the reason arecf-unverified.

acknowledged, refused and failed send ecf.delivered, ecf.delivery-refused and ecf.delivery-failed, with the event ID {ecfId}:delivery. not-electronic sends no event, so read it with GET /ecf/{id}. Give a buyer who is not electronic the printed e-CF.

The buyer's commercial approval

A buyer who receives your e-CF can approve or reject it with an Aprobación Comercial (ACECF), which it sends to your receptor. The API checks its signature and that it names this e-CF with its buyer, date and total, then records it in commercialApproval.

{
  "commercialApproval": {
    "decision": "rejected",
    "reason": "La mercancía llegó incompleta",
    "receivedAt": "2026-10-21T13:02:44.000Z"
  }
}
commercialApproval.decisionMeaning
approvedThe buyer approved the e-CF
rejectedThe buyer rejected the e-CF, and reason says why
conflictingTwo approvals with different decisions arrived for this e-CF

The DGII keeps the buyer's answer, and no DGII service confirms an approval or names who may sign for the buyer's RNC. So commercialApproval is the approval as your receptor received it. When a second approval with another decision arrives, decision turns conflicting and Rápido Pagos is alerted. Do not act on a conflicting decision, and ask the buyer which answer stands. The receptor keeps at most 5 approvals of one e-CF.

Each decision sends ecf.commercial-approval-received, with the event ID {ecfId}:commercial-approval:{decision}, so a conflicting decision gets an event of its own. A buyer can send an approval only once you register the receptor URL in the DGII.

On this page