Introduction

Qost is a decentralized orderbook and liquidity protocol for device merchants, built on the Sui blockchain.

Our platform enables merchants to list devices with transparent pricing, track provenance via IMEI/Serial numbers, and access global liquidity for their inventory.

Architecture

Qost utilizes a hybrid architecture to ensure both transparency and privacy:

  • On-Chain (Sui): Public profiles, product listings, price offers, and device provenance history.
  • Off-Chain: Sensitive data (KYC documents, bank details) and high-performance indexing.

Smart Contracts

We deploy a suite of Move modules to handle the core logic:

product_listing

Defines the TelephoneProduct standard and handles global product cataloging.

device_provenance

Tracks individual device lifecycle, ownership, and condition reports via IMEI.

price_discovery

Aggregates merchant offers to determine fair market value.

merchant_registry

Manages merchant identities and verification status.

Authentication

All requests to the Market API require an API Key in the header.

x-api-key: YOUR_PARTNER_API_KEY

For the hackathon demo, use: qost-hackathon-demo-key

Get Aggregated Listings

Fetch the global order book of available devices. Filter by category, brand, or price.

GET /api/market/listings

Query Parameters

Param Type Description
limit number Number of results (default: 50)
category string Filter by category (e.g., "Smartphones")
brand string Filter by brand (e.g., "Apple")

Get Product Details

Get full specifications and blockchain provenance for a specific listing.

GET /api/market/listings/:id

Verify Device Provenance

Verify the history and authenticity of a device using its IMEI. This queries both the Qost database and the Sui Blockchain.

GET /api/market/verify/:imei

Response Example

{
  "success": true,
  "data": {
    "imei": "356938035643809",
    "status": "LISTED",
    "blockchain_verified": true,
    "device_details": {
      "name": "iPhone 13 Pro Max",
      "condition": "Used - Good"
    },
    "provenance": {
      "origin_region": "UK",
      "import_date": "2025-11-20T08:30:00.000Z"
    }
  }
}

Report Sale (Order Placement)

Notify Qost when a device is sold on your platform. This marks the item as sold in the global order book and transfers ownership on the blockchain.

POST /api/market/sales

Request Body

{
  "product_id": "550e8400-e29b-41d4-a716-446655440000",
  "sale_price": 450000,
  "buyer_address": "0x123... (Optional)"
}

Submit Product Review

Allow customers to submit reviews for products they've purchased. Reviews help build trust and provide valuable feedback to merchants.

POST /api/reviews

Request Body

{
  "product_id": "550e8400-e29b-41d4-a716-446655440000",
  "customer_email": "[email protected]",
  "customer_name": "John Doe",
  "rating": 5,
  "title": "Excellent phone!",
  "comment": "Great condition, fast delivery. Highly recommended!",
  "verified_purchase": true
}

Response Example

{
  "success": true,
  "message": "Review submitted successfully",
  "data": {
    "review_id": "123e4567-e89b-12d3-a456-426614174000",
    "product_name": "iPhone 13 Pro Max",
    "merchant_name": "TechStore Ltd",
    "rating": 5,
    "created_at": "2025-12-10T10:30:00.000Z"
  }
}

Get Product Reviews

Retrieve all reviews for a specific product, including ratings, comments, and merchant responses. Includes comprehensive statistics and rating distribution.

GET /api/reviews/product/:product_id

Query Parameters

Param Type Description
limit number Number of reviews (default: 20)
offset number Pagination offset (default: 0)
sort string Sort order: newest, oldest, highest_rating, lowest_rating, most_helpful

Response Example

{
  "success": true,
  "data": {
    "reviews": [
      {
        "review_id": "123e4567-e89b-12d3-a456-426614174000",
        "customer_name": "John Doe",
        "rating": 5,
        "title": "Excellent phone!",
        "comment": "Great condition, fast delivery.",
        "verified_purchase": true,
        "merchant_response": "Thank you for the positive feedback!",
        "merchant_response_date": "2025-12-10T11:00:00.000Z",
        "helpful_votes": 3,
        "createdAt": "2025-12-10T10:30:00.000Z"
      }
    ],
    "statistics": {
      "average_rating": "4.2",
      "total_reviews": 15,
      "verified_reviews": 12,
      "rating_distribution": [
        { "rating": 5, "count": 8 },
        { "rating": 4, "count": 4 },
        { "rating": 3, "count": 2 },
        { "rating": 2, "count": 1 },
        { "rating": 1, "count": 0 }
      ]
    }
  }
}

Mark Review as Helpful

Allow users to mark reviews as helpful, which helps surface the most useful reviews to other customers.

PUT /api/reviews/:review_id/helpful

Response Example

{
  "success": true,
  "message": "Review marked as helpful",
  "helpful_votes": 4
}

Platform Review Statistics

Get overall review statistics for the entire platform, useful for analytics and reporting.

GET /api/reviews/stats/summary

Response Example

{
  "success": true,
  "data": {
    "total_reviews": 1247,
    "average_rating": "4.3",
    "verified_reviews": 892,
    "responded_reviews": 734,
    "recent_reviews": 89,
    "response_rate": "58.9"
  }
}

Integration Tip: Use the review system to build trust with your customers. Display average ratings and review counts on product listings, and encourage customers to leave reviews after purchase by providing direct links to the review submission page.

Review UI Pages

We also provide ready-to-use HTML pages for customer review interactions:

Review Submission

Customer-friendly form for submitting reviews with star ratings and comments.

/review.html?product_id={id}&api_key={key}

Reviews Display

Comprehensive review listing with statistics, sorting, and pagination.

/reviews.html?product_id={id}&api_key={key}