Ir al contenido

API de la cuenta

Who is calling

GET
/v1/me

The environment the key issues in and what it may do, its organization, the business it acts for and that business's month. Ask it first.

Authorization

apiKey
headerAuthorizationBearer <token>

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

Response Body

The caller

application/json
  1. response
object*"me"
Value in"me"
environment*string

Where the call issues: sandbox, the simulator, with no tax validity; test, the SRI's testing service; live, the SRI's real one. A key's prefix fixes it.

Value in"sandbox""test""live"
organization*
credential*|

What the call authenticated with.

business*

The business the call acts for, with issuing.allowed saying whether it can issue right now: a key's own, the only one it reaches.

usage*|

That business's month, as GET /v1/usage answers it; null while it has no plan.

Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/me'
Example Response
{
  "object": "me",
  "environment": "sandbox",
  "organization": {
    "id": "string",
    "name": "string"
  },
  "credential": {
    "type": "api_key",
    "id": "string",
    "permission": "read_only",
    "emission_point_id": "6d626c5e-7ba0-4306-8630-baf88b761dd8"
  },
  "business": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "object": "business",
    "kind": "sandbox",
    "country": "ec",
    "ruc": "string",
    "legal_name": "string",
    "trade_name": "string",
    "head_office_address": "string",
    "head_office_phone": "string",
    "head_office_email": "string",
    "reply_to_email": "string",
    "footer_legend": "string",
    "keeps_accounting": true,
    "regime": "general",
    "special_taxpayer_resolution": "string",
    "withholding_agent_resolution": "string",
    "large_taxpayer_resolution": "string",
    "certificate": {
      "holder": "string",
      "holder_identification": "string",
      "holder_identification_type": "cedula",
      "kind": "natural_person",
      "issuer_name": "string",
      "subject": "string",
      "issuer": "string",
      "serial_number": "string",
      "valid_from": "2019-08-24T14:15:22Z",
      "valid_until": "2019-08-24T14:15:22Z"
    },
    "issuing": {
      "allowed": true,
      "lock": {
        "code": "plan_required",
        "message": "string",
        "canceled": true,
        "trial_ended": true
      },
      "ready": true,
      "missing": [
        {
          "code": "plan_required",
          "message": "string"
        }
      ]
    },
    "portal_url": "http://example.com",
    "stock_policy": "warn",
    "point_of_sale": true,
    "logo": {
      "url": "http://example.com",
      "content_type": "image/png",
      "size": 0
    },
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  },
  "usage": {
    "object": "usage",
    "business_id": "f59fcbb7-848d-4242-af07-a8bb7e3ab37c",
    "country": "ec",
    "plan": {
      "id": "string",
      "name": "string"
    },
    "period": {
      "start": "2019-08-24",
      "end": "2019-08-24",
      "timezone": "string"
    },
    "documents": 0,
    "quota": {
      "included": 0,
      "used": 0,
      "remaining": 0,
      "reached": true,
      "resets_on": "2019-08-24",
      "held": 0,
      "bigger_plan": {
        "id": "string",
        "name": "string",
        "included_documents": 0
      }
    },
    "establishments": {
      "used": 0,
      "limit": 0
    }
  }
}
GET
/v1/usage

The plan and usage of your key's business, as each live business has its own: the month's authorized live documents and where they stand against the plan's monthly quota. Nothing is charged above a plan: once quota.reached is true, a live document is refused with 402 plan_limit (plan_quota_reached) before it is numbered, and kept to issue once the business moves to a bigger plan. A sandbox business answers its month's sandbox documents, with no quota.

Authorization

apiKey
headerAuthorizationBearer <token>

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

Response Body

The plan and usage

application/json
  1. response
object*"usage"
Value in"usage"
business_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"
plan*|

The business's plan: sandbox for a sandbox business, which is free; null for a live business without a plan.

period*

The current calendar month, counted in the time zone of the timezone field. A yearly plan's quota also counts by calendar month.

documents*integer

Documents the SRI authorized for this business this month, by issue date: in live for a live business, where one annulled later still counts and rejected documents, test, imports and received documents do not; in sandbox for a sandbox business.

quota*|

Where the month stands against the plan's quota; null without a plan and for a sandbox business, which has none.

establishments*|

Where the business issues against its plan's establishments; null for a sandbox business, which has no limit.

Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/usage'
Example Response
{
  "object": "usage",
  "business_id": "f59fcbb7-848d-4242-af07-a8bb7e3ab37c",
  "country": "ec",
  "plan": {
    "id": "string",
    "name": "string"
  },
  "period": {
    "start": "2019-08-24",
    "end": "2019-08-24",
    "timezone": "string"
  },
  "documents": 0,
  "quota": {
    "included": 0,
    "used": 0,
    "remaining": 0,
    "reached": true,
    "resets_on": "2019-08-24",
    "held": 0,
    "bigger_plan": {
      "id": "string",
      "name": "string",
      "included_documents": 0
    }
  },
  "establishments": {
    "used": 0,
    "limit": 0
  }
}