jobs

Queue one validation

Queues one validation: document_base64 holds the document's bytes, media_type says what they are (the content must agree, as in synchronous validation) and options are the synchronous options. XML at most 5 MiB, a PDF at most 20 MiB; the envelope at most 28 MiB.

Acceptance. Every decision synchronous validation makes before it validates is made now: the document's content and size, the scope, a PDF's inspection and its embedded invoice, and the release latest or the ruleset id resolves to. A document it would refuse is refused here with the same Problem, and nothing is queued or charged. An accepted job is pinned to that release and its engines, and one validation is reserved on the billing account until the job finishes: charged if it reaches a verdict, returned otherwise. A batch is admitted whole or not at all.

Running. The job runs through the same validation as POST /v2/einvoices/validate. Its result is a V2 validation result, read at result_url once the job is completed; its usage and its webhook or S3 event (ironfang/finance/einvoice/event/v2, naming job_id) are a synchronous validation's. An unavailable engine or a timeout is retried, up to 3 attempts; then the job is failed, indeterminate and uncharged. The document is held encrypted until the job finishes, at most 24 hours (expires_at), then erased.

Queue. An organisation holds at most 100 unfinished jobs and 25 MiB of their documents; more is 429 quota_exhausted.

Idempotency. As synchronous validation, with the request identified by the document's bytes, the options and the scope. Keys are V2's own, apart from V1 jobs and from synchronous validation.

post/v2/einvoices/jobs

Request

  • Base URL: https://api.ironfang.com/finance
  • URL: https://api.ironfang.com/finance/v2/einvoices/jobs
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Optional on authenticated requests; scoped to the organisation and this endpoint. The same key with a different request (different bytes, selectors or scope) is 409 idempotency_conflict.

Request body

document_base64string byte required

The document's bytes, standard padded base64 without line breaks. XML at most 5 MiB, a PDF at most 20 MiB decoded.

media_type'application/xml' | 'text/xml' | 'application/pdf' required

What the document is. The content must agree, or the job is 415 unsupported_content_type.

Response

The job this Idempotency-Key already names, unchanged.

api_version'v1' | 'v2' required

The API a result was made through.

attemptsinteger required
batch_idstring
created_atstring date-time required
engine_image_digeststring required
expires_atstring date-time required

When an unfinished job is failed as job_expired and its document erased.

failure_code'validation_timeout' | 'validator_unavailable' | 'internal_error' | 'generation_failed' | 'job_cancelled' | 'job_expired'
finished_atstring date-time
idstring required
operation'validate' | 'generate' required

V2 jobs validate; a V1 job may generate.

operation_idstring required
outcome'valid' | 'invalid' | 'indeterminate'
positioninteger required

The job's place in its batch; 0 outside one.

result_availableboolean required
result_urlstring
ruleset_idstring required
schema'ironfang/finance/einvoice/job/v2' required
status'queued' | 'running' | 'completed' | 'failed' | 'cancelled' required
usage_chargedboolean required

Changes

No recorded changes to this operation across all 1 revision of this API.