POSThttps://api.veriko.mx/v1/finance/ceps/exports

Request the CEP archive in the background

Visibility
public
Auth
API key
Permission
finance.ceps.export
How-to guide →

Queues the preparation of the CEP ZIP for a date range and responds immediately with an HTTP status 202. It is the asynchronous alternative to GET /v1/finance/ceps for large ranges: the archive is built in the background, without holding the connection open.

The response carries the export in state queued and its location in the Location header. Poll GET /v1/finance/ceps/exports/{id} until status is terminal (ready, failed or expired) and download the archive with GET /v1/finance/ceps/exports/{id}/download. When it finishes, the service also notifies by email and inside the app, with a link (never with the archive attached).

The archive is the same ZIP that GET /v1/finance/ceps delivers. Once ready it can be downloaded for 24 hours; after that it is deleted and must be requested again.

Before queuing, the service counts the CEPs in the range:

  • With no receipts, it responds with an HTTP status 404 (with no_ceps in the body), like the synchronous ZIP.
  • With more than 10,000 receipts, it responds with an HTTP status 422 (with range_too_large in the body). Split the range into shorter periods.

If an export of the same range is already in progress, it returns that one instead of creating another. Each account can have 2 exports in progress at a time (429, with export_limit_reached) and the platform allows 5 in total (503, with exports_busy).

The operation supports Idempotency-Key.

If queueing fails, it responds with an HTTP 503 status (dispatch_failed).

Parameters
ParameterInTypeRequiredDescription
Idempotency-Keyheaderstringoptional

Optional client-generated key (Stripe-style) that guarantees the request is processed exactly once within a 24-hour TTL. The scope is (user_id, endpoint, key). Retries with the same key and the same body return the byte-for-byte cached response with the Idempotent-Replayed: true header, without consuming rate-limit quota, without re-firing webhooks, and without creating a new validations row. Same key with a different body → 422 idempotency_key_reused. Same key with an in-flight request → 409 idempotency_key_in_progress. 5xx, 429, 408, 401 and 403 responses are not cached (retries with the same key are processed for real); the other 4xx responses (400, 404, 409, 422) are cached and replayed. Format: 1–255 characters, alphanumeric + _ + -.

e.g. 11111111-2222-3333-4444-555555555555
Parameters
ParameterTypeRequiredDescription
fromstring (date) (pattern)required

Start date (inclusive, YYYY-MM-DD).

e.g. 2026-04-01
tostring (date) (pattern)required

End date (inclusive, YYYY-MM-DD). Must be ≥ from.

e.g. 2026-04-30
user_idstring (uuid)optional

Administrators only — UUID of the account whose CEPs are exported.

e.g. f47ac10b-58cc-4372-a567-0e02b2c3d479
Request
curl -X POST 'https://api.veriko.mx/v1/finance/ceps/exports' \
  -H 'Authorization: Bearer veriko_••••' \
  -H 'Content-Type: application/json' \
  -d '{
    "from": "2026-04-01",
    "to": "2026-04-30"
  }'

Python example — coming soon.

JavaScript example — coming soon.

PHP example — coming soon.

Response 202CepArchiveResponse
— The export was queued (`queued`), or it is the one already in progress for that range.
FieldTypeDescription
dataobject

Main response payload. Shape varies by endpoint (object, array, or JSON:API envelope with type, id, attributes).

typestring

JSON:API resource type. Always cep_archive.

e.g. cep_archive
idstring (uuid)

Resource identifier, unique within its type. It always travels as a string, even when it originates from an auto-increment column.

e.g. f47ac10b-58cc-4372-a567-0e02b2c3d479
attributesobject

Attributes of an asynchronous CEP archive export.

statusstring

Export state — queued: Waiting in the queue; building: The archive is being built; ready: The archive is ready to download; failed: It could not be generated (see error_code); expired: The archive expired and was deleted. The terminal states are ready, failed and expired: while it is queued or building, keep polling.

e.g. ready
fromstring (date)

Start date of the range (inclusive, YYYY-MM-DD).

e.g. 2026-04-01
tostring (date)

