Shopeak
Developers / REST API

Platform

REST API

Beta

Shopeak’s protected business APIs require a JWT. This reference covers a public, read-only subset for store discovery, products, collections, price previews and delivery estimates.

Basics#

This API is in beta

Endpoints and fields can change, and new fields can appear at any time. Ignore fields you don’t recognise, and treat missing fields as empty.

Authentication is endpoint-specific

Protected seller and staff APIs, including product and order management, require a valid Shopeak JWT. Send it as Authorization: Bearer <JWT>. Authentication does not replace account, subscription or permission checks.

The eight reference endpoints below do not require a JWT. They are not the API’s only public routes: POST /auth/login and POST /storefront/{storeId}/checkout also sit outside the seller JWT group. Login still requires credentials, and guest checkout validates shopper data and any required signed quote.

Do not infer authentication from a URL prefix: /storefront/{storeId}/me requires a buyer OIDC bearer access token, while order payment-status requests require a signed tracking token.

Every path on this page is relative to this base URL:

Base URL
https://api.shopeak.co.ke/api/v1
Reference authentication
No JWT for the eight endpoints listed below. Other routes under /api/v1 have their own authentication requirements.
Format
JSON over HTTPS. Send Content-Type: application/json with POST bodies.
Writes in this reference
None. The two POST endpoints calculate prices and delivery without saving anything.
IDs
24-character hex strings, such as 6650a1f4c2d84b0012e3a9c1. A product’s seller_id is its store’s ID.
Prices
Plain numbers in the store’s currency: 3450 means KES 3,450.00.
Timestamps
RFC 3339 in UTC, such as 2024-05-24T15:53:06Z.

Call the API from your server. Browsers block calls from other websites, because CORS only allows Shopeak’s own sites and verified store domains.

Node.js 18 or later
// Run this on your server. Browsers on other sites are blocked by CORS.
const BASE = "https://api.shopeak.co.ke/api/v1";

async function shopeak(path, init) {
  const res = await fetch(BASE + path, init);
  const body = await res.json().catch(() => ({}));
  if (!res.ok) throw new Error(body.error ?? "HTTP " + res.status);
  return body;
}

const { stores } = await shopeak("/marketplace/stores?city=Nairobi&limit=5");
console.log(stores.map((store) => store.store_name));

Pagination#

List endpoints take two query parameters:

  • page: the page number, starting at 1.
  • limit: results per page, from 1 to 50. The default is 20, and any value outside that range also gives you 20.

Responses include total and total_pages. Keep requesting pages until page reaches total_pages.

  • Product search returns total but no total_pages, so divide total by your limit.
  • The store directory can return a page with fewer stores than limit while later pages still have more. Don’t stop at a short page.

Errors and limits#

Storefront handlers return errors with an HTTP status code and a JSON body, for example:

404 Not Found
{
  "error": "Store not found"
}
400 Bad Request
A malformed ID or request body, or a missing required parameter.
401 Unauthorized
Authentication failed for the requested route. Check its credential requirements and token validity; absence from this reference does not mean a route requires a JWT.
404 Not Found
The store isn’t open, or the product doesn’t exist.
429 Too Many Requests
You hit a rate limit. Wait, then retry with exponential backoff.
500 Server Error
Something went wrong on our side. Try again later.

Check the status code, not the message: messages are written for people and can change.

Rate limits are per IP address. The store directory allows 300 requests a minute. Other endpoints don’t publish a limit yet but can be limited at any time, so cache responses where you can.

Endpoints#

Eight public, read-only endpoints, all relative to the base URL. This is not a complete list of the API’s public routes.

EndpointWhat it does
GET/marketplace/storesList and filter stores
GET/search/productsSearch products across all stores
GET/storefront/{storeId}/productsList a store’s products
GET/storefront/{storeId}/products/searchSearch a store’s product titles
GET/storefront/{storeId}/products/{productId}Get one product
GET/storefront/{storeId}/collectionsList a store’s collections
POST/storefront/{storeId}/pricing/previewPrice a list of items
POST/storefront/{storeId}/shipping/calculateGet delivery options for an address

Stores#

The store directory lists the live stores on Shopeak, highest rated first.

GET

