'Django CSRF verification failed. Webhook payment system

I'm trying to implement a webhook for my payment system. I have a path to my webhook view, which is a simple definition where the provided id is printed.

The usage is like this

http://localhost:8000/api/mollie-webhook/?id=ExampleId

Path

# mollie webhook
path('api/mollie-webhook/', mollie_webhook, name='mollie_webhook'),

View

def mollie_webhook(request):
    id = request.POST['id']
    print(id)
    return JsonResponse(data={"response": "Success!"})

I'm getting the following error

CSRF verification failed. Request aborted.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source