API Reference
Complete reference for the Cresva Storefront API. All endpoints use the base URL https://cresva.ai/api/storefront/{brandId}.
/.well-known/acp.jsonRetrieve the ACP discovery file for a domain. This is served at the domain root, not under the storefront base URL.
Authentication: public key
Response
{
"acp_version": "2.0",
"storefront_url": "https://cresva.ai/api/storefront/brand_abc123",
"brand_id": "brand_abc123",
"brand_name": "Acme Co",
"capabilities": ["search", "recommend", "compare", "negotiate", "transact"],
"supported_currencies": ["USD", "EUR"],
"documentation": "https://developers.cresva.ai/protocol/spec"
}/productsList all products in the storefront catalog. Supports pagination.
Authentication: public key
Query Parameters
categorystringFilter by category pathoffsetnumberPagination offset (default: 0)limitnumberResults per page (default: 20, max: 100)const products = await client.products.list({
category: "electronics/audio",
limit: 20,
});/products/{id}Get detailed information about a specific product.
Authentication: public key
const product = await client.products.get("prod_h7k2m");/searchSimple text search across products. For advanced queries, use POST /query.
Authentication: public key
Query Parameters
qstringSearch query string (required)categorystringFilter by categorymin_pricenumberMinimum pricemax_pricenumberMaximum pricein_stockbooleanOnly show in-stock itemssortstringSort: relevance, price_asc, price_desc, ratinglimitnumberResults per page (default: 10)const results = await client.search("wireless headphones", {
maxPrice: 200,
inStock: true,
sort: "relevance",
});/queryUnified query endpoint supporting search, recommend, compare, detail, review, and availability intents.
Authentication: public key
Request Body
intentstringRequired. One of: search, recommend, compare, detail, review, availabilityquerystringNatural language query (required for search)product_idsstring[]Product IDs (for compare, detail, review, availability)filtersQueryFiltersStructured filters (category, price, attributes, in_stock)contextQueryContextSession context (budget, preferences, session_id, platform)sortstringSort orderoffsetnumberPagination offset (default: 0)limitnumberResults per page (default: 10, max: 50)const results = await client.query({
intent: "search",
query: "noise-cancelling headphones under $200",
filters: {
category: "electronics/audio/headphones",
price: { max: 200, currency: "USD" },
attributes: { wireless: true, noiseCancelling: true },
},
context: { budget: "moderate", preferences: ["comfort"] },
limit: 5,
});/recommend/{productId}Get product recommendations based on a given product. Returns similar and complementary products.
Authentication: public key
Query Parameters
typestringRecommendation type: similar, complementary, frequently_bought_togetherlimitnumberNumber of recommendations (default: 5)const recs = await client.recommend("prod_h7k2m", {
type: "similar",
limit: 5,
});/compareCompare multiple products side by side. Returns a structured comparison with key differences highlighted.
Authentication: public key
Request Body
product_idsstring[]Array of 2-5 product IDs to compare (required)attributesstring[]Specific attributes to compare (optional, compares all by default)const comparison = await client.compare({
productIds: ["prod_h7k2m", "prod_x9y8z", "prod_a1b2c"],
attributes: ["price", "batteryLife", "weight", "noiseCancelling"],
});/reviews/{productId}Get review data for a product including aggregated summary and individual reviews.
Authentication: public key
Query Parameters
sortstringSort: recent, helpful, rating_high, rating_lowlimitnumberNumber of reviews (default: 10)offsetnumberPagination offsetconst reviews = await client.reviews.get("prod_h7k2m", {
sort: "helpful",
limit: 10,
});/pricingGet real-time pricing for one or more products. Returns current price, any active promotions, and volume pricing tiers.
Authentication: public key
Request Body
product_idsstring[]Product IDs to price (required)quantitynumberQuantity for volume pricing (default: 1)currencystringDesired currency (ISO 4217)const pricing = await client.pricing.get({
productIds: ["prod_h7k2m"],
quantity: 1,
currency: "USD",
});/pricing/holdHold a price for a limited time while the agent completes the purchase flow. Prevents price changes during checkout.
Authentication: secret key
Request Body
product_idstringProduct to hold price for (required)pricenumberThe price to hold (required)currencystringCurrency (required)duration_minutesnumberHold duration (default: 15, max: 60)const hold = await client.pricing.hold({
productId: "prod_h7k2m",
price: 179.99,
currency: "USD",
durationMinutes: 15,
});
// hold.hold_id — use this in the transaction/negotiateInitiate or continue a price negotiation. Supports initiate, counter, accept, reject, withdraw, and inquire actions.
Authentication: secret key
Request Body
actionstringRequired. One of: initiate, counter, accept, reject, withdraw, inquirenegotiation_idstringRequired for all actions except initiate and inquireproduct_idstringThe product being negotiated (required)offered_pricenumberThe price being offered (for initiate/counter)currencystringCurrency of the offerquantitynumberNumber of units (default: 1)messagestringOptional message with the offer// Initiate negotiation
const negotiation = await client.negotiate({
action: "initiate",
productId: "prod_h7k2m",
offeredPrice: 149.99,
currency: "USD",
message: "Comparing with competitor at $145",
});
// Accept counter-offer
await client.negotiate({
action: "accept",
negotiationId: negotiation.negotiation_id,
productId: "prod_h7k2m",
});/offersList active agent-exclusive offers. These are special deals available only through AI agent channels.
Authentication: public key
const offers = await client.offers.list();/offers/{id}Get details of a specific offer.
Authentication: public key
const offer = await client.offers.get("offer_promo1");/offers/{id}/claimClaim an offer for a user. Returns a claim token to use during transaction creation.
Authentication: secret key
const claim = await client.offers.claim("offer_promo1");
// Use claim.claim_token in your transaction/bundlesList available product bundles with discounted pricing.
Authentication: public key
const bundles = await client.bundles.list();/bundles/{id}Get details of a specific bundle including all products and bundle pricing.
Authentication: public key
const bundle = await client.bundles.get("bundle_audio1");/transactionsCreate a new transaction. Initiates the purchase flow for one or more products.
Authentication: secret key
Request Body
itemsTransactionItem[]Array of items to purchase (required)currencystringTransaction currency (required)shipping_addressAddressShipping address (required for physical goods)negotiation_idstringIf this transaction results from a negotiationoffer_claim_tokenstringIf claiming an offerescrowbooleanWhether to use escrow (default: false)const txn = await client.transactions.create({
items: [
{ productId: "prod_h7k2m", quantity: 1, price: 164.99 },
],
currency: "USD",
shippingAddress: {
line1: "123 Main St",
city: "San Francisco",
state: "CA",
postalCode: "94102",
country: "US",
},
negotiationId: "neg_a1b2c3",
});/transactions/{id}Get the current status and details of a transaction.
Authentication: secret key
const txn = await client.transactions.get("txn_x9y8z7");/transactions/{id}/confirmConfirm a transaction and proceed to payment.
Authentication: secret key
await client.transactions.confirm("txn_x9y8z7");/transactions/{id}/cancelCancel a transaction. Only possible before payment is completed.
Authentication: secret key
await client.transactions.cancel("txn_x9y8z7", {
reason: "User changed their mind",
});/transactions/{id}/escrow/releaseRelease escrowed funds to the seller. Typically called after delivery confirmation.
Authentication: secret key
await client.transactions.escrow.release("txn_x9y8z7");/transactions/{id}/escrow/disputeOpen a dispute on escrowed funds. Freezes the escrow until the dispute is resolved.
Authentication: secret key
Request Body
reasonstringDispute reason (required)evidencestringSupporting evidence or descriptionawait client.transactions.escrow.dispute("txn_x9y8z7", {
reason: "Product not as described",
evidence: "Item received was a different color than listed",
});/trustGet the trust score for this storefront including overall score, tier, and individual components.
Authentication: public key
const trust = await client.trust.get();
console.log(trust.overall, trust.tier);Example Response
{
"overall": 92,
"tier": "Gold",
"components": {
"product_accuracy": 95,
"fulfillment_reliability": 91,
"pricing_transparency": 94,
"customer_satisfaction": 89,
"response_time": 96,
"dispute_resolution": 88,
"data_freshness": 93
},
"last_updated": "2026-03-27T00:00:00Z"
}/trust/compareCompare trust scores across multiple storefronts.
Authentication: public key
Query Parameters
brand_idsstringComma-separated brand IDs to compare (required)const comparison = await client.trust.compare([
"brand_abc123",
"brand_def456",
]);/feedbackSubmit agent feedback about the quality of product data, search results, or transaction experience.
Authentication: secret key
Request Body
typestringFeedback type: query_quality, product_accuracy, transaction_experience (required)ratingnumberRating 1-5 (required)query_idstringRelated query ID (if applicable)transaction_idstringRelated transaction ID (if applicable)commentstringFree-text feedbackawait client.feedback.submit({
type: "query_quality",
rating: 4,
queryId: "qry_9f8e7d6c",
comment: "Results were relevant but missing some budget options",
});/feedback/summaryGet aggregated feedback summary for this storefront.
Authentication: public key
const summary = await client.feedback.summary();/healthCheck storefront API health and status. No authentication required.
Authentication: public key
const health = await client.health();
// { status: "ok", latency_ms: 12, acp_version: "2.0" }Example Response
{
"status": "ok",
"latency_ms": 12,
"acp_version": "2.0",
"timestamp": "2026-03-27T10:30:00Z"
}