/marketplace/stores

Lists and filters stores in the Shopeak directory.

Returns stores, total, page, limit and total_pages. Limited to 300 requests a minute per IP address.

Query parameters

NameTypeDescription
qOptionalstringText to find in the store name, tagline, description or category. Ignores case. Text past 100 characters is dropped.
cityOptionalstringOnly stores in this city, such as Nairobi. The whole name must match, ignoring case. Most stores haven’t recorded a city yet, so this filter leaves out stores whose location is unknown.
countryOptionalstringOnly stores in this country, such as Kenya. The whole name must match, ignoring case.
payableOptionalbooleanDefaults to true, which lists only stores set up to take payments. Pass false to also list live stores that haven’t set up payments yet. Test stores and stores with an unpaid or suspended subscription are never listed. Either way, check each store’s payments_enabled.
pageOptionalintegerPage number, starting at 1.
limitOptionalintegerResults per page, from 1 to 50. Default 20.

Good to know

  • Test stores and stores with an unpaid or suspended subscription aren’t listed.
  • total and total_pages are exact: stores that aren’t listed are left out by the query itself, not removed after a page is fetched. A page holds limit stores until the last one.
Request
curl "https://api.shopeak.co.ke/api/v1/marketplace/stores?q=outdoor&city=Nairobi&limit=5"
Response
{
  "stores": [
    {
      "_id": "6650a1f4c2d84b0012e3a9c1",
      "store_name": "Mfano Outdoor",
      "slug": "mfano-outdoor",
      "tagline": "Gear for Kenya's trails",
      "category": "Sports & Outdoors",
      "logo": {
        "url": "https://images.example.com/mfano-outdoor/logo.png",
        "content_type": "image/png"
      },
      "city": "Nairobi",
      "country": "Kenya",
      "currency": "KES",
      "rating": {
        "average": 4.8,
        "total_reviews": 126
      },
      "payments_enabled": true,
      "verified": true,
      "storefront_url": "https://mfano-outdoor.myshopeak.com"
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 5,
  "total_pages": 1
}

Store fields

FieldTypeDescription
_idstringThe store ID. Use it as {storeId} in the storefront endpoints.
store_namestringThe store’s display name.
slugstringURL-friendly version of the name.
taglinestringA short tagline, if set.
descriptionstringAbout the store, if set. Can contain HTML, so sanitize it before rendering.
categorystringWhat the store sells, if set.
logomediaThe store logo, if set. See media objects.
bannermediaThe store banner, if set.
citystringWhere the store is based, if set.
countrystringThe store’s country, if set.
contact_emailstringOptional customer contact email from Seller Settings > General. Uses the business email, or the same account-email fallback displayed in those settings.
contact_phonestringOptional customer contact phone from Seller Settings > General; not the separate login or payout phone.
whatsapp_numberstringOptional public WhatsApp number configured by the store. Contact fields are also returned by the public storefront profile endpoint.
verifiedbooleantrue when Shopeak has checked the identity of the business owner, so you can show a verified badge. It doesn’t vouch for products or delivery, and payments_enabled doesn’t imply it. Also returned by the storefront profile endpoint.
storefront_urlstringThe store’s own website: its verified custom domain, or its myshopeak.com address. Left out when the store has neither. Also returned by the storefront profile endpoint.
currencystringThe currency the store prices in. If it’s missing, assume KES.
ratingobjectaverage (0 to 5) and total_reviews.
payments_enabledbooleanWhether the store can take payments right now. Only these stores can be checked out.

Products#

Search the whole marketplace, or browse one store. Every endpoint here returns product objects. The examples are shortened.

GET

/search/products

Searches products across every store, best matches first.

Returns products, total, page and query.

Query parameters

NameTypeDescription
qRequiredstringWords to search for in product titles, descriptions and tags.
categoryOptionalstringOnly products in this category, using a product’s category_id. An invalid ID is ignored.
pageOptionalintegerPage number, starting at 1.
limitOptionalintegerResults per page, from 1 to 50. Default 20.

Good to know

  • Results aren’t filtered by store, so some can come from stores that are closed or can’t take payments. To show only products people can buy, keep those whose seller_id is in the store directory with payments_enabled set to true.
  • A missing q returns 400.
Request
curl "https://api.shopeak.co.ke/api/v1/search/products?q=waterproof%20backpack"
Response
{
  "products": [
    {
      "_id": "6650b7e2c41d8a2f9e0b1c3d",
      "seller_id": "6650a1f4c2d84b0012e3a9c1",
      "title": "30 L roll-top backpack",
      "slug": "30-l-roll-top-backpack",
      "price": 3450,
      "compare_at": 3990,
      "currency": "KES",
      "stock": 12,
      "thumbnail": {
        "url": "https://images.example.com/mfano-outdoor/backpack-olive.jpg",
        "content_type": "image/jpeg"
      },
      "ratings": {
        "average": 4.7,
        "count": 38,
        "distribution": {
          "1": 0,
          "2": 0,
          "3": 2,
          "4": 7,
          "5": 29
        }
      }
    }
  ],
  "total": 1,
  "page": 1,
  "query": "waterproof backpack"
}
GET

/storefront/{storeId}/products

Lists one store’s products, newest first unless you choose another order.

Returns products, total, page, limit and total_pages.

Parameters

NameTypeDescription
storeIdRequiredstringIn the path. The store’s _id.
collectionOptionalstringOnly products in this collection, using an _id from the collections endpoint. Unknown, unpublished or empty collections can be ignored, which returns the whole catalog.
min_priceOptionalnumberLowest price to include, in the store’s currency.
max_priceOptionalnumberHighest price to include, in the store’s currency.
sortOptionalstringnewest (default), oldest, price_asc, price_desc, title_asc or title_desc.
pageOptionalintegerPage number, starting at 1.
limitOptionalintegerResults per page, from 1 to 50. Default 20.

Good to know

  • Products can appear with stock at 0, so check stock before offering them.
  • Price filters use the product’s price, not variant prices.
  • Returns 404 if the store isn’t open.
Request
curl "https://api.shopeak.co.ke/api/v1/storefront/6650a1f4c2d84b0012e3a9c1/products?collection=6652d0a3b7e14c0012f4a8b6&max_price=5000&sort=price_asc"
Response
{
  "products": [
    {
      "_id": "6650b7e2c41d8a2f9e0b1c3d",
      "seller_id": "6650a1f4c2d84b0012e3a9c1",
      "title": "30 L roll-top backpack",
      "slug": "30-l-roll-top-backpack",
      "price": 3450,
      "compare_at": 3990,
      "currency": "KES",
      "stock": 12,
      "thumbnail": {
        "url": "https://images.example.com/mfano-outdoor/backpack-olive.jpg",
        "content_type": "image/jpeg"
      },
      "ratings": {
        "average": 4.7,
        "count": 38,
        "distribution": {
          "1": 0,
          "2": 0,
          "3": 2,
          "4": 7,
          "5": 29
        }
      }
    }
  ],
  "total": 1,
  "page": 1,
  "limit": 20,
  "total_pages": 1
}
GET

/storefront/{storeId}/products/search

Finds products in one store whose title contains your text.

Returns the same fields as listing a store’s products.

Parameters

NameTypeDescription
storeIdRequiredstringIn the path. The store’s _id.
qRequiredstringText to find in product titles, ignoring case. An empty q returns no products.
sortOptionalstringnewest (default), price_asc or price_desc.
pageOptionalintegerPage number, starting at 1.
limitOptionalintegerResults per page, from 1 to 50. Default 20.

Good to know

  • Only titles are searched. To search descriptions and tags too, use product search.
  • Returns 404 if the store isn’t open.
Request
curl "https://api.shopeak.co.ke/api/v1/storefront/6650a1f4c2d84b0012e3a9c1/products/search?q=roll-top&sort=price_asc"
GET

/storefront/{storeId}/products/{productId}

Gets one product by ID or slug.

Returns a product object on its own, not wrapped in another object.

Parameters

NameTypeDescription
storeIdRequiredstringIn the path. The store’s _id.
productIdRequiredstringIn the path. The product’s _id or slug.

Good to know

  • This endpoint doesn’t check the store. Before selling, confirm the store has payments_enabled set to true in the directory.
  • Returns 404 if the product doesn’t exist or isn’t for sale.
Request
# By ID
curl "https://api.shopeak.co.ke/api/v1/storefront/6650a1f4c2d84b0012e3a9c1/products/6650b7e2c41d8a2f9e0b1c3d"

# Or by slug
curl "https://api.shopeak.co.ke/api/v1/storefront/6650a1f4c2d84b0012e3a9c1/products/30-l-roll-top-backpack"
GET

/storefront/{storeId}/collections

Lists a store’s published collections, in the store’s own order.

Returns collections.

Parameters

NameTypeDescription
storeIdRequiredstringIn the path. The store’s _id.

Collection fields

FieldTypeDescription
_idstringThe collection ID. Pass it as collection when you list a store’s products.
titlestringThe collection’s name.
slugstringURL-friendly version of the title.
descriptionstringAbout the collection, if set.
imagemediaThe collection image, if set.
product_countintegerHow many products it had when last counted. It can lag behind the catalog.

Use only these fields. The response has others that this endpoint leaves empty.

Request
curl "https://api.shopeak.co.ke/api/v1/storefront/6650a1f4c2d84b0012e3a9c1/collections"
Response
{
  "collections": [
    {
      "_id": "6652d0a3b7e14c0012f4a8b6",
      "title": "Hiking gear",
      "slug": "hiking-gear",
      "description": "Packs, bottles and layers for day hikes.",
      "image": {
        "url": "https://images.example.com/mfano-outdoor/hiking-gear.jpg",
        "content_type": "image/jpeg"
      },
      "product_count": 9
    }
  ]
}

Prices and delivery#

Estimate what a cart will cost before checkout. Neither endpoint saves anything or holds stock.

POST

/storefront/{storeId}/pricing/preview

Works out current prices for a list of items, including price-list discounts for a known shopper.

Item prices only. Delivery, tax and fees are added at checkout.

Parameters

NameTypeDescription
storeIdRequiredstringIn the path. The store’s _id.
itemsRequiredarrayThe items to price, all from this store.
items[].product_idRequiredstringThe product’s _id.
items[].variant_idOptionalstringThe variant’s _id, for products with variants.
items[].quantityRequiredintegerHow many. Some price lists give better prices for larger quantities.
emailOptionalstringThe shopper’s email. If they have a price list at this store, its prices apply. Leave it out for standard prices. The response never reveals whether the email has an account.

Response fields

FieldTypeDescription
itemsarrayOne line per item priced: product_id, variant_id, base_price, price (after any price-list discount), quantity, subtotal and discounted.
subtotalnumberThe total of the line subtotals.
savingsnumberHow much the price list saves overall.
buyer_matchedbooleantrue when the email’s price list lowered at least one price.
currencystringThe store’s currency, such as KES.
settled_currencystringFor stores that don’t price in KES: always KES, the currency Paystack charges in.
settled_subtotalnumberFor stores that don’t price in KES: subtotal converted to KES.
fx_ratenumberFor stores that don’t price in KES: the rate used for the conversion.
fx_expires_inintegerFor stores that don’t price in KES: how long the rate is valid, in seconds.
fx_errorstringunavailable when the conversion to KES failed. This store can’t be checked out until it works again.

Good to know

  • Items that don’t match a product for sale in this store, or have a quantity below 1, are left out without an error. Compare the response with what you sent. If none match, items is null.
  • If variant_id doesn’t match a variant for sale, the product’s own price is used.
Request
curl -X POST "https://api.shopeak.co.ke/api/v1/storefront/6650a1f4c2d84b0012e3a9c1/pricing/preview" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "wanjiku@example.com",
    "items": [
      {
        "product_id": "6650b7e2c41d8a2f9e0b1c3d",
        "variant_id": "6650b7e2c41d8a2f9e0b1c3f",
        "quantity": 2
      }
    ]
  }'
Response
{
  "buyer_matched": true,
  "items": [
    {
      "product_id": "6650b7e2c41d8a2f9e0b1c3d",
      "variant_id": "6650b7e2c41d8a2f9e0b1c3f",
      "base_price": 3450,
      "price": 3200,
      "quantity": 2,
      "subtotal": 6400,
      "discounted": true
    }
  ],
  "subtotal": 6400,
  "savings": 500,
  "currency": "KES"
}
POST

/storefront/{storeId}/shipping/calculate

Lists the delivery and pickup options a store offers for an address, with prices.

Returns options and the store’s tax settings.

Parameters

NameTypeDescription
storeIdRequiredstringIn the path. The store’s _id.
cityOptionalstringThe delivery city, such as Nairobi. Delivery zones match on city or country names.
countryOptionalstringThe delivery country, such as Kenya.
subtotalOptionalnumberThe order subtotal in the store’s currency. Used for free-delivery thresholds and minimum orders.
latitudeOptionalnumberThe delivery pin. Needed for rider delivery priced by distance, and for local delivery within a radius.
longitudeOptionalnumberThe delivery pin, with latitude.

Response fields

FieldTypeDescription
options[].namestringThe option name to show the shopper.
options[].ratenumberThe price in the store’s currency. 0 for pickup and free delivery.
options[].est_daysstringUsually same_day, 1_2_days or 3_5_days. Can be empty.
options[].typestringlocal, distance, zone, free, fallback or pickup.
options[].requires_quotebooleantrue when the store confirms the delivery price separately. The rate shows 0 until then.
options[].distance_kmnumberThe delivery distance, on distance options only.
taxobjectenabled, name, rate (a percentage, so 16 means 16%) and included (whether prices already include it).

Good to know

  • If no option fits the address, options is empty or null.
  • When subtotal reaches the store’s free-delivery threshold, the matching options show a rate of 0.
  • Returns 404 if the store isn’t open.
Request
curl -X POST "https://api.shopeak.co.ke/api/v1/storefront/6650a1f4c2d84b0012e3a9c1/shipping/calculate" \
  -H "Content-Type: application/json" \
  -d '{
    "city": "Nairobi",
    "country": "Kenya",
    "subtotal": 6400,
    "latitude": -1.2648,
    "longitude": 36.8045
  }'
