Clientes y terceros
Administración de clientes y terceros.
GET /v1/customer Listar registros ▶
| Parám. | Descripción | Defecto |
|---|---|---|
page | Número de página | 1 |
per_page | Registros por página (máx. 1000) | 20 |
since | Inicio del rango de creación (columna entered). Solo fecha = desde las 00:00:00 | — |
until | Fin del rango de creación. Solo fecha = hasta las 23:59:59 | — |
q | Búsqueda de texto en los campos indicados en cada recurso: name name_commercial doi email | — |
s / o | Campo de ordenamiento · Sentido: asc o desc | según recurso |
f | Filtros exactos en JSON | — |
# página 2, 20 por página
curl -H "X-SYNCS-API-TOKEN: TU_TOKEN" "https://sandbox.minimarket.digital/v1/customer?page=2&per_page=20"
# creados en un rango de fechas, más recientes primero
curl -H "X-SYNCS-API-TOKEN: TU_TOKEN" "https://sandbox.minimarket.digital/v1/customer?since=2026-07-01&until=2026-07-31&s=entered&o=desc"
Respuesta
{
"status": "success",
"code": "200",
"message": "LIST",
"data": {
"a1b2c3d4-5e6f-7890-abcd-ef1234567890": {
"id": "a1b2c3d4-5e6f-7890-abcd-ef1234567890",
"doi_id": "rucPE",
"doi": "20123456786",
"name": "ACME Distribuciones SAC",
"name_commercial": "ACME",
"cus_cla_id": "a",
"email": "ventas@acme.pe",
"phone_mobile": "+51987654321",
"city": "Lima",
"address": "Av. Javier Prado Este 1234"
}
},
"meta": {
"page": 1,
"per_page": 20,
"count": 1,
"total": 134
}
}
GET /v1/customer/{id} Obtener un registro ▶
curl -H "X-SYNCS-API-TOKEN: TU_TOKEN" "https://sandbox.minimarket.digital/v1/customer/ID"
Respuesta
{
"status": "success",
"code": "200",
"message": "GET",
"data": {
"id": "a1b2c3d4-5e6f-7890-abcd-ef1234567890",
"doi_id": "rucPE",
"doi": "20123456786",
"name": "ACME Distribuciones SAC",
"name_commercial": "ACME",
"cus_cla_id": "a",
"email": "ventas@acme.pe",
"phone_mobile": "+51987654321",
"city": "Lima",
"address": "Av. Javier Prado Este 1234"
}
}
POST /v1/customer Crear un registro ▶
Solo se graban las columnas de la lista blanca de cada recurso (los campos grabables que aparecen en cada endpoint); cualquier otra clave del JSON se ignora en silencio. Cada valor es un texto, un número, un booleano (se guarda como 1 o 0) o null; un arreglo o un objeto responde 400 FIELD_INVALID: campo. Los componentes de la clave primaria que no se envíen toman el valor ---. El id puede enviarse (máximo 45 caracteres alfanuméricos, _, - y .); si se omite, la API genera un UUID.
Requeridos en POST
doi_id doi name
Componentes de la clave — si no se envían toman ---
cus_cha_id sll_id cus_grp_id cus_cla_id cus_sec_id cat_id doi_id doi
| Campo | Etiqueta | Tipo | Obl. |
|---|---|---|---|
cou_id | — | texto | |
geo_id | — | texto | |
name | — | texto | • |
description | — | texto | |
name_commercial | — | texto | |
registered | — | fecha | |
sic_id | — | texto | |
cus_cnt_id | — | texto | |
cus_cnt_name | — | texto | |
firstname | — | texto | |
lastname | — | texto | |
middlename | — | texto | |
status | — | texto | |
condition | — | texto | |
type | — | texto | |
activity | — | fecha | |
phone | — | texto | |
phone_home | — | texto | |
phone_mobile | — | texto | |
phone_office | — | texto | |
phone_fax | — | texto | |
email | — | texto | |
state | — | texto | |
province | — | texto | |
city | — | texto | |
zone | — | texto | |
address | — | texto | |
billing_address | — | texto | |
shipping_address | — | texto | |
importer | — | booleano | |
exporter | — | booleano | |
legal_representatives | — | texto | |
employees | — | número | |
mar_id | — | texto | |
edu_id | — | texto | |
annual_revenue | — | número | |
agent_detraction | — | booleano | |
agent_retention | — | booleano | |
agent_collection | — | booleano | |
electronic_invoicing | — | fecha | |
electronic_payroll | — | fecha | |
system_accounting | — | texto | |
system_invoicing | — | texto | |
code | — | texto | |
prd_prc_id | — | referencia a Listas de Precios | |
itm_prc_id | — | texto | |
rating | — | número | |
score | — | número |
Nunca se devuelven
pass token
Con formato (se sanean al guardar) description
curl -X POST "https://sandbox.minimarket.digital/v1/customer" \
-H "X-SYNCS-API-TOKEN: TU_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"doi_id": "rucPE",
"doi": "20123456786",
"name": "ACME Distribuciones SAC",
"name_commercial": "ACME",
"cus_cla_id": "a",
"email": "ventas@acme.pe",
"phone_mobile": "+51987654321",
"city": "Lima",
"address": "Av. Javier Prado Este 1234"
}'
Respuesta
{
"status": "success",
"code": "201",
"message": "ADD",
"data": {
"id": "a1b2c3d4-5e6f-7890-abcd-ef1234567890",
"doi_id": "rucPE",
"doi": "20123456786",
"name": "ACME Distribuciones SAC",
"name_commercial": "ACME",
"cus_cla_id": "a",
"email": "ventas@acme.pe",
"phone_mobile": "+51987654321",
"city": "Lima",
"address": "Av. Javier Prado Este 1234"
}
}
PATCH /v1/customer/{id} Actualizar un registro ▶
Ambos hacen exactamente lo mismo: actualización parcial. Solo se modifican las columnas presentes en el JSON, el resto queda intacto — no hace falta reenviar el registro completo. Se usa PATCH por corrección semántica y PUT por compatibilidad con clientes que no lo soportan. La API graba modified y modified_by automáticamente.
Si el id no existe, ya se eliminó o queda fuera del alcance del permiso, responden 404 NO_DATA; si el JSON no trae ninguna columna válida, 400 NO_VALID_FIELDS.
Los componentes de la clave identifican el registro y no se cambian: enviarlos responde 400 FIELD_READONLY: campo, con todos los que llegaron. En los recursos por idioma, lng_id indica qué traducción se edita y no se escribe.
| Campo | Etiqueta | Tipo |
|---|---|---|
cou_id | — | texto |
geo_id | — | texto |
name | — | texto |
description | — | texto |
name_commercial | — | texto |
registered | — | fecha |
sic_id | — | texto |
cus_cnt_id | — | texto |
cus_cnt_name | — | texto |
firstname | — | texto |
lastname | — | texto |
middlename | — | texto |
status | — | texto |
condition | — | texto |
type | — | texto |
activity | — | fecha |
phone | — | texto |
phone_home | — | texto |
phone_mobile | — | texto |
phone_office | — | texto |
phone_fax | — | texto |
email | — | texto |
state | — | texto |
province | — | texto |
city | — | texto |
zone | — | texto |
address | — | texto |
billing_address | — | texto |
shipping_address | — | texto |
importer | — | booleano |
exporter | — | booleano |
legal_representatives | — | texto |
employees | — | número |
mar_id | — | texto |
edu_id | — | texto |
annual_revenue | — | número |
agent_detraction | — | booleano |
agent_retention | — | booleano |
agent_collection | — | booleano |
electronic_invoicing | — | fecha |
electronic_payroll | — | fecha |
system_accounting | — | texto |
system_invoicing | — | texto |
code | — | texto |
prd_prc_id | — | referencia a Listas de Precios |
itm_prc_id | — | texto |
rating | — | número |
score | — | número |
No cambian por PUT/PATCH (400 FIELD_READONLY) cus_cha_id sll_id cus_grp_id cus_cla_id cus_sec_id cat_id doi_id doi
curl -X PATCH "https://sandbox.minimarket.digital/v1/customer/ID" \
-H "X-SYNCS-API-TOKEN: TU_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name_commercial": "ACME",
"email": "ventas@acme.pe"
}'
Respuesta
{
"status": "success",
"code": "200",
"message": "UPDATE",
"data": {
"id": "a1b2c3d4-5e6f-7890-abcd-ef1234567890",
"name_commercial": "ACME",
"email": "ventas@acme.pe"
}
}
PUT /v1/customer/{id} Actualizar (compatibilidad) — idéntico a PATCH ▶
| Campo | Etiqueta | Tipo |
|---|---|---|
cou_id | — | texto |
geo_id | — | texto |
name | — | texto |
description | — | texto |
name_commercial | — | texto |
registered | — | fecha |
sic_id | — | texto |
cus_cnt_id | — | texto |
cus_cnt_name | — | texto |
firstname | — | texto |
lastname | — | texto |
middlename | — | texto |
status | — | texto |
condition | — | texto |
type | — | texto |
activity | — | fecha |
phone | — | texto |
phone_home | — | texto |
phone_mobile | — | texto |
phone_office | — | texto |
phone_fax | — | texto |
email | — | texto |
state | — | texto |
province | — | texto |
city | — | texto |
zone | — | texto |
address | — | texto |
billing_address | — | texto |
shipping_address | — | texto |
importer | — | booleano |
exporter | — | booleano |
legal_representatives | — | texto |
employees | — | número |
mar_id | — | texto |
edu_id | — | texto |
annual_revenue | — | número |
agent_detraction | — | booleano |
agent_retention | — | booleano |
agent_collection | — | booleano |
electronic_invoicing | — | fecha |
electronic_payroll | — | fecha |
system_accounting | — | texto |
system_invoicing | — | texto |
code | — | texto |
prd_prc_id | — | referencia a Listas de Precios |
itm_prc_id | — | texto |
rating | — | número |
score | — | número |
curl -X PUT "https://sandbox.minimarket.digital/v1/customer/ID" \
-H "X-SYNCS-API-TOKEN: TU_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name_commercial": "ACME",
"email": "ventas@acme.pe"
}'
DELETE /v1/customer/{id} Eliminar un registro — Elimina el registro ▶
curl -X DELETE "https://sandbox.minimarket.digital/v1/customer/ID" \
-H "X-SYNCS-API-TOKEN: TU_TOKEN"
Respuesta
{
"status": "success",
"code": "200",
"message": "DELETED",
"data": null
}