Ir al contenido

Get a document

GET
/v1/documents/{documentId}
curl --request GET \
--url https://api.flashpi.com.ec/v1/documents/example \
--header 'Authorization: Bearer <token>'

Any API key can read (read_only included); an issuer-scoped key only sees its issuer. Test keys see test documents and live keys live documents.

documentId
required
string
Accept-Language
string

Language of error messages and of the localized texts of resources (SRI messages, failures, certificate rejections): Spanish when the entry with the highest q-value is es or es- plus a region (es-EC, es-419), English otherwise. Errors state it in Content-Language.

X-Correlation-Id
string
>= 1 characters <= 128 characters /^[A-Za-z0-9._:/+=-]{1,128}$/

Your own ID for the request (letters, digits and -_.:/+=), echoed back in the X-Correlation-Id response header and logged next to the request ID. An invalid value gets 400 invalid_correlation_id.

Media typeapplication/json

An SRI document of any type.

object
id
required
string format: uuid
type
required
string
Allowed values: invoice purchase_settlement credit_note debit_note waybill withholding
environment
required

Mode of the API key that issued it: test (SRI pruebas) or live.

string
Allowed values: test live
status
required

Tax status: processing (being signed and sent), pending_sri (waiting for the SRI), authorized, rejected, failed or voided.

string
Allowed values: processing pending_sri authorized rejected failed voided
issuerId
required
string format: uuid
establishment
required
string
emissionPoint
required
string
sequential
required
number
number
required

Establishment-emission point-sequential.

string
accessKey
required

The 49-digit access key, also the authorization number.

string
issueDate
required
string format: date
xmlVersion
required

Version of the SRI XML.

string
counterparty
required
Any of:

The buyer, supplier, withheld subject or carrier.

object
id
required
string
name
required
string
totals
required
Any of:

Totals computed by Flashpi. Invoices have every field but withheld; purchase settlements and credit notes have no tip; debit notes have no discount nor tip; withholding receipts only have withheld.

object
subtotal

Sum of the line subtotals.

string
discount

Sum of the line discounts.

string
taxes
Array<object>

A tax total, grouped per tax and rate.

object
type
required
string
Allowed values: vat ice
rate
required

VAT: the rate (15, 0, exempt, …). ICE: the percentage.

string
code

ICE: the TABLA 18 code.

string
taxableBase
required

Taxable base.

string
amount
required

Tax amount.

string
tip

Tip.

string
total

Total (credited amount of a credit note, total of a debit note).

string
withheld

Total withheld.

string
authorization
required

The SRI authorization.

object
number
required

Authorization number (the access key), once authorized.

string | null
authorizedAt
required
string | null format: date-time
ride
required

The RIDE (printed PDF), generated once the document is authorized.

object
status
required
string
Allowed values: pending generated failed
template
required
string | null
Allowed values: modern classic minimal
generatedAt
required
string | null format: date-time
email
required

Email delivery, separate from the tax status: sent only once the document is authorized, when it was requested and there is a recipient.

object
requested
required

Whether the email was requested.

boolean
status
required

not_requested (opted out), skipped (no recipient), queued (sent once authorized), then sent, delivered, bounced, complained or failed.

string
Allowed values: not_requested skipped queued sent delivered bounced complained failed
deliveries
required
Array<object>

One email to one recipient.

object
id
required
string format: uuid
recipient
required
string
status
required
string
Allowed values: queued sent delivered bounced complained failed
sentAt
required
string | null format: date-time
lastEventAt
required
string | null format: date-time
error
required

Why the email failed or bounced, as a code: for example rejected, timeout, invalid_address, bounce_permanent, bounce_suppressed (the address is on the suppression list of Flashpi’s email provider after an earlier bounce or complaint), complaint, account_email_limit_reached (the account’s emails of the day were used up; nothing was sent), platform_email_limit_reached (Flashpi’s emails of the day across all accounts were used up; nothing was sent), email_sending_paused (the account’s emails of the mode are paused; nothing was sent), platform_email_sending_paused (Flashpi paused the emails of its email provider for every account after too many bounces or complaints; nothing was sent), test_recipient_not_allowed (a test document whose recipient is not a verified member of the account’s team; nothing was sent: download the RIDE and the XML to send them) or invalid_domain (the recipient’s domain does not exist or receives no mail: no MX, A or AAAA record, or a null MX; nothing was sent).

