Ir al contenido

API de notas de crédito

Issue credit note

POST
/v1/ec/credit-notes

A credit note ("nota de crédito") cancels or reduces an authorized invoice: a return, a discount granted afterwards, a corrected price. Name the invoice in modified_document: by document_id when it was issued in Fiscalbase, and then the buyer may be left out and each line given as the invoice line's code with the quantity credited; or by number and issue_date for one issued elsewhere, with the buyer and the lines in full. Say why in reason. Its total can't exceed the invoice's credit_balance, and an invoice issued to consumidor_final takes no credit 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/credit-notes/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.

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

preview_id?string

The preview_id of POST /v1/ec/credit-notes/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.

Match^[0-9a-f]{64}$

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
Fiscalbase-Emission-Point?string

The 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.

Formatuuid

Request Body

application/json
  1. body

The issue date is always today in Ecuador: documents are transmitted when issued.

buyer?|||

Who receives the credit. Omit it when modified_document is an invoice's document_id: it is that invoice's buyer.

modified_document*|
reason*string

Why the invoice is credited (motivo), in free text: the SRI has no codes for it. Such as a return, a discount granted afterwards or a correction of a price.

Match^[^\n\r]*$
Length1 <= length <= 300
lines*array<|>

What is credited: each line in full, or, when modified_document is an invoice's document_id, by the invoice line's code and the quantity credited.

Items1 <= items
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.

Default[]
establishment?string

The establishment whose series numbers it, such as 001. Without it, the first active series of the document type.

Match^\d{3}$
emission_point?string

The emission point of that establishment, such as 001. Without it, the first active one.

Match^\d{3}$
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).

Default{}
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.

Response Body

Accepted and numbered; a repeat with the same Idempotency-Key answers the same

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*"credit_note"

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"credit_note"
lines*array<>
taxes*array<||>
subtotal*string
discount*string
iva*string
ice*string
irbpnr*string
total*string
issue_date*string
Formatdate
buyer*
modified_document*
reason*string
compensations*array<>

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

fiscal_machine*|null
additional_info*array<>
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/credit-notes' \
  -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"
  },
  "modified_document": {
    "document_type": "factura",
    "number": "001-002-000004812",
    "issue_date": "2026-09-23"
  },
  "reason": "Devolución de 1 taladro por falla de fábrica",
  "lines": [
    {
      "code": "SKU-1",
      "description": "Taladro percutor",
      "quantity": "1",
      "unit_price": "120.00",
      "taxes": [
        {
          "type": "iva",
          "rate": "iva_15"
        }
      ]
    }
  ]
}'
Example Response
{
  "id": "01a21860-2eb4-7dfe-9030-3d03e00119ca",
  "object": "document",
  "type": "credit_note",
  "country": "ec",
  "currency": "USD",
  "environment": "sandbox",
  "status": "pending",
  "status_transitions": {
    "pending": "2026-11-26T15:01:30.475Z"
  },
  "business_id": "01a21860-2e9d-70ec-b681-221fd8fda46e",
  "number": "001-001-000000001",
  "access_key": "2611202604179214673900110010010000000010709838811",
  "authorization": null,
  "sri_messages": [],
  "metadata": {},
  "channel": "api",
  "import_id": null,
  "verification": null,
  "listing": null,
  "issued_at": "2026-11-26T15:01:26.321Z",
  "delivery_status": null,
  "emails": [],
  "portal_views": 0,
  "portal_last_viewed_at": null,
  "ice": "0.00",
  "iva": "18.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": "120.00",
      "code": "SKU-1",
      "unit": null,
      "taxes": [
        {
          "base": "120.00",
          "rate": "iva_15",
          "type": "iva",
          "value": "18.00"
        }
      ],
      "discount": "0.00",
      "quantity": "1",
      "unit_price": "120",
      "description": "Taladro percutor",
      "auxiliary_code": null,
      "additional_info": []
    }
  ],
  "taxes": [
    {
      "base": "120.00",
      "rate": "iva_15",
      "type": "iva",
      "value": "18.00",
      "refund": null,
      "additional_discount": null
    }
  ],
  "total": "138.00",
  "irbpnr": "0.00",
  "reason": "Devolución de 1 taladro por falla de fábrica",
  "discount": "0.00",
  "subtotal": "120.00",
  "issue_date": "2026-11-26",
  "compensations": [],
  "fiscal_machine": null,
  "additional_info": [],
  "modified_document": {
    "number": "001-002-000004812",
    "issue_date": "2026-09-23",
    "document_type": "factura"
  },
  "created_at": "2026-11-26T15:01:26.321Z",
  "updated_at": "2026-11-26T15:01:26.321Z"
}