Response
{
  "options": [
    {
      "name": "Rider delivery (4.2 km)",
      "rate": 250,
      "est_days": "same_day",
      "type": "distance",
      "requires_quote": false,
      "distance_km": 4.2
    },
    {
      "name": "Nairobi",
      "rate": 350,
      "est_days": "1_2_days",
      "type": "zone",
      "requires_quote": false
    },
    {
      "name": "Pickup — Westlands shop",
      "rate": 0,
      "est_days": "same_day",
      "type": "pickup",
      "requires_quote": false
    }
  ],
  "tax": {
    "rate": 16,
    "name": "VAT",
    "included": true,
    "enabled": true
  }
}

The product object#

Every product endpoint returns this object. The example is shortened, and the table lists the fields you can rely on.

Product
{
  "_id": "6650b7e2c41d8a2f9e0b1c3d",
  "seller_id": "6650a1f4c2d84b0012e3a9c1",
  "title": "30 L roll-top backpack",
  "slug": "30-l-roll-top-backpack",
  "description": "<p>A waterproof 30-litre roll-top pack with a padded laptop sleeve.</p>",
  "short_desc": "Waterproof 30 L daypack",
  "bullet_points": [
    "Waterproof roll-top closure",
    "Padded 15-inch laptop sleeve"
  ],
  "price": 3450,
  "compare_at": 3990,
  "currency": "KES",
  "tax_inclusive": true,
  "category_id": "64f0c2a9e1b34d0012a7c5e8",
  "brand_name": "Mfano",
  "tags": [
    "backpack",
    "hiking",
    "waterproof"
  ],
  "condition": "new",
  "thumbnail": {
    "url": "https://images.example.com/mfano-outdoor/backpack-olive.jpg",
    "content_type": "image/jpeg"
  },
  "images": [
    {
      "url": "https://images.example.com/mfano-outdoor/backpack-olive.jpg",
      "content_type": "image/jpeg"
    },
    {
      "url": "https://images.example.com/mfano-outdoor/backpack-olive-back.jpg",
      "content_type": "image/jpeg"
    }
  ],
  "variants": [
    {
      "_id": "6650b7e2c41d8a2f9e0b1c3f",
      "sku": "MF-RT30-OLV",
      "name": "Olive",
      "price": 3450,
      "stock": 12,
      "options": {
        "color": "Olive"
      },
      "is_active": true
    }
  ],
  "attributes": {
    "material": "Ripstop nylon"
  },
  "stock": 12,
  "min_order_qty": 1,
  "max_order_qty": 0,
  "allow_backorder": false,
  "weight": 850,
  "free_shipping": false,
  "ratings": {
    "average": 4.7,
    "count": 38,
    "distribution": {
      "1": 0,
      "2": 0,
      "3": 2,
      "4": 7,
      "5": 29
    }
  },
  "return_policy": "14_days",
  "status": "active",
  "created_at": "2024-05-24T15:53:06Z",
  "updated_at": "2024-06-02T11:40:00Z"
}
FieldTypeDescription
_idstringThe product ID.
seller_idstringThe store’s _id.
titlestringThe product name.
slugstringURL-friendly version of the title. Works in place of the ID when you get one product.
descriptionstringThe full description. Can contain HTML, so sanitize it before rendering.
short_descstringA one-line summary, if set.
bullet_pointsstring[]Key features, if set.
pricenumberThe price in the store’s currency. For variants, use the variant’s price.
compare_atnumberThe original price, when it’s on sale.
currencystringThe currency of price, such as KES.
tax_inclusivebooleanWhether price already includes tax.
category_idstringThe marketplace category. Works as the category filter in product search.
brand_namestringThe brand, if set.
tagsstring[]Search tags, if set.
conditionstringnew, used, refurbished or open_box.
thumbnailmediaThe main image, if set.
imagesmedia[]All product images, if any.
videosmedia[]Product videos, if any.
variantsvariant[]Choices such as size or color. See variants.
attributesobjectExtra details as name and value pairs, such as material.
stockintegerUnits in stock. For products with variants, check each variant’s stock.
skustringThe stock-keeping unit, if set.
min_order_qtyintegerThe smallest quantity per order.
max_order_qtyintegerThe largest quantity per order. 0 means no limit.
allow_backorderbooleanWhether it can be ordered when out of stock.
weightnumberWeight in grams, if set.
dimensionsobjectlength, width and height in centimetres, if set.
free_shippingbooleanWhether the store marks this product as free to deliver.
ships_fromstringWhere it ships from, if set.
ratingsobjectaverage (0 to 5), count, and distribution: the number of reviews for each star rating.
warrantyobjecthas_warranty, plus duration, type and details when set.
return_policystring7_days, 14_days, 30_days or no_return, if set.
statusstringAlways active in these responses.
created_atstringWhen the product was created.
updated_atstringWhen the product last changed.

