WaForgeDevelopers

Get started

How the agent gets live prices

When a customer asks a price or stock question on WhatsApp, the agent does not remember an answer: it calls a tool, WaForge calls your website with a signed request, and your website answers from your own database. This page shows exactly what happens, step by step.

The sequence #

  1. Customer to agent"Is the black card in stock? How much?"
  2. Agent to WaForge ConnectTool calls check_availability and get_product
  3. WaForge ConnectFresh copy in cache? Stock 60 s, price 300 s, orders never
  4. WaForge Connect to your websitePOST /waforge/availability + WaForge-Signature
  5. Your websiteChecks the HMAC, reads your database
  6. Your website to WaForge Connect200 {data, as_of, ttl}
  7. WaForge Connect to agentResult with as_of and fresh: true
  8. Agent to customer"Yes, 3 in stock, 249 QAR."
  9. If anything failsTimeout, error, bad signature or stale value: the agent says it will check with the team and hands the chat to your inbox

Step by step #

  1. The customer writes on WhatsApp to your business number. The AI agent reads the message and decides it needs a fact it does not have.
  2. The agent calls a tool, for example check_availability with a product id. The agent never sees your secret, your database or your URL: it only sees the tool result.
  3. WaForge checks its short cache. A recent answer can be reused, but never for longer than your ttl and never longer than the cap for that kind of data (caching rules). Order status is never cached.
  4. WaForge calls your feed over HTTPS on port 443, on your verified domain only, with a WaForge-Signature header. It waits 2.5 seconds by default (you can ask for 1 to 5 seconds in your manifest).
  5. Your site verifies the signature with your feed secret and reads the value from your own database. The kits do this for you.
  6. Your site answers with a small JSON envelope: data, as_of (when the value was true) and ttl (how many seconds it may be reused).
  7. WaForge checks the answer: valid envelope, and for stock, prices, slots and delivery, a value no older than its cap. It cleans the text (HTML, hidden characters) and hands the result to the agent.
  8. The agent replies with the value it just read. Every tool call is logged with its source, status and time.

What your site receives #

HTTP request from WaForge
POST /waforge/availability HTTP/1.1
Host: shop.example.com
Accept: application/json
Content-Type: application/json
WaForge-Signature: t=1762424160,kid=fs_k3j9x0aq1m2b7c,v1=5f0c2a...e91b
WaForge-Request-Id: 2b8f7c0e-4d1a-4c2e-9a57-0c1d2e3f4a5b
WaForge-Tenant: wf_tn_Xc81pQ0aZr7mT2Lk

{"items":[{"product_id":"p_1001","quantity":1}]}
Your answer
HTTP/1.1 200 OK
Content-Type: application/json

{"data":{"items":[{"product_id":"p_1001","available":true,"quantity_available":3,"status":"low_stock"}]},
 "as_of":"2026-11-07T10:15:00Z","ttl":30}

Which agent tool calls which endpoint #

Agent toolCalls on your feedNotes
search_catalogGET catalog.searchq and limit (the agent asks for at most 10)
get_productGET product.getIf that answers 404 and you declare product.by_sku, the same id is tried as a SKU
check_availabilityPOST availabilityOne item per request, quantity: 1
get_price_quoteGET product.get per item, then GET delivery.zones if a zone is givenWaForge multiplies your prices and adds the zone fee. Your /quote endpoint is not called yet.
lookup_orderPOST order.statusSends the customer's WhatsApp number from the chat session, never a number the customer typed
get_delivery_optionsGET delivery.zones
get_booking_slotsGET booking.slotsAt most 14 days between from and to
create_order, create_bookingNothing (create_booking re-reads booking.slots first)The confirmed request is put in your WaForge inbox for your team. Nothing is written to your site and nothing is charged.
get_business_hours, search_faqsNothingAnswered from the hours and FAQs in your agent setup

Without a live feed, search, product and stock questions are answered from your Google Sheet or CSV catalog. Orders, delivery zones and booking slots need a live feed.

When the agent hands off #

The tool result tells the agent not to state a value, and to hand the chat to a person, when:

  • your feed times out (2.5 s by default), cannot be reached, or answers anything other than 2xx or 404;
  • your feed refuses our signature (401), for example after a secret rotation you have not deployed yet;
  • the answer is not a valid envelope (data, as_of, integer ttl);
  • a stock, price, slot or delivery value is older than its cap (for example stock with an as_of more than 60 s ago);
  • your feed failed 5 times in a row: WaForge then pauses calls to it for 60 seconds;
  • stock from a sheet or CSV is older than 24 hours.

A 404 is not a failure: the agent says it could not find the item or order. The handoff puts the chat in your inbox and alerts you; the customer is told someone will check.

Next #

Pick how to expose your data: Connect your website.