How agents work with Avanza Fibra
An agent quotes, checks coverage, leaves a draft, gets payment through a secure link and creates the order. The server recalculates every total and the customer confirms the conditions.
- Read the catalog
Load the catalog once and reuse it to choose what to quote.
products_listGET /productsList the public catalog: fibre, mobile, TV, landline, alarms and packs. - Quote the configuration
Send the chosen configuration to the pricing engine. Keep the total it returns: it is the one the order will expect.
pricing_calculatePOST /pricing/calculateQuote a configuration with the pricing engine. The total is the one order_create expects. - Check coverage
Check the installation address before you promise fibre.
coverage_checkCheck whether an address has fibre coverage. Needscatalog:read. - Leave a draft
Save the configuration as a draft and keep the signed link for the customer.
draft_createPOST /draftsLeave a configured draft and get the customer's signed link (72 h). orders:write also opens it. Needsdrafts:write. - Create the secure payment link
Create the link from the draft and hand it to the customer. They type the IBAN there, not you.
payment_link_createPOST /payment-linksCreate the secure link (30 minutes) the customer opens to type their IBAN. You never see it. Needsorders:write. - Check the payment link
Poll the link until it is completed, then keep the paymentRef it returns.
payment_link_statusGET /payment-links/{linkId}/statusCheck a payment link: pending, completed or expired. On completed it returns paymentRef and the masked IBAN. Needsorders:write. - Create the order
Send the order with the paymentRef, the quoted total and the instant the customer confirmed the conditions.
order_createPOST /ordersCreate an order on behalf of a customer. Requires paymentRef and conditions.userConfirmedAt; accepts an idempotency key. Needsorders:write.
Then follow the order with order_status_get while it is processed.
Send the same key on every attempt of the same purchase.
POST /orders
Authorization: Bearer <token>
idempotency-key: <uuid>
content-type: application/json- The idempotency-key header is optional but recommended: without it the order is still created, with no protection against a retry.
- A retry with the same key returns the original order with 200 and the Idempotency-Replayed: true header. Over MCP, the response always includes replay (boolean) and, when it is true, replayNote explains (in Spanish) that nothing new was created.
IDEMPOTENCY_KEY_EXPIRED: The key is more than 24 hours old. Nothing was created with it: generate a new key for the SAME cart.IDEMPOTENCY_KEY_REUSED: An order may already exist with that key and different data. Do not regenerate the key: you would create the duplicate that idempotency prevents.
Always send an idempotency key
The idempotency-key header is optional for the server, but without it a retry after a lost response creates a second order. The same purchase carries the SAME key in all its attempts and the retry returns the original order. The replay window is 24 hours.
Retry only what can be retried
PRICE_MISMATCH, IDEMPOTENCY_KEY_REUSED and the 4xx validation errors do not improve when repeated: they give the same result. AGENT_RATE_LIMITED, 5xx responses and network errors do make sense to retry.
Never send personal data to logs
ID numbers, IBANs and full addresses do not go to logs, traces or error messages. The API masks them in its own output; an agent must not reintroduce them anywhere else. The IBAN, moreover, never passes through your hands: the customer types it in the secure link (see "Payments without an IBAN").
Do not trust the total you calculate
The authoritative amount is the one the server sets. An agent that builds its own price and sends it as truth receives PRICE_MISMATCH, and that is the correct behavior.
The agent never completes the customer's part.
- The draft link opens the contracting funnel at https://pedido.avanzafibra.com so the customer can review and finish.
- The secure payment link is where the customer types their IBAN and, with
collectPersonalData=true, their personal details. The agent never types or sees the IBAN. See Payments without an IBAN. - The customer confirms the conditions: your order carries that instant in
conditions.userConfirmedAt.
WebMCP-compatible browsers discover tools with a strict schema on the pages of avanzafibra.com, instead of reading the screen and pressing buttons. Each tool uses the same endpoints as the interface.
Available in browsers that expose document.modelContext (Chrome with the origin trial or with the chrome://flags/#enable-webmcp-testing flag). Without that support nothing is registered.
| Tool | Where | What it does |
|---|---|---|
buscar_direccion | any page of avanzafibra.com | Searches towns and streets with the coverage autocomplete. |
comprobar_cobertura | any page of avanzafibra.com | Checks whether an address has fibre, with the same states as the website. |
listar_tarifas | any page of avanzafibra.com | Lists fibre, mobile, TV, landline and packs with the current catalog prices. |
calcular_presupuesto | any page of avanzafibra.com | Calculates the monthly quote with the server pricing engine. |
promocion_vigente | any page of avanzafibra.com | Returns the current promotion and its conditions. |
empezar_contratacion | any page of avanzafibra.com | Takes the user to the contracting funnel with the configuration already chosen. |
What no tool does
- No tool submits the order, accepts conditions or signs: the final confirmation is always a click by the user.
- No tool asks for or fills in name, ID number, IBAN, email or phone: the user types them.
- The address tools (street, town, postal code, number) use the address the agent gives only to check coverage and prefill the order; the user reviews it. The address and the cart are saved when the tab closes, whether or not the user accepted the data processing, just as if the customer typed them; only commercial messages depend on consent.
- The tools that remove or replace something already chosen (cart products, address, mobile line options, the order open in the funnel) reject it unless the agent passes sustituir: true, and they are marked as consequential so the browser asks for confirmation. A draft only opens with an empty order and no earlier content in the page session.
- The tools only exist while the page is open in a WebMCP-compatible browser.