Skip to content
Documentation
Get started

Business

Run a certification workbook

POST
/v1/business/certification/test-runs
curl --request POST \
--url https://api.timbro.do/v1/business/certification/test-runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'idempotency-key: example' \
--data '{ "kind": "ecf", "testSetId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "confirmation": { "statementVersion": "2026-10-21", "language": "es" } }'

Signs each case of the retained workbook (kind ecf for DGII step 2, acecf for step 3) with the business’s signing certificate in Timbro’s custody and sends it to DGII, in workbook order, stopping at the first rejection. Call it only while the business certification lists the run_test_set action; otherwise it answers business_certification_unavailable. It needs the representative’s confirmation of the statement, recorded with the actor, time, and statement hash before Timbro is asked; only a person or an admin key can confirm, not an agent. A retained workbook of that kind must exist, or it answers business_certification_test_set_required. A retry with the same Idempotency-Key and body returns the same run; a new run needs a new confirmation and key. A run is evidence for the business and the team, not a DGII decision: it never changes a step’s status. Read the outcome with retrieveBusinessCertificationTestRun.

idempotency-key
required
string
>= 1 characters <= 255 characters /^[\x20-\x7e]+$/
Media typeapplication/json
object
kind
required
Any of:
string
Allowed value: ecf
testSetId
required

The id of the retained workbook the representative saw. If a newer workbook of that kind has replaced it, the operation answers business_certification_test_set_changed and runs nothing.

string format: uuid
confirmation
required

The statement the representative read and accepted for this workbook. {business} is the business’s legal name. Send a new Idempotency-Key for each confirmation. 2026-10-21, es: “Autorizo a Timbro a firmar con el certificado digital de {business} y a enviar a la DGII los casos de prueba de este archivo.” 2026-10-21, en: “I authorize Timbro to sign with {business}’s digital certificate and send the test cases in this file to DGII.”

object
statementVersion
required
Any of:
string
Allowed value: 2026-10-21
language
required
Any of:
string
Allowed value: es

One run of a retained DGII test workbook. Timbro signs each case with the business’s custodied certificate and sends it to DGII in workbook order, and stops at the first rejection. refused means the workbook could not be built into documents and nothing was sent; refusal names the sheet, row, and column, never the cell text. consumerInvoices lists the signed consumer invoices (E32) to upload in DGII’s portal box for step 2, and is empty for acecf. A run is evidence, not a DGII decision: it never changes a step’s status.

Media typeapplication/json
Response fields and codes

One run of a retained DGII test workbook. Timbro signs each case with the business’s custodied certificate and sends it to DGII in workbook order, and stops at the first rejection. refused means the workbook could not be built into documents and nothing was sent; refusal names the sheet, row, and column, never the cell text. consumerInvoices lists the signed consumer invoices (E32) to upload in DGII’s portal box for step 2, and is empty for acecf. A run is evidence, not a DGII decision: it never changes a step’s status.

object
object
required
string
Allowed value: certification_test_run
id
required
string format: uuid
attemptReference
required
string
>= 1 characters
kind
required
Any of:
string
Allowed value: ecf
testSetId
required
string format: uuid
status
required
Any of:
string
Allowed value: running
failureMessage
required
Any of:
string
createdAt
required
string format: date-time
completedAt
required
Any of:
string format: date-time
counts
required
Array<object>
object
documentType
required

An e-CF type from 31 to 47, RFCE, or ACECF.

string
total
required
integer
accepted
required
integer
rejected
required
integer
cases
required
Array<object>
object
sourceRow
required

The workbook row the case came from.

integer
>= 1
caseLabel
required
Any of:
string
documentType
required
string
eNcf
required
string
status
required
Any of:
string
Allowed value: pending
dgiiMessage
required
Any of:
string
refusal
required
Any of:
object
code
required
string
sheet
required
Any of:
string
row
required
Any of:
integer
>= 1
column
required
Any of:
integer
>= 1
consumerInvoices
required
Array<object>
object
eNcf
required
string
sourceRow
required
integer
>= 1
request-id
required
string

Identifies this request. Quote it when you contact support.

Idempotent-Replayed
string
Allowed value: true

true when this response replays the stored result of an earlier request with the same Idempotency-Key.