Automation · Collections and receivables
Create an Alegra sales invoice draft with human approval
Verify the customer, products, prices, and taxes, then create an Alegra invoice draft only after fresh approval. No issuance and no automatic retry.
How do I create an Alegra sales invoice draft after reviewing it?
From Meteor's web platform, the Met verifies the account, an existing customer, and every Alegra product or service. It reads the pre-tax price, tax ids, and stock when the item tracks it, then shows the customer, dates, lines, and the operation's expected total. It ends the turn and waits for explicit approval in a new message. Only then does it call crear_pedido with confirmar as the literal boolean true. The handler validates every field before the network, fixes status to draft, never forwards confirmar, and makes one POST. It reports the number, status, total, and currency returned by Alegra. It does not issue an electronic invoice, record payment, send email, or generate a PDF.
What starts it
When someone asks for it
A person starts the task in the web platform with the sale to save as a draft. The Met prepares the summary and stops. A later message must approve those exact fields. Any change replaces the summary and invalidates the previous approval.
A manual task: someone on the team runs it with a button, or asks the Met for it in chat.
Who runs it
Alegra administration Met
Finance and operations team
It supports a person working from the desk, prepares one concrete document, preserves Alegra as the source of truth, and separates human review from the single write.
What you need connected
- Alegra Collect and manage
6 steps · 8 tools
The procedure, step by step
Each step shows the tool that runs. They belong to the real connector: if one of them stopped existing, this page would not build.
- 1
Verify the account and administrative preconditions
The Met reads the company to get the actual account country, currency, and time zone. Alegra must already have a preferred numbering template, because this tool cannot select one and the API returns an error when it cannot use the preferred template. Reading the country does not validate a fiscal contract. This recipe only creates a draft and does not issue the document.
- 2
Select an existing customer and rule out an obvious duplicate
It searches by tax id, email, phone, or name and keeps one verified existing cliente_id. This recipe does not create or correct contacts. It then lists that customer's invoices on the approved date, in pages of up to 30 records, and opens any candidate that matches the prepared document. Because there is no unique idempotency reference, it shows every reasonable candidate and stops for the operator to decide. It does not declare an unequivocal match by itself.
- 3
Verify products, prices, taxes, and stock
Every line starts from a reference or name resolved to an existing producto_id. The exact price lookup returns price lists and configured taxes with id, percentage, and status. The operator chooses the pre-tax unit price and exact impuestos_ids. It uses [] only after reviewing that the line carries no tax. When the item tracks inventory, it also reads stock by warehouse. A service without inventory is not presented as out of stock.
- 4
Show every field and end the turn
The Met shows cliente_id and name, account country and currency, explicit fecha and fecha_vencimiento in YYYY-MM-DD, and every producto_id with a positive quantity, precio_override before tax, and impuestos_ids. It also shows the operation's expected total and says Alegra will calculate the final total. The initial request does not approve this summary. Silence, a question, or an ambiguous answer leaves the draft uncreated.
- 5
Create once and read the returned draft
Only after a new, unambiguous yes does it call crear_pedido with confirmar as the literal boolean true. Missing, false, and the text "true" are rejected before any fetch. Empty products, empty ids, nonpositive quantities, missing or nonfinite prices, nonexplicit impuestos_ids, invalid dates, and a due date before the document date also fail before the network. confirmar never enters the body. Alegra receives status draft, the customer, dates, and approved lines. The Met opens the created id and reports only the returned number, status, total, and currency.
- 6
Reconcile an uncertain response without repeating the POST
The transport never retries POST /invoices, even after 429. When crear_pedido returns posiblemente_creada after a network failure or an HTTP 5xx response, preserving the status when available, the Met does not call the write again. It lists the customer's invoices on that date across every applicable page and opens candidates to compare dates, lines, and total. Even with no match, it hands the evidence to the operator for manual review in Alegra. A second attempt requires another human decision.
Before you start
What you need ready
The Met solves none of these for you. If one is missing, the automation stops there.
-
An Alegra account with API access
In Alegra, open Settings, Integrations, API and generate the token. Meteor stores the Base64 value of email:token per workspace. The Met reads the company country, currency, and time zone, but it does not turn that lookup into fiscal validation.
-
Existing customer, products, taxes, and prices
Keep the correct customer and active products or services in Alegra with their price lists and taxes. The recipe reads and reuses their ids. Registration and data corrections happen outside this task.
-
Preferred numbering and agreed dates
Configure a preferred numbering template in Alegra that can be used for the draft. Before approval, the operator sets explicit document and due dates in YYYY-MM-DD. The Met does not choose defaults after approval.
The limits
What this automation does NOT solve
Better said here than discovered halfway through the rollout.
-
It does not run over WhatsApp, web chat, Instagram, or Messenger. crear_pedido belongs to the sensitive accounting group and the handler refuses it when the request carries channel context.
-
It does not create or update customers. If buscar_cliente does not return one unique current record, the person resolves the contact master in Alegra before resuming.
-
It does not choose taxes or convert a tax-inclusive price. It forwards only the approved pre-tax precio_override and tax ids. [] must be an explicit decision.
-
It does not select numbering, a sales rep, a warehouse, a cost center, a multicurrency price list, retentions, or country-specific terms. Those cases are prepared in Alegra.
-
It does not issue, file, stamp, or void an electronic invoice. status draft is a draft and does not prove acceptance by DIAN, SAT, or any other tax authority.
-
It does not record payment or mark the document paid. The write contains no payments, and later status and balance are queried separately.
-
It does not email the draft or return a PDF. Alegra's documentation says a draft cannot generate a PDF URL, and the connector does not call the email endpoint.
-
It does not automatically retry a failed or uncertain creation. An uncertain result can hide an existing draft, so even no match requires human review.
FAQ
Questions about this automation
The initial request does not yet contain the summary that must be approved. The later message responds to the customer, dates, lines, prices, taxes, and expected total just shown by the Met. The handler requires confirmar as literal boolean true before any network request.
No. The tool fixes status to draft and calls no issuance, filing, or stamping endpoint. The operator continues the fiscal process in Alegra according to the country and account setup.
consultar_precio returns configured taxes with their ids. The operator approves the exact list and crear_pedido sends it as tax objects with id. The Met never infers taxes from a name, percentage, country, or product type.
No. Both must exist before the summary. If a record is missing or matches are ambiguous, the person creates or corrects it in Alegra and runs the lookups again.
The POST is not repeated. The recipe lists documents for the customer and date, opens candidates, and hands over the evidence. Even without a matching draft, another creation requires a fresh human decision after reviewing Alegra.
Keep going
Other automations built on the same tools
Collections and receivables
Collect overdue invoices over WhatsApp without chasing anyone by hand
How do I collect overdue invoices over WhatsApp without reviewing the ledger by hand?
Finance and operations
- Starts:
- at a set time
- Steps:
- 5, with 8 real tools
- Needs:
- Alegra · Meteor CRM
Sales and quoting
Quote over WhatsApp against live Alegra inventory
How do I quote over WhatsApp without having to open Alegra?
Finance and operations
- Starts:
- when the customer writes
- Steps:
- 5, with 12 real tools
- Needs:
- Alegra · Meteor CRM
Collections and receivables
Charge inside the conversation with a Mercado Pago link
How do I charge over WhatsApp without sending people to another app or asking for card details?
Sales
- Starts:
- when the customer writes
- Steps:
- 6, with 11 real tools
- Needs:
- Mercado Pago · Meteor CRM
Collections and receivables
Charge by PSE and Nequi inside the conversation, with Wompi
How do I charge by PSE or Nequi from WhatsApp without pulling the customer out of the chat?
Sales
- Starts:
- when the customer writes
- Steps:
- 5, with 10 real tools
- Needs:
- Wompi · Meteor CRM
Want this automation running on your own data?
We will show it to you with your accounts connected, not with a canned demo.