Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mathewsonyango's avatar

Lemon squeezy integration

I recently integrated Lemon Squeezy into my Laravel app. I followed all the instructions provided in the documentation, and my webhooks are successfully being registered and sent to Lemon Squeezy. According to the documentation, webhooks should update the database automatically. However, I am encountering a 404 error on post requests. Despite this, when I check my Lemon Squeezy account, I can see the records, but they are not reflected in my local database.

0 likes
6 replies
mathewsonyango's avatar

Am getting 404 POST /lemon-squeezy/webhook .......................................... , in my console

mahekarim's avatar

Did you use ngrock or others tools for communicating LS account to your local server ? And Make sure your webhook route looks like this .

// Webhook Exposed to LemonSqueezy.

Route::post('/lemon-squeezy/webhook', [BuyController::class, 'webhook']);

Snapey's avatar

do you have other conflicting routes earlier in your routes file?

when you say you see 404 in the console, is this from expose?

mathewsonyango's avatar

@Snapey , I get that error from expose, so at any point a make payment, see the logs down in my console rendered by expose .because from what i read, the webhook should do really a lot behind the scene ,update the customer tables accordingly as well.

Snapey's avatar

@mathewsonyango ok, so its reaching your app and its returning 404

can you do a test post from local to debug if your routing is ok

Do you have any other routes starting lemon-squeezy ? Try putting this route at the top of your routes

Have you added this route to your except array on csrf middleware?

Please or to participate in this conversation.