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

mehdirahimi's avatar

Post request from another domain results TokenMismatchException

I'm working with a bank api. The bank send a post request to my website but does not return there is not a token field is their request and I am faced with TokenMismatchException. How can I fix this problem?

0 likes
5 replies
ohffs's avatar

I guess just be a bit more careful with that route - you're pretty much letting anyone in the world send a POST request to it. Depends if you can limit access in some other way - but you'll have to look into that for your app & the bank.

1 like
mehdirahimi's avatar

@ohffs One more thing, how can i except a route that has parameter. for example:

    protected $except = [
        'new-order/{orderId}/after-payment'
    ];
ohffs's avatar

The docs show using the * to match any sub-route. Like new-order/*.

1 like

Please or to participate in this conversation.