Skip to content

Rebuild Invoice

Corrects and re-signs a rejected document. The rebuilt document keeps the same accessKey, sequential, and issueDate as the original.

POST /v1/documents/:accessKey/rebuild

Use this when a document is in RETURNED or NOT_AUTHORIZED status. After rebuilding, send it again with Send to SRI.

Authentication

Authorization: Bearer <api-key> and X-Issuer-Id: <issuer-id> (numeric id from GET /v1/issuers)

Path parameters

ParameterDescription
accessKeyThe 49-digit access key of the document to rebuild

Request body

Same schema as Create Invoice. Supply the corrected invoice content. The issueDate from the original document is preserved regardless of what is supplied here.

The original payload is available in the requestPayload field on the Get Document response — use it to pre-fill the form with the data that was submitted when the document was first created.

Response

200 OK

json
{
  "ok": true,
  "document": {
    "accessKey": "1503202601179234567800110010010000000011234567810",
    "documentType": "01",
    "sequential": "000000001",
    "status": "SIGNED",
    "issueDate": "15/03/2026",
    "total": "120.00",
    "email": {
      "status": "PENDING"
    }
  }
}

Errors

CodeStatusWhen
VALIDATION_FAILED400Request body fails field validation
UNAUTHORIZED401Missing or invalid API key
NOT_FOUND404Document not found
BAD_REQUEST400Document is not in RETURNED or NOT_AUTHORIZED status

Comprobify API Documentation