End date of the range (inclusive, YYYY-MM-DD).

e.g. 2026-04-30
item_countinteger | nullnullable

Number of CEPs included in the archive. null until the export is ready.

e.g. 42
size_bytesinteger | nullnullable

Size of the ZIP archive in bytes. null until the export is ready.

e.g. 1638400
error_codestring | nullnullable

Cause of the failure when status is failed — range_too_large: The range exceeds the maximum CEPs per export; no_ceps: The range no longer has CEPs available; storage_full: The service has no room to store the archive; build_failed: Building the archive failed. null in any other state.

e.g. null
created_atstring (date-time)

Moment the export was requested, in UTC.

e.g. 2026-05-01T15:00:00Z
completed_atstring | nullnullable

Moment it finished (ready or failed), in UTC. null while in progress.

e.g. 2026-05-01T15:00:20Z
expires_atstring | nullnullable

Moment from which the archive can no longer be downloaded, in UTC: 24 hours after completed_at. null until the export is ready.

e.g. 2026-05-02T15:00:20Z
linksobject

Export links. download appears only when the state is ready.

selfstring

Path of this export, to check its status.

e.g. /v1/finance/ceps/exports/f47ac10b-58cc-4372-a567-0e02b2c3d479
downloadstring

Download path of the ZIP. Present only when the status is ready.

e.g. /v1/finance/ceps/exports/f47ac10b-58cc-4372-a567-0e02b2c3d479/download
metaobject

Response metadata including API version, route prefix, unique request identifier, and the server timestamp in UTC.

versionstring

API version that processed the request.

e.g. 1.47.0
api_versionstring

API route prefix version (e.g. v1).

e.g. v1
request_idstring

Unique request identifier, 24 hexadecimal characters. Keep it and quote it when you contact support: it locates the request.

e.g. a1b2c3d4e5f66f5e4d3c2b1a
datetimeobject

Companion descriptor present in the meta block of every response (and in the meta of outgoing webhook bodies). Lets clients assert the timezone contract without re-reading the spec.

e.g. {"timezone":"UTC","format":"ISO 8601"}
timezone*string

Always UTC: The canonical timezone for every datetime field in the body.

e.g. UTC
format*string

Always ISO 8601: Explicit Z suffix on every datetime.

e.g. ISO 8601
field_names_noticeobject

Field-name change notice. It only appears on POST /v1/validate, POST /v1/validate-ocr, GET /v1/validations, GET /v1/validations/{id}, POST /v1/validations/{id}/recheck, GET /v1/summary and GET /v1/finance/summary, the same operations that send the Deprecation and Sunset headers. With legacy_request_fields, the request used Spanish field names; it is also sent on error responses. With legacy_response_fields, the request used English names only and the notice refers to the Spanish fields the response duplicates; it is sent on successful responses only.

e.g. {"code":"legacy_request_fields","message":"This request uses Spanish field names, which are accepted until March 1, 2027. From that date, the API will only accept and return English field names. You can migrate whenever it suits you; see the migration guide.","sunset":"2027-03-01","documentation_url":"https://docs.example.com/en/how-to/migrate-to-english-field-names","legacy_fields":["fecha","monto"]}
code*string

Notice type. legacy_request_fields: the request used Spanish field names. legacy_response_fields: the response includes duplicated Spanish fields that will stop being sent.

e.g. legacy_request_fields
message*string

Notice text, in the response language (Accept-Language).

e.g. This request uses Spanish field names, which are accepted until March 1, 2027. From that date, the API will only accept and return English field names. You can migrate whenever it suits you; see the migration guide.
sunset*string (date)

Cut-off date, the same one the Sunset header announces.

e.g. 2027-03-01
documentation_url*string (uri)

Migration guide to the English names, in the response language.

e.g. https://docs.example.com/en/how-to/migrate-to-english-field-names
legacy_fieldsarray

Spanish names the request sent. Only with legacy_request_fields.

e.g. ["fecha","monto"]
linksobject

Pagination or related links, present only when the endpoint returns a paginated collection.

