- Run the pricepally-api reference backend
- Create the agent in the dashboard
- Ground answers with a knowledge base (delivery, payments, seasons)
- Wire a Skill for search products, add to cart, and track order status
- Deploy the Mobile app profile and embed in React Native
The reference backend lives at
pricepally-api/ in the Chatropic repo (port 8084). The reference mobile shell is examples/react-native-demo/. Swap in your own API base URL, the dashboard action setup is the same.What you are building
API reference (pricepally-api)
All protected routes requireAuthorization: Bearer <jwt> from POST /api/auth/login.
Agent BFF routes (signed-in users)
When each shopper has their own JWT, point Chatropic actions at/api/agent/* instead of calling protected routes with a shared token. The BFF validates a static service token, reads X-End-User-Id, looks up that user’s Pricepally JWT from the session store, and proxies the request.
BFF headers (on every agent action):
Prerequisites
1
Start Postgres
From the Chatropic repo root:
2
Run pricepally-api
curl http://localhost:8084/health, {"status":"ok"}On first boot the API runs migrations and seeds from seed/pricepally_seed.json.3
Demo credentials
4
Obtain a JWT for action testing
token from the response, use it when testing actions in the dashboard.5
Chatropic dashboard
Open the playground dashboard (default
http://localhost:3000) and sign in to your workspace.Step 1, Create the agent
1
Create workspace
Sign in and open (or create) a workspace for your grocery product.
2
Set product type
Use Customer Support so the agent can combine knowledge retrieval with HTTP actions.
3
Open Playground
In Playground, set the display name (for example Pricepally Assistant), welcome message, and suggested prompts (see Step 6).
Step 2, Knowledge base setup
Ground delivery, payment, and policy answers so the agent does not invent storefront rules.1
Add FAQ documents
Documents: paste or upload content such as:
2
Smoke test retrieval
New test session, ask “What payment methods do you accept?”, answer should cite your document.
Step 3, Authentication for actions
pricepally-api protects catalog, cart, and order routes with JWT. Pick one pattern:
- Demo (static JWT)
- Agent BFF (signed-in app)
- Customer login (OAuth)
1
Login and copy token
2
Save static token
Manage tokens: new Static token
3
Use in action headers
On each HTTP action:Point actions at
/api/products, /api/cart/items, /api/orders (not /api/agent/*).Manage tokens
Static vs customer-login tokens.
Step 4, Skill setup
Create one skill per feature under Agent settings → Skills → New skill. Each skill covers a single capability and auto-creates the linked HTTP action when saved.What is a Skill?
A Skill is a playbook that tells the agent when to activate and how to carry out one feature, including the API call to make. When you save a skill with a webhook step, Chatropic creates (or updates) the linked HTTP action automatically. See the Skills guide for the full editor reference. Create the three skills below in sequence. For each one:- Open Agent settings → Skills, then New skill.
- Paste the description prompt into the Describe your skill field.
- Review the generated When to use, Steps, and webhook URL/headers. Edit inline if needed.
- Click Save skill. The linked action appears under Available actions.
For the Demo static JWT pattern, replace
{{token.pricepally_bff}} with {{token.pricepally_demo_jwt}} and use the direct API URLs (/api/products, /api/cart/items, /api/orders) instead of /api/agent/*.4a, Search products skill
Prompt to paste:When a shopper asks what produce is available, in season, or asks for the price of an item, search the Pricepally catalog. CallWebhook the skill should generate:GET http://localhost:8084/api/agent/products?q={{query}}with headersAuthorization: Bearer {{token.pricepally_bff}}andX-End-User-Id: {{end_user_id}}. Summarize results by name, price range in Naira, and season status. If no results, say so and suggest refining the search.
Sample response:
4b, Add to cart skill
Prompt to paste:When a shopper asks to add an item to their cart, add it using the Pricepally API. If theWebhook the skill should generate:product_idis not already known, first search for the product to resolve it. Then callPOST http://localhost:8084/api/agent/cart/itemswith headersAuthorization: Bearer {{token.pricepally_bff}},X-End-User-Id: {{end_user_id}},Content-Type: application/json, andAccept: application/json. Send body{"product_id":"{{product_id}}","quantity":{{quantity}}}. Default quantity to 1 if not specified. Confirm the updated cart subtotal in Naira.
Accept: application/json is required. The mobile app uses Accept: text/event-stream for live cart sync; the agent action needs a normal JSON response.4c, Order status skill
Prompt to paste:When a shopper asks where their order is or provides an order reference, look up the delivery status. CallWebhook the skill should generate:GET http://localhost:8084/api/agent/orders?order_id={{order_id}}with headersAuthorization: Bearer {{token.pricepally_bff}}andX-End-User-Id: {{end_user_id}}. Report the status, order date, and main product. If the user asks to see all their orders without a reference, omit theorder_idparameter.
Sample response:
Validate auto-created actions
After saving all three skills, confirm each linked action is wired correctly:- Open Available actions → click each action (
search_products,add_to_cart,get_order_status) - Verify the URL, method, and headers match the tables above
- Use the action Test panel with sample parameters (
query: "ginger",order_id: "00A49291044D1") - Use each action’s Test panel to check resolved URLs and response bodies
Skills
Create and manage skills under Agent settings.
Action chaining
Search → add to cart chain reference.
Step 5, Agent instructions
In AI (or Agent settings), add system guidance:Step 6, Suggested prompts
Suggested prompts on the Content tab:Step 7, Test in Playground
1
Product search
Ask “Do you have ugu?”,
search_products with q=ugu, agent lists Ugu with price range.2
Add to cart
Ask “Add ginger to my cart”, search then
add_to_cart with product_id: "3", confirms updated subtotal.3
Order status
Ask “Where is order 00B77120355E2?”,
get_order_status, explains Processing status and main item.4
FAQ without action
Ask “How do I pay?”, answer from Documents, no HTTP call.
Step 8, React Native embed
The repo includes a Pricepally-skinned demo that uses the same API for login, products, cart SSE, and orders.1
Configure env
2
Run services
3
Deploy mobile profile
Mobile app, configure style and content, Deploy, toggle Live.
4
Sign in and chat
Use demo credentials
ada@pricepally.demo / Demo1234! in the app shell, then open the chat launcher. Cart tab stays in sync via GET /api/cart/stream SSE.React Native deploy
Mobile app profile and tenant id.
React Native SDK
ChatWidgetLauncher, storage, and identity props.Quick curl reference
Troubleshooting
Related
- Backend README:
pricepally-api/README.mdin the Chatropic repo - Catalog & product FAQ, generic catalog patterns
- Fintech SaaS agent, JWT + customer-login token patterns