Entities

Create an entity

POST
/v1/ec/entities

Only a person, from the platform: an API key acts for the business it was created for (403 person_required). A sandbox business practices with made-up data and is free; a live one is registered by its RUC, which is looked up in the SRI registry where its data is taken from, and issues in test and live once paid.

Authorization

session
fiscalbase.session_token<token>

A person's session on the platform, started with the six-digit code they receive by email (POST /auth/sign-in/email-otp), with their active organization. Also send the Fiscalbase-Environment header (sandbox, test or live), the Fiscalbase-Entity header with the id of the business the call acts for (without it, a call about one business is refused and a list covers every business of the organization) and, on methods that change something, an Origin from the platform.

In: cookie

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

The kind of business is chosen on creation and never changes. A sandbox business makes up its legal data and uses the practice RUC 9999999999001; it issues in sandbox instantly, with 001-001 numbering for each document type. A live one is a real RUC (the practice one is rejected): the legal name, regime, accounting and obligations come from the SRI registry. The resolutions are required when the registry says the RUC is a special taxpayer or withholding agent. The registry does not say who is a large taxpayer: if the RUC is one, send large_taxpayer_resolution and the legend "Gran Contribuyente" is written on its invoices, purchase settlements, credit notes and debit notes.

The kind of business is chosen on creation and never changes. A sandbox business makes up its legal data and uses the practice RUC 9999999999001; it issues in sandbox instantly, with 001-001 numbering for each document type. A live one is a real RUC (the practice one is rejected): the legal name, regime, accounting and obligations come from the SRI registry. The resolutions are required when the registry says the RUC is a special taxpayer or withholding agent. The registry does not say who is a large taxpayer: if the RUC is one, send large_taxpayer_resolution and the legend "Gran Contribuyente" is written on its invoices, purchase settlements, credit notes and debit notes.

kind*"live"

Value in

  • "live"
ruc*string
regime?string

Only when the SRI registry does not say which regime the RUC is in.

Value in

  • "general"
  • "rimpe_emprendedor"
  • "rimpe_negocio_popular"
trade_name?string
Length1 <= length <= 300
head_office_address?string
Length1 <= length <= 300
head_office_phone?string

The head office's phone number. It is printed on the RIDE; the SRI's XML does not carry it.

Length5 <= length <= 30
head_office_email?string

The head office's email. It is printed on the RIDE; the SRI's XML does not carry it.

Lengthlength <= 254
reply_to_email?string

Where your customers' replies go when they answer an email from Fiscalbase: it is sent as Reply-To. Without it, they reply to Fiscalbase's sender.

Lengthlength <= 254
footer_legend?string

A line printed at the foot of every RIDE and of the emails to your customers. The SRI's XML does not carry it.

Length1 <= length <= 160
special_taxpayer_resolution?string
Match^[A-Za-z0-9]{3,5}$
withholding_agent_resolution?string
Match^0*[1-9]\d{0,7}$
large_taxpayer_resolution?string
Match^[^\n\r]*$
Length1 <= length <= 300

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://example.com/v1/ec/entities" \  -H "Content-Type: application/json" \  -d '{    "kind": "live",    "ruc": "string"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "object": "entity",  "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"  },  "portal_shows_test": true,  "live_since": "2019-08-24T14:15:22Z",  "issuing": {    "allowed": true,    "lock": {      "code": "plan_required",      "message": "string",      "canceled": true    }  },  "logo": {    "url": "http://example.com",    "content_type": "image/png",    "size": 0  },  "created_at": "2019-08-24T14:15:22Z"}