Data feed quickstarts
Any stack (raw HTTP)
Python, Django, Flask, FastAPI, Rails, Go, .NET, Java, an ERP or a POS: if it can answer HTTPS with JSON, it can feed your agent. This page is the whole contract in raw HTTP. About 15 minutes for the minimum.
The contract in four rules #
- A public manifest at
https://YOUR-DOMAIN/.well-known/waforge.json(or any URL on your domain that you paste in the dashboard). No secrets in it. - At least one endpoint under your
base_url. The useful minimum isGET /catalog/search,GET /products/{id}andPOST /availability; addPOST /orders/lookupwhen you can. - A signature check on every endpoint except the manifest: recompute the HMAC from
WaForge-Signatureand answer 401 when it does not match (algorithm and test vectors). - An envelope on every 2xx answer:
{"data": ..., "as_of": "2026-11-07T10:15:00Z", "ttl": 60}. Answer 404 when an item does not exist.
1. The manifest #
{
"waforge_feed": "1.0",
"tenant": "wf_tn_...",
"verification": "wfv_...",
"base_url": "https://shop.example.com/waforge",
"auth": { "type": "hmac-sha256", "key_id": "fs_..." },
"business": { "name": "Example Shop", "currency": "QAR", "prices_include_tax": true,
"default_locale": "en", "locales": ["en", "ar"], "timezone": "Asia/Qatar" },
"capabilities": {
"catalog.search": "/catalog/search",
"product.get": "/products/{id}",
"availability": "/availability",
"order.status": "/orders/lookup"
},
"limits": { "timeout_ms": 2500 }
}The dashboard shows this manifest pre-filled with your values ("Example manifest" on your feed's page).
2. The endpoints #
GET /waforge/catalog/search?q=black%20card&limit=5
WaForge-Signature: t=1762510500,kid=fs_...,v1=...
200 {"data":{"items":[{"id":"p_1001","name":"Black card","currency":"QAR","price":"249.00",
"url":"https://shop.example.com/p/black-card","variants":[{"id":"p_1001","price":"249.00","available":true}]}]},
"as_of":"2026-11-07T10:15:00Z","ttl":300,"next_cursor":null}GET /waforge/products/p_1001
WaForge-Signature: t=1762510500,kid=fs_...,v1=...
200 {"data":{"id":"p_1001","name":"Black card","currency":"QAR","price":"249.00",
"variants":[{"id":"p_1001","sku":"BC-01","price":"249.00","available":true}]},
"as_of":"2026-11-07T10:15:00Z","ttl":60}
404 {"type":"https://waforge.online/developers/troubleshooting#not_found","title":"Not found",
"status":404,"code":"not_found","detail":"No such product"}POST /waforge/availability
Content-Type: application/json
WaForge-Signature: t=1762510500,kid=fs_...,v1=...
{"items":[{"product_id":"p_1001","quantity":1}]}
200 {"data":{"items":[{"product_id":"p_1001","available":true,"quantity_available":3,"status":"low_stock"}]},
"as_of":"2026-11-07T10:15:00Z","ttl":30}POST /waforge/orders/lookup
Content-Type: application/json
WaForge-Signature: t=1762510500,kid=fs_...,v1=...
{"order_number":"CMD-2041","phone":"+97455551234"}
200 {"data":{"order_number":"CMD-2041","status":"shipped","status_label":"Shipped"},"as_of":"2026-11-07T10:15:00Z","ttl":0}
404 when the order does not exist OR the phone on the order does not match (same answer for both)Exact field lists and the optional endpoints are in the Data feed reference.
3. Verify the signature #
header = "t=<unix seconds>,kid=<key id>,v1=<64 lower-case hex>"
reject unless t matches ^[1-9][0-9]*$ and v1 matches ^[0-9a-f]{64}$
reject if |now - t| > 300
base = t + "\n" + METHOD + "\n" + path_and_query + "\n" + hex(sha256(raw_body))
expected = hex(hmac_sha256(key = your feed secret "wf_fs_...", message = base))
accept only if constant_time_equal(expected, v1) and (t, v1) was not seen in the last 600 sExamples per language #
# pip install flask ; flask --app flask_app run (waforge_feed.py is in generic.zip)
import os, time
from flask import Blueprint, Flask, request, jsonify
from waforge_feed import verify, envelope, problem, replay_key, MAX_BODY
app = Flask(__name__)
app.config["MAX_CONTENT_LENGTH"] = MAX_BODY # 413 above 1 MB
SECRET = os.environ["WAFORGE_FEED_SECRET"]
feed = Blueprint("waforge", __name__, url_prefix="/waforge")
_seen = {} # in-process replay guard; with several workers use Redis SET key 1 NX EX 600
@feed.before_request
def check_signature():
pq = request.path + (("?" + request.query_string.decode()) if request.query_string else "")
header = request.headers.get("WaForge-Signature", "")
if not verify(header, [SECRET], request.method, pq, request.get_data()):
return jsonify(problem(401, "unauthorized", "Invalid or expired WaForge-Signature")), 401
key, now = replay_key(header), time.time()
if _seen.get(key, 0) > now:
return jsonify(problem(401, "unauthorized", "Replayed request")), 401
_seen[key] = now + 600
@feed.get("/products/<pid>")
def product(pid):
p = db_find_product(pid) # your code
if not p:
return jsonify(problem(404, "not_found", "No such product")), 404
return jsonify(envelope({"id": p.id, "name": p.name, "currency": "QAR", "price": f"{p.price:.2f}",
"variants": [{"id": p.id, "price": f"{p.price:.2f}"}]}, 60))
app.register_blueprint(feed)# settings.py: WAFORGE_FEED_SECRETS = [os.environ["WAFORGE_FEED_SECRET"]]
# urls.py: path("waforge/products/<str:pid>", views.product)
from django.http import JsonResponse
from .waforge_django import waforge_signed # 1 MB cap, raw body, get_full_path(), replay guard via cache.add
from .waforge_feed import envelope, problem
@waforge_signed
def product(request, pid):
p = Product.objects.filter(pk=pid, is_published=True).first()
if not p:
return JsonResponse(problem(404, "not_found", "No such product"), status=404)
price = f"{p.price:.2f}"
return JsonResponse(envelope({"id": str(p.pk), "name": p.name, "currency": "SAR", "price": price,
"variants": [{"id": str(p.pk), "price": price}]}, ttl=60))// waforge.go is in generic.zip: Sign, Verify, Middleware (HMAC + 300 s window + 1 MB cap).
// Add your own replay guard (for example Redis SET key NX EX 600 on ReplayKey(header)).
mux := http.NewServeMux()
mux.HandleFunc("/waforge/availability", availabilityHandler)
mux.HandleFunc("/waforge/products/", productHandler)
http.Handle("/waforge/", waforge.Middleware([]string{os.Getenv("WAFORGE_FEED_SECRET")}, mux))
http.ListenAndServe(":8080", nil)# waforge.rb is in generic.zip
class WaforgeController < ActionController::API
before_action do
header = request.headers['WaForge-Signature'].to_s
ok = WaForge.verify(header, [ENV['WAFORGE_FEED_SECRET']], request.method, request.fullpath, request.raw_post)
ok &&= Rails.cache.write("waforge:seen:#{WaForge.replay_key(header)}", 1, expires_in: 600, unless_exist: true)
head :unauthorized unless ok
end
def product
p = Product.find_by(id: params[:id])
return render(json: { code: 'not_found' }, status: 404) unless p
render json: { data: { id: p.id.to_s, name: p.name, currency: 'QAR', price: format('%.2f', p.price) },
as_of: Time.now.utc.iso8601, ttl: 60 }
end
endA C# signing function is in the README of generic.zip.
4. Test with curl and openssl #
SECRET='wf_fs_...'; KID='fs_...'; PQ='/waforge/catalog/search?q=card&limit=3'
T=$(date +%s)
BODY_HASH=$(printf '' | openssl dgst -sha256 -hex | sed 's/^.* //')
V1=$(printf '%s\n%s\n%s\n%s' "$T" GET "$PQ" "$BODY_HASH" | openssl dgst -sha256 -hmac "$SECRET" -hex | sed 's/^.* //')
curl -s -H "WaForge-Signature: t=$T,kid=$KID,v1=$V1" "https://shop.example.com$PQ"Expect your envelope. Run the same command again within 10 minutes with the same T and you should get 401 (replay). Then use the feed checker in the dashboard.