Competitor price tracking in Mauritius · API & webhooks

Price API and webhooks for Mauritian retail and stock software

Many Mauritian retailers run their own stock, point-of-sale or accounting software, often looked after by a local IT provider. 4pricing feeds it through a REST API with products, price history, comparisons, opportunities and the daily briefing, and accepts your own prices and daily sales in return. A signed webhook notifies your endpoint of alerts, approved and reverted prices and new briefings. No ready-made connector is supplied; your developers wire it up.

What your IT team works with

JSON over REST

Endpoints protected by keys return the current prices of the products you follow, in JSON. The OpenAPI 3.1 specification is public, so a client can be generated in the language your team prefers.

History on request

Fetch the stored history of any product for your own analysis, for instance to compare the December school rush with the Divali weeks. Reading data does not use credits.

Alerts sent to you

When an alert fires, your endpoint receives a signed JSON POST: a level crossed, a percentage fall, a restock or an undercut. Only alert events are sent, not every reading.

Sales sent to us

Post daily sales per product to POST /sales/bulk, up to 2,000 rows per request, idempotent per product and day. Opportunity values are based on these figures; without them, they read “—”.

Insights and briefing

GET /insights/ lists findings with evidence and proposed prices, GET /opportunities/ gives a summary that separates sales-based value from market estimates, and GET /briefings/latest returns the newest briefing.

Tracking a price action

GET /actions/ shows each action as proposed, sent, applied or reverted. After your system writes a price received in price.apply, call POST /actions/{id}/confirm to mark it applied.

Keys under your control

Keys are created and revoked in the panel and need an active plan. Send them in the X-API-Key header or as a Bearer token.

Your own prices in, recommendations out

Submit your own prices one by one or in batches of up to 2,000, then read group comparisons and recommended prices. A recommendation leaves through the webhook only once approved.

Signed and retried

Every delivery carries X-4Pricing-Timestamp and X-4Pricing-Signature, where the signature is sha256= plus an HMAC-SHA256 of “<timestamp>.<body>”. Undelivered events are retried at increasing intervals.

The 4pricing API and webhook in brief.

ComponentDetails
REST APIJSON endpoints behind keys, 60 requests a minute per account, public OpenAPI 3.1
HistoryStored price history for each followed product, read free of credits
WebhookSigned POST to one endpoint per account, retried: alerts, price.apply, price.revert, briefing.ready
SalesPOST /sales/bulk, up to 2,000 rows a request, idempotent per product and day
InsightsGET /insights/ findings, GET /opportunities/ summary, GET /briefings/latest
ActionsGET /actions/, then POST /actions/{id}/confirm after applying a price.apply
KeysMade and revoked in the panel, sent as X-API-Key or Bearer, active plan needed
Own pricesSingle or in batches of up to 2,000, no credits used

Generate 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 must be fetched, for example when you add a product or a group member by link or request a refresh; reading data and sending your own prices are free of credits. Register a webhook endpoint and verify the signature of every POST. On price.apply, write the price in your software and call POST /actions/{id}/confirm. Read opportunities and the briefing with GET /insights/, GET /opportunities/ and GET /briefings/latest.

API and webhook questions from Mauritian developers

What data can our software pull?

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

Which events does the webhook send?

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

How do we verify that a delivery really comes from 4pricing?

Read the X-4Pricing-Timestamp header and the raw body, compute an HMAC-SHA256 of “<timestamp>.<body>” with the webhook secret from your account, prefix it with sha256= and compare it with X-4Pricing-Signature. Only act on the event if both match.

What is inside a price.apply event?

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 path for confirmation. Write the price, then call POST /api/v1/pricing/actions/{action_id}/confirm to move the action from “sent” to “applied”. price.revert follows the same structure and confirmation.

Is there a connector for the software we already use?

No. The REST API, the signed webhook and the CSV export of your product list are what your team uses to link your systems. A price is applied without your own software only in a 4buildsite shop linked to the product.

How do we authenticate?

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

Which calls consume credits?

Only calls that make 4pricing fetch a shop page, such as adding a product or a group member by link, or asking for a refresh. Reading data and submitting your own prices do not use credits.

Plug 4pricing into your own software

REST endpoints for prices, history, opportunities and the briefing, and a signed webhook for alerts and approved prices.