leonardo-picciani/senior-erp-agent-skills
Overview
This skill creates Sales Orders (Pedido de Venda) in the Senior ERP through the Senior X Platform. It focuses on safe, idempotent creation flows for orders coming from external channels such as e-commerce or marketplace. Use it when you need validation, confirmation and normalized results before writing into the ERP.
How this skill works
The skill validates input (client, items, delivery, payment), checks idempotency using an external_order_id, and queries Senior APIs to detect existing orders. It presents a compact confirmation summary, then calls the appropriate Senior endpoint to create or update the order with retry/backoff for transient errors. The result is normalized: Senior order number, external_order_id, status and any warnings or actionable errors.
When to use it
- Importing or synchronizing e-commerce/marketplace orders into Senior ERP
- Creating sales orders where deduplication by external_order_id is required
- Flows that require a human confirmation step before mutating ERP data
- Batch imports where you must report created vs already-existing orders
- Scenarios requiring validation of items, prices, shipping and payment data
Best practices
- Define and use external_order_id as the idempotency key for every incoming order
- Decide price precedence (channel price vs ERP price table) and apply consistently
- Validate required fields (client, item SKU, quantity > 0, payment terms) before API calls
- Query the ERP for existing orders first to avoid duplicates and support updates
- Show a concise summary (client, total, top items, delivery, payment) and get confirmation before create
- Implement retries with exponential backoff for 429 and 5xx responses and handle validation errors explicitly
Example use cases
- Real-time checkout integration: validate cart, confirm with operator, then create PV with external_order_id
- Bulk import of marketplace orders: deduplicate, create missing orders and report grouped errors
- Order enrichment flow: locate or create client in Senior, validate SKUs, then persist sales order
- Automated pipeline that flags stock warnings or price substitutions back to the channel
FAQ
Use external_order_id as the canonical idempotency key; first check the ERP for that key before creating.
What should I show in the confirmation step?
A compact summary: customer, order total, top N items, delivery method/cost and payment condition.
How are validation errors returned?
Return a normalized error structure with the failure reason and recommended action (fix data, retry, contact support).
2 skills
This skill creates a sale order in Senior ERP via API, ensuring idempotency, validation, and controlled confirmation before recording.
This skill upserts a client in Senior ERP via Senior X Platform, handling deduplication, validation, and optional partial updates.