Skip to content

Retry an e-invoice

The einvoices.retry operation: POST /api/v1/einvoices/{id}/retry in the REST API and the einvoices_retry tool in the MCP server.

POST/api/v1/einvoices/{id}/retry

Sends a failed or rejected e-invoice again, once its cause is fixed: for example after setting the customer's einvoice_endpoint metadata (its electronic address). The e-invoice goes back to pending with the customer's and the entity's current e-invoicing details, one attempt more, and is generated and handed to its provider after the call returns (einvoice.sent, or einvoice.failed again). The document itself never changes: correct a wrong invoice with a credit note.

At a glance

  • REST: POST /api/v1/einvoices/{id}/retry
  • MCP tool: einvoices_retry
  • Operation ID: einvoices.retry
  • Scope: Brand
  • Permission: invoices:write
  • Risk tier: write
  • Dry run: Supported (send Ownrecord-Dry-Run: true)
  • Idempotency: Idempotency-Key required
  • Modes: Test and live
  • Authentication: API key with the invoices:write scope
  • Since: M13

Request

Path parameters

FieldTypeDescription
ideinv_… ID

Body

This operation takes no body.

Response

200 OK with a JSON object:

FieldTypeDescription
ideinv_… ID
object"einvoice"
livemodeboolean
orgIdorg_… ID
entityIdent_… ID
brandIdbrd_… ID
documentKindone of invoice, credit_note
documentIdstringThe invoice (inv_…) or credit note (cn_…) it was generated from.
documentNumberstring
customerIdstring or null
countrystring
transactionTypeone of b2b, b2g, b2c
providerstring
formatone of UBL_2_1_PEPPOL_BIS_3, CII, national
statusone of pending, queued, delivered, accepted, rejected, failedpending (queued for sending), queued (the provider took it), delivered, accepted, rejected (by the receiver) or failed (couldn't be generated or sent).
externalIdstring or nullThe provider's ID of the transmission.
buyerEndpointstring or null
sellerEndpointstring or null
buyerReferencestring or null
fileobject or nullThe generated document as stored (UBL XML) and the generator version that wrote it.
errorobject or null
attemptsinteger
sentAtdate-time or null
lastCheckedAtdate-time or null
historyarray of object
history[].statusone of pending, queued, delivered, accepted, rejected, failed
history[].atdate-time
history[].reasonstring or null
createdAtdate-time
updatedAtdate-time

Examples

Send a failed e-invoice again

HTTP
POST /api/v1/einvoices/einv_01jbxa6qk3f0v8w9zq2y7k5n70/retry
Authorization: Bearer or_test_…
Idempotency-Key: 3f1c9a52-7d0e-4b8f-9a61-0c2d5e8b7f14

Response (200):

JSON
{
  "id": "einv_01jbxa6qk3f0v8w9zq2y7k5n70",
  "object": "einvoice",
  "livemode": false,
  "orgId": "org_01jacq4m3xf0v8w9zq2y7k5n6a",
  "entityId": "ent_01jacq4m3xf0v8w9zq2y7k5n6h",
  "brandId": "brd_01jacq4m3xf0v8w9zq2y7k5n6j",
  "documentKind": "invoice",
  "documentId": "inv_01jacq4m3xf0v8w9zq2y7k5n70",
  "documentNumber": "ACME-2026-000101",
  "customerId": "cus_01jacq4m3xf0v8w9zq2y7k5n6k",
  "country": "HR",
  "transactionType": "b2b",
  "provider": "fake",
  "format": "UBL_2_1_PEPPOL_BIS_3",
  "status": "pending",
  "externalId": null,
  "buyerEndpoint": "0208:0123456789",
  "sellerEndpoint": null,
  "buyerReference": null,
  "file": null,
  "error": null,
  "attempts": 2,
  "sentAt": null,
  "lastCheckedAt": null,
  "history": [
    {
      "status": "pending",
      "at": "2026-10-14T09:30:05.000Z",
      "reason": null
    },
    {
      "status": "failed",
      "at": "2026-10-14T09:31:02.000Z",
      "reason": "The buyer has no electronic address: set the customer's `einvoice_endpoint` metadata (<scheme>:<identifier>)."
    },
    {
      "status": "pending",
      "at": "2026-10-15T08:00:00.000Z",
      "reason": null
    }
  ],
  "createdAt": "2026-10-14T09:30:05.000Z",
  "updatedAt": "2026-10-15T08:00:00.000Z"
}

Errors

CodeHTTP statusWhenWhat to do
einvoice_not_retryable409The e-invoice is pending, on its way or done.Only a failed or rejected e-invoice can be sent again. One that is pending, queued, delivered or accepted is on its way or done.
einvoice_provider_unavailable400Its provider can't be used here any more; change the entity's route and contact support.Choose a provider that is available in this environment. The fake provider exists only in development and test; certified providers are added with the product owner (spec §35 #8).
einvoice_endpoint_invalid400The customer's einvoice_endpoint metadata is malformed.Write it as <scheme>:<identifier> with a scheme from the Peppol list of electronic address schemes, e.g. 9934:HR12345678903 or 0208:0123456789.
resource_not_found404No such e-invoice for this brand in this mode.Check the ID and that your credentials are scoped to the right organization, entity, brand and mode.
version_conflict409The e-invoice changed at the same moment; try again.Fetch the object again and retry the change.
permission_denied403You can't change this brand's invoices.Ask an organization owner or admin for a role or scope that allows this action.

It can also return these common errors: validation_failed, api_version_unsupported, invalid_json, unsupported_media_type, authentication_required, api_key_invalid, scope_required, idempotency_key_required, idempotency_key_reused, idempotency_in_progress, approval_required, approval_rejected, approval_expired, stale_approval, approval_policy_denied, rate_limited, internal_error.