string | null
warnings
required

Warnings about the recipient’s address, computed when the document is read: empty when nothing looks wrong.

Array<object>

Something about the email that looks wrong. A warning never stops or changes the email.

object
code
required

recipient_domain_typo: the recipient’s domain looks like a typo of a common mail domain (for example gmial.com for gmail.com). The email is still sent to the address as given; nothing changes it.

string
Allowed values: recipient_domain_typo
message
required

Follows Accept-Language (English or Spanish).

string
suggestedRecipient
required

The address with the suggested domain.

string
sriMessages
required

Messages of the last SRI answer, mapped to Flashpi codes (the reasons of a rejection, or warnings of an authorization). Texts follow Accept-Language (English or Spanish).

Array<object>

A message of the SRI, mapped by Flashpi.

object
code
required

Flashpi error code.

string
message
required
string
severity
required
string
Allowed values: error warning
failure
required
Any of:

Why a failed document could not reach an SRI answer.

object
code
required
string
Allowed values: certificate_required certificate_expired certificate_not_yet_valid certificate_blocked certificate_revoked certificate_unusable document_too_large document_invalid signing_failed sri_unavailable sri_authorization_timeout sri_request_refused sri_environment_mismatch
message
required
string
voidedAt
required
string | null format: date-time
createdAt
required
string format: date-time
updatedAt
required
string format: date-time

Example

{
"id": "01a13fdf-9620-77a7-a18e-0b13542f5fed",
"type": "invoice",
"environment": "test",
"status": "processing",
"establishment": "001",
"emissionPoint": "001",
"sequential": 123,
"number": "001-001-000000123",
"accessKey": "1510202601179000000000110010010000001234152637411",
"issueDate": "2026-10-15",
"xmlVersion": "2.1.0",
"counterparty": {
"id": "1790000000001",
"name": "Supermercados La Pradera S.A."
},
"totals": {
"subtotal": "60.31",
"discount": "0.75",
"taxes": [
{
"type": "vat",
"rate": "15",
"code": "3031",
"taxableBase": "57.50",
"amount": "8.63"
}
],
"tip": "0.00",
"total": "68.94",
"withheld": "62.50"
},
"authorization": {
"number": null,
"authorizedAt": null
},
"ride": {
"status": "pending",
"template": "modern",
"generatedAt": null
},
"email": {
"requested": true,
"status": "not_requested",
"deliveries": [
{
"recipient": "compras@example.com",
"status": "queued",
"error": null
}
],
"warnings": [
{
"code": "recipient_domain_typo",
"message": "The recipient's email address may be mistyped: did you mean compras@gmail.com?",
"suggestedRecipient": "compras@gmail.com"
}
]
},
"sriMessages": [
{
"code": "calculation_mismatch",
"message": "The SRI found differences in the calculations.",
"severity": "error"
}
],
"failure": {
"code": "certificate_required",
"message": "The issuer has no accepted signing certificate for this mode. Upload its .p12 certificate and issue the document again."
}
}
X-Request-Id
string format: uuid

Flashpi’s ID of the request, a UUIDv7 (also requestId in errors). Include it when you contact support.

authentication_required: no Authorization: Bearer header. invalid_api_key: the key is malformed, unknown or revoked.

Media typeapplication/problem+json

RFC 9457 problem details, in the language of Content-Language (en, or es with Accept-Language: es). Some codes add extension members, listed below; others may appear.

object
type
required