Only use the fields listed here

Responses also carry fields for running a store, such as view and sales counts. They aren’t part of the API and may be removed without notice.

Variants

Products sold in different sizes, colors or styles list each choice in variants. Each variant has its own price and stock.

FieldTypeDescription
_idstringThe variant ID. Send it as variant_id when pricing items.
namestringThe display name, such as Olive or Red / Large.
optionsobjectThe chosen values, such as {"color": "Olive"}.
pricenumberThe variant’s price. Use it instead of the product price.
compare_atnumberThe original price, when it’s on sale.
stockintegerUnits in stock.
skustringThe stock-keeping unit.
barcodestringThe barcode, if set.
weightnumberWeight in grams, if set.
imagemediaThe variant image, if set.
is_activebooleanWhether the variant is for sale. Skip variants where this is false.

Media objects

Images and videos are media objects. Use url to show them. The other fields are for storage, so you can ignore them.

FieldTypeDescription
urlstringThe public URL of the file.
content_typestringThe file type, such as image/jpeg.
sizeintegerThe file size in bytes.

Checkout#

The eight endpoints documented above do not create orders. The API also has a public guest checkout route, POST /storefront/{storeId}/checkout, which creates orders without a seller JWT. AI agents can use it through the Shopeak MCP’s guest checkout flow, where the shopper approves the exact amount and pays on Paystack.

Need to create orders from another kind of app? Email info@shopeak.co.ke and tell us what you’re building.

Next steps#

Questions or feedback about these docs? Email info@shopeak.co.ke.