AfriHarvex Developers

Public read-only API and embed widgets. Build your own integrations against AfriHarvex storefronts β€” no auth required, no API key, no rate limits beyond standard Vercel edge protections.
πŸ”“ PublicNo auth, no key. CORS open from any origin.
⚑ Edge-cached2-min freshness on JSON, 5-min on embeds. SWR fallback up to 24h.
πŸ“¦ Stable shapeVersioned at /api/v1/. Future shape changes ship under /v2.
πŸ† Empire dataLoyalty tier + aggregator status surfaced on every response.
Quick start: drop this anywhere on your website to show an AfriHarvex storefront card β†’
<iframe src="https://afriharvex.com/embed/storefront/<slug>"
        width="320" height="460" frameborder="0"
        style="border:0;border-radius:14px"></iframe>

πŸ“‘ JSON API

Storefront Β· GET CORS 120s

/api/v1/storefront/<slug> β€” fetch a single storefront + its 50 most recent active listings.

# curl example
curl https://afriharvex.com/api/v1/storefront/jamsrock

# Response (200)
{
  "storefront": {
    "id": "f74be819-716b-4ed8-a766-178910ff3e9b",
    "slug": "jamsrock",
    "name": "Jamsrock",
    "industry": "Agriculture",
    "country": "Nigeria",
    "about": "We buy and sell",
    "logo_url": null,
    "cover_url": null,
    "verified": false,
    "loyalty_level": "bronze",    // bronze | silver | gold | platinum | diamond
    "is_aggregator": false,        // 20%-commission agent flag
    "url": "https://afriharvex.com/biz/jamsrock",
    "created_at": "2026-05-04T04:49:28.599764+00:00"
  },
  "listings": [
    {
      "id": "afa57af4-...",
      "name": "One crate of egg",
      "price": 6400,                 // major units (₦, not kobo)
      "currency": "NGN",
      "unit": "crate",
      "qty": 1,
      "category": "livestock",
      "image_url": "https://...supabase.co/.../crate.jpg",
      "ships_internationally": false,
      "delivery_fee": 0
    }
  ],
  "meta": {
    "api_version": "v1",
    "listing_count": 1,
    "fetched_at": "2026-05-26T22:30:00.000Z"
  }
}
FieldTypeNotes
storefront.loyalty_levelstringOne of bronze Β· silver Β· gold Β· platinum Β· diamond
storefront.is_aggregatorboolTrue = seller earns 20% on agent-sourced deals
storefront.verifiedboolKYC-verified business
listings[].pricenumberMajor units (₦, not kobo). Divide cents by 100 already done.
listings[].ships_internationallyboolIf false, only ships within seller's country

Error responses: 404 {"error":"storefront not found"} for unknown / suspended slugs. 400 {"error":"invalid slug"} for malformed input.

🧩 Embed Widget

Storefront card Β· GET 300s

/embed/storefront/<slug> β€” drop-in iframe with logo, name, verified pill, loyalty + aggregator chips, 3 top listings, and a "View on AfriHarvex β†’" CTA.

<!-- 320Γ—460 card, suggested dimensions -->
<iframe src="https://afriharvex.com/embed/storefront/jamsrock"
        width="320" height="460"
        frameborder="0"
        style="border:0;border-radius:14px"></iframe>

Click any part of the card opens the live storefront at /biz/<slug> in a new tab. Iframe-safe (frame-ancestors *) so it embeds anywhere β€” WordPress, Shopify, blogs, Notion, anywhere.

🎨 Brand skin params

Both embed widgets (/embed/storefront/<slug> and /embed/listing/<id>) accept optional query params so the card matches your own site. All are validated server-side β€” invalid values fall back to the default, so a bad param never breaks the widget.

ParamValuesEffect
accent6-digit hex (%23c20e0e or c20e0e)Primary color β€” CTA, price, verified pill.
themelight Β· dark (default)Light or dark card palette.
logohttps URLOverride the card logo (storefront widget only).
radius0–24 (default 14)Corner radius in px.
chromeminHide the "Powered by AfriHarvex" footer line. (The View/Buy CTA always stays.)
<!-- brand-matched: red accent, light, rounded, minimal chrome -->
<iframe src="https://afriharvex.com/embed/storefront/jamsrock?accent=%23c20e0e&theme=light&radius=10&chrome=min"
        width="320" height="460" frameborder="0" style="border:0"></iframe>

Sellers: grab your own embed snippet inside Profile β†’ Dashboard β†’ πŸ“± QR & embed code.

πŸ—ΊοΈ Sitemap

/sitemap.xml β€” dynamic, enumerates every public non-suspended storefront slug. Rebuilds every hour at the edge. Use this for SEO crawler hints if you mirror or index AfriHarvex content.

πŸ” What you'll never see in the API

The public surface is intentionally narrow. Anything that could identify or contact a user is filtered out at the function head:

πŸš€ Coming next


Questions? Bugs? Tag @afriharvex or open an issue. We ship the empire daily.