Ir al contenido

API de documentos

List documents of every type

GET
/v1/ec/documents

A single list of the six types, from newest to oldest, with the same filters as each type plus type. Each document carries its type.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Query Parameters

limit?integer

How many per page, from 1 to 100.

Range1 <= value <= 100
Default20
cursor?string

The next_cursor or prev_cursor of a previous response. Without a cursor, the first page.

Lengthlength <= 200
status?|array<>

Only in these statuses; repeat it for several (status=returned&status=not_authorized).

channel?|array<>

Only those that arrived through these channels; repeat it for several.

counterparty_identification?string

The identification of the document's buyer or supplier; on a delivery note, that of the carrier or of any of its recipients.

counterparty_name?string

With a counterparty_identification that is a passport or a foreign identification (exterior), which the SRI doesn't keep unique, only the documents that name it with this name, ignoring case, accents, spaces and punctuation: one of the customers GET /v1/ec/contacts lists with that identification. A RUC or cedula is one customer whatever the name, so it matches none of theirs.

Length1 <= length <= 300
establishment_id?|array<>

Only those numbered at these establishments (GET /v1/ec/establishments); repeat it for several.

emission_point_id?|array<>

Only those numbered at these emission points (GET /v1/ec/emission-points); repeat it for several.

q?string

Searches words in the number (001-001-000000123), the access key, the name of whoever appears on the document (ignoring case and accents) or the start of their identification. Each word must appear somewhere; it combines with the other filters.

Length1 <= length <= 100
issue_date[gte]?string
Formatdate
issue_date[lte]?string
Formatdate
receivable?string

Only invoices whose receivable is in this state: open (still owed) or collected.

Value in"open""collected"
overdue?string

true: only invoices still owed whose due date has passed. false: only those still owed that are not due yet.

Value in"true""false"
next_due_date[lte]?string

Only invoices still owed whose next due date is this day or earlier.

Formatdate
created_at[gte]?string
Formatdate-time
created_at[lte]?string
Formatdate-time
updated_at[gte]?string
Formatdate-time
updated_at[lte]?string
Formatdate-time
include?"total_count"

total_count adds where the page sits among the documents the filters select: total_count and offset. Leave it out when you only page.

Value in"total_count"
type?|array<>

Only these types, by their object; repeat it for several (type=invoice&type=credit_note). Without it, all of them.

metadata?

Only those whose metadata has exactly these pairs, for example metadata[order_id]=5812345678901. Up to 20; all must match.

Response Body

A page of documents

application/json
  1. response
object*"list"
Value in"list"
data*array<|||||>
next_cursor*|

The next page (older); null if there are no more.

prev_cursor*|

The previous page (newer); null on the first.

total_count?integer

With include=total_count: how many documents match the filters, across all pages.

offset?integer

With include=total_count: how many documents match the filters and come before the first one on this page, from newest to oldest: the page shows offset + 1 to offset + data.length of total_count. 0 on the first page.

Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/ec/documents'
Example Response
{
  "object": "list",
  "data": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "country": "ec",
      "currency": "string",
      "environment": "sandbox",
      "status": "pending",
      "status_transitions": {
        "pending": "2019-08-24T14:15:22Z",
        "submitted": "2019-08-24T14:15:22Z",
        "authorized": "2019-08-24T14:15:22Z",
        "returned": "2019-08-24T14:15:22Z",
        "not_authorized": "2019-08-24T14:15:22Z",
        "annulled": "2019-08-24T14:15:22Z"
      },
      "business_id": "f59fcbb7-848d-4242-af07-a8bb7e3ab37c",
      "number": "string",
      "access_key": "stringstringstringstringstringstringstringstrings",
      "authorization": {
        "number": "string",
        "authorized_at": "2019-08-24T14:15:22Z"
      },
      "sri_messages": [
        {
          "code": "string",
          "message": "string",
          "detail": "string",
          "type": "error",
          "cause": "string",
          "remedy": "string"
        }
      ],
      "metadata": {
        "property1": "string",
        "property2": "string"
      },
      "issued_at": "2019-08-24T14:15:22Z",
      "delivery_status": "sent",
      "emails": [
        {
          "to": "string",
          "status": "sent",
          "sent_at": "2019-08-24T14:15:22Z",
          "delivered_at": "2019-08-24T14:15:22Z",
          "opened_at": "2019-08-24T14:15:22Z",
          "bounced_at": "2019-08-24T14:15:22Z",
          "complained_at": "2019-08-24T14:15:22Z",
          "bounce_type": "permanent"
        }
      ],
      "portal_views": 0,
      "portal_last_viewed_at": "2019-08-24T14:15:22Z",
      "channel": "api",
      "import_id": "13230382-dadc-41f2-963d-e123bd5c0585",
      "verification": "sri",
      "listing": {
        "import_id": "13230382-dadc-41f2-963d-e123bd5c0585",
        "file": "string",
        "entry": "string",
        "sha256": "stringstringstringstringstringstringstringstringstringstringstri",
        "line": 1,
        "authorized_at": "2019-08-24T14:15:22Z"
      },
      "object": "document",
      "type": "invoice",
      "lines": [
        {
          "code": "string",
          "auxiliary_code": "string",
          "description": "string",
          "unit": "string",
          "quantity": "string",
          "unit_price": "string",
          "discount": "string",
          "net": "string",
          "taxes": [
            {
              "type": "iva",
              "rate": "iva_15",
              "base": "string",
              "value": "string"
            }
          ],
          "additional_info": [
            {
              "name": "string",
              "value": "string"
            }
          ],
          "unsubsidized_price": "string"
        }
      ],
      "taxes": [
        {
          "type": "iva",
          "rate": "iva_15",
          "base": "string",
          "value": "string",
          "additional_discount": "string",
          "refund": "string"
        }
      ],
      "subtotal": "string",
      "discount": "string",
      "iva": "string",
      "ice": "string",
      "irbpnr": "string",
      "total": "string",
      "subsidy": "string",
      "tip": "string",
      "issue_date": "2019-08-24",
      "buyer": {
        "identification_type": "ruc",
        "identification": "string",
        "name": "string",
        "address": "string",
        "email": "string"
      },
      "payments": [
        {
          "method": "sin_sistema_financiero",
          "amount": "string",
          "term": {
            "length": 0,
            "unit": "days"
          }
        }
      ],
      "plate": "string",
      "delivery_note_number": "string",
      "export": {
        "incoterm": "string",
        "incoterm_place": "string",
        "origin_country": "string",
        "loading_port": "string",
        "destination_port": "string",
        "destination_country": "string",
        "acquisition_country": "string",
        "subtotal_incoterm": "string",
        "international_freight": "string",
        "international_insurance": "string",
        "customs_costs": "string",
        "other_transport_costs": "string"
      },
      "reimbursement": {
        "document_type": "factura",
        "total": "string",
        "base": "string",
        "tax": "string",
        "documents": [
          {
            "supplier": {
              "identification_type": "ruc",
              "identification": "string"
            },
            "supplier_type": "persona_natural",
            "payment_country": "string",
            "document_type": "factura",
            "number": "string",
            "issue_date": "2019-08-24",
            "authorization_number": "string",
            "taxes": [
              {
                "type": "iva",
                "rate": "iva_15",
                "base": "string",
                "value": "string"
              }
            ],
            "compensations": [
              {
                "code": "string",
                "rate": "string",
                "value": "string"
              }
            ]
          }
        ]
      },
      "withholdings": [
        {
          "type": "iva_100",
          "value": "string"
        }
      ],
      "withheld_iva": "string",
      "withheld_renta": "string",
      "substitute_delivery_note": {
        "origin_address": "string",
        "destination_address": "string",
        "transport_start": "string",
        "transport_end": "string",
        "carrier": {
          "identification_type": "ruc",
          "identification": "string",
          "name": "string"
        },
        "plate": "string",
        "destinations": [
          {
            "reason": "string",
            "customs_document": "string",
            "destination_establishment": "string",
            "route": "string"
          }
        ]
      },
      "third_party_charges": [
        {
          "concept": "string",
          "amount": "string"
        }
      ],
      "negotiable": {
        "notification_email": "string"
      },
      "compensations": [
        {
          "code": "string",
          "rate": "string",
          "value": "string"
        }
      ],
      "fiscal_machine": {
        "brand": "string",
        "model": "string",
        "serial": "string"
      },
      "additional_info": [
        {
          "name": "string",
          "value": "string"
        }
      ],
      "credit_balance": "string",
      "receivable": {
        "object": "receivable",
        "state": "open",
        "currency": "string",
        "amount": "string",
        "collected": "string",
        "withheld": "string",
        "credited": "string",
        "balance": "string",
        "next_due_date": "2019-08-24",
        "overdue_days": 0,
        "collect_later": true,
        "installments": [
          {
            "amount": "string",
            "due_date": "2019-08-24",
            "balance": "string"
          }
        ],
        "closed_on": "2019-08-24"
      },
      "quote_id": "3c071a1d-db86-46a7-9dc8-72ba3fbca992",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "next_cursor": "string",
  "prev_cursor": "string",
  "total_count": 0,
  "offset": 0
}

