- Home
- Skills
- Leonardo Picciani
- Senior Erp Agent Skills
- Senior Erp Cliente Upsert
senior-erp-cliente-upsert_skill
0
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill leonardo-picciani/senior-erp-agent-skills --skill senior-erp-cliente-upsert- SKILL.md5.2 KB
Overview
This skill creates or updates customer records in Senior ERP via the Senior X Platform using an upsert pattern. It handles both individual (PF) and corporate (PJ) customers, with deduplication by CNPJ/CPF or external ID and validation of addresses and contacts. Use it to synchronize CRM, e-commerce, or other systems with Senior while preserving idempotency and clear error reporting.
How this skill works
The skill validates minimal required inputs (identifier, name, contact, addresses), normalizes identifiers (only digits for CNPJ/CPF/CEP), and queries the Senior API to check for existing records. It decides between create or update, prepares a compact change summary for explicit confirmation, then calls the appropriate Senior endpoint with retry/backoff and required headers. Results are returned in a normalized form showing created/updated fields, Senior record ID, and actionable errors if any.
When to use it
- Create or register a new customer (cadastro de cliente)
- Update an existing customer by CNPJ/CPF or external code
- Perform upsert flows when source data may duplicate existing records
- Integrate CRM or e-commerce customer lists into Senior ERP
- Apply deduplication and validation before persisting customer data
Best practices
- Agree on deduplication keys up front (CNPJ/CPF + company/branch or external_id)
- Send only normalized identifiers (digits only) and avoid echoing full PII in logs
- Collect minimum required fields and prefer partial updates when supported
- Show a compact summary and request explicit confirmation before mutating data
- Implement timeout, retry and backoff for 429/5xx and return clear field-level validation messages
Example use cases
- Upsert a PJ customer by CNPJ from an e-commerce onboarding flow
- Update delivery address for a customer found by CPF after confirmation
- Bulk-sync CRM customers to Senior and report counts of created vs updated vs failed
- Run a pre-check to detect duplicates across branches before creating a new customer record
FAQ
Mandatory fields depend on the target endpoint; typically an identifier (CNPJ/CPF or external_id), name/razão social and at least one contact. Confirm required fields via the Senior API Browser.
How is deduplication performed?
Deduplication is performed by querying Senior using the agreed identifier(s). If a match exists the skill prepares an update; otherwise it creates a new record. Use external_id when available to avoid CNPJ/CPF collisions.