Schedule an invoice
Reserve the issuance of a draft invoice for a future instant.
-
The invoice moves to
scheduledand nothing fiscal happens yet: it keeps itsBORRADORplaceholder number, no series counter is consumed and nothing is registered with VeriFactu. -
Scheduling never burns numbering.
-
What happens at
scheduled_for. A sweep runs every minute and, on the first pass at or after that instant, it: (1) assigns the definitive correlative number of the series at that moment, not when you scheduled — so a document scheduled today and issued next month takes the number that corresponds to next month; (2) freezes the recipient and issuer snapshots as of that instant, which is what the PDF and the fiscal XML will show; (3) moves the invoice tosent; (4) queues the VeriFactu alta to AEAT asynchronously when the company is enrolled; and (5) emails the client only whenscheduled_actionisissue_and_sendand the client has an email on file — withscheduled_action: draftthe invoice is issued but never delivered, andissue_and_sendwithout a recipient email still issues it, silently skipping the delivery. -
Time zone.
scheduled_foris an ISO 8601 date-time. -
If it carries an explicit offset (
2027-01-15T09:00:00Z,…+01:00) that offset is honoured; without one it is read in the account's server time zone,Europe/Madrid. -
Resolution is minute-level: expect issuance within about a minute of the instant you asked for, never before it.
-
If the scheduled issuance fails, each invoice is isolated in its own transaction: the failing one stays
scheduledwith its date in the past, the error is logged, the rest of the batch is unaffected and the next sweep retries it. -
A successful issuance is never repeated, because
scheduled → sentcan only happen once. -
Limits: only a
draftcan be scheduled (any other status returns 422) andscheduled_formust be strictly in the future (422 otherwise). -
While it is still
scheduledyou can callunscheduleto return it todraft, orrescheduleto move only the date.
In: header
Path Parameters
Headers
Client-generated opaque key (up to 255 characters; UUID v7 recommended) that makes retries safe: the first response is cached and replayed for repeats without re-executing the mutation. Reusing a key with a different body returns 409 idempotency_key_reused. See the Idempotency guide.
1 <= length <= 255Pin the API version (YYYY-MM-DD, Stripe-style date versioning) for this request; omit to use the key's pinned version, or the latest if none. Unsupported version → 400 unsupported_api_version; malformed → 400 parameter_invalid_format. The effective version is echoed in the Factuarea-Version response header. See the Versioning guide.
dateOperate on behalf of a child company (gestoría master key): pass its public id (UUID v7) and the request runs against that child's data without changing the key's scope, tier or environment (omit to use the key's own company). Invalid UUID → 400 parameter_invalid_uuid; unknown or non-owned id → 404 profile_not_found. See the Acting on behalf guide.
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json