Retrieve a document of any type

GET
/v1/ec/documents/{id}

The document with this id, whatever its type: its type says which. For whoever only has the id, such as a link to the console.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Path Parameters

id*string
Formatuuid

Response Body

The document

application/json
  1. response
id*string
Formatuuid
country*"ec"

The country, as its lowercase ISO 3166-1 alpha-2 code, the same as in the path (/v1/ec/…). New countries may appear.

Value in"ec"
currency*string

The currency of the amounts, as its ISO 4217 code. New currencies may appear.

Match^[A-Z]{3}$
environment*string
Value in"sandbox""test""live"
status*string
Value in"pending""submitted""authorized""returned""not_authorized""annulled"
status_transitions*

When the document last reached each status.

business_id*string
Formatuuid
number*string
access_key*string
Length49 <= length <= 49
authorization*|null
sri_messages*array<>

The messages of the SRI's latest response, each with its cause and what to do. A returned or not_authorized document says here why.

metadata*
issued_at*|

When it was issued, with date and time. On a document issued here it is the moment Fiscalbase accepted and numbered it, which sets its issue date (always today in Ecuador). SRI documents carry only the date, so on an imported one (channel imported) it is the time the SRI authorized it, and null if nothing dates it.

Formatdate-time
delivery_status*|

How the emails of the current revision are doing, the heaviest outcome wins: complained (marked the email as spam) over bounced (bounced) over opened (opened it) over delivered (reached the mailbox) over sent (the email provider accepted it, no news yet). null if no email was sent. The email provider reports it; without its notices it stays at sent.

Value in"sent""delivered""opened""bounced""complained"null
emails*array<>

The emails sent with the document's current revision, one per recipient and per send, from first to last. Empty if none was sent.

portal_views*integer

How many times its recipient opened the document in the portal, signing in with their code or with the link in the email. Downloads of the PDF and the XML do not count. 0 if it was never opened.

portal_last_viewed_at*|

The last time it was opened in the portal; null if never.

Formatdate-time
channel*string

How it arrived: api if your system issued it with a key, or an agent did for the person who connected it, console if someone issued it on the platform, imported if it came in an import from another system. It is recorded at issue and does not change.

Value in"api""console""imported"
import_id*|

The import that brought it; null if it was issued here.

Formatuuid
verification*|

