Platform
REST API
BetaShopeak’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
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:
https://api.shopeak.co.ke/api/v1- Reference authentication
- No JWT for the eight endpoints listed below. Other routes under
/api/v1have their own authentication requirements. - Format
- JSON over HTTPS. Send
Content-Type: application/jsonwith 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’sseller_idis its store’s ID. - Prices
- Plain numbers in the store’s currency:
3450means 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.
// 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
totalbut nototal_pages, so dividetotalby yourlimit. - The store directory can return a page with fewer stores than
limitwhile 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:
{
"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.
| Endpoint | What it does |
|---|---|
| GET/marketplace/stores | List and filter stores |
| GET/search/products | Search products across all stores |
| GET/storefront/{storeId}/products | List a store’s products |
| GET/storefront/{storeId}/products/search | Search a store’s product titles |
| GET/storefront/{storeId}/products/{productId} | Get one product |
| GET/storefront/{storeId}/collections | List a store’s collections |
| POST/storefront/{storeId}/pricing/preview | Price a list of items |
| POST/storefront/{storeId}/shipping/calculate | Get delivery options for an address |
Stores#
The store directory lists the live stores on Shopeak, highest rated first.
/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
| Name | Type | Description |
|---|---|---|
qOptional | string | Text to find in the store name, tagline, description or category. Ignores case. Text past 100 characters is dropped. |
cityOptional | string | Only 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. |
countryOptional | string | Only stores in this country, such as Kenya. The whole name must match, ignoring case. |
payableOptional | boolean | Defaults 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. |
pageOptional | integer | Page number, starting at 1. |
limitOptional | integer | Results per page, from 1 to 50. Default 20. |
Good to know
- Test stores and stores with an unpaid or suspended subscription aren’t listed.
totalandtotal_pagesare exact: stores that aren’t listed are left out by the query itself, not removed after a page is fetched. A page holdslimitstores until the last one.
curl "https://api.shopeak.co.ke/api/v1/marketplace/stores?q=outdoor&city=Nairobi&limit=5"{
"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
| Field | Type | Description |
|---|---|---|
_id | string | The store ID. Use it as {storeId} in the storefront endpoints. |
store_name | string | The store’s display name. |
slug | string | URL-friendly version of the name. |
tagline | string | A short tagline, if set. |
description | string | About the store, if set. Can contain HTML, so sanitize it before rendering. |
category | string | What the store sells, if set. |
logo | media | The store logo, if set. See media objects. |
banner | media | The store banner, if set. |
city | string | Where the store is based, if set. |
country | string | The store’s country, if set. |
contact_email | string | Optional customer contact email from Seller Settings > General. Uses the business email, or the same account-email fallback displayed in those settings. |
contact_phone | string | Optional customer contact phone from Seller Settings > General; not the separate login or payout phone. |
whatsapp_number | string | Optional public WhatsApp number configured by the store. Contact fields are also returned by the public storefront profile endpoint. |
verified | boolean | true 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_url | string | The 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. |
currency | string | The currency the store prices in. If it’s missing, assume KES. |
rating | object | average (0 to 5) and total_reviews. |
payments_enabled | boolean | Whether 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.
/search/products
Searches products across every store, best matches first.
Returns products, total, page and query.
Query parameters
| Name | Type | Description |
|---|---|---|
qRequired | string | Words to search for in product titles, descriptions and tags. |
categoryOptional | string | Only products in this category, using a product’s category_id. An invalid ID is ignored. |
pageOptional | integer | Page number, starting at 1. |
limitOptional | integer | Results 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_idis in the store directory withpayments_enabledset totrue. - A missing
qreturns400.
curl "https://api.shopeak.co.ke/api/v1/search/products?q=waterproof%20backpack"{
"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"
}/storefront/{storeId}/products
Lists one store’s products, newest first unless you choose another order.
Returns products, total, page, limit and total_pages.
Parameters
| Name | Type | Description |
|---|---|---|
storeIdRequired | string | In the path. The store’s _id. |
collectionOptional | string | Only 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_priceOptional | number | Lowest price to include, in the store’s currency. |
max_priceOptional | number | Highest price to include, in the store’s currency. |
sortOptional | string | newest (default), oldest, price_asc, price_desc, title_asc or title_desc. |
pageOptional | integer | Page number, starting at 1. |
limitOptional | integer | Results per page, from 1 to 50. Default 20. |
Good to know
- Products can appear with
stockat 0, so check stock before offering them. - Price filters use the product’s
price, not variant prices. - Returns
404if the store isn’t open.
curl "https://api.shopeak.co.ke/api/v1/storefront/6650a1f4c2d84b0012e3a9c1/products?collection=6652d0a3b7e14c0012f4a8b6&max_price=5000&sort=price_asc"{
"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
}/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
| Name | Type | Description |
|---|---|---|
storeIdRequired | string | In the path. The store’s _id. |
qRequired | string | Text to find in product titles, ignoring case. An empty q returns no products. |
sortOptional | string | newest (default), price_asc or price_desc. |
pageOptional | integer | Page number, starting at 1. |
limitOptional | integer | Results 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
404if the store isn’t open.
curl "https://api.shopeak.co.ke/api/v1/storefront/6650a1f4c2d84b0012e3a9c1/products/search?q=roll-top&sort=price_asc"/storefront/{storeId}/products/{productId}
Gets one product by ID or slug.
Returns a product object on its own, not wrapped in another object.
Parameters
| Name | Type | Description |
|---|---|---|
storeIdRequired | string | In the path. The store’s _id. |
productIdRequired | string | In 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_enabledset totruein the directory. - Returns
404if the product doesn’t exist or isn’t for sale.
# 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"/storefront/{storeId}/collections
Lists a store’s published collections, in the store’s own order.
Returns collections.
Parameters
| Name | Type | Description |
|---|---|---|
storeIdRequired | string | In the path. The store’s _id. |
Collection fields
| Field | Type | Description |
|---|---|---|
_id | string | The collection ID. Pass it as collection when you list a store’s products. |
title | string | The collection’s name. |
slug | string | URL-friendly version of the title. |
description | string | About the collection, if set. |
image | media | The collection image, if set. |
product_count | integer | How 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.
curl "https://api.shopeak.co.ke/api/v1/storefront/6650a1f4c2d84b0012e3a9c1/collections"{
"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.
/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
| Name | Type | Description |
|---|---|---|
storeIdRequired | string | In the path. The store’s _id. |
itemsRequired | array | The items to price, all from this store. |
items[].product_idRequired | string | The product’s _id. |
items[].variant_idOptional | string | The variant’s _id, for products with variants. |
items[].quantityRequired | integer | How many. Some price lists give better prices for larger quantities. |
emailOptional | string | The 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
| Field | Type | Description |
|---|---|---|
items | array | One line per item priced: product_id, variant_id, base_price, price (after any price-list discount), quantity, subtotal and discounted. |
subtotal | number | The total of the line subtotals. |
savings | number | How much the price list saves overall. |
buyer_matched | boolean | true when the email’s price list lowered at least one price. |
currency | string | The store’s currency, such as KES. |
settled_currency | string | For stores that don’t price in KES: always KES, the currency Paystack charges in. |
settled_subtotal | number | For stores that don’t price in KES: subtotal converted to KES. |
fx_rate | number | For stores that don’t price in KES: the rate used for the conversion. |
fx_expires_in | integer | For stores that don’t price in KES: how long the rate is valid, in seconds. |
fx_error | string | unavailable 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,
itemsisnull. - If
variant_iddoesn’t match a variant for sale, the product’s own price is used.
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
}
]
}'{
"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"
}/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
| Name | Type | Description |
|---|---|---|
storeIdRequired | string | In the path. The store’s _id. |
cityOptional | string | The delivery city, such as Nairobi. Delivery zones match on city or country names. |
countryOptional | string | The delivery country, such as Kenya. |
subtotalOptional | number | The order subtotal in the store’s currency. Used for free-delivery thresholds and minimum orders. |
latitudeOptional | number | The delivery pin. Needed for rider delivery priced by distance, and for local delivery within a radius. |
longitudeOptional | number | The delivery pin, with latitude. |
Response fields
| Field | Type | Description |
|---|---|---|
options[].name | string | The option name to show the shopper. |
options[].rate | number | The price in the store’s currency. 0 for pickup and free delivery. |
options[].est_days | string | Usually same_day, 1_2_days or 3_5_days. Can be empty. |
options[].type | string | local, distance, zone, free, fallback or pickup. |
options[].requires_quote | boolean | true when the store confirms the delivery price separately. The rate shows 0 until then. |
options[].distance_km | number | The delivery distance, on distance options only. |
tax | object | enabled, name, rate (a percentage, so 16 means 16%) and included (whether prices already include it). |
Good to know
- If no option fits the address,
optionsis empty ornull. - When
subtotalreaches the store’s free-delivery threshold, the matching options show a rate of 0. - Returns
404if the store isn’t open.
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
}'{
"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.
{
"_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"
}| Field | Type | Description |
|---|---|---|
_id | string | The product ID. |
seller_id | string | The store’s _id. |
title | string | The product name. |
slug | string | URL-friendly version of the title. Works in place of the ID when you get one product. |
description | string | The full description. Can contain HTML, so sanitize it before rendering. |
short_desc | string | A one-line summary, if set. |
bullet_points | string[] | Key features, if set. |
price | number | The price in the store’s currency. For variants, use the variant’s price. |
compare_at | number | The original price, when it’s on sale. |
currency | string | The currency of price, such as KES. |
tax_inclusive | boolean | Whether price already includes tax. |
category_id | string | The marketplace category. Works as the category filter in product search. |
brand_name | string | The brand, if set. |
tags | string[] | Search tags, if set. |
condition | string | new, used, refurbished or open_box. |
thumbnail | media | The main image, if set. |
images | media[] | All product images, if any. |
videos | media[] | Product videos, if any. |
variants | variant[] | Choices such as size or color. See variants. |
attributes | object | Extra details as name and value pairs, such as material. |
stock | integer | Units in stock. For products with variants, check each variant’s stock. |
sku | string | The stock-keeping unit, if set. |
min_order_qty | integer | The smallest quantity per order. |
max_order_qty | integer | The largest quantity per order. 0 means no limit. |
allow_backorder | boolean | Whether it can be ordered when out of stock. |
weight | number | Weight in grams, if set. |
dimensions | object | length, width and height in centimetres, if set. |
free_shipping | boolean | Whether the store marks this product as free to deliver. |
ships_from | string | Where it ships from, if set. |
ratings | object | average (0 to 5), count, and distribution: the number of reviews for each star rating. |
warranty | object | has_warranty, plus duration, type and details when set. |
return_policy | string | 7_days, 14_days, 30_days or no_return, if set. |
status | string | Always active in these responses. |
created_at | string | When the product was created. |
updated_at | string | When the product last changed. |
Only use the fields listed here
Variants
Products sold in different sizes, colors or styles list each choice in variants. Each variant has its own price and stock.
| Field | Type | Description |
|---|---|---|
_id | string | The variant ID. Send it as variant_id when pricing items. |
name | string | The display name, such as Olive or Red / Large. |
options | object | The chosen values, such as {"color": "Olive"}. |
price | number | The variant’s price. Use it instead of the product price. |
compare_at | number | The original price, when it’s on sale. |
stock | integer | Units in stock. |
sku | string | The stock-keeping unit. |
barcode | string | The barcode, if set. |
weight | number | Weight in grams, if set. |
image | media | The variant image, if set. |
is_active | boolean | Whether 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.
| Field | Type | Description |
|---|---|---|
url | string | The public URL of the file. |
content_type | string | The file type, such as image/jpeg. |
size | integer | The 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.