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

bipin_1611's avatar

Unable to Get JSON Response Via Web Hooks API.

I am Using SquareUp(https://developer.squareup.com/) for API. I have set endpoint for webhooks on SquareUp and it's pointing to my domain. But i trying to send test webhooks on the SquareUp it's returning the 200 status code.

Endpoint on the SquareUp:- /domain_url/real_store_notification

On the My Project have call API for that endpoint which entered on the SquareUp.

here is my route api.php

Route::post('real_store_notification', [App\Http\Controllers\RESTAPI\NotificationServicesController::class,'realStoreNotification']);

And i also have kept out from the verifyToken...

here is my App\Http\MiddlewareVerifyCsrfToken.php

class VerifyCsrfToken extends Middleware
{
    /**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    protected $except = [
        'real_store_notification'
    ];
}

But, i am not getting the response which sent by webhooks.

please let me know if you need anything.

0 likes
2 replies
aurawindsurfing's avatar

@bipin_1611 did you ever hear about Postman? Have a look at this link:

https://developer.squareup.com/docs/testing/postman

First set up your postman, then download squareup collection (all of the API endpoints already configured), then test it with postman so you are sure everything works as expected, then transfer that to Laravel.

It is much easier to troubleshoot that way.

Also the easiest way to access API in laravel is to use Http client:

https://laravel.com/docs/master/http-client#request-data

use Illuminate\Support\Facades\Http;

$response = Http::post('http://example.com/users', [
    'name' => 'Steve',
    'role' => 'Network Administrator',
]);

and then your json will be here:

$response->json();

Hope it helps!

1 like
bipin_1611's avatar
bipin_1611
OP
Best Answer
Level 4

I found solution. For external calling APIs we do have remove csrf token verification,,

on your App\Http\Middleware\VerifyCsrfToken.php

add following code:

 protected $except = [
        '/api/real_store_notification/'
    ];

it's should work.

have a good day!!

Please or to participate in this conversation.