Imported documents only, how we know it is authorized, from most to least certain: sri if the SRI confirmed it at import; listed if its key appears in an SRI listing you uploaded (the Facturador report or the issued-documents one from the SRI's online portal); signature if its file carries the authorization, which nobody signs; unconfirmed if it only has the issuer's signature and nothing shows that the SRI authorized it. unconfirmed documents do not appear in the portal until you upload the listing. Except for sri, the SRI no longer remembered it (or it was imported in sandbox) and its annulment cannot be detected. null if it was issued here.

Value in"sri""listed""signature""unconfirmed"null
listing*|

With verification listed, the listing that shows it authorized and where it came from. Any listing of keys counts, so which one it was is recorded. null otherwise.

object*"document"
Value in"document"
type*"invoice"

The family: invoice, credit_note, debit_note, withholding, delivery_note or purchase_settlement. Every other operation on the document is under its path (/v1/ec/invoices/{id}/…).

Value in"invoice"
lines*array<>
taxes*array<||>
subtotal*string
discount*string
iva*string
ice*string
irbpnr*string
total*string
subsidy*string|null
tip*string
issue_date*string
Formatdate
buyer*
payments*array<>
plate*string|null
delivery_note_number*string|null
export*|null
reimbursement*|null
withholdings*array<>
withheld_iva*string|null
withheld_renta*string|null
substitute_delivery_note*|null
third_party_charges*array<>
negotiable*|null
compensations*array<>

Solidarity compensation of 2 % of the IVA (2016), only on imported documents that carry it.

fiscal_machine*|null
additional_info*array<>
credit_balance*|

Invoices only. What can still be credited: the total minus that of the credit notes that modify it and still stand (authorized or still on their way to the SRI; not the returned, not authorized or annulled ones). It never goes below zero. POST /v1/ec/credit-notes rejects a note that exceeds it. null for an invoice issued to consumidor_final, which takes no credit note (NAC-DGERCGC25-00000014, art. 3).

receivable*|

Invoices only. What it is still owed, when it was issued on credit (a payment with a term) or with collect_later. null for an invoice paid at once, for one issued to consumidor_final, who is nobody to collect from, and for imported ones.

quote_id*|

Invoices only. The quote it was issued from (POST /v1/ec/quotes/{id}/convert), whole at GET /v1/ec/quotes/{id}; null for one issued otherwise.

Formatuuid
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/ec/documents/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
{
  "id": "01a21860-2ded-7d4a-aa7a-a3c78d93bde8",
  "object": "document",
  "type": "invoice",
  "country": "ec",
  "currency": "USD",
  "environment": "sandbox",
  "status": "pending",
  "status_transitions": {
    "pending": "2026-11-26T15:01:30.276Z"
  },
  "business_id": "01a21860-2da6-7794-836d-46af5e2362e9",
  "number": "001-001-000000001",
  "access_key": "2611202601179214673900110010010000000013224023710",
  "authorization": null,
  "sri_messages": [],
  "metadata": {},
  "channel": "api",
  "import_id": null,
  "verification": null,
  "listing": null,
  "issued_at": "2026-11-26T15:01:26.120Z",
  "delivery_status": null,
  "emails": [],
  "portal_views": 0,
  "portal_last_viewed_at": null,
  "ice": "0.00",
  "iva": "36.00",
  "tip": "0.00",
  "buyer": {
    "name": "FERRETERÍA EL SOL S.A.",
    "email": "compras@elsol.ec",
    "address": "Av. 10 de Agosto N21-44, Quito",
    "identification": "1790012345001",
    "identification_type": "ruc"
  },
  "lines": [
    {
      "net": "240.00",
      "code": "SKU-1",
      "unit": null,
      "taxes": [
        {
          "base": "240.00",
          "rate": "iva_15",
          "type": "iva",
          "value": "36.00"
        }
      ],
      "discount": "0.00",
      "quantity": "2",
      "unit_price": "120",
      "description": "Taladro percutor",
      "auxiliary_code": null,
      "additional_info": [],
      "unsubsidized_price": null
    },
    {
      "net": "9.00",
      "code": "SKU-1",
      "unit": null,
      "taxes": [
        {
          "base": "9.00",
          "rate": "iva_0",
          "type": "iva",
          "value": "0.00"
        }
      ],
      "discount": "0.00",
      "quantity": "2",
      "unit_price": "4.5",
      "description": "Guantes",
      "auxiliary_code": null,
      "additional_info": [],
      "unsubsidized_price": null
    }
  ],
  "plate": null,
  "taxes": [
    {
      "base": "240.00",
      "rate": "iva_15",
      "type": "iva",
      "value": "36.00",
      "refund": null,
      "additional_discount": null
    },
    {
      "base": "9.00",
      "rate": "iva_0",
      "type": "iva",
      "value": "0.00",
      "refund": null,
      "additional_discount": null
    }
  ],
  "total": "285.00",
  "export": null,
  "irbpnr": "0.00",
  "subsidy": null,
  "discount": "0.00",
  "payments": [
    {
      "term": {
        "unit": "days",
        "length": 30
      },
      "amount": "285.00",
      "method": "tarjeta_credito"
    }
  ],
  "subtotal": "249.00",
  "issue_date": "2026-11-26",
  "negotiable": null,
  "withheld_iva": null,
  "withholdings": [],
  "compensations": [],
  "reimbursement": null,
  "fiscal_machine": null,
  "withheld_renta": null,
  "additional_info": [
    {
      "name": "Orden de compra",
      "value": "OC-1041"
    }
  ],
  "third_party_charges": [],
  "delivery_note_number": null,
  "substitute_delivery_note": null,
  "created_at": "2026-11-26T15:01:26.120Z",
  "updated_at": "2026-11-26T15:01:26.120Z",
  "credit_balance": "285.00",
  "receivable": {
    "object": "receivable",
    "state": "open",
    "currency": "USD",
    "amount": "285.00",
    "collected": "0.00",
    "withheld": "0.00",
    "credited": "0.00",
    "balance": "285.00",
    "next_due_date": "2026-12-26",
    "overdue_days": 0,
    "collect_later": false,
    "installments": [
      {
        "amount": "285.00",
        "due_date": "2026-12-26",
        "balance": "285.00"
      }
    ],
    "closed_on": null
  },
  "quote_id": null
}

List a document's timeline

GET
/v1/ec/documents/{id}/timeline

Every step it went through, from newest to oldest: accepted, signed, received, authorized or returned, the PDF generated, each email sent and each correction. These are the document's own steps, not the events webhooks deliver (GET /v1/events).

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Path Parameters

id*string
Formatuuid

Query Parameters

limit?integer

How many per page, from 1 to 100.

Range1 <= value <= 100
Default20
cursor?string

The next_cursor or prev_cursor of a previous response. Without a cursor, the first page.

Lengthlength <= 200
created_at[gte]?string

Only what was created at or after this moment, ISO 8601 with its offset.

Formatdate-time
created_at[lte]?string

Only what was created at or before this moment, ISO 8601 with its offset.

Formatdate-time
updated_at[gte]?string

Only what last changed at or after this moment, ISO 8601 with its offset: poll with the time of your last read to get what changed since.

Formatdate-time
updated_at[lte]?string

Only what last changed at or before this moment, ISO 8601 with its offset.

Formatdate-time

Response Body

A page of the timeline

application/json
  1. response
object*"list"
Value in"list"
data*array<>
next_cursor*|

The next page (older); null if there are no more.

prev_cursor*|

The previous page (newer); null on the first.

Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/ec/documents/497f6eca-6276-4993-bfeb-53cbbbba6f08/timeline'
Example Response
{
  "object": "list",
  "data": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "object": "timeline_entry",
      "document_id": "b792e8ae-2cb4-4209-85b9-32be4c2fcdd6",
      "type": "string",
      "revision": 0,
      "data": {
        "property1": null,
        "property2": null
      },
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "next_cursor": "string",
  "prev_cursor": "string"
}

Record a document's annulment

POST
/v1/ec/documents/{id}/annul

Only records an annulment you already made in the SRI's online portal; it does not request it from the SRI. The document goes to annulled, keeps its files, leaves your customer's portal and <type>.annulled is sent to your webhooks. Only for an authorized one, and never for one issued to a consumidor_final buyer, which the SRI does not annul.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Path Parameters

id*string
Formatuuid

Header Parameters

idempotency-key?string

Send the same key to retry safely: a repeat of the same request answers what the first answered, without doing it again. Keys are scoped to the business the call acts for and its environment; the same key with another request is 409 idempotency_key_reused.

Length1 <= length <= 255

Request Body

application/json
  1. body
annulled_on*string

The date the SRI annulled it, as it appears in the SRI's online portal. Not before the issue date and not in the future.

Formatdate
reason?string

Why it was annulled, for your records.

Length1 <= length <= 300

Response Body

Annulled

application/json
  1. response
id*string
Formatuuid
country*"ec"

The country, as its lowercase ISO 3166-1 alpha-2 code, the same as in the path (/v1/ec/…). New countries may appear.

Value in"ec"
currency*string

The currency of the amounts, as its ISO 4217 code. New currencies may appear.

Match^[A-Z]{3}$
environment*string
Value in"sandbox""test""live"
status*string
Value in"pending""submitted""authorized""returned""not_authorized""annulled"
status_transitions*

When the document last reached each status.

business_id*string
Formatuuid
number*string
access_key*string
Length49 <= length <= 49
authorization*|null
sri_messages*array<>

The messages of the SRI's latest response, each with its cause and what to do. A returned or not_authorized document says here why.

metadata*
issued_at*|

When it was issued, with date and time. On a document issued here it is the moment Fiscalbase accepted and numbered it, which sets its issue date (always today in Ecuador). SRI documents carry only the date, so on an imported one (channel imported) it is the time the SRI authorized it, and null if nothing dates it.

Formatdate-time
delivery_status*|

How the emails of the current revision are doing, the heaviest outcome wins: complained (marked the email as spam) over bounced (bounced) over opened (opened it) over delivered (reached the mailbox) over sent (the email provider accepted it, no news yet). null if no email was sent. The email provider reports it; without its notices it stays at sent.

Value in"sent""delivered""opened""bounced""complained"null
emails*array<>

The emails sent with the document's current revision, one per recipient and per send, from first to last. Empty if none was sent.

portal_views*integer

How many times its recipient opened the document in the portal, signing in with their code or with the link in the email. Downloads of the PDF and the XML do not count. 0 if it was never opened.

portal_last_viewed_at*|

The last time it was opened in the portal; null if never.

Formatdate-time
channel*string

How it arrived: api if your system issued it with a key, or an agent did for the person who connected it, console if someone issued it on the platform, imported if it came in an import from another system. It is recorded at issue and does not change.

Value in"api""console""imported"
import_id*|

The import that brought it; null if it was issued here.

Formatuuid
verification*|

Imported documents only, how we know it is authorized, from most to least certain: sri if the SRI confirmed it at import; listed if its key appears in an SRI listing you uploaded (the Facturador report or the issued-documents one from the SRI's online portal); signature if its file carries the authorization, which nobody signs; unconfirmed if it only has the issuer's signature and nothing shows that the SRI authorized it. unconfirmed documents do not appear in the portal until you upload the listing. Except for sri, the SRI no longer remembered it (or it was imported in sandbox) and its annulment cannot be detected. null if it was issued here.

Value in"sri""listed""signature""unconfirmed"null
listing*|

With verification listed, the listing that shows it authorized and where it came from. Any listing of keys counts, so which one it was is recorded. null otherwise.

object*"document"
Value in"document"
type*"invoice"

The family: invoice, credit_note, debit_note, withholding, delivery_note or purchase_settlement. Every other operation on the document is under its path (/v1/ec/invoices/{id}/…).

Value in"invoice"
lines*array<>
taxes*array<||>
subtotal*string
discount*string
iva*string
ice*string
irbpnr*string
total*string
subsidy*string|null
tip*string
issue_date*string
Formatdate
buyer*
payments*array<>
plate*string|null
delivery_note_number*string|null
export*|null
reimbursement*|null
withholdings*array<>
withheld_iva*string|null
withheld_renta*string|null
substitute_delivery_note*|null
third_party_charges*array<>
negotiable*|null
compensations*array<>

Solidarity compensation of 2 % of the IVA (2016), only on imported documents that carry it.

fiscal_machine*|null
additional_info*array<>
credit_balance*|

Invoices only. What can still be credited: the total minus that of the credit notes that modify it and still stand (authorized or still on their way to the SRI; not the returned, not authorized or annulled ones). It never goes below zero. POST /v1/ec/credit-notes rejects a note that exceeds it. null for an invoice issued to consumidor_final, which takes no credit note (NAC-DGERCGC25-00000014, art. 3).

receivable*|

Invoices only. What it is still owed, when it was issued on credit (a payment with a term) or with collect_later. null for an invoice paid at once, for one issued to consumidor_final, who is nobody to collect from, and for imported ones.

quote_id*|

Invoices only. The quote it was issued from (POST /v1/ec/quotes/{id}/convert), whole at GET /v1/ec/quotes/{id}; null for one issued otherwise.

Formatuuid
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/documents/497f6eca-6276-4993-bfeb-53cbbbba6f08/annul' \
  -H 'Content-Type: application/json' \
  -d '{
  "annulled_on": "2026-11-26",
  "reason": "Precio equivocado"
}'
Example Response
{
  "id": "01a21860-3dd8-7d46-8297-b94e42715da0",
  "object": "document",
  "type": "invoice",
  "country": "ec",
  "currency": "USD",
  "environment": "sandbox",
  "status": "annulled",
  "status_transitions": {
    "pending": "2026-11-26T15:01:34.351Z",
    "annulled": "2026-11-26T15:01:34.365Z"
  },
  "business_id": "01a21860-3da0-7cc7-aa37-09107902c5ea",
  "number": "001-001-000000001",
  "access_key": "2611202601179214673900110010010000000018758237718",
  "authorization": null,
  "sri_messages": [],
  "metadata": {},
  "channel": "api",
  "import_id": null,
  "verification": null,
  "listing": null,
  "issued_at": "2026-11-26T15:01:30.197Z",
  "delivery_status": null,
  "emails": [],
  "portal_views": 0,
  "portal_last_viewed_at": null,
  "ice": "0.00",
  "iva": "36.00",
  "tip": "0.00",
  "buyer": {
    "name": "FERRETERÍA EL SOL S.A.",
    "email": "compras@elsol.ec",
    "address": "Av. 10 de Agosto N21-44, Quito",
    "identification": "1790012345001",
    "identification_type": "ruc"
  },
  "lines": [
    {
      "net": "240.00",
      "code": "SKU-1",
      "unit": null,
      "taxes": [
        {
          "base": "240.00",
          "rate": "iva_15",
          "type": "iva",
          "value": "36.00"
        }
      ],
      "discount": "0.00",
      "quantity": "2",
      "unit_price": "120",
      "description": "Taladro percutor",
      "auxiliary_code": null,
      "additional_info": [],
      "unsubsidized_price": null
    },
    {
      "net": "9.00",
      "code": "SKU-1",
      "unit": null,
      "taxes": [
        {
          "base": "9.00",
          "rate": "iva_0",
          "type": "iva",
          "value": "0.00"
        }
      ],
      "discount": "0.00",
      "quantity": "2",
      "unit_price": "4.5",
      "description": "Guantes",
      "auxiliary_code": null,
      "additional_info": [],
      "unsubsidized_price": null
    }
  ],
  "plate": null,
  "taxes": [
    {
      "base": "240.00",
      "rate": "iva_15",
      "type": "iva",
      "value": "36.00",
      "refund": null,
      "additional_discount": null
    },
    {
      "base": "9.00",
      "rate": "iva_0",
      "type": "iva",
      "value": "0.00",
      "refund": null,
      "additional_discount": null
    }
  ],
  "total": "285.00",
  "export": null,
  "irbpnr": "0.00",
  "subsidy": null,
  "discount": "0.00",
  "payments": [
    {
      "term": {
        "unit": "days",
        "length": 30
      },
      "amount": "285.00",
      "method": "tarjeta_credito"
    }
  ],
  "subtotal": "249.00",
  "issue_date": "2026-11-26",
  "negotiable": null,
  "withheld_iva": null,
  "withholdings": [],
  "compensations": [],
  "reimbursement": null,
  "fiscal_machine": null,
  "withheld_renta": null,
  "additional_info": [
    {
      "name": "Orden de compra",
      "value": "OC-1041"
    }
  ],
  "third_party_charges": [],
  "delivery_note_number": null,
  "substitute_delivery_note": null,
  "created_at": "2026-11-26T15:01:30.197Z",
  "updated_at": "2026-11-26T15:01:34.365Z",
  "credit_balance": "285.00",
  "receivable": {
    "object": "receivable",
    "state": "void",
    "currency": "USD",
    "amount": "285.00",
    "collected": "0.00",
    "withheld": "0.00",
    "credited": "0.00",
    "balance": "285.00",
    "next_due_date": null,
    "overdue_days": 0,
    "collect_later": false,
    "installments": [
      {
        "amount": "285.00",
        "due_date": "2026-12-26",
        "balance": "285.00"
      }
    ],
    "closed_on": "2026-11-26"
  },
  "quote_id": null
}

Renumber a document

POST
/v1/ec/documents/{id}/renumber

Only for a returned document with error 45, SECUENCIAL REGISTRADO: another document of the RUC already has that number at the SRI. It takes the next number in its series with a new access key, keeps its content and its issue date, gains a revision and goes back to pending. In sandbox and test this happens on its own; in live never, because that number belongs to an authorized document that Fiscalbase does not know about. It requires an Idempotency-Key.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Path Parameters

id*string
Formatuuid

Header Parameters

idempotency-key*string

Required. Without it a retry could number another document or reach the SRI again. A retry with the same key and body answers the first answer instead; the same key with another body is 409 idempotency_key_reused.

Length1 <= length <= 255

Response Body

Renumbered and sent again

application/json
  1. response
id*string
Formatuuid
country*"ec"

The country, as its lowercase ISO 3166-1 alpha-2 code, the same as in the path (/v1/ec/…). New countries may appear.

Value in"ec"
currency*string

The currency of the amounts, as its ISO 4217 code. New currencies may appear.

Match^[A-Z]{3}$
environment*string
Value in"sandbox""test""live"
status*string
Value in"pending""submitted""authorized""returned""not_authorized""annulled"
status_transitions*

When the document last reached each status.

business_id*string
Formatuuid
number*string
access_key*string
Length49 <= length <= 49
authorization*|null
sri_messages*array<>

The messages of the SRI's latest response, each with its cause and what to do. A returned or not_authorized document says here why.

metadata*
issued_at*|

When it was issued, with date and time. On a document issued here it is the moment Fiscalbase accepted and numbered it, which sets its issue date (always today in Ecuador). SRI documents carry only the date, so on an imported one (channel imported) it is the time the SRI authorized it, and null if nothing dates it.

Formatdate-time
delivery_status*|

How the emails of the current revision are doing, the heaviest outcome wins: complained (marked the email as spam) over bounced (bounced) over opened (opened it) over delivered (reached the mailbox) over sent (the email provider accepted it, no news yet). null if no email was sent. The email provider reports it; without its notices it stays at sent.

Value in"sent""delivered""opened""bounced""complained"null
emails*array<>

The emails sent with the document's current revision, one per recipient and per send, from first to last. Empty if none was sent.

portal_views*integer

How many times its recipient opened the document in the portal, signing in with their code or with the link in the email. Downloads of the PDF and the XML do not count. 0 if it was never opened.

portal_last_viewed_at*|

The last time it was opened in the portal; null if never.

Formatdate-time
channel*string

How it arrived: api if your system issued it with a key, or an agent did for the person who connected it, console if someone issued it on the platform, imported if it came in an import from another system. It is recorded at issue and does not change.

Value in"api""console""imported"
import_id*|

The import that brought it; null if it was issued here.

Formatuuid
verification*|

Imported documents only, how we know it is authorized, from most to least certain: sri if the SRI confirmed it at import; listed if its key appears in an SRI listing you uploaded (the Facturador report or the issued-documents one from the SRI's online portal); signature if its file carries the authorization, which nobody signs; unconfirmed if it only has the issuer's signature and nothing shows that the SRI authorized it. unconfirmed documents do not appear in the portal until you upload the listing. Except for sri, the SRI no longer remembered it (or it was imported in sandbox) and its annulment cannot be detected. null if it was issued here.

Value in"sri""listed""signature""unconfirmed"null
listing*|

With verification listed, the listing that shows it authorized and where it came from. Any listing of keys counts, so which one it was is recorded. null otherwise.

object*"document"
Value in"document"
type*"invoice"

The family: invoice, credit_note, debit_note, withholding, delivery_note or purchase_settlement. Every other operation on the document is under its path (/v1/ec/invoices/{id}/…).

Value in"invoice"
lines*array<>
taxes*array<||>
subtotal*string
discount*string
iva*string
ice*string
irbpnr*string
total*string
subsidy*string|null
tip*string
issue_date*string
Formatdate
buyer*
payments*array<>
plate*string|null
delivery_note_number*string|null
export*|null
reimbursement*|null
withholdings*array<>
withheld_iva*string|null
withheld_renta*string|null
substitute_delivery_note*|null
third_party_charges*array<>
negotiable*|null
compensations*array<>

Solidarity compensation of 2 % of the IVA (2016), only on imported documents that carry it.

fiscal_machine*|null
additional_info*array<>
credit_balance*|

Invoices only. What can still be credited: the total minus that of the credit notes that modify it and still stand (authorized or still on their way to the SRI; not the returned, not authorized or annulled ones). It never goes below zero. POST /v1/ec/credit-notes rejects a note that exceeds it. null for an invoice issued to consumidor_final, which takes no credit note (NAC-DGERCGC25-00000014, art. 3).

receivable*|

Invoices only. What it is still owed, when it was issued on credit (a payment with a term) or with collect_later. null for an invoice paid at once, for one issued to consumidor_final, who is nobody to collect from, and for imported ones.

quote_id*|

Invoices only. The quote it was issued from (POST /v1/ec/quotes/{id}/convert), whole at GET /v1/ec/quotes/{id}; null for one issued otherwise.

Formatuuid
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/documents/497f6eca-6276-4993-bfeb-53cbbbba6f08/renumber' \
  -H 'idempotency-key: string'
Example Response
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "country": "ec",
  "currency": "string",
  "environment": "sandbox",
  "status": "pending",
  "status_transitions": {
    "pending": "2019-08-24T14:15:22Z",
    "submitted": "2019-08-24T14:15:22Z",
    "authorized": "2019-08-24T14:15:22Z",
    "returned": "2019-08-24T14:15:22Z",
    "not_authorized": "2019-08-24T14:15:22Z",
    "annulled": "2019-08-24T14:15:22Z"
  },
  "business_id": "f59fcbb7-848d-4242-af07-a8bb7e3ab37c",
  "number": "string",
  "access_key": "stringstringstringstringstringstringstringstrings",
  "authorization": {
    "number": "string",
    "authorized_at": "2019-08-24T14:15:22Z"
  },
  "sri_messages": [
    {
      "code": "string",
      "message": "string",
      "detail": "string",
      "type": "error",
      "cause": "string",
      "remedy": "string"
    }
  ],
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "issued_at": "2019-08-24T14:15:22Z",
  "delivery_status": "sent",
  "emails": [
    {
      "to": "string",
      "status": "sent",
      "sent_at": "2019-08-24T14:15:22Z",
      "delivered_at": "2019-08-24T14:15:22Z",
      "opened_at": "2019-08-24T14:15:22Z",
      "bounced_at": "2019-08-24T14:15:22Z",
      "complained_at": "2019-08-24T14:15:22Z",
      "bounce_type": "permanent"
    }
  ],
  "portal_views": 0,
  "portal_last_viewed_at": "2019-08-24T14:15:22Z",
  "channel": "api",
  "import_id": "13230382-dadc-41f2-963d-e123bd5c0585",
  "verification": "sri",
  "listing": {
    "import_id": "13230382-dadc-41f2-963d-e123bd5c0585",
    "file": "string",
    "entry": "string",
    "sha256": "stringstringstringstringstringstringstringstringstringstringstri",
    "line": 1,
    "authorized_at": "2019-08-24T14:15:22Z"
  },
  "object": "document",
  "type": "invoice",
  "lines": [
    {
      "code": "string",
      "auxiliary_code": "string",
      "description": "string",
      "unit": "string",
      "quantity": "string",
      "unit_price": "string",
      "discount": "string",
      "net": "string",
      "taxes": [
        {
          "type": "iva",
          "rate": "iva_15",
          "base": "string",
          "value": "string"
        }
      ],
      "additional_info": [
        {
          "name": "string",
          "value": "string"
        }
      ],
      "unsubsidized_price": "string"
    }
  ],
  "taxes": [
    {
      "type": "iva",
      "rate": "iva_15",
      "base": "string",
      "value": "string",
      "additional_discount": "string",
      "refund": "string"
    }
  ],
  "subtotal": "string",
  "discount": "string",
  "iva": "string",
  "ice": "string",
  "irbpnr": "string",
  "total": "string",
  "subsidy": "string",
  "tip": "string",
  "issue_date": "2019-08-24",
  "buyer": {
    "identification_type": "ruc",
    "identification": "string",
    "name": "string",
    "address": "string",
    "email": "string"
  },
  "payments": [
    {
      "method": "sin_sistema_financiero",
      "amount": "string",
      "term": {
        "length": 0,
        "unit": "days"
      }
    }
  ],
  "plate": "string",
  "delivery_note_number": "string",
  "export": {
    "incoterm": "string",
    "incoterm_place": "string",
    "origin_country": "string",
    "loading_port": "string",
    "destination_port": "string",
    "destination_country": "string",
    "acquisition_country": "string",
    "subtotal_incoterm": "string",
    "international_freight": "string",
    "international_insurance": "string",
    "customs_costs": "string",
    "other_transport_costs": "string"
  },
  "reimbursement": {
    "document_type": "factura",
    "total": "string",
    "base": "string",
    "tax": "string",
    "documents": [
      {
        "supplier": {
          "identification_type": "ruc",
          "identification": "string"
        },
        "supplier_type": "persona_natural",
        "payment_country": "string",
        "document_type": "factura",
        "number": "string",
        "issue_date": "2019-08-24",
        "authorization_number": "string",
        "taxes": [
          {
            "type": "iva",
            "rate": "iva_15",
            "base": "string",
            "value": "string"
          }
        ],
        "compensations": [
          {
            "code": "string",
            "rate": "string",
            "value": "string"
          }
        ]
      }
    ]
  },
  "withholdings": [
    {
      "type": "iva_100",
      "value": "string"
    }
  ],
  "withheld_iva": "string",
  "withheld_renta": "string",
  "substitute_delivery_note": {
    "origin_address": "string",
    "destination_address": "string",
    "transport_start": "string",
    "transport_end": "string",
    "carrier": {
      "identification_type": "ruc",
      "identification": "string",
      "name": "string"
    },
    "plate": "string",
    "destinations": [
      {
        "reason": "string",
        "customs_document": "string",
        "destination_establishment": "string",
        "route": "string"
      }
    ]
  },
  "third_party_charges": [
    {
      "concept": "string",
      "amount": "string"
    }
  ],
  "negotiable": {
    "notification_email": "string"
  },
  "compensations": [
    {
      "code": "string",
      "rate": "string",
      "value": "string"
    }
  ],
  "fiscal_machine": {
    "brand": "string",
    "model": "string",
    "serial": "string"
  },
  "additional_info": [
    {
      "name": "string",
      "value": "string"
    }
  ],
  "credit_balance": "string",
  "receivable": {
    "object": "receivable",
    "state": "open",
    "currency": "string",
    "amount": "string",
    "collected": "string",
    "withheld": "string",
    "credited": "string",
    "balance": "string",
    "next_due_date": "2019-08-24",
    "overdue_days": 0,
    "collect_later": true,
    "installments": [
      {
        "amount": "string",
        "due_date": "2019-08-24",
        "balance": "string"
      }
    ],
    "closed_on": "2019-08-24"
  },
  "quote_id": "3c071a1d-db86-46a7-9dc8-72ba3fbca992",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}

Check a document's status now

POST
/v1/ec/documents/{id}/refresh-status

Asks the SRI right now whether it has decided on a submitted document, without waiting for the next scheduled check; the answer arrives through the usual flow (the status changes and the webhook is sent). A pending document is already being signed or sent, and one the SRI has already decided has nothing to ask: both come back as they are, with nothing queued. Each document is checked at most once every 10 seconds: repeating it sooner answers 429 with Retry-After, and the SRI receives a single question however many times it is pressed.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Path Parameters

id*string
Formatuuid

Header Parameters

idempotency-key?string

Send the same key to retry safely: a repeat of the same request answers what the first answered, without doing it again. Keys are scoped to the business the call acts for and its environment; the same key with another request is 409 idempotency_key_reused.

Length1 <= length <= 255

Response Body

Nothing to check (it is pending or the SRI has already decided): the document, as it is

application/json
  1. response
id*string
Formatuuid
country*"ec"

The country, as its lowercase ISO 3166-1 alpha-2 code, the same as in the path (/v1/ec/…). New countries may appear.

Value in"ec"
currency*string

The currency of the amounts, as its ISO 4217 code. New currencies may appear.

Match^[A-Z]{3}$
environment*string
Value in"sandbox""test""live"
status*string
Value in"pending""submitted""authorized""returned""not_authorized""annulled"
status_transitions*

When the document last reached each status.

business_id*string
Formatuuid
number*string
access_key*string
Length49 <= length <= 49
authorization*|null
sri_messages*array<>

The messages of the SRI's latest response, each with its cause and what to do. A returned or not_authorized document says here why.

metadata*
issued_at*|

When it was issued, with date and time. On a document issued here it is the moment Fiscalbase accepted and numbered it, which sets its issue date (always today in Ecuador). SRI documents carry only the date, so on an imported one (channel imported) it is the time the SRI authorized it, and null if nothing dates it.

Formatdate-time
delivery_status*|

How the emails of the current revision are doing, the heaviest outcome wins: complained (marked the email as spam) over bounced (bounced) over opened (opened it) over delivered (reached the mailbox) over sent (the email provider accepted it, no news yet). null if no email was sent. The email provider reports it; without its notices it stays at sent.

Value in"sent""delivered""opened""bounced""complained"null
emails*array<>

The emails sent with the document's current revision, one per recipient and per send, from first to last. Empty if none was sent.

portal_views*integer

How many times its recipient opened the document in the portal, signing in with their code or with the link in the email. Downloads of the PDF and the XML do not count. 0 if it was never opened.

portal_last_viewed_at*|

The last time it was opened in the portal; null if never.

Formatdate-time
channel*string

How it arrived: api if your system issued it with a key, or an agent did for the person who connected it, console if someone issued it on the platform, imported if it came in an import from another system. It is recorded at issue and does not change.

Value in"api""console""imported"
import_id*|

The import that brought it; null if it was issued here.

Formatuuid
verification*|

Imported documents only, how we know it is authorized, from most to least certain: sri if the SRI confirmed it at import; listed if its key appears in an SRI listing you uploaded (the Facturador report or the issued-documents one from the SRI's online portal); signature if its file carries the authorization, which nobody signs; unconfirmed if it only has the issuer's signature and nothing shows that the SRI authorized it. unconfirmed documents do not appear in the portal until you upload the listing. Except for sri, the SRI no longer remembered it (or it was imported in sandbox) and its annulment cannot be detected. null if it was issued here.

Value in"sri""listed""signature""unconfirmed"null
listing*|

With verification listed, the listing that shows it authorized and where it came from. Any listing of keys counts, so which one it was is recorded. null otherwise.

object*"document"
Value in"document"
type*"invoice"

The family: invoice, credit_note, debit_note, withholding, delivery_note or purchase_settlement. Every other operation on the document is under its path (/v1/ec/invoices/{id}/…).

Value in"invoice"
lines*array<>
taxes*array<||>
subtotal*string
discount*string
iva*string
ice*string
irbpnr*string
total*string
subsidy*string|null
tip*string
issue_date*string
Formatdate
buyer*
payments*array<>
plate*string|null
delivery_note_number*string|null
export*|null
reimbursement*|null
withholdings*array<>
withheld_iva*string|null
withheld_renta*string|null
substitute_delivery_note*|null
third_party_charges*array<>
negotiable*|null
compensations*array<>

Solidarity compensation of 2 % of the IVA (2016), only on imported documents that carry it.

fiscal_machine*|null
additional_info*array<>
credit_balance*|

Invoices only. What can still be credited: the total minus that of the credit notes that modify it and still stand (authorized or still on their way to the SRI; not the returned, not authorized or annulled ones). It never goes below zero. POST /v1/ec/credit-notes rejects a note that exceeds it. null for an invoice issued to consumidor_final, which takes no credit note (NAC-DGERCGC25-00000014, art. 3).

receivable*|

Invoices only. What it is still owed, when it was issued on credit (a payment with a term) or with collect_later. null for an invoice paid at once, for one issued to consumidor_final, who is nobody to collect from, and for imported ones.

quote_id*|

Invoices only. The quote it was issued from (POST /v1/ec/quotes/{id}/convert), whole at GET /v1/ec/quotes/{id}; null for one issued otherwise.

Formatuuid
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/documents/497f6eca-6276-4993-bfeb-53cbbbba6f08/refresh-status'
Example Response
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "country": "ec",
  "currency": "string",
  "environment": "sandbox",
  "status": "pending",
  "status_transitions": {
    "pending": "2019-08-24T14:15:22Z",
    "submitted": "2019-08-24T14:15:22Z",
    "authorized": "2019-08-24T14:15:22Z",
    "returned": "2019-08-24T14:15:22Z",
    "not_authorized": "2019-08-24T14:15:22Z",
    "annulled": "2019-08-24T14:15:22Z"
  },
  "business_id": "f59fcbb7-848d-4242-af07-a8bb7e3ab37c",
  "number": "string",
  "access_key": "stringstringstringstringstringstringstringstrings",
  "authorization": {
    "number": "string",
    "authorized_at": "2019-08-24T14:15:22Z"
  },
  "sri_messages": [
    {
      "code": "string",
      "message": "string",
      "detail": "string",
      "type": "error",
      "cause": "string",
      "remedy": "string"
    }
  ],
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "issued_at": "2019-08-24T14:15:22Z",
  "delivery_status": "sent",
  "emails": [
    {
      "to": "string",
      "status": "sent",
      "sent_at": "2019-08-24T14:15:22Z",
      "delivered_at": "2019-08-24T14:15:22Z",
      "opened_at": "2019-08-24T14:15:22Z",
      "bounced_at": "2019-08-24T14:15:22Z",
      "complained_at": "2019-08-24T14:15:22Z",
      "bounce_type": "permanent"
    }
  ],
  "portal_views": 0,
  "portal_last_viewed_at": "2019-08-24T14:15:22Z",
  "channel": "api",
  "import_id": "13230382-dadc-41f2-963d-e123bd5c0585",
  "verification": "sri",
  "listing": {
    "import_id": "13230382-dadc-41f2-963d-e123bd5c0585",
    "file": "string",
    "entry": "string",
    "sha256": "stringstringstringstringstringstringstringstringstringstringstri",
    "line": 1,
    "authorized_at": "2019-08-24T14:15:22Z"
  },
  "object": "document",
  "type": "invoice",
  "lines": [
    {
      "code": "string",
      "auxiliary_code": "string",
      "description": "string",
      "unit": "string",
      "quantity": "string",
      "unit_price": "string",
      "discount": "string",
      "net": "string",
      "taxes": [
        {
          "type": "iva",
          "rate": "iva_15",
          "base": "string",
          "value": "string"
        }
      ],
      "additional_info": [
        {
          "name": "string",
          "value": "string"
        }
      ],
      "unsubsidized_price": "string"
    }
  ],
  "taxes": [
    {
      "type": "iva",
      "rate": "iva_15",
      "base": "string",
      "value": "string",
      "additional_discount": "string",
      "refund": "string"
    }
  ],
  "subtotal": "string",
  "discount": "string",
  "iva": "string",
  "ice": "string",
  "irbpnr": "string",
  "total": "string",
  "subsidy": "string",
  "tip": "string",
  "issue_date": "2019-08-24",
  "buyer": {
    "identification_type": "ruc",
    "identification": "string",
    "name": "string",
    "address": "string",
    "email": "string"
  },
  "payments": [
    {
      "method": "sin_sistema_financiero",
      "amount": "string",
      "term": {
        "length": 0,
        "unit": "days"
      }
    }
  ],
  "plate": "string",
  "delivery_note_number": "string",
  "export": {
    "incoterm": "string",
    "incoterm_place": "string",
    "origin_country": "string",
    "loading_port": "string",
    "destination_port": "string",
    "destination_country": "string",
    "acquisition_country": "string",
    "subtotal_incoterm": "string",
    "international_freight": "string",
    "international_insurance": "string",
    "customs_costs": "string",
    "other_transport_costs": "string"
  },
  "reimbursement": {
    "document_type": "factura",
    "total": "string",
    "base": "string",
    "tax": "string",
    "documents": [
      {
        "supplier": {
          "identification_type": "ruc",
          "identification": "string"
        },
        "supplier_type": "persona_natural",
        "payment_country": "string",
        "document_type": "factura",
        "number": "string",
        "issue_date": "2019-08-24",
        "authorization_number": "string",
        "taxes": [
          {
            "type": "iva",
            "rate": "iva_15",
            "base": "string",
            "value": "string"
          }
        ],
        "compensations": [
          {
            "code": "string",
            "rate": "string",
            "value": "string"
          }
        ]
      }
    ]
  },
  "withholdings": [
    {
      "type": "iva_100",
      "value": "string"
    }
  ],
  "withheld_iva": "string",
  "withheld_renta": "string",
  "substitute_delivery_note": {
    "origin_address": "string",
    "destination_address": "string",
    "transport_start": "string",
    "transport_end": "string",
    "carrier": {
      "identification_type": "ruc",
      "identification": "string",
      "name": "string"
    },
    "plate": "string",
    "destinations": [
      {
        "reason": "string",
        "customs_document": "string",
        "destination_establishment": "string",
        "route": "string"
      }
    ]
  },
  "third_party_charges": [
    {
      "concept": "string",
      "amount": "string"
    }
  ],
  "negotiable": {
    "notification_email": "string"
  },
  "compensations": [
    {
      "code": "string",
      "rate": "string",
      "value": "string"
    }
  ],
  "fiscal_machine": {
    "brand": "string",
    "model": "string",
    "serial": "string"
  },
  "additional_info": [
    {
      "name": "string",
      "value": "string"
    }
  ],
  "credit_balance": "string",
  "receivable": {
    "object": "receivable",
    "state": "open",
    "currency": "string",
    "amount": "string",
    "collected": "string",
    "withheld": "string",
    "credited": "string",
    "balance": "string",
    "next_due_date": "2019-08-24",
    "overdue_days": 0,
    "collect_later": true,
    "installments": [
      {
        "amount": "string",
        "due_date": "2019-08-24",
        "balance": "string"
      }
    ],
    "closed_on": "2019-08-24"
  },
  "quote_id": "3c071a1d-db86-46a7-9dc8-72ba3fbca992",
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}

Email a document

POST
/v1/ec/documents/{id}/email

Queues an email with the PDF and the authorized XML. In every environment the document is already sent on its own when it is authorized, to its recipient; this send is for resending it, to its recipient or to the addresses you give.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Path Parameters

id*string
Formatuuid

Header Parameters

idempotency-key?string

Send the same key to retry safely: a repeat of the same request answers what the first answered, without doing it again. Keys are scoped to the business the call acts for and its environment; the same key with another request is 409 idempotency_key_reused.

Length1 <= length <= 255

Request Body

application/json
  1. body
to?array<>

Who to send it to. If you omit it, it goes to the recipients the document names. In Sandbox nothing is emailed: the timeline records an email_skipped per address instead.

Items1 <= items <= 10

Response Body

Queued

application/json
  1. response
object*"email"
Value in"email"
document_id*string
Formatuuid
to*array<string>
Example Request
curl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/documents/497f6eca-6276-4993-bfeb-53cbbbba6f08/email' \
  -H 'Content-Type: application/json' \
  -d '{
  "to": [
    "dev@example.com"
  ]
}'
Example Response
{
  "object": "email",
  "document_id": "b792e8ae-2cb4-4209-85b9-32be4c2fcdd6",
  "to": [
    "string"
  ]
}
GET
/v1/ec/documents/{id}/ticket

The document as a shop's receipt, for a thermal printer: everything the PDF prints, with its labels and in its order, laid out for a roll of the width and columns asked. Each line's price is before IVA, the access key prints as the digits of its number of authorization, and there is no barcode. It answers as soon as the document is numbered, without waiting for the SRI, and the SRI's time then prints once it has authorized it. A document the SRI returned or did not authorize is 409 document_not_authorized. Two things the tax law sets are kept: a purchase settlement prints two copies, for the supplier to sign, and a Sandbox document says it has no tax validity while a live one does not. text is the receipt a console shows, escpos the bytes a thermal printer takes (code page 850, one cut per copy), and pdf the roll itself, for a browser's print dialog.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Path Parameters

id*string
Formatuuid

Query Parameters

width?string

The roll's width in millimetres: 80, 48 characters a line by default (or 42, see columns), or 58, at 32. It fixes the PDF's page width.

Default"80"
Value in"58""80"
columns?string

How many characters a line holds: 48 on an 80 mm roll, 42 on the same printer set to it, 32 on a 58 mm one, which width chooses when this is left out. A width it can't have is 422.

Value in"32""42""48"
format?string

text: the ticket as plain text, one line as printed and each copy after a form feed, which the console's ticket shows. escpos: the same lines as ESC/POS bytes on code page 850, for a thermal printer, each copy cut. pdf: the same lines as a PDF the width of the roll and as long as its lines, which the browser's print dialog prints.

Default"text"
Value in"text""escpos""pdf"
cashier?string

The first name of whoever sold it, for "Atendido por". Left out when a key issued it and nobody did.

Lengthlength <= 40
received?string

The cash the buyer handed over, for "Recibido" and "Cambio": it prints only when it covers what is paid in cash, and never on a delivery note.

Match^\d{1,10}(?<cents>\.\d{1,2})?$

Response Body

The ticket, as text, ESC/POS bytes or a PDF

response?file
Formatbinary
Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/ec/documents/497f6eca-6276-4993-bfeb-53cbbbba6f08/ticket'
Example Response
"string"

Download the authorized XML

GET
/v1/ec/documents/{id}/xml

The SRI autorizacion with the signed document inside, the same as the download from the SRI portal.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Path Parameters

id*string
Formatuuid

Response Body

The file

response?fileapplication/xml
Formatbinary
Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/ec/documents/497f6eca-6276-4993-bfeb-53cbbbba6f08/xml'
Example Response
"string"

Download the PDF

GET
/v1/ec/documents/{id}/pdf

The printed representation, on A4. In sandbox and test it carries a watermark: it has no tax validity.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Path Parameters

id*string
Formatuuid

Response Body

The file

response?fileapplication/pdf
Formatbinary
Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/ec/documents/497f6eca-6276-4993-bfeb-53cbbbba6f08/pdf'
Example Response
"string"

How the SRI is answering

GET
/v1/ec/sri/status

Whether the SRI is slow to receive or decide your documents in the key's environment right now, so a client deciding whether to wait or retry knows. Read from your own documents in one pass; the SRI is never asked.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Response Body

The SRI's state

application/json
  1. response
object*"sri_status"
Value in"sri_status"
environment*string
Value in"sandbox""test""live"
status*string

slow when one of your documents has waited more than 5 minutes for the SRI to receive it or more than 10 for its decision; ok otherwise. Judged by your own documents in the environment, not by asking the SRI.

Value in"ok""slow"
waiting_reception*integer

Your documents the SRI hasn't received yet (pending).

waiting_decision*integer

Your documents the SRI received and hasn't decided yet (submitted).

oldest_waiting_since*|

When the document that has waited longest started waiting; null when none waits.

Formatdate-time
Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/ec/sri/status'
Example Response
{
  "object": "sri_status",
  "environment": "sandbox",
  "status": "ok",
  "waiting_reception": 0,
  "waiting_decision": 0,
  "oldest_waiting_since": "2019-08-24T14:15:22Z"
}

List the held sales

GET
/v1/ec/held-documents

The live sales of your key's business refused at the month's quota (402 plan_quota_reached, with their held_document_id) that still wait, and those that failed once there was room, newest first. Nothing is charged above a plan: a held sale issues by itself, oldest first, once there is room, after the business moves to a plan with more documents or when the quota starts again on the first of the month.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Query Parameters

limit?integer

How many per page, from 1 to 100.

Range1 <= value <= 100
Default20
cursor?string

The next_cursor or prev_cursor of a previous response. Without a cursor, the first page.

Lengthlength <= 200
created_at[gte]?string

Only what was created at or after this moment, ISO 8601 with its offset.

Formatdate-time
created_at[lte]?string

Only what was created at or before this moment, ISO 8601 with its offset.

Formatdate-time
updated_at[gte]?string

Only what last changed at or after this moment, ISO 8601 with its offset: poll with the time of your last read to get what changed since.

Formatdate-time
updated_at[lte]?string

Only what last changed at or before this moment, ISO 8601 with its offset.

Formatdate-time

Response Body

The held sales

application/json
  1. response
object*"list"
Value in"list"
data*array<>
next_cursor*|

The next page (older); null if there are no more.

prev_cursor*|

The previous page (newer); null on the first.

Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/ec/held-documents'
Example Response
{
  "object": "list",
  "data": [
    {
      "object": "held_document",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "business_id": "f59fcbb7-848d-4242-af07-a8bb7e3ab37c",
      "environment": "live",
      "type": "invoice",
      "status": "held",
      "channel": "api",
      "request": {
        "property1": null,
        "property2": null
      },
      "document_id": "b792e8ae-2cb4-4209-85b9-32be4c2fcdd6",
      "failure": {
        "code": "string",
        "message": "string",
        "params": {
          "property1": "string",
          "property2": "string"
        }
      },
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "next_cursor": "string",
  "prev_cursor": "string"
}

Retrieve a held sale

GET
/v1/ec/held-documents/{id}

One held sale of your key's business in whatever state it is in. Unlike the list, which keeps to those that wait or failed, it also answers one that issued, with the document_id it became, or was discarded.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Path Parameters

id*string
Formatuuid

Response Body

The held sale

application/json
  1. response
object*"held_document"
Value in"held_document"
id*string
Formatuuid
business_id*string
Formatuuid
environment*"live"

Always live: a sale is held only where the plan's quota counts.

Value in"live"
type*string

The document it issues as: invoice, credit_note…

Value in"invoice""credit_note""debit_note""withholding""delivery_note""purchase_settlement"
status*string

held: waiting for room in the month's quota; issued: it became document_id; discarded: someone discarded it; failed: once there was room, issuing it was refused for another reason, which failure names.

Value in"held""issued""discarded""failed"
channel*string
Value in"api""console"
request*

The request as it was sent: it issues as it is, dated the day it issues.

document_id*|
Formatuuid
failure*|

Why issuing it was refused, when it failed.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/ec/held-documents/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
{
  "object": "held_document",
  "id": "01a21860-2f2f-7a3d-8ebd-f21705bc6501",
  "business_id": "01a21860-2f05-786e-a3a6-c88f8d0d6269",
  "environment": "live",
  "type": "invoice",
  "status": "held",
  "channel": "api",
  "request": {
    "buyer": {
      "name": "FERRETERÍA EL SOL S.A.",
      "email": "compras@elsol.ec",
      "address": "Av. 10 de Agosto N21-44, Quito",
      "identification": "1790012345001",
      "identification_type": "ruc"
    },
    "lines": [
      {
        "code": "SKU-1",
        "taxes": [
          {
            "rate": "iva_15",
            "type": "iva"
          }
        ],
        "discount": "0",
        "quantity": "2",
        "unit_price": "120.00",
        "description": "Taladro percutor",
        "additional_info": []
      },
      {
        "code": "SKU-1",
        "taxes": [
          {
            "rate": "iva_0",
            "type": "iva"
          }
        ],
        "discount": "0",
        "quantity": "2",
        "unit_price": "4.50",
        "description": "Guantes",
        "additional_info": []
      }
    ],
    "metadata": {},
    "payments": [
      {
        "term": {
          "unit": "days",
          "length": 30
        },
        "method": "tarjeta_credito"
      }
    ],
    "establishment": "001",
    "emission_point": "001",
    "additional_info": [
      {
        "name": "Orden de compra",
        "value": "OC-1041"
      }
    ]
  },
  "document_id": null,
  "failure": null,
  "created_at": "2026-11-26T15:01:26.446Z",
  "updated_at": "2026-11-26T15:01:26.446Z"
}

Discard a held sale

POST
/v1/ec/held-documents/{id}/discard

Discards a sale that waits or failed: it never issues. Retrying its request with the same Idempotency-Key holds it again, or issues it when there is room.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Path Parameters

id*string
Formatuuid

Header Parameters

idempotency-key?string

Send the same key to retry safely: a repeat of the same request answers what the first answered, without doing it again. Keys are scoped to the business the call acts for and its environment; the same key with another request is 409 idempotency_key_reused.

Length1 <= length <= 255

Response Body

Discarded

application/json
  1. response
object*"held_document"
Value in"held_document"
id*string
Formatuuid
business_id*string
Formatuuid
environment*"live"

Always live: a sale is held only where the plan's quota counts.

Value in"live"
type*string

The document it issues as: invoice, credit_note…

Value in"invoice""credit_note""debit_note""withholding""delivery_note""purchase_settlement"
status*string

held: waiting for room in the month's quota; issued: it became document_id; discarded: someone discarded it; failed: once there was room, issuing it was refused for another reason, which failure names.

Value in"held""issued""discarded""failed"
channel*string
Value in"api""console"
request*

The request as it was sent: it issues as it is, dated the day it issues.

document_id*|
Formatuuid
failure*|

Why issuing it was refused, when it failed.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/held-documents/497f6eca-6276-4993-bfeb-53cbbbba6f08/discard'
Example Response
{
  "object": "held_document",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "business_id": "f59fcbb7-848d-4242-af07-a8bb7e3ab37c",
  "environment": "live",
  "type": "invoice",
  "status": "held",
  "channel": "api",
  "request": {
    "property1": null,
    "property2": null
  },
  "document_id": "b792e8ae-2cb4-4209-85b9-32be4c2fcdd6",
  "failure": {
    "code": "string",
    "message": "string",
    "params": {
      "property1": "string",
      "property2": "string"
    }
  },
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}