Integrating an Ecommerce
Integrating an Ecommerce
The host application sends catalog data and consumes signals. Final price application stays outside this package.
Route::post('/webhooks/price-intel', function (Request $request) {
abort_unless(WebhookSigner::verify(
$request->getContent(),
config('services.pi.secret'),
$request->header(WebhookSigner::HEADER, '')
), 401);
match ($request->input('event')) {
'price.dropped', 'undercut.detected' => MarginOS::reevaluate($request->input('data')),
default => null,
};
});
Boundary
The package emits observations, alerts, and advisory decisions. The host owns margins, inventory, catalog policy, and final price writes.
Common Flow
- Issue an API key.
- Bulk upsert products by
external_id. - Create monitoring targets by country.
- Let discovery find URLs or pass
given_urls. - Review borderline matches.
- Process signed webhook deliveries.