Skip to Content
Next Centra CheckoutcreateGetCentraWebhookEvents

createGetCentraWebhookEvents

See source on Github

Create get Centra webhook events. Parses and returns the events from the incoming Centra request.

Example

const getCentraWebhookEvents = createGetCentraWebhookEvents({ adapter: nextAppRouterAdapter }) const POST = async (request: Request) => { const [error, results] = await getCentraWebhookEvents(req) if (error) { // Handle error codes return Response.json({ message: 'Error' }, { status: 500 }) } if ('products' in results) { return Response.json({ products: results.products }, { status: 200 }) } }

See

nextAppRouterAdapter

See source on Github

app router adapter, to be used with createGetCentraWebhookEvents

nextPagesRouterAdapter

See source on Github

pages router adapter, to be used with createGetCentraWebhookEvents

CentraWebhookEventsError

See source on Github

Centra webhook events error. Errors that could occur while validating / parsing incoming request that (should) originate from Centra.