URI of the problem type: the page that documents code, in the language of the response (https://flashpi.com.ec/docs/en/errors/{code} in English, https://flashpi.com.ec/docs/errors/{code} with Accept-Language: es). It changes with the language, so branch on code, never on type.

string format: uri
title
required

Localized summary of the type.

string
status
required

HTTP status code.

number
detail
required

Localized explanation of this occurrence.

string
instance
required

Path of the request.

string
code
required

Stable machine-readable error code, the same in every language. Branch on it, never on type, title or detail. New codes may be added: handle an unknown one by its HTTP status.

string
Allowed values: bad_request malformed_json invalid_correlation_id validation_failed authentication_required forbidden not_found method_not_allowed not_acceptable conflict payload_too_large unsupported_media_type rate_limited internal_error service_unavailable invalid_api_key key_scope_mismatch key_read_only ip_not_allowed invalid_idempotency_key idempotency_key_reused idempotency_key_in_progress issuer_already_exists establishment_already_exists emission_point_already_exists resource_in_use issuer_onboarding_not_ready issuer_onboarding_expired issuer_onboarding_completed issuer_onboarding_rejected total_mismatch sequential_already_used sequentials_exhausted document_schema_invalid document_too_large document_not_authorized ride_not_available email_recipient_missing email_already_queued email_resend_limit_reached account_email_limit_reached email_sending_paused test_recipient_not_allowed platform_email_limit_reached webhook_endpoint_disabled webhook_endpoint_already_verified webhook_endpoint_not_verified webhook_delivery_in_progress sandbox_not_enabled demo_issuer_quota_exceeded demo_issuer_unavailable account_suspended
errors
required

Field-level errors (may be empty).

Array<object>
object
field
required

Path of the invalid field.

string
code
required

Stable machine-readable reason. New codes may be added: treat an unknown one like invalid_value.

string
Allowed values: required unknown_field invalid_type invalid_format invalid_option too_short too_long out_of_range invalid_value unsupported_character not_found invalid_decimal invalid_identification invalid_check_digit final_consumer_not_allowed not_in_force too_many_additional_fields reserved_name amount_mismatch future_date date_too_early date_too_late discount_exceeds_amount duplicate vat_required unsupported_tax rate_mismatch incompatible_issuer_profile url_not_allowed demo_issuer_test_only demo_issuer_sequential_not_allowed ruc_mismatch
message
required

Localized message.

string
requestId
required

Request ID (UUIDv7); include it when contacting support.

string
documentId

idempotency_key_reused: the document the Idempotency-Key already created.

string format: uuid
limit

The daily limit that was reached (email_resend_limit_reached, account_email_limit_reached, demo_issuer_quota_exceeded).

integer
resetsAt

When the daily limit resets: the next midnight in Ecuador (the three codes above and platform_email_limit_reached). Retry-After gives the same in seconds.

string format: date-time
rideStatus

ride_not_available: the status of the RIDE.

string
Allowed values: pending generated failed
documentStatus

document_not_authorized: the status of the document.

string
Allowed values: processing pending_sri authorized rejected failed voided
environment

email_sending_paused: the mode whose email sending is paused.

string
Allowed values: test live
expectedTotal

total_mismatch: the expectedTotal you sent.

string
computedTotal

total_mismatch: the total Flashpi computed.

string
key
additional properties
any

Example

{
"type": "https://flashpi.com.ec/docs/en/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid. See errors for details.",
"instance": "/v1/invoices",
"code": "validation_failed",
"errors": [
{
"field": "customer.id",
"code": "required",
"message": "This field is required."
}
],
"requestId": "017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
"rideStatus": "pending",
"documentStatus": "processing",
"environment": "test",
"expectedTotal": "112.00",
"computedTotal": "111.99"
}
WWW-Authenticate
string

RFC 6750 challenge: Bearer realm="flashpi", plus error="invalid_token" with invalid_api_key.

The API key cannot perform this operation: key_scope_mismatch, key_read_only or ip_not_allowed; or its account is suspended (account_suspended).

Media typeapplication/problem+json

RFC 9457 problem details, in the language of Content-Language (en, or es with Accept-Language: es). Some codes add extension members, listed below; others may appear.

object
type
required

URI of the problem type: the page that documents code, in the language of the response (https://flashpi.com.ec/docs/en/errors/{code} in English, https://flashpi.com.ec/docs/errors/{code} with Accept-Language: es). It changes with the language, so branch on code, never on type.

string format: uri
title
required

Localized summary of the type.

string
status
required

HTTP status code.

number
detail
required

Localized explanation of this occurrence.

string
instance
required

Path of the request.

string
code
required

Stable machine-readable error code, the same in every language. Branch on it, never on type, title or detail. New codes may be added: handle an unknown one by its HTTP status.

string
Allowed values: bad_request malformed_json invalid_correlation_id validation_failed authentication_required forbidden not_found method_not_allowed not_acceptable conflict payload_too_large unsupported_media_type rate_limited internal_error service_unavailable invalid_api_key key_scope_mismatch key_read_only ip_not_allowed invalid_idempotency_key idempotency_key_reused idempotency_key_in_progress issuer_already_exists establishment_already_exists emission_point_already_exists resource_in_use issuer_onboarding_not_ready issuer_onboarding_expired issuer_onboarding_completed issuer_onboarding_rejected total_mismatch sequential_already_used sequentials_exhausted document_schema_invalid document_too_large document_not_authorized ride_not_available email_recipient_missing email_already_queued email_resend_limit_reached account_email_limit_reached email_sending_paused test_recipient_not_allowed platform_email_limit_reached webhook_endpoint_disabled webhook_endpoint_already_verified webhook_endpoint_not_verified webhook_delivery_in_progress sandbox_not_enabled demo_issuer_quota_exceeded demo_issuer_unavailable account_suspended
errors
required

Field-level errors (may be empty).

Array<object>
object
field
required

Path of the invalid field.

string
code
required

Stable machine-readable reason. New codes may be added: treat an unknown one like invalid_value.

string
Allowed values: required unknown_field invalid_type invalid_format invalid_option too_short too_long out_of_range invalid_value unsupported_character not_found invalid_decimal invalid_identification invalid_check_digit final_consumer_not_allowed not_in_force too_many_additional_fields reserved_name amount_mismatch future_date date_too_early date_too_late discount_exceeds_amount duplicate vat_required unsupported_tax rate_mismatch incompatible_issuer_profile url_not_allowed demo_issuer_test_only demo_issuer_sequential_not_allowed ruc_mismatch
message
required

Localized message.

string
requestId
required

Request ID (UUIDv7); include it when contacting support.

string
documentId

idempotency_key_reused: the document the Idempotency-Key already created.

string format: uuid
limit

The daily limit that was reached (email_resend_limit_reached, account_email_limit_reached, demo_issuer_quota_exceeded).

integer
resetsAt

When the daily limit resets: the next midnight in Ecuador (the three codes above and platform_email_limit_reached). Retry-After gives the same in seconds.

string format: date-time
rideStatus

ride_not_available: the status of the RIDE.

string
Allowed values: pending generated failed
documentStatus

document_not_authorized: the status of the document.

string
Allowed values: processing pending_sri authorized rejected failed voided
environment

email_sending_paused: the mode whose email sending is paused.

string
Allowed values: test live
expectedTotal

total_mismatch: the expectedTotal you sent.

string
computedTotal

total_mismatch: the total Flashpi computed.

string
key
additional properties
any

Example

{
"type": "https://flashpi.com.ec/docs/en/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid. See errors for details.",
"instance": "/v1/invoices",
"code": "validation_failed",
"errors": [
{
"field": "customer.id",
"code": "required",
"message": "This field is required."
}
],
"requestId": "017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
"rideStatus": "pending",
"documentStatus": "processing",
"environment": "test",
"expectedTotal": "112.00",
"computedTotal": "111.99"
}

Not_found

Media typeapplication/problem+json

RFC 9457 problem details, in the language of Content-Language (en, or es with Accept-Language: es). Some codes add extension members, listed below; others may appear.

object
type
required

URI of the problem type: the page that documents code, in the language of the response (https://flashpi.com.ec/docs/en/errors/{code} in English, https://flashpi.com.ec/docs/errors/{code} with Accept-Language: es). It changes with the language, so branch on code, never on type.

string format: uri
title
required

Localized summary of the type.

string
status
required

HTTP status code.

number
detail
required

Localized explanation of this occurrence.

string
instance
required

Path of the request.

string
code
required

Stable machine-readable error code, the same in every language. Branch on it, never on type, title or detail. New codes may be added: handle an unknown one by its HTTP status.

string
Allowed values: bad_request malformed_json invalid_correlation_id validation_failed authentication_required forbidden not_found method_not_allowed not_acceptable conflict payload_too_large unsupported_media_type rate_limited internal_error service_unavailable invalid_api_key key_scope_mismatch key_read_only ip_not_allowed invalid_idempotency_key idempotency_key_reused idempotency_key_in_progress issuer_already_exists establishment_already_exists emission_point_already_exists resource_in_use issuer_onboarding_not_ready issuer_onboarding_expired issuer_onboarding_completed issuer_onboarding_rejected total_mismatch sequential_already_used sequentials_exhausted document_schema_invalid document_too_large document_not_authorized ride_not_available email_recipient_missing email_already_queued email_resend_limit_reached account_email_limit_reached email_sending_paused test_recipient_not_allowed platform_email_limit_reached webhook_endpoint_disabled webhook_endpoint_already_verified webhook_endpoint_not_verified webhook_delivery_in_progress sandbox_not_enabled demo_issuer_quota_exceeded demo_issuer_unavailable account_suspended
errors
required

Field-level errors (may be empty).

Array<object>
object
field
required

Path of the invalid field.

string
code
required

Stable machine-readable reason. New codes may be added: treat an unknown one like invalid_value.

string
Allowed values: required unknown_field invalid_type invalid_format invalid_option too_short too_long out_of_range invalid_value unsupported_character not_found invalid_decimal invalid_identification invalid_check_digit final_consumer_not_allowed not_in_force too_many_additional_fields reserved_name amount_mismatch future_date date_too_early date_too_late discount_exceeds_amount duplicate vat_required unsupported_tax rate_mismatch incompatible_issuer_profile url_not_allowed demo_issuer_test_only demo_issuer_sequential_not_allowed ruc_mismatch
message
required

Localized message.

string
requestId
required

Request ID (UUIDv7); include it when contacting support.

string
documentId

idempotency_key_reused: the document the Idempotency-Key already created.

string format: uuid
limit

The daily limit that was reached (email_resend_limit_reached, account_email_limit_reached, demo_issuer_quota_exceeded).

integer
resetsAt

When the daily limit resets: the next midnight in Ecuador (the three codes above and platform_email_limit_reached). Retry-After gives the same in seconds.

string format: date-time
rideStatus

ride_not_available: the status of the RIDE.

string
Allowed values: pending generated failed
documentStatus

document_not_authorized: the status of the document.

string
Allowed values: processing pending_sri authorized rejected failed voided
environment

email_sending_paused: the mode whose email sending is paused.

string
Allowed values: test live
expectedTotal

total_mismatch: the expectedTotal you sent.

string
computedTotal

total_mismatch: the total Flashpi computed.

string
key
additional properties
any

Example

{
"type": "https://flashpi.com.ec/docs/en/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields are invalid. See errors for details.",
"instance": "/v1/invoices",
"code": "validation_failed",
"errors": [
{
"field": "customer.id",
"code": "required",
"message": "This field is required."
}
],
"requestId": "017f22e2-79b0-7cc3-98c4-dc0c0c07398f",
"rideStatus": "pending",
"documentStatus": "processing",
"environment": "test",
"expectedTotal": "112.00",
"computedTotal": "111.99"
}