Preview credit note

POST
/v1/ec/credit-notes/preview

Checks the body of POST /v1/ec/credit-notes 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/credit-notes?preview_id=… to issue exactly this body.

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

Fiscalbase-Emission-Point?string

The 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.

Formatuuid

Request Body

application/json
  1. body

The issue date is always today in Ecuador: documents are transmitted when issued.

buyer?|||

Who receives the credit. Omit it when modified_document is an invoice's document_id: it is that invoice's buyer.

modified_document*|
reason*string

Why the invoice is credited (motivo), in free text: the SRI has no codes for it. Such as a return, a discount granted afterwards or a correction of a price.

Match^[^\n\r]*$
Length1 <= length <= 300
lines*array<|>

What is credited: each line in full, or, when modified_document is an invoice's document_id, by the invoice line's code and the quantity credited.

Items1 <= items
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.

Default[]
establishment?string

The establishment whose series numbers it, such as 001. Without it, the first active series of the document type.

Match^\d{3}$
emission_point?string

The emission point of that establishment, such as 001. Without it, the first active one.

Match^\d{3}$
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).

Default{}
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.

Response Body

The document as it would be issued

application/json
  1. response
object*"document_preview"
Value in"document_preview"
type*"credit_note"
Value in"credit_note"
preview_id*string

What 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.

Length64 <= length <= 64
environment*string
Value in"sandbox""test""live"
business_id*string

The business that would issue it.

Formatuuid
issue_date*string

Today in Ecuador: the date it would carry.

Formatdate
currency*string

The 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.

Example Request
curl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/credit-notes/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"
  },
  "modified_document": {
    "document_type": "factura",
    "number": "001-002-000004812",
    "issue_date": "2026-09-23"
  },
  "reason": "Devolución de 1 taladro por falla de fábrica",
  "lines": [
    {
      "code": "SKU-1",
      "description": "Taladro percutor",
      "quantity": "1",
      "unit_price": "120.00",
      "taxes": [
        {
          "type": "iva",
          "rate": "iva_15"
        }
      ]
    }
  ]
}'
Example Response
{
  "object": "document_preview",
  "type": "credit_note",
  "preview_id": "05a2906992af263dbc2bc03bf32e1978009c42ace2269901065be151316eb688",
  "environment": "sandbox",
  "business_id": "01a21860-75ca-7104-a8a4-00b371cd44ee",
  "issue_date": "2026-11-26",
  "currency": "USD",
  "total": "138.00",
  "tax_total": "18.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"
    },
    "modified_document": {
      "document_type": "factura",
      "number": "001-002-000004812",
      "issue_date": "2026-09-23"
    },
    "reason": "Devolución de 1 taladro por falla de fábrica",
    "lines": [
      {
        "code": "SKU-1",
        "auxiliary_code": null,
        "description": "Taladro percutor",
        "unit": null,
        "quantity": "1",
        "unit_price": "120",
        "discount": "0.00",
        "net": "120.00",
        "taxes": [
          {
            "type": "iva",
            "rate": "iva_15",
            "base": "120.00",
            "value": "18.00"
          }
        ],
        "additional_info": []
      }
    ],
    "taxes": [
      {
        "type": "iva",
        "rate": "iva_15",
        "base": "120.00",
        "value": "18.00",
        "additional_discount": null,
        "refund": null
      }
    ],
    "subtotal": "120.00",
    "discount": "0.00",
    "iva": "18.00",
    "ice": "0.00",
    "irbpnr": "0.00",
    "total": "138.00",
    "compensations": [],
    "fiscal_machine": null,
    "additional_info": []
  }
}

