For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DashboardGet started
  • Getting Started
    • Introduction
    • Quickstart
    • Errors
  • Core Concepts
    • Capabilities
    • Containers
    • Gateway
    • Wallets and top-ups
    • Grants and controls
    • Mandates
    • Approvals
    • Receipts
    • Settlements
  • Authentication
    • Authentication overview
    • Wallet sign-in (SIWE)
    • Connected apps (OAuth)
  • Guides
    • Call a capability
    • Monetize an API
    • Apply for public capability
    • Test with a hotel menu
    • Realtime notifications
  • Agents
    • MCP
    • CLI
  • API Reference
    • Overview
    • Authentication
  • Generated API Explorer
LogoLogo
DashboardGet started
On this page
  • 1. Start the hotel menu API
  • 2. Register it as a capability
  • 3. Call it through Lipafy
  • 4. Use the CLI
  • 5. Connect ChatGPT, Codex, or another MCP client
Guides

Test with a hotel menu

Was this page helpful?
Previous

Realtime notifications

Next
Built with

This guide gives you a small API you can use to test the full Lipafy loop: upstream service -> capability registration -> gateway call -> agent connection. The useful bit is flexible pricing: reading the menu can be free, while POST /order charges the total of the selected food items.

1. Start the hotel menu API

From the test app folder:

1cd "C:\Users\KIPKOECH\Downloads\test hotel"
2node server.mjs

It listens on http://127.0.0.1:4010 and exposes:

MethodPathWhat it does
GET/menuReturns the Soko Garden Hotel menu
POST/orderAccepts an order with item ids

Try it directly:

$curl http://127.0.0.1:4010/menu

2. Register it as a capability

Create an API key in the local dashboard, then register the test capability against your local Lipafy API.

The price_amount is the fallback price. The private provider_config.lipafy_pricing policy below makes /menu and /health free, then charges POST /order by adding the item ids in the request body.

$curl -X POST http://localhost:3000/v1/capabilities \
> -H "Authorization: Bearer lip_live_xxx" \
> -H "Content-Type: application/json" \
> -d '{
> "slug": "hotel.soko-garden.order",
> "name": "Soko Garden Hotel ordering",
> "description": "Browse the hotel menu and place a test food order.",
> "provider_type": "passthrough",
> "provider_config": {
> "endpoint_url": "http://127.0.0.1:4010",
> "auth_type": "none",
> "auth_value": "",
> "lipafy_pricing": {
> "mode": "request_body_items",
> "free_paths": ["/menu", "/health"],
> "items_field": "items",
> "items": {
> "swahili-breakfast": "850",
> "grilled-tilapia": "1450",
> "coastal-pilau": "1200",
> "passion-juice": "300"
> }
> }
> },
> "price_amount": "10",
> "price_currency": "KES",
> "revenue_share_percent": 0,
> "status": "active"
> }'

Local/private upstream URLs are allowed only outside production. In production, Lipafy blocks private addresses to prevent server-side request forgery. To test this against https://api.lipafy.xyz, deploy the hotel API somewhere public or expose it with a temporary HTTPS tunnel and use that public URL as provider_config.endpoint_url.

For your Netlify test deployment, use this endpoint instead:

1"endpoint_url": "https://chaihotel.netlify.app"

3. Call it through Lipafy

List the menu through the gateway:

$curl http://localhost:3000/gateway/hotel.soko-garden.order/menu \
> -H "Authorization: Bearer lip_live_xxx"

This call returns X-Payment-Charged: 0 because /menu is configured as a free browsing path.

Place a test order:

$curl -X POST http://localhost:3000/gateway/hotel.soko-garden.order/order \
> -H "Authorization: Bearer lip_live_xxx" \
> -H "Content-Type: application/json" \
> -d '{"items":["coastal-pilau","passion-juice"],"note":"No chilli"}'

This order charges 1500 KES: 1200 for coastal-pilau plus 300 for passion-juice.

If you exposed the hotel API publicly and registered it on production, switch the base URL to https://api.lipafy.xyz:

$curl https://api.lipafy.xyz/gateway/hotel.soko-garden.order/menu \
> -H "Authorization: Bearer lip_live_xxx"

4. Use the CLI

After installing the CLI:

$lipafy login --token lip_live_xxx --api-base http://localhost:3000
$lipafy call GET /gateway/hotel.soko-garden.order/menu
$lipafy call POST /gateway/hotel.soko-garden.order/order \
> -d '{"items":["grilled-tilapia"],"note":"Extra kachumbari"}'

5. Connect ChatGPT, Codex, or another MCP client

For Codex or another local MCP-capable client running on your machine, point it at your local Lipafy API:

1{
2 "mcpServers": {
3 "lipafy": {
4 "type": "http",
5 "url": "http://localhost:3000/mcp"
6 }
7 }
8}

For ChatGPT or any hosted MCP client, use the production URL and a publicly reachable hotel API endpoint:

1{
2 "mcpServers": {
3 "lipafy": {
4 "type": "http",
5 "url": "https://api.lipafy.xyz/mcp"
6 }
7 }
8}

Then ask the agent:

List my Lipafy capabilities, find the hotel menu capability, show me the menu, and place a test order for coastal pilau and passion juice.

The agent should discover hotel.soko-garden.order and call lipafy.execute_capability.