Ir al contenido

API de contactos

Search your business's contacts

GET
/v1/ec/contacts

The people and companies your key's business deals with in its environment, most recent first: the ones you saved, and everyone a document you issued or imported names, added on their own. q searches by name or identification; identification finds the one with exactly it. Archived contacts are left out unless archived asks for them.

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

limit?integer

How many per page, from 1 to 100.

Range1 <= value <= 100
Default20
cursor?string

The next_cursor or prev_cursor of a previous response. Without a cursor, the first page.

Lengthlength <= 200
q?string

Words of the name (ignoring case and accents), or the start of an identification of any type.

Length1 <= length <= 100
archived?string

true: only the archived contacts. all: archived or not. Without it, or false, only those not archived.

Value in"true""false""all"
identification?string

Only the contacts with exactly this identification: one for a RUC or cedula, and each of those who share a pasaporte or exterior identification.

Length1 <= length <= 20
created_at[gte]?string

Only what was created at or after this moment, ISO 8601 with its offset.

Formatdate-time
created_at[lte]?string

Only what was created at or before this moment, ISO 8601 with its offset.

Formatdate-time
updated_at[gte]?string

Only what last changed at or after this moment, ISO 8601 with its offset: poll with the time of your last read to get what changed since.

Formatdate-time
updated_at[lte]?string

Only what last changed at or before this moment, ISO 8601 with its offset.

Formatdate-time

Response Body

A page of contacts

application/json
  1. response
object*"list"
Value in"list"
data*array<>
next_cursor*|

The next page (older); null if there are no more.

prev_cursor*|

The previous page (newer); null on the first.

Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/ec/contacts'
Example Response
{
  "object": "list",
  "data": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "object": "contact",
      "environment": "sandbox",
      "business_id": "f59fcbb7-848d-4242-af07-a8bb7e3ab37c",
      "identification_type": "ruc",
      "identification": "string",
      "name": "string",
      "email": "string",
      "address": "string",
      "payment_term_days": 0,
      "phone": "string",
      "archived_at": "2019-08-24T14:15:22Z",
      "last_issue_date": "2019-08-24",
      "sri_status": "active",
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "next_cursor": "string",
  "prev_cursor": "string"
}

Save a contact

POST
/v1/ec/contacts

Saves a person or company before any document names them, such as a customer at the counter whose invoice comes later: by RUC or cedula, or by a passport or foreign identification with identification_type. The documents you issue to them afterwards keep the name and email they carry, as for every contact.

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

idempotency-key?string

Send the same key to retry safely: a repeat of the same request answers what the first answered, without doing it again. Keys are scoped to the business the call acts for and its environment; the same key with another request is 409 idempotency_key_reused.

Length1 <= length <= 255

Request Body

application/json
  1. body
identification_type?string

Tabla 6: ruc, cedula, pasaporte or exterior. Without it, identification is a RUC or a cedula, told apart by length.

Value in"ruc""cedula""pasaporte""exterior"
identification*string

Their RUC (13 digits) or cedula (10), validated; a passport or foreign identification, up to 20 characters.

name*string

Their legal name, or full name.

Match^[^\n\r]*$
Length1 <= length <= 300
email?string

Where their documents are emailed.

Formatemail
phone?string

Digits only, from 7 to 15, with a leading + if it carries a country code: 0991234567 or +593991234567.

Match^\+?\d{7,15}$
address?string

Their address, up to 300 characters. An invoice issued to them carries it as the buyer's address when the request does not name one.

Match^[^\n\r]*$
Length1 <= length <= 300
payment_term_days?integer

The days of credit you give them, from 1 to 365, which the console starts a sale on credit to them from.

Range1 <= value <= 365

Response Body

Saved

application/json
  1. response
id*string
Formatuuid
object*"contact"
Value in"contact"
environment*string
Value in"sandbox""test""live"
business_id*string

The business that issued to them.

Formatuuid
identification_type*string

How their most recent document identifies them (tabla 6): ruc, cedula, pasaporte, consumidor_final or exterior. A RUC or cedula is one contact; a pasaporte or exterior identification, which the SRI doesn't keep unique, is one contact for each name it comes with.

Value in"ruc""cedula""pasaporte""consumidor_final""exterior"
identification*string
name*string

