API de facturas
An invoice ("factura") records a sale. Its body needs the buyer (identified by ruc, cedula, pasaporte or exterior, or consumidor_final for a sale of at most USD 50), the lines, each with its taxes (one iva, and an ice or irbpnr where they apply), and the payments, which add up to the total (a single payment may leave out its amount). Fiscalbase computes every total from the lines. Look up codes with GET /v1/ec/catalogs/{table} (payment_methods, iva_rates, ice). To cancel or reduce an invoice later, issue a credit note; to add charges, a debit note.
Issuing numbers the document, stores it and queues it to be signed and sent to the SRI, all at once: the issue date is today in Ecuador. The status then advances on its own (pending, submitted, then authorized, returned or not_authorized): the SRI's decision arrives on the event stream (GET /v1/events) and as a webhook, and retrieving the document shows it. A refused document says why in sri_messages, each with its remedy. Check the body first with POST /v1/ec/invoices/preview, which spends no number, and pass its preview_id to issue exactly what was previewed. The Idempotency-Key header is required (422 idempotency_key_required without it): a retry with the same key and body answers the first response, status included, without numbering another document.
apiKeyAuthorizationBearer <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.
preview_id?stringThe preview_id of POST /v1/ec/invoices/preview for this same body: if the body isn't the one previewed, or the preview is from an earlier day, nothing is issued and the answer is 409 preview_mismatch.
^[0-9a-f]{64}$idempotency-key*stringRequired. 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.
1 <= length <= 255Fiscalbase-Emission-Point?stringThe emission point (GET /v1/ec/emission-points) the documents this call issues are numbered at, when their body names no establishment or emission_point. One the business lacks in the call's environment is 422 emission_point_not_found. It beats the key's default emission point.
uuidapplication/json- body
The issue date is always today in Ecuador: documents are transmitted when issued.
buyer*||||lines*array<>1 <= itemspayments*array<>1 <= itemsplate?stringVehicle plate (placa): of the commercial transport service (tabla 33), three letters and four digits such as PCM4567, or of the vehicle fuel was dispatched to (tabla 29), ZZZ9999 when there is none. No spaces, stored in capitals.
^[A-Z0-9-]{1,20}$tip?stringTip (propina), up to 10 % of the subtotal before taxes. It adds to the total.
^\d+(\.\d{1,2})?$delivery_note_number?stringNumber of the delivery note that accompanies the goods (guiaRemision).
^\d{3}-\d{3}-\d{9}$export?Export invoice (annex 4). The buyer needs an address.
reimbursement?Expense reimbursement (annex 5): the documents being reimbursed. We compute their totals.
withholdings?array<>Withholdings the invoice itself declares (retenciones, tablas 22 and 23): fuel marketers and press.
substitute_delivery_note?Invoice that replaces a delivery note (annex 9): the transfer of the goods it sells.
third_party_charges?array<>Other third-party items (annex 8): amounts you collect on behalf of third parties. They aren't part of the invoice's total.
negotiable?Negotiable commercial document (annex 11): requires the counterparty's address and a term on each payment.
additional_discounts?array<>Additional discount on the IVA base of a rate (descuentoAdicional), applied after the lines: the IVA of that rate is computed on the base minus the discount.
iva_refunds?array<>IVA refunded to an older adult (valorDevolucionIva, annex 20), by rate, as the SRI's DIG service authorized it. It is subtracted from the total; the buyer must identify with a cedula.
fiscal_machine?The fiscal machine the document is issued from (annex 13). Only when one issues it.
additional_info?array<>Your fields on the PDF.
Free fields the PDF prints (campoAdicional), such as a purchase order or a delivery address: each a name and a value of up to 300 characters, no name repeated. A document holds 15 in all, and Fiscalbase writes some of them after yours: Email, the counterparty's email, on every document but a delivery note (a consumidor_final buyer's is the fixed address); Gran Contribuyente, the business's resolution when it declared one, on invoices, purchase settlements and credit and debit notes (annex 24); and RUC Proveedor, the RUC of Fiscalbase as the invoicing system's provider (annex 26), on every document. So an invoice takes 13 of yours, 12 from a gran contribuyente, and a delivery note 14. One of those names in yours is additional_info_reserved_name, and a list that doesn't fit beside them, additional_info_overflow, which says how many fit.
[]establishment?stringThe establishment whose series numbers it, such as 001. Without it, the first active series of the document type.
^\d{3}$emission_point?stringThe emission point of that establishment, such as 001. Without it, the first active one.
^\d{3}$allow_negative_stock?booleanSell even what the establishment doesn't hold, when the business refuses a sale its stock can't cover (block). Only a key with full permission, or a person whose role adjusts inventory. Without it, such a sale is 409 insufficient_stock before a number is taken.
collect_later?booleanTrack this invoice as owed although it is paid at once: its whole total is due on its issue date, and receivable follows what is collected. The document sent to the SRI doesn't change. An invoice with a payment term is tracked by its terms, with or without it. Refused for consumidor_final (422 credit_requires_buyer).
metadata?Up to 20 pairs of your own, such as your order id, returned as sent and never interpreted; lists filter by them (metadata[key]=value).
{}deliver_to?Where the buyer gets the document. It is kept with the request, a held sale's too, and an authorized document's email goes to email as well as to the addresses the document names.
simulate?Only with a sandbox key (422 in test and live, where the SRI decides): the outcome the simulator gives this revision, to rehearse how your system handles each one. Without it, it is authorized.
Accepted and numbered; a repeat with the same Idempotency-Key answers the same
application/json- response
id*stringuuidcountry*"ec"The country, as its lowercase ISO 3166-1 alpha-2 code, the same as in the path (/v1/ec/…). New countries may appear.
"ec"currency*stringThe currency of the amounts, as its ISO 4217 code. New currencies may appear.
^[A-Z]{3}$environment*string"sandbox""test""live"status*string"pending""submitted""authorized""returned""not_authorized""annulled"status_transitions*When the document last reached each status.
business_id*stringuuidnumber*stringaccess_key*string49 <= length <= 49authorization*|nullsri_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.
date-timedelivery_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.
"sent""delivered""opened""bounced""complained"nullemails*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*integerHow 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.
date-timechannel*stringHow 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.
"api""console""imported"import_id*|The import that brought it; null if it was issued here.
uuidverification*|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.
"sri""listed""signature""unconfirmed"nulllisting*|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""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}/…).
"invoice"lines*array<>taxes*array<||>subtotal*stringdiscount*stringiva*stringice*stringirbpnr*stringtotal*stringsubsidy*string|nulltip*stringissue_date*stringdatebuyer*payments*array<>plate*string|nulldelivery_note_number*string|nullexport*|nullreimbursement*|nullwithholdings*array<>withheld_iva*string|nullwithheld_renta*string|nullsubstitute_delivery_note*|nullthird_party_charges*array<>negotiable*|nullcompensations*array<>Solidarity compensation of 2 % of the IVA (2016), only on imported documents that carry it.
fiscal_machine*|nulladditional_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.
uuidcreated_at*stringdate-timeupdated_at*stringdate-timecurl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/invoices' \
-H 'idempotency-key: string' \
-H 'Content-Type: application/json' \
-d '{
"buyer": {
"identification_type": "ruc",
"identification": "1790012345001",
"name": "FERRETERÍA EL SOL S.A.",
"address": "Av. 10 de Agosto N21-44, Quito",
"email": "compras@elsol.ec"
},
"lines": [
{
"code": "SKU-1",
"description": "Taladro percutor",
"quantity": "2",
"unit_price": "120.00",
"taxes": [
{
"type": "iva",
"rate": "iva_15"
}
]
},
{
"code": "SKU-1",
"description": "Guantes",
"quantity": "2",
"unit_price": "4.50",
"taxes": [
{
"type": "iva",
"rate": "iva_0"
}
]
}
],
"payments": [
{
"method": "tarjeta_credito",
"term": {
"length": 30,
"unit": "days"
}
}
],
"additional_info": [
{
"name": "Orden de compra",
"value": "OC-1041"
}
]
}'{
"id": "01a21860-2db9-771e-905e-888ddbde0f06",
"object": "document",
"type": "invoice",
"country": "ec",
"currency": "USD",
"environment": "live",
"status": "pending",
"status_transitions": {
"pending": "2026-11-26T15:01:30.224Z"
},
"business_id": "01a21860-2c42-7b55-b7a2-3a8727be9d45",
"number": "001-001-000000001",
"access_key": "2611202601179214673900120010010000000014953230811",
"authorization": null,
"sri_messages": [],
"metadata": {},
"channel": "api",
"import_id": null,
"verification": null,
"listing": null,
"issued_at": "2026-11-26T15:01:26.067Z",
"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.067Z",
"updated_at": "2026-11-26T15:01:26.067Z",
"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
}Checks the body of POST /v1/ec/invoices and computes the document as it would be issued today, without numbering, storing or sending anything. What is wrong with the body is refused with 422, as issuing would refuse it; what would stop issuing it right now (no plan, certificate or numbering, a business not live yet, the month's quota used up) comes back in warnings. Pass its preview_id to POST /v1/ec/invoices?preview_id=… to issue exactly this body.
apiKeyAuthorizationBearer <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.
Fiscalbase-Emission-Point?stringThe emission point (GET /v1/ec/emission-points) the documents this call issues are numbered at, when their body names no establishment or emission_point. One the business lacks in the call's environment is 422 emission_point_not_found. It beats the key's default emission point.
uuidapplication/json- body
The issue date is always today in Ecuador: documents are transmitted when issued.
buyer*||||lines*array<>1 <= itemspayments*array<>1 <= itemsplate?stringVehicle plate (placa): of the commercial transport service (tabla 33), three letters and four digits such as PCM4567, or of the vehicle fuel was dispatched to (tabla 29), ZZZ9999 when there is none. No spaces, stored in capitals.
^[A-Z0-9-]{1,20}$tip?stringTip (propina), up to 10 % of the subtotal before taxes. It adds to the total.
^\d+(\.\d{1,2})?$delivery_note_number?stringNumber of the delivery note that accompanies the goods (guiaRemision).
^\d{3}-\d{3}-\d{9}$export?Export invoice (annex 4). The buyer needs an address.
reimbursement?Expense reimbursement (annex 5): the documents being reimbursed. We compute their totals.
withholdings?array<>Withholdings the invoice itself declares (retenciones, tablas 22 and 23): fuel marketers and press.
substitute_delivery_note?Invoice that replaces a delivery note (annex 9): the transfer of the goods it sells.
third_party_charges?array<>Other third-party items (annex 8): amounts you collect on behalf of third parties. They aren't part of the invoice's total.
negotiable?Negotiable commercial document (annex 11): requires the counterparty's address and a term on each payment.
additional_discounts?array<>Additional discount on the IVA base of a rate (descuentoAdicional), applied after the lines: the IVA of that rate is computed on the base minus the discount.
iva_refunds?array<>IVA refunded to an older adult (valorDevolucionIva, annex 20), by rate, as the SRI's DIG service authorized it. It is subtracted from the total; the buyer must identify with a cedula.
fiscal_machine?The fiscal machine the document is issued from (annex 13). Only when one issues it.
additional_info?array<>Your fields on the PDF.
Free fields the PDF prints (campoAdicional), such as a purchase order or a delivery address: each a name and a value of up to 300 characters, no name repeated. A document holds 15 in all, and Fiscalbase writes some of them after yours: Email, the counterparty's email, on every document but a delivery note (a consumidor_final buyer's is the fixed address); Gran Contribuyente, the business's resolution when it declared one, on invoices, purchase settlements and credit and debit notes (annex 24); and RUC Proveedor, the RUC of Fiscalbase as the invoicing system's provider (annex 26), on every document. So an invoice takes 13 of yours, 12 from a gran contribuyente, and a delivery note 14. One of those names in yours is additional_info_reserved_name, and a list that doesn't fit beside them, additional_info_overflow, which says how many fit.
[]establishment?stringThe establishment whose series numbers it, such as 001. Without it, the first active series of the document type.
^\d{3}$emission_point?stringThe emission point of that establishment, such as 001. Without it, the first active one.
^\d{3}$allow_negative_stock?booleanSell even what the establishment doesn't hold, when the business refuses a sale its stock can't cover (block). Only a key with full permission, or a person whose role adjusts inventory. Without it, such a sale is 409 insufficient_stock before a number is taken.
collect_later?booleanTrack this invoice as owed although it is paid at once: its whole total is due on its issue date, and receivable follows what is collected. The document sent to the SRI doesn't change. An invoice with a payment term is tracked by its terms, with or without it. Refused for consumidor_final (422 credit_requires_buyer).
metadata?Up to 20 pairs of your own, such as your order id, returned as sent and never interpreted; lists filter by them (metadata[key]=value).
{}deliver_to?Where the buyer gets the document. It is kept with the request, a held sale's too, and an authorized document's email goes to email as well as to the addresses the document names.
simulate?Only with a sandbox key (422 in test and live, where the SRI decides): the outcome the simulator gives this revision, to rehearse how your system handles each one. Without it, it is authorized.
The document as it would be issued
application/json- response
object*"document_preview""document_preview"type*"invoice""invoice"preview_id*stringWhat this preview vouches for: the body, its type and today's date, hashed. Send it as preview_id when issuing to make sure the document issued is the one previewed.
64 <= length <= 64environment*string"sandbox""test""live"business_id*stringThe business that would issue it.
uuidissue_date*stringToday in Ecuador: the date it would carry.
datecurrency*stringThe ISO 4217 code of its amounts' currency.
total*|What it would total; null on a delivery note, which has no amounts.
tax_total*|The IVA it would charge; null on a withholding and a delivery note.
warnings*array<>What would stop issuing it right now, though the body is fine. Empty when it can be issued.
document*The document as it would be calculated: the same fields an issued one carries after its envelope.
curl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/invoices/preview' \
-H 'Content-Type: application/json' \
-d '{
"buyer": {
"identification_type": "ruc",
"identification": "1790012345001",
"name": "FERRETERÍA EL SOL S.A.",
"address": "Av. 10 de Agosto N21-44, Quito",
"email": "compras@elsol.ec"
},
"lines": [
{
"description": "Taladro",
"quantity": "0",
"unit_price": "9999999999999",
"taxes": [
{
"type": "iva",
"rate": "iva_15"
}
]
}
],
"payments": [
{
"method": "tarjeta_credito",
"term": {
"length": 30,
"unit": "days"
}
}
],
"additional_info": [
{
"name": "Orden de compra",
"value": "OC-1041"
}
]
}'{
"object": "document_preview",
"type": "invoice",
"preview_id": "5d7e4021f6961b6ee946cc91ba370849dc446684c7a21ac3bf50ba108ea75861",
"environment": "sandbox",
"business_id": "01a21860-61d0-7fa6-86af-276f3c20223e",
"issue_date": "2026-11-26",
"currency": "USD",
"total": "0.00",
"tax_total": "0.00",
"warnings": [],
"document": {
"issue_date": "2026-11-26",
"buyer": {
"identification_type": "ruc",
"identification": "1790012345001",
"name": "FERRETERÍA EL SOL S.A.",
"address": "Av. 10 de Agosto N21-44, Quito",
"email": "compras@elsol.ec"
},
"lines": [
{
"code": null,
"auxiliary_code": null,
"description": "Taladro",
"unit": null,
"quantity": "0",
"unit_price": "9999999999999",
"unsubsidized_price": null,
"discount": "0.00",
"net": "0.00",
"taxes": [
{
"type": "iva",
"rate": "iva_15",
"base": "0.00",
"value": "0.00"
}
],
"additional_info": []
}
],
"taxes": [
{
"type": "iva",
"rate": "iva_15",
"base": "0.00",
"value": "0.00",
"additional_discount": null,
"refund": null
}
],
"subtotal": "0.00",
"discount": "0.00",
"iva": "0.00",
"ice": "0.00",
"irbpnr": "0.00",
"total": "0.00",
"subsidy": null,
"tip": "0.00",
"payments": [
{
"method": "tarjeta_credito",
"amount": "0.00",
"term": {
"length": 30,
"unit": "days"
}
}
],
"plate": null,
"delivery_note_number": null,
"export": null,
"reimbursement": null,
"withholdings": [],
"withheld_iva": null,
"withheld_renta": null,
"substitute_delivery_note": null,
"third_party_charges": [],
"negotiable": null,
"compensations": [],
"fiscal_machine": null,
"additional_info": [
{
"name": "Orden de compra",
"value": "OC-1041"
}
]
}
}Only for a returned or not_authorized document. The SRI receives the correction with the same number and the same access key: the document keeps both, gains a revision and goes back to pending. It requires an Idempotency-Key.
apiKeyAuthorizationBearer <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.
id*stringuuididempotency-key*stringRequired. 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.
1 <= length <= 255application/json- body
The corrected document. Its number, access key and issue date do not change.
buyer*||||lines*array<>1 <= itemspayments*array<>1 <= itemsplate?stringVehicle plate (placa): of the commercial transport service (tabla 33), three letters and four digits such as PCM4567, or of the vehicle fuel was dispatched to (tabla 29), ZZZ9999 when there is none. No spaces, stored in capitals.
^[A-Z0-9-]{1,20}$tip?stringTip (propina), up to 10 % of the subtotal before taxes. It adds to the total.
^\d+(\.\d{1,2})?$delivery_note_number?stringNumber of the delivery note that accompanies the goods (guiaRemision).
^\d{3}-\d{3}-\d{9}$export?Export invoice (annex 4). The buyer needs an address.
reimbursement?Expense reimbursement (annex 5): the documents being reimbursed. We compute their totals.
withholdings?array<>Withholdings the invoice itself declares (retenciones, tablas 22 and 23): fuel marketers and press.
substitute_delivery_note?Invoice that replaces a delivery note (annex 9): the transfer of the goods it sells.
third_party_charges?array<>Other third-party items (annex 8): amounts you collect on behalf of third parties. They aren't part of the invoice's total.
negotiable?Negotiable commercial document (annex 11): requires the counterparty's address and a term on each payment.
additional_discounts?array<>Additional discount on the IVA base of a rate (descuentoAdicional), applied after the lines: the IVA of that rate is computed on the base minus the discount.
iva_refunds?array<>IVA refunded to an older adult (valorDevolucionIva, annex 20), by rate, as the SRI's DIG service authorized it. It is subtracted from the total; the buyer must identify with a cedula.
fiscal_machine?The fiscal machine the document is issued from (annex 13). Only when one issues it.
additional_info?array<>Your fields on the PDF.
Free fields the PDF prints (campoAdicional), such as a purchase order or a delivery address: each a name and a value of up to 300 characters, no name repeated. A document holds 15 in all, and Fiscalbase writes some of them after yours: Email, the counterparty's email, on every document but a delivery note (a consumidor_final buyer's is the fixed address); Gran Contribuyente, the business's resolution when it declared one, on invoices, purchase settlements and credit and debit notes (annex 24); and RUC Proveedor, the RUC of Fiscalbase as the invoicing system's provider (annex 26), on every document. So an invoice takes 13 of yours, 12 from a gran contribuyente, and a delivery note 14. One of those names in yours is additional_info_reserved_name, and a list that doesn't fit beside them, additional_info_overflow, which says how many fit.
[]collect_later?booleanTrack this invoice as owed although it is paid at once: its whole total is due on its issue date, and receivable follows what is collected. The document sent to the SRI doesn't change. An invoice with a payment term is tracked by its terms, with or without it. Refused for consumidor_final (422 credit_requires_buyer).
metadata?Up to 20 pairs of your own, such as your order id, returned as sent and never interpreted; lists filter by them (metadata[key]=value).
{}deliver_to?Where the buyer gets the document. It is kept with the request, a held sale's too, and an authorized document's email goes to email as well as to the addresses the document names.
simulate?Only with a sandbox key (422 in test and live, where the SRI decides): the outcome the simulator gives this revision, to rehearse how your system handles each one. Without it, it is authorized.
Accepted again
application/json- response
id*stringuuidcountry*"ec"The country, as its lowercase ISO 3166-1 alpha-2 code, the same as in the path (/v1/ec/…). New countries may appear.
"ec"currency*stringThe currency of the amounts, as its ISO 4217 code. New currencies may appear.
^[A-Z]{3}$environment*string"sandbox""test""live"status*string"pending""submitted""authorized""returned""not_authorized""annulled"status_transitions*When the document last reached each status.
business_id*stringuuidnumber*stringaccess_key*string49 <= length <= 49authorization*|nullsri_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.
date-timedelivery_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.
"sent""delivered""opened""bounced""complained"nullemails*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*integerHow 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.
date-timechannel*stringHow 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.
"api""console""imported"import_id*|The import that brought it; null if it was issued here.
uuidverification*|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.
"sri""listed""signature""unconfirmed"nulllisting*|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""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}/…).
"invoice"lines*array<>taxes*array<||>subtotal*stringdiscount*stringiva*stringice*stringirbpnr*stringtotal*stringsubsidy*string|nulltip*stringissue_date*stringdatebuyer*payments*array<>plate*string|nulldelivery_note_number*string|nullexport*|nullreimbursement*|nullwithholdings*array<>withheld_iva*string|nullwithheld_renta*string|nullsubstitute_delivery_note*|nullthird_party_charges*array<>negotiable*|nullcompensations*array<>Solidarity compensation of 2 % of the IVA (2016), only on imported documents that carry it.
fiscal_machine*|nulladditional_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.
uuidcreated_at*stringdate-timeupdated_at*stringdate-timecurl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/resubmit' \
-H 'idempotency-key: string' \
-H 'Content-Type: application/json' \
-d '{
"buyer": {
"identification_type": "ruc",
"identification": "1790012345001",
"name": "FERRETERÍA EL SOL S.A.",
"address": "Av. 10 de Agosto N21-44, Quito",
"email": "compras@elsol.ec"
},
"lines": [
{
"code": "SKU-1",
"description": "Taladro percutor",
"quantity": "2",
"unit_price": "120.00",
"taxes": [
{
"type": "iva",
"rate": "iva_15"
}
]
},
{
"code": "SKU-1",
"description": "Guantes",
"quantity": "2",
"unit_price": "4.50",
"taxes": [
{
"type": "iva",
"rate": "iva_0"
}
]
}
],
"payments": [
{
"method": "tarjeta_credito",
"term": {
"length": 30,
"unit": "days"
}
}
],
"additional_info": [
{
"name": "Orden de compra",
"value": "OC-1041"
}
],
"metadata": {
"attempt": "2"
}
}'{
"id": "01a21860-4069-7a56-b4f4-fb40eec31fac",
"object": "document",
"type": "invoice",
"country": "ec",
"currency": "USD",
"environment": "sandbox",
"status": "pending",
"status_transitions": {
"pending": "2026-11-26T15:01:35.020Z"
},
"business_id": "01a21860-4059-7729-8ed1-dac94b5a158c",
"number": "001-001-000000001",
"access_key": "2611202601179214673900110010010000000015432413312",
"authorization": null,
"sri_messages": [],
"metadata": {
"attempt": "2"
},
"channel": "api",
"import_id": null,
"verification": null,
"listing": null,
"issued_at": "2026-11-26T15:01:30.855Z",
"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.855Z",
"updated_at": "2026-11-26T15:01:35.020Z",
"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
}Each line the invoice sold and how much of it the credit notes already took, from the invoice and the credit notes that stand against it: what a return screen steps through. A credit note that returns more of a line than is left is refused (credited_quantity_exceeds_left). A credit note line is a return of an invoice line when it has the same code (or, without one, the same description) at the same unit price. Only an authorized invoice can be credited.
apiKeyAuthorizationBearer <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.
id*stringuuidWhat is left, by line
application/json- response
object*"returnable""returnable"invoice_id*stringuuidcurrency*stringThe ISO 4217 code of its amounts' currency.
credit_balance*|The invoice's credit_balance, which caps a credit note by amount whatever its lines say. null for an invoice issued to consumidor_final, which takes no credit note.
lines*array<>curl -X GET 'https://api-sandbox.fiscalbase.io/v1/ec/invoices/497f6eca-6276-4993-bfeb-53cbbbba6f08/returnable'{
"object": "returnable",
"invoice_id": "f4c4edb8-11e0-4b33-bcc1-482dc59ebb32",
"currency": "string",
"credit_balance": "string",
"lines": [
{
"line_index": 0,
"code": "string",
"description": "string",
"unit": "string",
"unit_price": "string",
"quantity_sold": "string",
"quantity_returned": "string",
"quantity_left": "string"
}
]
}Documents
All six types together: one list, each document's files, timeline and actions, and the `live` sales refused at the month's quota, held to issue by themselves once there is room. Issuing, previewing and resubmitting are per type.
Credit notes
Returns, discounts and partial cancellations of an invoice.