Price tracking in Kenya · API & webhooks

Price API and webhooks for Kenyan retail and marketplace systems

If your business runs its own stock, order or accounting software, 4pricing data can flow into it through a REST API: tracked products, price history, group comparisons, opportunities and the daily briefing. In the other direction you can push your own prices and daily sales. A signed webhook calls your endpoint on alerts, approved and reverted prices and new briefings. There are no ready-made connectors: your developers or integrator do the wiring.

What your developers get

REST endpoints returning JSON

Authenticated calls return the current prices of your tracked products as JSON. The OpenAPI 3.1 specification is published, so your team can generate a client in its preferred language.

History when you need it

Retrieve the stored price history of any product for your own analysis, for example to set the last festive season against the January school period. Reading data does not use credits.

Alerts sent to your endpoint

When an alert fires, a signed JSON POST reaches your URL: a level crossed, a percentage fall, a restock or a rival undercut. It carries alert events, not every reading.

Your sales in

Send daily sales per product to POST /sales/bulk, up to 2,000 rows per call and idempotent per product and day. Opportunity values rest on this data; without it they show “—”.

Findings and briefing

GET /insights/ returns findings with evidence and price proposals, GET /opportunities/ a summary that keeps sales-based value apart from the market estimate, and GET /briefings/latest the newest briefing.

Lifecycle of each action

GET /actions/ lists price actions as proposed, sent, applied or reverted. Once your system has applied a price from price.apply, call POST /actions/{id}/confirm to mark it applied.

Keys you manage

Create API keys in the panel and revoke them whenever you need to; an active plan is required. Send the key in the X-API-Key header or as a Bearer token.

Your prices and the recommendation

Push your own prices singly or in batches of up to 2,000, then read group comparisons and the recommended price. A recommendation reaches your system by webhook only after approval.

Signed and retried

Each delivery includes X-4Pricing-Timestamp and X-4Pricing-Signature, where the signature is sha256= followed by an HMAC-SHA256 of “<timestamp>.<body>”. Failed deliveries are retried with longer pauses.

The 4pricing API and webhook at a glance.

ComponentDetails
REST APIAuthenticated JSON endpoints, 60 requests per minute per account, OpenAPI 3.1 published
HistoryStored price history per tracked product, read without using credits
WebhookSigned POST to one endpoint per account, retried on failure: alerts, price.apply, price.revert, briefing.ready
SalesPOST /sales/bulk, up to 2,000 rows per call, idempotent per product and day
InsightsFindings from GET /insights/, summary from GET /opportunities/, newest briefing from GET /briefings/latest
ActionsGET /actions/, then POST /actions/{id}/confirm after applying a price.apply
KeysCreated and revoked in the panel, sent as X-API-Key or Bearer, active plan required
Own pricesSingle or in batches of up to 2,000, no credits used

Create a key in the panel and call the REST endpoints, up to 60 requests per minute per account. Credits are used only when a shop page has to be fetched, for example when you add a product or group member by link, or request a refresh; reading data and pushing your own prices cost nothing. Register a webhook endpoint and verify the signature of every POST. When price.apply arrives, write the price in your system and call POST /actions/{id}/confirm. Use GET /insights/, GET /opportunities/ and GET /briefings/latest for findings and the briefing.

API and webhooks: questions from Kenyan developers

Which data can our system read?

Tracked products with current prices, price history, group comparisons, opportunities (GET /insights/, GET /opportunities/), the briefing (GET /briefings/latest) and price actions (GET /actions/). You can also push your own prices and daily sales through POST /sales/bulk. The limit is 60 requests per minute per account.

Which events does the webhook deliver?

A single endpoint per account receives JSON signed with HMAC-SHA256 (X-4Pricing-Signature and X-4Pricing-Timestamp headers) for alerts, approved and reverted prices (price.apply, price.revert) and briefing.ready. Failed deliveries are retried at growing intervals. Individual readings are not pushed.

How do we confirm a webhook really comes from 4pricing?

Take the X-4Pricing-Timestamp header and the raw body, compute the HMAC-SHA256 of “<timestamp>.<body>” with the webhook secret from your account, add the sha256= prefix and compare the result with X-4Pricing-Signature. Process the event only if the two match.

What does a price.apply event contain?

The event name, the action_id, the group (id, name, sku, store_product_id), the old and new price in minor units, the currency, the reason, the mode and the confirmation path. Apply the price, then call POST /api/v1/pricing/actions/{action_id}/confirm to move the action from “sent” to “applied”. price.revert has the same structure and confirmation step.

Is there a ready connector for our ERP, accounting software or marketplace seller account?

No. The REST API, the signed webhook and the CSV of your product list are what your team uses to connect your own software. Prices are applied without your system only in a 4buildsite shop linked to the product.

How is access authenticated?

With an API key sent in the X-API-Key header or as a Bearer token. Keys are created and revoked in the panel and require an active plan.

Which calls use credits?

Only calls that make 4pricing fetch a shop page, such as adding a product or group member by link, or requesting a refresh. Reading data and pushing your own prices are free.

Bring 4pricing data into your own software

A REST API for prices, history, opportunities and the briefing, plus a signed webhook for alerts and approved prices.