Ir al contenido

API de importaciones

List imports

GET
/v1/ec/imports

Your key's business's imports in its environment, from newest to oldest.

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?string
Value in"queued""processing""completed""failed""canceled"
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 imports

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/imports'
Example Response
{
  "object": "list",
  "data": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "object": "import",
      "country": "ec",
      "environment": "sandbox",
      "business_id": "f59fcbb7-848d-4242-af07-a8bb7e3ab37c",
      "status": "queued",
      "status_transitions": {
        "queued": "2019-08-24T14:15:22Z",
        "processing": "2019-08-24T14:15:22Z",
        "completed": "2019-08-24T14:15:22Z",
        "failed": "2019-08-24T14:15:22Z",
        "canceled": "2019-08-24T14:15:22Z"
      },
      "files": [
        {
          "name": "string",
          "kind": "xml",
          "size": 0,
          "sha256": "string",
          "ignored_entries": 0
        }
      ],
      "counts": {
        "found": 0,
        "pending": 0,
        "imported": 0,
        "duplicate": 0,
        "received": 0,
        "skipped": 0,
        "failed": 0
      },
      "verification": {
        "sri": 0,
        "listed": 0,
        "signature": 0,
        "unconfirmed": 0
      },
      "currency": "string",
      "sales_total": "string",
      "upgraded": {
        "signature": 0,
        "unconfirmed": 0
      },
      "numbering": [
        {
          "series_id": "0f6582ac-1e7e-41dc-a63a-24fccd074d0c",
          "type": "invoice",
          "establishment": "string",
          "emission_point": "string",
          "highest_imported": 0,
          "highest_reserved": 0,
          "next_number": 0,
          "active": true,
          "created": true
        }
      ],
      "failure": {
        "code": "unreadable_archive",
        "message": "string"
      },
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "next_cursor": "string",
  "prev_cursor": "string"
}

Import documents

POST
/v1/ec/imports

Upload your key's business's authorized documents as multipart/form-data, or as JSON with each file in base64 for a client that can't send a form: XML, ZIP or the SRI's key listings, issued and received alike. What the business issued (its history from a previous system) becomes its documents, its numbering moving past them; what another RUC issued to it goes to its received documents (received), in live, checked against the issuer's signature and the SRI, or in sandbox, where any well-formed XML addressed to the business is kept unchecked, as unconfirmed and with no tax validity. They are stored and queued: it answers 201 with the import in queued. Retrieve it or wait for the import.completed event. The same files while their import is still running return that import with 200, and a repeated Idempotency-Key answers the first response again.

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.

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

  1. body
file*array<>

From 1 to 20 files: authorized or merely signed XML (like those the SRI's Facturador downloads), ZIPs of XML, or text with access keys (the Facturador listing or the issued-documents report from the SRI's online portal, saved as text or CSV). A listed key confirms the signed XML of that key, in this import or an earlier one. A PDF will not do: it proves nothing. Neither will an Excel sheet: save it as CSV.

Response Body

The running import of the same files

application/json
  1. response
id*string
Formatuuid
object*"import"
Value in"import"
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"
environment*string
Value in"sandbox""test""live"
business_id*string
Formatuuid
status*string

queued until the files are read, processing while each document is decided, then completed. failed if the files could not be used; canceled if you canceled it.

Value in"queued""processing""completed""failed""canceled"
status_transitions*

When the import reached each status.

files*array<>
counts*

Documents by result: pending + imported + duplicate + received + skipped + failed = found.

verification*

The imported documents by what shows they are authorized, as this import decided: the SRI (sri), an SRI listing uploaded with them (listed), the authorization their file carries (signature) or nothing more than the issuer's signature (unconfirmed). They add up to counts.imported. A listing uploaded later upgrades them on their document, not here.

currency*string

The currency of sales_total.

Match^[A-Z]{3}$
sales_total*string

Sales in the documents this import brought, with cents: authorized invoices and debit notes minus credit notes. Those that were already there do not count. Withholdings, delivery notes and purchase settlements do not add up.

upgraded*

Documents imported earlier that this import's listings confirmed: they are now listed, counted by what they had (signature or unconfirmed). They are part of counts.duplicate, with the code evidence_added; the unconfirmed ones among them now appear in the portal.

numbering*array<>

Each series in which the import found used numbers. Numbering continues after the highest one, imported or reserved: uploading the SRI's issued-documents report is enough to continue the numbering, even if their XML can no longer be imported.

