Skip to Content

Retrieve a received document

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

One of your received documents, as stored. To read an invoice from the SRI without storing it, GET /v1/ec/sri/invoices/{access_key}.

Authorization

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

Fiscalbase-Environment?string

The environment the call acts in. Required with a person's session; a key's own environment is the one that counts, so a key may leave it out, and naming another is 422 environment_mismatch.

Value in"sandbox""test""live"
Fiscalbase-Business?string

The business the call acts for. With a person's session, the one the call is about (without it, a call about one business is 422 business_required and a list covers every business of the organization); a key acts for its own, so naming another is 422 business_mismatch.

Formatuuid
Fiscalbase-Channel?string

Which of Fiscalbase's own integrations a key's call comes from, recorded as the channel of the documents it issues: a record, not a permission. Without it, api. A person's call is always console.

Value in"api""mcp"
Fiscalbase-Agent?string

The AI agent a key's call comes from, as its client names itself (the MCP server sets it); recorded with the request and shown in the console's request log.

Response Body

The received document

application/json
  1. response
id*string
Formatuuid
object*"received_document"
Value in"received_document"
environment*string
Value in"sandbox""live"
business_id*string
Formatuuid
access_key*string
Length49 <= length <= 49
number*string
issue_date*string
Formatdate
issuer*

Who issued it: your supplier, or your customer for a withholding.

buyer*|

Whom it is addressed to, as the document names them; null until the XML is here.

authorization*|null
sri_status*string

What the SRI last said: authorized, annulment_pending (its issuer asked to annul it and the receiver hasn't accepted; still valid) or annulled.

Value in"authorized""annulment_pending""annulled"
verification*string

How much it is proven, as for imports: sri, listed (an SRI report names it), signature (an AUTORIZADO wrapper) or unconfirmed (only its issuer's signature).

Value in"sri""listed""signature""unconfirmed"
xml_status*string

available; pending while the SRI is asked; missing when the SRI didn't give it in reach (only its issuer can send it); out_of_window when a report named it past the SRI's 60 days.

Value in"available""pending""missing""out_of_window"
sources*array<>

Every way it arrived: key, report, xml, email.

subtotal*string|null
taxes*array<||>
total*string|null
payments*array<>
description*|

The description of its first line.

withholding*|

The withholding your business issued over it: the latest authorized one that names it among its support documents. Null while none does, or once that one is annulled.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
type*"invoice"

The family, as the issuing API names it.

Value in"invoice"
document*|

The invoice read from its XML, in the shape the issuing API returns it; null until the XML is here.

Example Request
curl -X GET 'https://api.fiscalbase.io/v1/ec/received-documents/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "object": "received_document",
  "environment": "sandbox",
  "business_id": "f59fcbb7-848d-4242-af07-a8bb7e3ab37c",
  "access_key": "stringstringstringstringstringstringstringstrings",
  "number": "string",
  "issue_date": "2019-08-24",
  "issuer": {
    "ruc": "string",
    "name": "string",
    "trade_name": "string",
    "regime": "general",
    "special_taxpayer": true
  },
  "buyer": {
    "identification_type": "ruc",
    "identification": "string",
    "name": "string",
    "address": "string",
    "email": "string"
  },
  "authorization": {
    "number": "string",
    "authorized_at": "2019-08-24T14:15:22Z"
  },
  "sri_status": "authorized",
  "verification": "sri",
  "xml_status": "available",
  "sources": [
    "report"
  ],
  "subtotal": "string",
  "taxes": [
    {
      "type": "iva",
      "rate": "iva_15",
      "base": "string",
      "value": "string",
      "additional_discount": "string",
      "refund": "string"
    }
  ],
  "total": "string",
  "payments": [
    {
      "method": "sin_sistema_financiero",
      "amount": "string",
      "term": {
        "length": 0,
        "unit": "days"
      }
    }
  ],
  "description": "string",
  "withholding": {
    "object": "document",
    "type": "withholding",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "number": "string"
  },
  "created_at": "2019-08-24T14:15:22Z",
  "updated_at": "2019-08-24T14:15:22Z",
  "type": "invoice",
  "document": {
    "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"
      }
    ]
  }
}