As their most recent document, by issue date, names them.

email*|

The email for their documents: the latest one any document gave. null if none carries one.

address*|

The address you saved for this customer, or null. An invoice issued to them carries it as the buyer's address when the request does not name one.

payment_term_days*|

The days of credit you give this customer, or null: what the console starts a sale on credit to them from. The API applies no term by itself: an invoice is on credit when its payments say so.

phone*|

The phone number carried in the additional information (Teléfono, Celular) of their most recent document that has one; documents have no phone field of their own. null if none carries it.

archived_at*|

When it was archived: an archived contact keeps its documents, and is out of the lists and the suggestions. null while it is not.

Formatdate-time
last_issue_date*|

The issue date of their latest authorized document.

Formatdate
sri_status*|

What the SRI records for their RUC: active, or review if it is not active or the SRI flags it. null until it has been looked up (GET /v1/ec/taxpayers/{identification}), if they have no RUC, and always for a pasaporte or exterior identification, which the SRI's registry doesn't hold.

Value in"active""review"null
created_at*string

When you issued their first document.

Formatdate-time
updated_at*string

When a document last named them, with its name and email.

Formatdate-time
Example Request
curl -X POST 'https://api-sandbox.fiscalbase.io/v1/ec/contacts' \
  -H 'Content-Type: application/json' \
  -d '{
  "identification_type": "cedula",
  "identification": "1710034065",
  "name": "Ana Robles"
}'
Example Response
{
  "id": "01a21860-754b-7578-8804-e44485712385",
  "object": "contact",
  "environment": "sandbox",
  "business_id": "01a21860-752b-74c6-bd03-9d71506d0570",
  "identification_type": "cedula",
  "identification": "1710034065",
  "name": "Ana Robles",
  "email": null,
  "address": null,
  "payment_term_days": null,
  "phone": null,
  "archived_at": null,
  "last_issue_date": null,
  "sri_status": null,
  "created_at": "2026-11-26T15:01:44.394Z",
  "updated_at": "2026-11-26T15:01:44.394Z"
}

Retrieve a contact

GET
/v1/ec/contacts/{id}

One contact by its id. GET /v1/ec/contacts?identification= finds it by the RUC, cedula, passport or foreign identification its documents carry.

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

Response Body

The contact

application/json
  1. response
id*string
Formatuuid
object*"contact"
Value in"contact"
environment*string
Value in"sandbox""test""live"
business_id*string

The business that issued to them.

Formatuuid
identification_type*string

How their most recent document identifies them (tabla 6): ruc, cedula, pasaporte, consumidor_final or exterior. A RUC or cedula is one contact; a pasaporte or exterior identification, which the SRI doesn't keep unique, is one contact for each name it comes with.

Value in"ruc""cedula""pasaporte""consumidor_final""exterior"
identification*string
name*string

As their most recent document, by issue date, names them.

email*|

The email for their documents: the latest one any document gave. null if none carries one.

address*|

The address you saved for this customer, or null. An invoice issued to them carries it as the buyer's address when the request does not name one.

payment_term_days*|

The days of credit you give this customer, or null: what the console starts a sale on credit to them from. The API applies no term by itself: an invoice is on credit when its payments say so.

phone*|

The phone number carried in the additional information (Teléfono, Celular) of their most recent document that has one; documents have no phone field of their own. null if none carries it.

archived_at*|

When it was archived: an archived contact keeps its documents, and is out of the lists and the suggestions. null while it is not.

Formatdate-time
last_issue_date*|

The issue date of their latest authorized document.

Formatdate
sri_status*|

What the SRI records for their RUC: active, or review if it is not active or the SRI flags it. null until it has been looked up (GET /v1/ec/taxpayers/{identification}), if they have no RUC, and always for a pasaporte or exterior identification, which the SRI's registry doesn't hold.

Value in"active""review"null
created_at*string

When you issued their first document.

Formatdate-time
updated_at*string

When a document last named them, with its name and email.

