Competitor price monitoring in Ghana · API & webhooks

Price API and webhooks for retail software in Ghana

If your business runs its own inventory, point-of-sale or accounting software, 4pricing data can flow into it through a REST API: monitored products, price history, group comparisons, opportunities and the daily briefing. In the other direction you can send us your own prices and daily sales. A signed webhook calls your URL on alerts, on approved and reverted prices and when a new briefing is ready. Ready-made connectors are not included; your developers or an integrator do the wiring.

What your developers work with

REST with JSON responses

Authenticated endpoints return the current prices of your monitored products in 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 last Christmas against the January back-to-school period. Reading data never consumes credits.

Alerts pushed to your endpoint

When an alert fires, a signed JSON POST reaches your endpoint: a level crossed, a percentage fall, a restock or a competitor undercut. It carries alert events, not a copy of every check.

Your sales in

Send daily sales per product to POST /sales/bulk, up to 2,000 rows per call, idempotent for each product and day. Opportunity values are calculated from these figures; without them they show “—”.

Findings and the 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 most recent briefing.

The life of a price action

GET /actions/ lists every price action 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

Send 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 through the webhook only after approval.

Signatures and retries

Each delivery carries X-4Pricing-Timestamp and X-4Pricing-Signature; the signature is sha256= followed by an HMAC-SHA256 of “<timestamp>.<body>”. Events that cannot be delivered are retried at growing intervals.

The 4pricing API and webhook at a glance.

ComponentDetails
REST APIAuthenticated JSON endpoints, 60 requests per minute per account, published OpenAPI 3.1
HistoryStored price history of every monitored product, read without credits
WebhookSigned POST to one URL 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/, a summary from GET /opportunities/, the latest briefing from GET /briefings/latest
ActionsGET /actions/, then POST /actions/{id}/confirm once a price.apply has been applied
KeysCreated and revoked in the panel, sent as X-API-Key or Bearer, active plan required
Own pricesOne at a time or batches of up to 2,000, without credits

Create a key in the panel and call the REST endpoints, within a limit of 60 requests per minute for each account. Credits are consumed only when a shop page has to be fetched, for instance when you add a product or group member from a link or ask for a refresh; reading data and sending your own prices cost nothing. Register a webhook URL for events and verify the signature on 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 opportunities and the briefing.

API and webhook questions from developers in Ghana

What can our software read through the API?

Monitored products and their current prices, price history, group comparisons, opportunities (GET /insights/, GET /opportunities/), the briefing (GET /briefings/latest) and price actions (GET /actions/). You can also send your own prices and daily sales (POST /sales/bulk). Each account may make 60 requests per minute.

What does the webhook deliver, and when?

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

How do we confirm a webhook is authentic?

Take the X-4Pricing-Timestamp header and the raw body, compute the HMAC-SHA256 of “<timestamp>.<body>” using the webhook secret from your account, add the sha256= prefix and compare the result with X-4Pricing-Signature. Process the event only when they 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 so the action moves from “sent” to “applied”. price.revert has the same structure and the same confirmation step.

Is there a ready connector for our accounting, ERP or shop software?

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

How does authentication work?

Pass an API key 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 requests use credits?

Only those that make 4pricing fetch a shop page, such as adding a product or group member from a link, or a refresh. Reading data and sending your own prices are free of credits.

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.