Shopify and Openedx webhook reciver set up

Hi @fghaas @foadlind,

I have gone through all the steps outlined in the guideline ( GitHub - hastexo/webhook-receiver: A Django application that listens for incoming webhooks, and translates them into Open edX REST API requests ), but I am still continuously receiving the error message, 400 error “Bad request”.

I have checked the following items

  1. sku matched
  2. both cart item and line note are in the jason data in shopify
  3. secrete key is correct

Could you please advise on what might be missing or misconfigured?

Thank you for your time and support.

Sincerely,

Linda Lu

Hello, there are several reasons for why you might be getting an HTTP 400 error from the webhook receiver. Your LMS logs should provide more information. Have you checked those?

Hi Florian @fghaas ,

Appreciated for the prompt response a lot. Yes, we did check LMS logs.

webhookreceiver-1  | 2025-10-01 01:48:18,205 WARNING 8 [django.request] log.py:246 - Bad Request: /webhooks/shopify/order/create
webhookreceiver-1  | 2025-10-01 01:48:18,205 WARNING 8 [django.request] log.py:246 - Bad Request: /webhooks/shopify/order/create 

Currently, it seems as if the 400 error is being caused by malformed data as it was explained in the readme. I believe it might be erroring before interacting with the oauth lms toolkit app, so other lms logs aren’t showing anything.

The JSON package from shopify also contains the email and a matching SKU. We also included the email in the cart notes section just in case:

"line_items": [
    {
      "properties": [
        {
          "name": "email",
          "value": "student@gmail.com"
        }
      ],
      "sku": "course-v1:TEST+TEST+TEST",

"note_attributes": [
    {
      "name": "email",
      "value": "student@gmail.com"
    }

Thanks for your time and prompt response again.

Linda Lu

Hmmm, this shouldn’t be all the logs you’re getting. The webhook receiver shouldn’t throw a 400 without invoking a logger.error() call before. Are you sure you’ve checked all relevant logs?

Hi @fghaas ,

After reviewing all of the logs available and testing a few more times, the only error messages thrown are from caddy and webhook receiver. Reverse proxy request does go through caddy but the plugin returns error 400 with the bad request message. The logging mode was left at default. Shopify is sending the payload but it is being rejected by the webhook receiver with the 400 message.

Could this be due to an error in the hostname? or something wrong with the webhook from shopify?

Thanks for the prompt response again. Appreciate a lot.

Sincerely,

Linda Lu

I suppose you’re using the Tutor plugin to deploy this? If so, check the logs of the webhook-receiver container as well.

Hi @fghaas,

Yes. We are using the Tutor plugin. The webhookreciver log was showing “Bad Request” only.

webhookreceiver-1  | 2025-10-01 01:48:18,205 WARNING 8 [django.request] log.py:246 - Bad Request: /webhooks/shopify/order/create
webhookreceiver-1  | 2025-10-01 01:48:18,205 WARNING 8 [django.request] log.py:246 - Bad Request: /webhooks/shopify/order/create

Thanks for the help.

LindaLu

I am rather out of ideas here. Perhaps you’d like to try this patch?

If you apply that and reproduce your problem, perhaps that gives you a slightly more useful error message to help you troubleshoot further?

1 Like

Hi Florian @fghaas

Sorry for the late reply. We’ve rechecked from the beginning and fully rebuilt the system. After rebuilt, the webhook receiver function is now working properly before we even test Add log message for unhandled exceptions in receive_json_webhook(). We believe the issue may have been caused by an error in our setup or launch process.

We really appreciate your prompt support and the clear guideline. Thanks a lot for your help!

Sincerely,
Linda Lu

OK, now that you’ve redeployed your system and it’s working, could you please outline what differences you’ve found between your current setup and the one you previously had? That might be useful to other users who run into a similar issue, and help them troubleshoot.