Formatdate-time
Example Request
curl -X GET 'https://api-sandbox.fiscalbase.io/v1/ec/contacts/497f6eca-6276-4993-bfeb-53cbbbba6f08'
Example Response
{
  "id": "01a21860-8888-7bf1-adfb-481845f587c5",
  "object": "contact",
  "environment": "sandbox",
  "business_id": "01a21860-8875-7776-91cc-c99af5ab6437",
  "identification_type": "cedula",
  "identification": "1740630551",
  "name": "REPETIDO",
  "email": "repetido@example.com",
  "address": null,
  "payment_term_days": null,
  "phone": null,
  "archived_at": "2026-11-26T15:01:53.509Z",
  "last_issue_date": null,
  "sri_status": null,
  "created_at": "2026-11-26T15:01:49.319Z",
  "updated_at": "2026-11-26T15:01:53.555Z"
}

Change or archive a contact

PATCH
/v1/ec/contacts/{id}

Changes their name, email, phone, address or days of credit, and archives them or brings them back (archived): only what you send. An archived contact keeps its documents and is out of the lists and the suggestions; issuing to them still works and leaves it archived. A phone you give wins over the one their documents carry. Renaming a contact with a pasaporte or exterior identification keeps their documents theirs, and the next ones that name them as before.

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

Request Body

application/json
  1. body
name?string
Match^[^\n\r]*$
Length1 <= length <= 300
email?|

null clears it.

Formatemail
phone?|

null clears it.

Match^\+?\d{7,15}$
address?|

null clears it.

Match^[^\n\r]*$
Length1 <= length <= 300
payment_term_days?|

null clears it.

Range1 <= value <= 365
archived?boolean

true archives it: it leaves the lists and the suggestions, and keeps its documents. false brings an archived one back. Issuing to them again leaves it archived.

Response Body

The contact

application/json
  1. response
id*string
Formatuuid
object*"contact"
Value in"contact"
environment*string
Value in"sandbox""test""live"
business_id*string

The business that issued to them.

Formatuuid
identification_type*string

How their most recent document identifies them (tabla 6): ruc, cedula, pasaporte, consumidor_final or exterior. A RUC or cedula is one contact; a pasaporte or exterior identification, which the SRI doesn't keep unique, is one contact for each name it comes with.

Value in"ruc""cedula""pasaporte""consumidor_final""exterior"
identification*string
name*string

As their most recent document, by issue date, names them.

email*|

The email for their documents: the latest one any document gave. null if none carries one.

address*|

The address you saved for this customer, or null. An invoice issued to them carries it as the buyer's address when the request does not name one.

payment_term_days*|

The days of credit you give this customer, or null: what the console starts a sale on credit to them from. The API applies no term by itself: an invoice is on credit when its payments say so.

phone*|

The phone number carried in the additional information (Teléfono, Celular) of their most recent document that has one; documents have no phone field of their own. null if none carries it.

archived_at*|

When it was archived: an archived contact keeps its documents, and is out of the lists and the suggestions. null while it is not.

Formatdate-time
last_issue_date*|

The issue date of their latest authorized document.

Formatdate
sri_status*|

What the SRI records for their RUC: active, or review if it is not active or the SRI flags it. null until it has been looked up (GET /v1/ec/taxpayers/{identification}), if they have no RUC, and always for a pasaporte or exterior identification, which the SRI's registry doesn't hold.

Value in"active""review"null
created_at*string

When you issued their first document.

Formatdate-time
updated_at*string

When a document last named them, with its name and email.

Formatdate-time
Example Request
curl -X PATCH 'https://api-sandbox.fiscalbase.io/v1/ec/contacts/497f6eca-6276-4993-bfeb-53cbbbba6f08' \
  -H 'Content-Type: application/json' \
  -d '{
  "archived": true
}'
Example Response
{
  "id": "01a21860-7ceb-785c-80eb-d994d40873c8",
  "object": "contact",
  "environment": "sandbox",
  "business_id": "01a21860-7cbc-76b0-9f41-37c3012afcf9",
  "identification_type": "ruc",
  "identification": "1790012345001",
  "name": "FERRETERÍA EL SOL S.A.",
  "email": "compras@elsol.ec",
  "address": null,
  "payment_term_days": null,
  "phone": null,
  "archived_at": "2026-11-26T15:01:50.534Z",
  "last_issue_date": null,
  "sri_status": null,
  "created_at": "2026-11-26T15:01:46.343Z",
  "updated_at": "2026-11-26T15:01:50.534Z"
}