Skip to main content
POST
Request a constancia

Authorizations

Authorization
string
header
required

API key: Authorization: Bearer sk_test_... or sk_live_....

Headers

Invoice-Version
string

Pin a dated API release (Stripe-style). Omit to use the current version. An unknown value returns 400 request.invalid_version. Echoed back on every response.

Example:

"2026-07-10"

Invoice-Account
string

Connect: act on behalf of one of your connected accounts (its acct_…/org_… id). Omit to act as your own organization. Not honored on /v1/api_keys.

Example:

"org_2P9connectedacct"

Idempotency-Key
string

Safely retry any POST. A successful (2xx) response is stored for 24h and replayed byte-for-byte for identical retries (the replay adds an idempotent-replayed: true header). A non-2xx releases the key, so you can fix the cause and retry with the same key; pac.stamp_outcome_unknown, pac.auth_failed and download.request_failed are the exceptions and replay like a success. Reusing the key of a stored response with a different body is 409 idempotency.key_reuse; an in-flight duplicate is 409 idempotency.key_processing.

Example:

"a1b2c3d4-e5f6-4789-8abc-1234567890ab"

Body

application/json
fiscal_profile_id
string
required

Fiscal profile whose saved SAT credential is used, e.g. "fp_2P9K3sample".

Minimum string length: 1
type
enum<string>
required

Always "constancia" for now.

Available options:
constancia
simulate
enum<string>

Test mode only: force this outcome. A live key that sends it gets 422 fiscal_document.simulate_test_only. See the Testing guide.

Available options:
failed,
needs_action,
cancelled,
credential_rejected,
capacity_reached

Response

Default Response

object
enum<string>
required

Always "fiscal_document".

Available options:
fiscal_document
id
string
required

Fiscal document id, e.g. "fdoc_2P9K3sample".

fiscal_profile_id
string
required

The fiscal profile this document belongs to.

type
enum<string>
required

Always "constancia" for now.

Available options:
constancia
status
enum<string>
required

pending: accepted, not started yet (also the state while our SAT document service is at capacity). processing: the document is being fetched. ready: the PDF can be downloaded. needs_action: stopped until someone acts, see error. failed: did not complete. cancelled: the request was cancelled. expired: the PDF was removed after the retention period.

Available options:
pending,
processing,
ready,
needs_action,
failed,
cancelled,
expired
livemode
boolean
required

False for test mode: the PDF is simulated and is not a SAT document.

deadline
string
required

When we stop working on this request, ISO-8601 UTC.

sha256
string | null
required

SHA-256 (hex) of the PDF once it is ready.

size_bytes
integer | null
required

PDF size in bytes once it is ready.

Required range: -9007199254740991 <= x <= 9007199254740991
pdf_url
string | null
required

Path to download the PDF; null unless status is ready.

pdf_expires_at
string | null
required

When the PDF is deleted from our storage, ISO-8601 UTC.

error
object | null
required

Why it stopped, set on needs_action, failed and cancelled; null otherwise.

created_at
string
required

Creation timestamp, ISO-8601 UTC.

updated_at
string
required

Last-update timestamp, ISO-8601 UTC.

ready_at
string | null
required

When the PDF was stored, ISO-8601 UTC.