Developer docs
Build with Pico
Try the sandbox, embed the shopping assistant, and learn the API conventions used across widget and merchant endpoints.
Quickstart
- Start the API
Run the API on
http://localhost:8000and seed it withphp artisan migrate --seed. - Open the sandbox
Use the sandbox or call the widget endpoints directly.
- Sign in as a merchant
Dashboard at
http://localhost:3000withowner@pico.test/password.
The public widget flow uses three calls:
# 1. Fetch widget configuration (public, no auth)
curl http://localhost:8000/api/v1/widget/config/pw_sandbox_demo_widget_001
# 2. Start a shopper session
curl -X POST http://localhost:8000/api/v1/widget/sessions \
-H "Content-Type: application/json" \
-d '{"public_widget_id":"pw_sandbox_demo_widget_001","locale":"en"}'
# 3. Send a message
curl -X POST http://localhost:8000/api/v1/widget/sessions/<session_id>/messages \
-H "Content-Type: application/json" \
-d '{"message":"Waterproof hiking boots under 150"}'Embed the widget
<script type="module" src="https://cdn.example.com/pico-widget.js"
data-public-widget-id="pw_sandbox_demo_widget_001"
data-api-url="http://localhost:8000/api/v1"></script>The widget renders inside a Shadow DOM so your site styles can’t break it. Add-to-cart is only shown when the connected store reports the add_to_cart capability.
Sandbox guide
The sandbox is a clearly labeled, non-production environment backed by a mock store with sample outdoor gear.
- Anonymous: enter the demo widget ID
pw_sandbox_demo_widget_001and chat. - Signed in: the sandbox loads your own sandbox store via
GET /sandbox/config. - Every request and response is shown as JSON so you can see exactly what the API returns.
- Nothing here touches real orders, payments, or production catalogs.
Error format
Every error uses an HTTP status and one consistent JSON body. Always log request_id when reporting an issue.
{
"error": {
"code": "VALIDATION_ERROR",
"message": "The request could not be validated.",
"details": { "message": ["The message field is required."] },
"request_id": "req_01HXYZ..."
}
}| Code | HTTP | Meaning |
|---|---|---|
VALIDATION_ERROR | 422 | Invalid input; details has field errors |
UNAUTHENTICATED | 401 | Missing or invalid session/credentials |
FORBIDDEN | 403 | Authenticated but not allowed |
NOT_FOUND | 404 | Resource missing in your scope |
RATE_LIMITED | 429 | Too many requests |
CONFLICT | 409 | State conflict or duplicate mutation |
CONNECTOR_ERROR | 502 | Upstream commerce platform failed |
UNSUPPORTED_CAPABILITY | 400 | Action not supported by this store |
SESSION_EXPIRED | 401 | Widget shopper session expired |
AGENT_UNAVAILABLE | 503 | Model/agent provider unavailable |
INTERNAL_ERROR | 500 | Unexpected server error |
details details may contain field errors, and never contains secrets or stack traces.
Integration guides
Connect Pico to your commerce platform. Guides cover credentials, sync, and storefront embed.
Mock store
AvailableSandbox catalog for demos and local API testing.
Shopware 6
AvailableAdmin API + Store API setup with official Admin screenshots.
Shopify
AvailableOAuth install, catalog sync, and theme app embed for the Pico assistant.
Laravel store
PlannedShared commerce contract for custom Laravel storefronts.