failure*|null
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/imports' \
  -H 'Content-Type: application/json' \
  -d '{
  "files": [
    {
      "name": "string",
      "content_base64": "string"
    }
  ]
}'
Example Response
{
  "id": "01a21860-67ab-710e-b927-f9b7c62743cd",
  "object": "import",
  "country": "ec",
  "environment": "test",
  "business_id": "01a21860-6770-76ca-b6ce-a581018e8e0f",
  "status": "queued",
  "status_transitions": {
    "queued": "2026-11-26T15:01:45.065Z"
  },
  "files": [
    {
      "name": "2025/factura.xml",
      "kind": "xml",
      "size": 8124,
      "sha256": "23dae343dbe4e2fb73524ee71183b4e73045ee632273a071481e188164510a62",
      "ignored_entries": 0
    },
    {
      "name": "notas.txt",
      "kind": "keys",
      "size": 10,
      "sha256": "ed942238acadadc9deb753400742f352a1fee16dc33bf97fa5965cc0fd40b72f",
      "ignored_entries": 0
    }
  ],
  "counts": {
    "found": 0,
    "pending": 0,
    "imported": 0,
    "duplicate": 0,
    "received": 0,
    "skipped": 0,
    "failed": 0
  },
  "verification": {
    "sri": 0,
    "listed": 0,
    "signature": 0,
    "unconfirmed": 0
  },
  "currency": "USD",
  "sales_total": "0.00",
  "upgraded": {
    "signature": 0,
    "unconfirmed": 0
  },
  "numbering": [],
  "failure": null,
  "created_at": "2026-11-26T15:01:40.911Z",
  "updated_at": "2026-11-26T15:01:40.911Z"
}

Retrieve an import

GET
/v1/ec/imports/{id}

The import with its status, the files you uploaded and how many documents were found, imported, repeated, skipped or failed. To see what happened to each one, use GET /v1/ec/imports/{id}/items.

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 import

application/json
  1. response
id*string
Formatuuid
object*"import"
Value in"import"
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"
environment*string
Value in"sandbox""test""live"
business_id*string
Formatuuid
status*string

queued until the files are read, processing while each document is decided, then completed. failed if the files could not be used; canceled if you canceled it.

Value in"queued""processing""completed""failed""canceled"
status_transitions*

When the import reached each status.

files*array<>
counts*

Documents by result: pending + imported + duplicate + received + skipped + failed = found.

verification*

The imported documents by what shows they are authorized, as this import decided: the SRI (sri), an SRI listing uploaded with them (listed), the authorization their file carries (signature) or nothing more than the issuer's signature (unconfirmed). They add up to counts.imported. A listing uploaded later upgrades them on their document, not here.

currency*string

The currency of sales_total.

Match^[A-Z]{3}$
sales_total*string

Sales in the documents this import brought, with cents: authorized invoices and debit notes minus credit notes. Those that were already there do not count. Withholdings, delivery notes and purchase settlements do not add up.

upgraded*

Documents imported earlier that this import's listings confirmed: they are now listed, counted by what they had (signature or unconfirmed). They are part of counts.duplicate, with the code evidence_added; the unconfirmed ones among them now appear in the portal.

numbering*array<>

Each series in which the import found used numbers. Numbering continues after the highest one, imported or reserved: uploading the SRI's issued-documents report is enough to continue the numbering, even if their XML can no longer be imported.

failure*|null
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/ec/imports/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
{
  "id": "01a21860-67ab-710e-b927-f9b7c62743cd",
  "object": "import",
  "country": "ec",
  "environment": "test",
  "business_id": "01a21860-6770-76ca-b6ce-a581018e8e0f",
  "status": "completed",
  "status_transitions": {
    "queued": "2026-11-26T15:01:45.065Z",
    "completed": "2026-11-26T15:01:45.135Z",
    "processing": "2026-11-26T15:01:45.087Z"
  },
  "files": [
    {
      "name": "2025/factura.xml",
      "kind": "xml",
      "size": 8124,
      "sha256": "23dae343dbe4e2fb73524ee71183b4e73045ee632273a071481e188164510a62",
      "ignored_entries": 0
    },
    {
      "name": "notas.txt",
      "kind": "keys",
      "size": 10,
      "sha256": "ed942238acadadc9deb753400742f352a1fee16dc33bf97fa5965cc0fd40b72f",
      "ignored_entries": 0
    }
  ],
  "counts": {
    "found": 1,
    "pending": 0,
    "imported": 1,
    "duplicate": 0,
    "received": 0,
    "skipped": 0,
    "failed": 0
  },
  "verification": {
    "sri": 0,
    "listed": 0,
    "signature": 1,
    "unconfirmed": 0
  },
  "currency": "USD",
  "sales_total": "285.00",
  "upgraded": {
    "signature": 0,
    "unconfirmed": 0
  },
  "numbering": [
    {
      "series_id": "01a21860-6778-70d4-a5dd-37ccd25e7076",
      "type": "invoice",
      "establishment": "001",
      "emission_point": "001",
      "highest_imported": 4812,
      "highest_reserved": 0,
      "next_number": 4813,
      "active": true,
      "created": false
    }
  ],
  "failure": null,
  "created_at": "2026-11-26T15:01:40.911Z",
  "updated_at": "2026-11-26T15:01:45.135Z"
}