Response status codesPOST /v1/finance/ceps/exports
StatusClassDescriptionBody
2022xx
The export was queued (queued), or it is the one already in progress for that range.
CepArchiveResponse
4004xx
invalid_range: Malformed dates or to < from.
ErrorResponse
4014xx
Authentication is required or the provided credentials are invalid.
ErrorResponse
4034xx
Insufficient permissions. Also email_verification_required: the account's email cannot receive mail and, until it is fixed or verified, only reading the profile, fixing the email, and logging out are allowed.
ErrorResponse
4044xx
no_ceps: No CEPs available in the specified range.
ErrorResponse
4134xx
The request body exceeds the maximum accepted size (body_too_large).
ErrorResponse
4224xx
range_too_large: The range exceeds the maximum CEPs per export (10,000).
ErrorResponse
4294xx
export_limit_reached: The account already has the maximum number of exports in progress. Check Retry-After and meta.retry_after. The API key request limit (rate_limit_exceeded) responds the same way.
RetryAfterError
5035xx
exports_busy: Too many exports are in progress on the platform, or dispatch_failed: it could not be queued. Check Retry-After when present.
ErrorResponse
Response headers202
HeaderTypeDescription
Idempotent-Replayedstring
Only present when the request included the Idempotency-Key header. false marks a fresh response; true marks a response reused from the idempotency cache, which remains valid for 24 hours per account, endpoint, and key.
Locationstring
Path of the export, to check its state.
Errors from POST /v1/finance/ceps/exports
StatusCodeExample
400body_empty

The request has no body.

Envelope
meta.request_id
a5b50469b810
400invalid_json

The request body is not valid JSON. Check its syntax and resend it.

Envelope
meta.request_id
c8e1560adbc6
400invalid_range

A date in the range is missing or not valid.

Envelope
meta.request_id
faed8eb266e0
400invalid_user_id

The user identifier is not in the expected format.

Envelope
meta.request_id
a39bb5a4314b
401unauthorized

This request requires authentication.

Envelope
meta.request_id
c4d5e6f7a8b99b8a7f6e5d4c
403forbidden

You do not have permission to perform this action.

Envelope
meta.request_id
aa095892ebb3
403permission_denied

You do not have permission to access this resource.

Envelope
meta.request_id
d5e6f7a8b9c00c9b8a7f6e5d
413body_too_large

The body exceeds the 1 MB maximum.

Envelope
meta.request_id
1a2b3c4d5e6ff6e5d4c3b2a1
422validation_error

Some data needs fixing.

Envelope
meta.request_id
ab25e86f22f6
429export_limit_reached

You already have the maximum number of exports in progress. Wait for one to finish before requesting another.

Envelope
meta.request_id
ab25e86f22f6
Response headers
  • Retry-After: integer
  • X-RateLimit-Limit: integer — Configured request cap for this bucket. It is emitted on every 429 and, on the authenticated API, also on successful responses, where it is the per-key cap of the account plan.
  • X-RateLimit-Remaining: integer — Requests remaining in the current window. Always 0 at the moment of the 429; on a successful response of the authenticated API it is what is left of the per-key cap.
  • X-RateLimit-Reset: integer — Absolute Unix epoch (seconds) when the window resets. Emitted on every 429, alongside Retry-After, and on successful responses of the authenticated API.
429rate_limit_exceeded

You exceeded the request limit.

Envelope
meta.request_id
ab25e86f22f6
Response headers
  • Retry-After: integer
  • X-RateLimit-Limit: integer — Configured request cap for this bucket. It is emitted on every 429 and, on the authenticated API, also on successful responses, where it is the per-key cap of the account plan.
  • X-RateLimit-Remaining: integer — Requests remaining in the current window. Always 0 at the moment of the 429; on a successful response of the authenticated API it is what is left of the per-key cap.
  • X-RateLimit-Reset: integer — Absolute Unix epoch (seconds) when the window resets. Emitted on every 429, alongside Retry-After, and on successful responses of the authenticated API.
503dispatch_failed

We could not start the request.

Envelope
meta.request_id
04e8123a287bb31cff56cf58
Response headers
  • Retry-After: integer