Correct and resubmit credit note

POST
/v1/ec/credit-notes/{id}/resubmit

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.

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

Request Body

application/json
  1. body

The corrected document. Its number, access key and issue date do not change.

buyer?|||

Who receives the credit. Omit it when modified_document is an invoice's document_id: it is that invoice's buyer.

modified_document*|
reason*string

Why the invoice is credited (motivo), in free text: the SRI has no codes for it. Such as a return, a discount granted afterwards or a correction of a price.

Match^[^\n\r]*$
Length1 <= length <= 300
lines*array<|>

What is credited: each line in full, or, when modified_document is an invoice's document_id, by the invoice line's code and the quantity credited.

Items1 <= items
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.

Default[]
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).

Default{}
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.

Response Body

Accepted 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*"credit_note"

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"credit_note"
lines*array<>
taxes*array<||>
subtotal*string
discount*string
iva*string
ice*string
irbpnr*string
total*string
issue_date*string
Formatdate
buyer*
modified_document*
reason*string
compensations*array<>

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

fiscal_machine*|null
additional_info*array<>
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/credit-notes/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"
  },
  "modified_document": {
    "document_type": "factura",
    "number": "001-001-000000001",
    "issue_date": "2026-11-26"
  },
  "reason": "Devolución de 1 taladro por falla de fábrica",
  "lines": [
    {
      "code": "SKU-1",
      "description": "Taladro percutor",
      "quantity": "1",
      "unit_price": "120.00",
      "taxes": [
        {
          "type": "iva",
          "rate": "iva_15"
        }
      ]
    }
  ]
}'
Example Response
{
  "id": "01a21860-35e5-7126-9912-831b753eb5c3",
  "object": "document",
  "type": "credit_note",
  "country": "ec",
  "currency": "USD",
  "environment": "live",
  "status": "pending",
  "status_transitions": {
    "pending": "2026-11-26T15:01:32.380Z"
  },
  "business_id": "01a21860-3597-75b6-8b4b-314e49a83ac6",
  "number": "001-001-000000001",
  "access_key": "2611202604179214673900120010010000000016578271211",
  "authorization": null,
  "sri_messages": [],
  "metadata": {},
  "channel": "api",
  "import_id": null,
  "verification": null,
  "listing": null,
  "issued_at": "2026-11-26T15:01:28.158Z",
  "delivery_status": null,
  "emails": [],
  "portal_views": 0,
  "portal_last_viewed_at": null,
  "ice": "0.00",
  "iva": "18.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": "120.00",
      "code": "SKU-1",
      "unit": null,
      "taxes": [
        {
          "base": "120.00",
          "rate": "iva_15",
          "type": "iva",
          "value": "18.00"
        }
      ],
      "discount": "0.00",
      "quantity": "1",
      "unit_price": "120",
      "description": "Taladro percutor",
      "auxiliary_code": null,
      "additional_info": []
    }
  ],
  "taxes": [
    {
      "base": "120.00",
      "rate": "iva_15",
      "type": "iva",
      "value": "18.00",
      "refund": null,
      "additional_discount": null
    }
  ],
  "total": "138.00",
  "irbpnr": "0.00",
  "reason": "Devolución de 1 taladro por falla de fábrica",
  "discount": "0.00",
  "subtotal": "120.00",
  "issue_date": "2026-11-26",
  "compensations": [],
  "fiscal_machine": null,
  "additional_info": [],
  "modified_document": {
    "number": "001-001-000000001",
    "issue_date": "2026-11-26",
    "document_type": "factura"
  },
  "created_at": "2026-11-26T15:01:28.158Z",
  "updated_at": "2026-11-26T15:01:32.380Z"
}