List an import's documents

GET
/v1/ec/imports/{id}/items

One per document found, from newest to oldest. Filter by result=skipped or result=failed to see those that need attention.

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
result?string
Value in"pending""imported""duplicate""received""skipped""failed"
code?string
Value in"confirmed_by_sri""annulment_pending""listed_by_sri""signature_only""issuer_signature_only""already_exists""evidence_added""received""no_received_documents_in_test""wrong_environment""unsupported_version""annulled""not_authorized""no_sri_in_sandbox""canceled""unreadable_xml""not_a_document""unknown_code""entry_too_large""invalid_access_key""invalid_signature""certificate_mismatch""certificate_expired""authorization_mismatch""unknown_to_sri""xml_unavailable""number_taken""not_importable""sri_unavailable"
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 documents found

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/imports/497f6eca-6276-4993-bfeb-53cbbbba6f08/items'
Example Response
{
  "object": "list",
  "data": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "object": "import_item",
      "import_id": "13230382-dadc-41f2-963d-e123bd5c0585",
      "file": "string",
      "entry": "string",
      "line": 0,
      "access_key": "string",
      "type": "invoice",
      "number": "string",
      "issue_date": "2019-08-24",
      "result": "pending",
      "code": "confirmed_by_sri",
      "message": "string",
      "params": {
        "property1": "string",
        "property2": "string"
      },
      "verification": "sri",
      "document_id": "b792e8ae-2cb4-4209-85b9-32be4c2fcdd6",
      "received_code": "string",
      "received_document": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "arrived_before": true,
        "xml_status": "available"
      },
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "next_cursor": "string",
  "prev_cursor": "string"
}

Cancel an import

POST
/v1/ec/imports/{id}/cancel

Stops a queued or processing import: what is not yet decided becomes skipped with canceled, and what was already imported stays.

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

Canceled

application/json
  1. response
id*string
Formatuuid
object*"import"
Value in"import"
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"
environment*string
Value in"sandbox""test""live"
business_id*string
Formatuuid
status*string

queued until the files are read, processing while each document is decided, then completed. failed if the files could not be used; canceled if you canceled it.

Value in"queued""processing""completed""failed""canceled"
status_transitions*

When the import reached each status.

files*array<>
counts*

Documents by result: pending + imported + duplicate + received + skipped + failed = found.

verification*

The imported documents by what shows they are authorized, as this import decided: the SRI (sri), an SRI listing uploaded with them (listed), the authorization their file carries (signature) or nothing more than the issuer's signature (unconfirmed). They add up to counts.imported. A listing uploaded later upgrades them on their document, not here.

currency*string

The currency of sales_total.

Match^[A-Z]{3}$
sales_total*string

Sales in the documents this import brought, with cents: authorized invoices and debit notes minus credit notes. Those that were already there do not count. Withholdings, delivery notes and purchase settlements do not add up.

upgraded*

Documents imported earlier that this import's listings confirmed: they are now listed, counted by what they had (signature or unconfirmed). They are part of counts.duplicate, with the code evidence_added; the unconfirmed ones among them now appear in the portal.

numbering*array<>

Each series in which the import found used numbers. Numbering continues after the highest one, imported or reserved: uploading the SRI's issued-documents report is enough to continue the numbering, even if their XML can no longer be imported.

failure*|null
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/imports/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel'
Example Response
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "object": "import",
  "country": "ec",
  "environment": "sandbox",
  "business_id": "f59fcbb7-848d-4242-af07-a8bb7e3ab37c",
  "status": "queued",
  "status_transitions": {
    "queued": "2019-08-24T14:15:22Z",
    "processing": "2019-08-24T14:15:22Z",
    "completed": "2019-08-24T14:15:22Z",
    "failed": "2019-08-24T14:15:22Z",
    "canceled": "2019-08-24T14:15:22Z"
  },
  "files": [
    {
      "name": "string",
      "kind": "xml",
      "size": 0,
      "sha256": "string",
      "ignored_entries": 0
    }
  ],
  "counts": {
    "found": 0,
    "pending": 0,
    "imported": 0,
    "duplicate": 0,
    "received": 0,
    "skipped": 0,
    "failed": 0
  },
  "verification": {
    "sri": 0,
    "listed": 0,
    "signature": 0,
    "unconfirmed": 0
  },
  "currency": "string",
  "sales_total": "string",
  "upgraded": {
    "signature": 0,
    "unconfirmed": 0
  },
  "numbering": [
    {
      "series_id": "0f6582ac-1e7e-41dc-a63a-24fccd074d0c",
      "type": "invoice",
      "establishment": "string",
      "emission_point": "string",
      "highest_imported": 0,
      "highest_reserved": 0,
      "next_number": 0,
      "active": true,
      "created": true
    }
  ],
  "failure": {
    "code": "unreadable_archive",
    "message": "string"
  },
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z"
}