Kifly REST API
The HTTP surface behind every Kifly integration. Anything an MCP tool does, you can do here.
Base URL
https://kifly.ai
Authentication
No key needed. Identify your agent with its UCP profile URL and start. Without a key you can use search, store lookups, carts, the shipping address, the payment link, order status, cancelling a checkout and feedback.
UCP-Agent: profile="https://<your-domain>/.well-known/ucp"
A bare URL also works: UCP-Agent: https://<your-domain>/.well-known/ucp. Replace <your-domain> with a domain you control: the URL must be absolute https:, and placeholder and reserved domains such as example.com are refused.
A key adds more: no daily limit, the buyer's saved address and email pre-filled, their order history across sessions, and USDC payment without a human step. Buyer-identity calls and USDC payment without a human step need one. Sign in with OAuth 2.1 (your MCP client offers it), or have your operator confirm one emailed code (POST /api/agent/credentials).
A key or OAuth token. OAuth 2.1 with Dynamic Client Registration is advertised at /.well-known/oauth-authorization-server, and buyer:write is a supported scope. See MCP Integration for which credential fits.
Authorization: Bearer kfa_live_xxxxxxxxxxxx
If Authorization is present it is always used, so an invalid key returns 401 rather than falling back to the open path. To shop without a key, drop the header and send your UCP-Agent profile.
A signing domain (platforms). If your agents sign their requests with HTTP Message Signatures (RFC 9421, Web Bot Auth, or Visa Trusted Agent Protocol's agent-payer-auth), register your domain once instead of giving each agent a key:
POST /api/agent/operators/hosts/requestwith{ "operator_email", "host" }. We email that address a code.POST /api/agent/operators/hosts/registerwith{ "request_id", "code" }, signed with a key listed in your UCP profile'skeys[]or your domain's/.well-known/http-message-signatures-directory, and aUCP-Agentprofile on that domain.
After that, a paid request with no key, signed the same way under your domain and covering the payment header, pays as yours. A domain that is not registered gets AGENT_CREDENTIAL_REQUIRED.
curl -sS 'https://kifly.ai/api/agent/search?q=hat&limit=3' \
-H 'UCP-Agent: profile="https://<your-domain>/.well-known/ucp"'
Several items in one search. Repeat q once per item the shopper wants, up to 5: ?q=dog+shampoo&q=cat+collar&q=dark+roast+coffee. Describe each item in the shopper's own words; a keyword phrasing can ride along as another query. Each query keeps its own results and the page takes them in turn, so every item gets its share. Each result carries kifly:matchedQuery (the index of the query that found it), and kifly:queryResults gives each query's count and says which found nothing. One string with commas is searched as one product.
Open endpoints
These accept UCP-Agent or a credential.
| Method | Path | What it does |
|---|---|---|
GET | /api/agent/search | Search or browse the catalog |
GET | /api/agent/sellers | List sellers |
GET | /api/agent/seller | One seller, by handle, domain or name |
GET | /api/agent/policies | A seller's store policies |
POST | /api/agent/cart | Create a cart |
GET DELETE | /api/agent/cart/{id} | Read or cancel a cart |
POST | /api/agent/cart/{id}/items | Add a line item |
PATCH DELETE | /api/agent/cart/{id}/items/{itemId} | Change quantity, or remove |
POST | /api/agent/cart/{id}/shipping-address | Set the shipping address |
POST | /api/agent/quick-buy | Cart, item and address in one call |
POST | /api/agent/payment-link | A payment link the buyer confirms |
POST | /api/agent/feedback | Report a problem |
GET | /api/agent/platform/limits | Live cart limits |
GET | /api/agent/docs/{slug} | These pages as JSON |
Buyer identity, order history and paying from the agent's own wallet (POST /api/agent/cart/{id}/checkout, or a paid request to a product's /api/x402/{handle}/{slug}) require a credential. See Payment Rails, and for an agent that pays on its own, Autonomous payments with x402.
Say which agent on your platform you are: Kifly-Agent: id="<stable opaque id>", name="<display name>". If your profile names your platform (a bare /.well-known/ucp), it is shared by every agent on it, so carts and checkout require this header (AGENT_ID_REQUIRED otherwise); browsing does not. A profile URL that names the agent (/agents/<name>) needs nothing more. Past the keyless daily allowance, or when Kifly asks an agent to identify itself, calls get 401 SIGN_IN_REQUIRED with a WWW-Authenticate header naming the OAuth server; sign in, or use an issued key, to continue.
Standard UCP endpoints
If your agent already speaks the Universal Commerce Protocol, it needs nothing Kifly-specific. Kifly serves the spec's shopping service (dev.ucp.shopping) over both of its transports, and your agent finds them under services["dev.ucp.shopping"] in /.well-known/ucp.
| Transport | Endpoint | Contract |
|---|---|---|
| REST | https://kifly.ai/api/ucp/rest | rest.openapi.json |
| MCP | https://kifly.ai/api/ucp/mcp | mcp.openrpc.json |
Over REST, append the spec's paths to the endpoint:
| Method | Path | What it does |
|---|---|---|
POST | /catalog/search | Search the catalog |
POST | /catalog/lookup | Products or variants by id, up to 20 |
POST | /catalog/product | One product, with its options |
POST | /carts | Create a cart |
GET PUT | /carts/{id} | Read a cart, or replace its line items |
POST | /carts/{id}/cancel | Cancel a cart |
POST | /checkout-sessions | Create a checkout |
GET PUT | /checkout-sessions/{id} | Read a checkout, or update its items and shipping address |
POST | /checkout-sessions/{id}/complete | Hand the checkout to the buyer |
POST | /checkout-sessions/{id}/cancel | Cancel a checkout |
GET | /orders/{id} | The order, once the buyer has paid |
curl -sS -X POST 'https://kifly.ai/api/ucp/rest/catalog/search' \
-H 'UCP-Agent: profile="https://<your-domain>/.well-known/ucp"' \
-H 'Content-Type: application/json' \
-d '{"query":"linen shirt"}'
- Identify with
UCP-Agent, as above. Your profile must declare each capability you call, at the version in Kifly's profile (2026-08-25). - Writes (every
PUT, and everyPOSTexcept the three catalog reads) need anIdempotency-Keyof 16 to 64 characters. The same key and body returns the original answer; the same key with a different body is409. - Status codes follow the spec. Business outcomes, including not found and out of stock, are
200withmessages; creating a cart or checkout is201. A missing or invalid profile is400, a profile Kifly cannot fetch is424, an unreadable or unsupported one is422. A429or503carriesRetry-After. - Completing a checkout never takes payment. It returns
status: "requires_escalation"and acontinue_urlthe buyer opens to review and pay. - Recorded facts. Each product's
metadata["ai.kifly.attributes"]holds the facts recorded for it (colour, size, material, weight, what it fits and more); absent means not recorded, not "no". A search narrows withfilters.color,filters.sizeandfilters.materialnext to aquery: a list, or commas, give alternatives, and any one matches. A filter is answered by a recorded fact or by one of the seller's own options (a Colour, Size or Material axis); a product with neither is left out, and a message says how many. - One seller's catalog. A seller's own UCP profile points at
https://kifly.ai/api/ucp/rest/sellers/<handle>, which serves only that seller.
Idempotency
Every POST, PATCH and DELETE needs an Idempotency-Key of 16 to 64 characters. Retrying with the same key returns the original response.
Idempotency-Key: <a-uuid-you-generate-per-request>
Errors
Every failure is JSON with a stable code:
{ "error": "human readable prose", "code": "STABLE_SCREAMING_SNAKE" }
Branch on code, not error. A 503 carries Retry-After; retry it. Full list in the Error Reference.
Machine-readable contracts
| What | Where |
|---|---|
| UCP capability manifest | GET /.well-known/ucp |
| MCP method contract (OpenRPC) | GET /api/mcp/openrpc.json |
| Standard UCP shopping service, REST | rest.openapi.json at /api/ucp/rest |
| Standard UCP shopping service, MCP | mcp.openrpc.json at /api/ucp/mcp |